/* Page composition: layers of paper carry major transitions, with open space between smaller groups. */
.nb-home {
  --panel-border: var(--deckled-paper) var(--deckled-slice) fill / 20px stretch;
  --panel-shadow: drop-shadow(0 3px 2px #624a332d);
}
:root[data-theme="dark"] .nb-home { --panel-shadow: drop-shadow(0 3px 3px #09070d70); }

.nb-main { width: min(1240px, calc(100% - 82px)); }
.nb-header, .nb-footer { max-width: 1240px; }

.nb-hero {
  position: relative;
  isolation: isolate;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  min-height: 0;
  gap: clamp(12px, 3vw, 46px);
  padding: clamp(38px, 5vw, 74px) 0 clamp(43px, 5vw, 74px);
}
.nb-hero::after, .nb-process::after {
  content: '';
  position: absolute;
  inset: auto -4px -1px;
  height: 20px;
  border: solid transparent;
  border-width: 0 0 20px;
  border-image: var(--deckled-paper) 0 0 60 0 / 0 0 20px stretch;
  filter: var(--panel-shadow);
  mask-image: linear-gradient(transparent, #000 72%);
  pointer-events: none;
}
[data-theme="dark"] :is(.nb-hero,.nb-process)::after { opacity: .2; }

.nb-hero h1 > span {
  font-size: clamp(39px, 4.5vw, 65px);
  letter-spacing: -.045em;
}
.nb-hero .nb-eyebrow { margin-bottom: 18px !important; }
.nb-hero h1 em::after { opacity: .72; }
.nb-hero .nb-position { margin-top: 19px !important; }
.nb-hero .nb-button { margin-top: 22px; }

.nb-scene {
  aspect-ratio: 1.2;
  margin: 0;
}
.nb-scene .sheet {
  width: 53%;
  top: 0;
  left: 8%;
  transform: rotate(-7deg);
}
.nb-scene .screen {
  width: 72%;
  top: 35%;
  left: 25%;
  transform: rotate(7deg);
}
.nb-scene .arrow {
  width: 20%;
  top: 24%;
  left: 51%;
}
.nb-scene .pencil {
  width: 62%;
  top: 87%;
  left: 30%;
  transform: rotate(8deg);
}
.nb-scene .idea {
  width: 23%;
  top: 65%;
  left: 9%;
  transform: rotate(-9deg);
}
.nb-scene .annotation-start { top: 5%; left: 67%; }
.nb-scene .annotation-end { top: 32%; left: 83%; }
.nb-scene .annotation-end::after { top: 74%; right: 63%; opacity: .75; }
.nb-scene::before {
  inset: 90% 7% 3% 29%;
  opacity: .28;
  transform: rotate(3deg);
}

.nb-home #work { padding-top: clamp(32px, 4vw, 55px); }
.nb-home #work::before, .nb-about::before, .nb-who::before, .nb-contact::before { content: none; }
.nb-home #work .nb-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  max-width: none;
}
.nb-home #work .nb-section-head .nb-script {
  display: inline-block;
  font: 600 23px/1.1 var(--hand-font);
  padding: 4px 3px 7px;
  background: var(--graphite-rule) 0 100% / 100% 7px no-repeat;
  margin-bottom: 7px !important;
}
.nb-home #work .nb-section-head .nb-text-link { margin: 0 0 5px; }

.nb-home .nb-who,
.nb-home .nb-experience,
.nb-home .nb-contact {
  position: relative;
  isolation: isolate;
}
.nb-home :is(.nb-who, .nb-experience, .nb-contact)::before {
  content: '';
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  z-index: -1;
  border: 20px solid transparent;
  border-image: var(--panel-border);
  background: none;
  filter: var(--panel-shadow);
  clip-path: none;
  pointer-events: none;
}
[data-theme="dark"] .nb-home :is(.nb-who, .nb-experience, .nb-contact)::before {
  filter: brightness(.40) saturate(.48) var(--panel-shadow);
}
.nb-home .nb-who { padding: clamp(24px, 3.3vw, 46px) clamp(19px, 3.4vw, 47px); }
.nb-who .home-commercial { grid-template-columns: minmax(95px, .25fr) minmax(0, 1.6fr); gap: 18px; }
.nb-who .home-commercial h2 {
  align-self: center;
  font-size: clamp(29px, 3vw, 43px);
  max-width: 5ch;
  padding-bottom: 10px;
  background: var(--graphite-rule) 0 100% / 100% 7px no-repeat;
}
.nb-who .home-commercial dl { gap: 14px; }
.nb-who .home-commercial dt {
  font: 700 19px/1.2 var(--display-font);
  color: var(--ink);
}
.nb-who .home-commercial dt::before {
  content: '';
  display: block;
  height: 24px;
  width: 24px;
  margin-bottom: 7px;
  background: var(--accent);
  mask: var(--audience-icon) center / contain no-repeat;
}
.nb-who dl > div:nth-child(1) { --audience-icon: url('/assets/icons/people.svg'); }
.nb-who dl > div:nth-child(2) { --audience-icon: url('/assets/icons/building.svg'); }
.nb-who dl > div:nth-child(3) { --audience-icon: url('/assets/icons/bag.svg'); }
.nb-who dl > div:nth-child(4) { --audience-icon: url('/assets/icons/global.svg'); }
.nb-who .home-commercial dd { margin-top: 6px; line-height: 1.55; }

.nb-home #services { margin-top: 20px; }
.nb-home #services::before { content: none; }
.service-illustration {
  display: block;
  position: relative;
  width: min(100%, 310px);
  aspect-ratio: 1.4;
  margin: 20px 0 0;
}
.service-illustration img {
  position: absolute;
  height: auto;
  pointer-events: none;
}
.service-illustration .service-wireframe {
  top: 0;
  left: 0;
  width: 95%;
}
.service-illustration .service-pencil {
  top: 71%;
  left: 27%;
  width: 68%;
  transform: rotate(9deg);
}
.nb-home .service-card-wide .service-meta { max-width: none; }
.nb-home #services > .nb-text-link {
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 4px 6px 5px 4px;
}

.nb-ways .home-commercial dl {
  border-block: 1px solid var(--soft-rule);
  padding: 3px 0;
}
.nb-ways .home-commercial dl > div:last-child { border-bottom: 0; }
.nb-process .phase-card { padding-inline: 0 12px; }
.nb-process { padding-bottom: clamp(42px, 6vw, 70px); }
.nb-process .phase-card:not(:last-child)::after { right: 9%; }

.nb-about-layout { grid-template-columns: minmax(0, 1fr) minmax(0, .94fr); align-items: start; }
.nb-home .nb-experience { padding: 25px clamp(17px, 2.55vw, 35px) 23px; }
.nb-home .nb-experience h3 {
  margin: 0 0 16px;
  width: max-content;
  padding-bottom: 6px;
  background: var(--graphite-rule) 0 100% / 100% 7px no-repeat;
}
.nb-home .nb-experience .exp-header { margin-left: 5px; }
.nb-about .nb-lead { line-height: 1.68; }

.nb-home #blog .nb-section-head { max-width: 100%; }
.nb-notes .nb-note { padding: 13px 13px 16px; }
.nb-notes .nb-note img { width: 100%; }
.nb-notes .nb-note h3 {
  color: var(--ink);
  font: 700 clamp(16px, 1.6vw, 20px)/1.23 var(--display-font);
}

.nb-home .nb-contact {
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 1.04fr) minmax(130px, .77fr);
  gap: clamp(19px, 3.3vw, 48px);
  align-items: center;
  padding: clamp(25px, 4vw, 53px) clamp(19px, 3.6vw, 47px);
}
.nb-contact > .nb-anchor { position: absolute; inset-block-start: 0; }
.nb-contact-art {
  margin: 0;
  align-self: center;
  pointer-events: none;
}
.nb-contact-art img { width: 100%; height: auto; }
.nb-contact .contact-links { min-width: 0; }
.nb-contact .contact-link-card { padding-block: 8px; }
.nb-contact .contact-link-card:last-child { border-bottom: 0; }
.nb-extras { padding-top: 16px; }

.nb-catalogue .article-card h3 {
  font-family: var(--display-font);
  font-weight: 700;
  line-height: 1.21;
}
.nb-catalogue .article-card[lang="ar"] h3 { font-family: 'Noto Sans Arabic', Arial, sans-serif; line-height: 1.55; }
.nb-catalogue .card-image img { aspect-ratio: 16 / 9; }
.paths-section .path-link { min-width: 0; }

@media (min-width: 768px) and (max-width: 1023px) {
  .nb-main { width: calc(100% - 54px); }
  .nb-hero h1 > span { font-size: clamp(30px, 4.3vw, 43px); }
  .nb-scene .annotation { font-size: 18px; }
  .nb-home .nb-contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .nb-contact-art { display: none; }
  .nb-who .home-commercial dl { grid-template-columns: 1fr 1fr; gap: 17px 14px; }
}

@media (max-width: 767px) {
  .nb-main { width: calc(100% - 32px); }
  .nb-hero { grid-template-columns: 1fr; padding: 26px 0 33px; gap: 17px; }
  .nb-hero h1 > span { font-size: clamp(32px, 9vw, 45px); }
  .nb-hero .nb-position { margin-top: 13px !important; }
  .nb-scene { width: min(100%, 450px); margin-inline: auto; }
  .nb-scene .annotation { font-size: clamp(15px, 4.5vw, 21px); }
  .nb-scene .annotation-start { left: 62%; }
  .nb-scene .annotation-end { left: 80%; top: 29%; }
  .nb-hero::after, .nb-process::after { height: 14px; border-image-width: 0 0 14px; }

  .nb-home #work .nb-section-head { align-items: start; flex-direction: column; gap: 3px; }
  .nb-home #work .nb-section-head .nb-text-link { margin: 0; }
  .nb-home #work .nb-section-head .nb-script { font-size: 22px; }
  .nb-who .home-commercial { display: block; }
  .nb-who .home-commercial h2 { max-width: none; background-size: 105px 7px; }
  .nb-who .home-commercial dl { margin-top: 10px; gap: 20px 11px; }
  .nb-who .home-commercial dt { font-size: 18px; }
  .nb-who .home-commercial dt::before { height: 20px; width: 20px; }
  .nb-who .home-commercial dl > div { padding-inline-start: 9px; }
  .nb-home #services { margin-top: 8px; }
  .service-illustration { width: min(48%, 180px); margin-top: 10px; }
  .nb-home .service-content h3 { font-size: 21px; }
  .nb-home .nb-experience { margin-block-start: 3px; }
  .nb-home .nb-contact {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .nb-contact-art { width: min(61%, 210px); justify-self: center; }
  .nb-contact > div > p:not(.nb-script) { margin-top: 10px; }
  .nb-notes .nb-note a { display: block; }
  .nb-notes .nb-note img { margin-bottom: 9px; }

  .library-intro {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    padding-bottom: 12px;
  }
  .library-intro h1 { max-width: 18ch; }
  .library-intro .nb-library-art {
    grid-column: 1;
    grid-row: auto;
    width: min(74%, 263px);
    justify-self: center;
  }
  .library-intro .nb-library-art img { max-height: 119px; }
  .library-toolbar.nb-catalogue-controls {
    margin-bottom: 13px;
  }
  .nb-topic-strip { margin-bottom: 9px; }
  .nb-catalogue .article-card { display: block; padding: 11px 12px 14px; }
  .nb-catalogue .article-card .card-image { margin-bottom: 9px; }
  .nb-catalogue .article-card .card-copy { padding-inline: 3px; }
  .nb-catalogue .article-card h3 { font-size: 21px; }
  .nb-catalogue .card-meta { font-size: 12px; margin-top: 8px; }
}
