/* =====================================================================
   Mouadh Bouali: site stylesheet
   Paper and void scenes, one broad and one narrow voice of Archivo,
   square one-pixel frames, a single blue and a rare ember signal.
   Fully local: one self-hosted OFL font, no external requests.
   ===================================================================== */

/* The Archivo face is declared in fonts.css (embedded, OFL). */

:root {
  /* surfaces */
  --void: #070b10;
  --void-2: #0d131a;
  --void-3: #141c25;
  --paper: #e6e4df;
  --paper-2: #eeece8;
  --paper-3: #dad7d1;

  /* ink on paper */
  --ink: #070b10;
  --ink-2: rgba(7, 11, 16, .76);
  --ink-3: rgba(7, 11, 16, .64);
  --ink-line: rgba(7, 11, 16, .16);
  --ink-line-2: rgba(7, 11, 16, .34);

  /* ice on void */
  --ice: #dce8f2;
  --ice-2: rgba(220, 232, 242, .78);
  --ice-3: rgba(220, 232, 242, .64);
  --ice-line: rgba(220, 232, 242, .16);
  --ice-line-2: rgba(220, 232, 242, .36);

  /* signals */
  --blue: #1458c8;
  --blue-hover: #0f469f;
  --blue-ink: #0f469f;
  --blue-light: #8fc0ff;
  --ember: #f0642a;

  --f-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-narrow: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;

  --max: 1280px;
  --gutter: clamp(20px, 4.6vw, 72px);
  --strip-h: 34px;
  --header-h: 60px;
  --ease: cubic-bezier(.19, 1, .22, 1);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--void);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--f-sans);
  font-size: 1.125rem;
  line-height: 1.5;
  letter-spacing: -.012em;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure, dl, dd, ol, ul, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-weight: 400; text-wrap: balance; }
p { text-wrap: pretty; }
svg { display: block; overflow: visible; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--blue-ink);
  outline-offset: 3px;
}
.scene :focus-visible,
.site-header[data-tone="dark"] :focus-visible,
.menu :focus-visible { outline-color: var(--blue-light); }

::selection { background: var(--blue); color: #fff; }

[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Narrow voice: labels, navigation, roles, dates */
.narrow,
.label {
  font-family: var(--f-narrow);
  font-stretch: 75%;
}
/* uppercase condensed text needs a little air, never negative tracking */
.label, .strip, .nav-link, .brand__name, .btn, .tag, .menu-btn, .menu__close,
.stack__label, .rail a, .rail__count, .specs dt, .legend li, .flow .who,
.cap__num, .cap__tools, .step__num, .rev-mark, .rev-where, .role__when,
.role__org, .side-block h3, .side-block .when, .closing__links dt,
.site-footer, .crumbs, .seq__head span, .flow > li::before {
  letter-spacing: .02em;
}
.label {
  font-size: .875rem;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--ink-3);
}
.scene .label { color: var(--ice-3); }

.tnum { font-variant-numeric: tabular-nums; }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -6rem;
  z-index: 100;
  padding: .7rem 1rem;
  color: #fff;
  background: var(--blue);
  font: 500 1rem/1 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { top: .5rem; }

/* ---------- Surfaces ---------- */

.paper {
  position: relative;
  isolation: isolate;
  background: var(--paper) url("img/paper.jpg") repeat;
  background-size: 512px 512px;
  color: var(--ink);
}
.paper--light {
  background: var(--paper-2) url("img/paper-light.jpg") repeat;
  background-size: 512px 512px;
}

.scene {
  position: relative;
  isolation: isolate;
  background: var(--void) url("img/void.jpg") repeat;
  background-size: 512px 512px;
  color: var(--ice);
}
/* faint measured grid that fades at the edges */
.scene--grid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--ice-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ice-line) 1px, transparent 1px);
  background-size: 88px 88px;
  background-position: center top;
  opacity: .32;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
}

/* ---------- Announcement strip ---------- */

.strip {
  position: relative;
  z-index: 31;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: var(--strip-h);
  padding: .4rem var(--gutter);
  color: var(--ice-2);
  background: var(--void);
  border-bottom: 1px solid var(--ice-line);
  font: 400 .875rem/1.25 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  text-align: center;
}
.strip__dot {
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--ember);
}
.strip a {
  color: var(--ice);
  text-decoration-color: var(--ice-line-2);
}
.strip a:hover { text-decoration-color: var(--ice); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  color: var(--ice);
  transition: color .5s cubic-bezier(0, 0, .2, 1);
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(7, 11, 16, .95);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--ice-line);
  transition: background-color .5s cubic-bezier(0, 0, .2, 1), border-color .5s;
}
.site-header[data-tone="light"] { color: var(--ink); }
.site-header[data-tone="light"]::before {
  background: rgba(230, 228, 223, .94);
  border-bottom-color: var(--ink-line);
}

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-list--end { justify-content: flex-end; }

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: 400 .95rem/1 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  text-decoration: none;
  opacity: .78;
  transition: opacity .3s;
}
.nav-link:hover,
.nav-link[aria-current] { opacity: 1; }
.nav-link[aria-current] { text-decoration: underline; text-underline-offset: .45em; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-height: 44px;
  text-decoration: none;
}
.brand__mark {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
}
.brand__mark::after {
  content: "";
  position: absolute;
  left: 3px; right: 3px; bottom: 3px;
  height: 4px;
  background: var(--blue);
}
.site-header[data-tone="dark"] .brand__mark::after { background: var(--blue-light); }
.brand__name {
  font: 600 1.05rem/1 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  min-height: 44px;
  padding: .7rem 1.1rem;
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
  font: 400 1.05rem/1 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn--sm { min-height: 38px; padding: .5rem .85rem; font-size: .95rem; }
.btn--lg { min-height: 56px; padding: 1rem 1.4rem; font-size: 1.3rem; }
.btn--ghost {
  color: inherit;
  background: transparent;
  border-color: currentColor;
}
.btn--ghost:hover { background: rgba(127, 140, 155, .14); border-color: currentColor; }
.btn__arrow { font-family: var(--f-sans); font-stretch: 100%; }

.menu-btn { display: none; }

.nav-link--compact { display: none; }

@media (max-width: 860px) {
  .site-header__inner { grid-template-columns: auto 1fr; gap: 0 1rem; }
  .site-header__inner > .brand { grid-column: 1; grid-row: 1; }
  .nav-list--end { grid-column: 2; grid-row: 1; gap: .75rem; }
  .nav-list--end .nav-link { display: none; }
  /* without JavaScript the section links wrap onto a second row */
  .nav-list--start {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 1.25rem;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-list--start::-webkit-scrollbar { display: none; }
  .nav-link--compact { display: inline-flex; }
  .js .nav-list--start { display: none; }
  .js .menu-btn { display: inline-flex; }
}
@media (max-width: 420px) {
  .js .nav-list--end .btn { display: none; }
  .brand__name { font-size: .98rem; }
}

.menu-btn {
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  padding: 0 .9rem;
  border: 1px solid currentColor;
  color: inherit;
  background: transparent;
  font: 400 1rem/1 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  cursor: pointer;
}
.menu-btn__bars {
  display: grid;
  gap: 4px;
  width: 16px;
}
.menu-btn__bars::before,
.menu-btn__bars::after {
  content: "";
  height: 1.5px;
  background: currentColor;
}

/* Full-height mobile menu */
.menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: 1rem var(--gutter) max(1.5rem, env(safe-area-inset-bottom));
  color: var(--ice);
  background:
    radial-gradient(120% 70% at 50% 112%, rgba(20, 88, 200, .42), rgba(10, 40, 90, .14) 45%, transparent 75%),
    var(--void);
  overflow-y: auto;
}
.menu[hidden] { display: none; }
.menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}
.menu__close {
  min-height: 44px;
  padding: 0 .9rem;
  border: 1px solid var(--ice-line-2);
  color: var(--ice);
  background: transparent;
  font: 400 1rem/1 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  cursor: pointer;
}
.menu__list { margin-top: 2.5rem; }
.menu__list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--ice-line);
  font: 300 2.5rem/1.1 var(--f-sans);
  letter-spacing: -.04em;
  text-decoration: none;
}
.menu__list a span {
  font: 400 .9rem/1 var(--f-narrow);
  font-stretch: 75%;
  letter-spacing: 0;
  color: var(--ice-3);
}
.menu__foot { margin-top: auto; padding-top: 2rem; }
.menu__foot a { width: 100%; }

@media (prefers-reduced-motion: no-preference) {
  .menu:not([hidden]) { animation: menu-in .35s var(--ease) both; }
  .menu:not([hidden]) .menu__list li { animation: rise .6s var(--ease) both; }
  .menu__list li:nth-child(2) { animation-delay: .06s !important; }
  .menu__list li:nth-child(3) { animation-delay: .12s !important; }
  .menu__list li:nth-child(4) { animation-delay: .18s !important; }
  .menu__list li:nth-child(5) { animation-delay: .24s !important; }
}
@keyframes menu-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */

.hero {
  overflow: hidden;
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3.5rem, 7vw, 6rem);
}
/* a cool pool of light beneath the object */
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -10%;
  bottom: -30%;
  width: min(80vw, 980px);
  aspect-ratio: 1.6;
  background: radial-gradient(closest-side, rgba(40, 110, 220, .34), rgba(20, 70, 160, .12) 55%, transparent);
  pointer-events: none;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.hero__eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.1rem;
  color: var(--ice-2);
}
.hero__eyebrow span + span::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 1.1rem;
  vertical-align: middle;
  background: var(--ice-3);
}

.hero__title {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  font-size: clamp(3.9rem, 1.6rem + 7.2vw, 8.4rem);
  font-weight: 200;
  line-height: .9;
  letter-spacing: -.055em;
}
.hero__lede {
  max-width: 34rem;
  margin-top: clamp(1.25rem, 3vw, 2rem);
  color: var(--ice);
  font-size: clamp(1.5rem, 1.05rem + 1.5vw, 2.4rem);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -.04em;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
}
.hero .btn { background: var(--blue); }
.hero .btn--ghost { color: var(--ice); background: transparent; border-color: var(--ice-line-2); }
.hero .btn--ghost:hover { border-color: var(--ice); background: rgba(220, 232, 242, .06); }

.tags {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  gap: 8px;
  margin-top: clamp(2rem, 4vw, 3rem);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 32px;
  padding: .3rem .75rem;
  border: 1px solid var(--ice-line-2);
  color: var(--ice);
  font: 400 .95rem/1.1 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
}
.tag::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--blue-light);
}
@media (max-width: 1100px) {
  .tags { grid-template-columns: repeat(2, max-content); }
}

.hero__figure { position: relative; }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__figure { max-width: 30rem; margin-inline: auto; width: 100%; }
}
@media (max-width: 480px) {
  .tags { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tag { min-height: 40px; font-size: .85rem; }
}

/* ---------- The stack (original isometric figure) ---------- */

.stack {
  position: relative;
  width: 100%;
  aspect-ratio: 700 / 540;
  --g: 70;
}
.stack svg { width: 100%; height: 100%; }

.stack .plate {
  --i: 0;
  transform: translateY(calc(var(--i) * var(--g) * 1px));
  transition: transform 1.2s var(--ease);
}
.stack .plate:nth-of-type(1) { --i: 4; }
.stack .plate:nth-of-type(2) { --i: 3; }
.stack .plate:nth-of-type(3) { --i: 2; }
.stack .plate:nth-of-type(4) { --i: 1; }
.stack .plate:nth-of-type(5) { --i: 0; }

.pl-top { fill: var(--void-2); stroke: var(--ice-line-2); stroke-width: 1; transition: fill .4s, stroke .4s; }
.pl-side { fill: var(--void-3); stroke: var(--ice-line-2); stroke-width: 1; transition: fill .4s, stroke .4s; }
.pl-side--r { fill: #0a1017; }
.pl-hatch { opacity: .22; transition: opacity .4s; }
.pl-edge { fill: none; stroke: var(--ice); stroke-width: 1.2; opacity: .55; transition: opacity .4s, stroke .4s; }


/* labels sit to the right of the stack */
.stack__labels { position: absolute; inset: 0; pointer-events: none; }
.stack__label {
  position: absolute;
  left: 61%;
  display: flex;
  align-items: center;
  gap: .55rem;
  transform: translateY(-50%);
  transition: top 1.2s var(--ease), color .4s, opacity .4s;
  font: 400 clamp(.78rem, .62rem + .45vw, .95rem)/1.1 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  color: var(--ice-2);
  white-space: nowrap;
}
.stack__label::before {
  content: "";
  width: clamp(14px, 3vw, 38px);
  height: 1px;
  background: currentColor;
  opacity: .7;
}
.stack__label b { font-weight: 400; color: var(--ice-3); margin-right: .35rem; }

/* label rows follow each plate's right corner: (118 + i * g) / 540 */
.stack .stack__label:nth-child(1) { top: calc((118 + 0 * var(--g)) / 540 * 100%); }
.stack .stack__label:nth-child(2) { top: calc((118 + 1 * var(--g)) / 540 * 100%); }
.stack .stack__label:nth-child(3) { top: calc((118 + 2 * var(--g)) / 540 * 100%); }
.stack .stack__label:nth-child(4) { top: calc((118 + 3 * var(--g)) / 540 * 100%); }
.stack .stack__label:nth-child(5) { top: calc((118 + 4 * var(--g)) / 540 * 100%); }

/* active layer (capabilities) */
.stack[data-active] .plate { opacity: .5; transition: transform 1.2s var(--ease), opacity .4s; }
.stack[data-active] .stack__label { opacity: .45; }
.stack[data-active="interfaces"] .plate[data-layer="interfaces"],
.stack[data-active="systems"] .plate[data-layer="systems"],
.stack[data-active="models"] .plate[data-layer="models"],
.stack[data-active="data"] .plate[data-layer="data"],
.stack[data-active="delivery"] .plate[data-layer="delivery"] { opacity: 1; }
.stack[data-active="interfaces"] .plate[data-layer="interfaces"] .pl-top,
.stack[data-active="systems"] .plate[data-layer="systems"] .pl-top,
.stack[data-active="models"] .plate[data-layer="models"] .pl-top,
.stack[data-active="data"] .plate[data-layer="data"] .pl-top,
.stack[data-active="delivery"] .plate[data-layer="delivery"] .pl-top { fill: #0d2a55; stroke: var(--blue-light); }
.stack[data-active="interfaces"] .plate[data-layer="interfaces"] .pl-hatch,
.stack[data-active="systems"] .plate[data-layer="systems"] .pl-hatch,
.stack[data-active="models"] .plate[data-layer="models"] .pl-hatch,
.stack[data-active="data"] .plate[data-layer="data"] .pl-hatch,
.stack[data-active="delivery"] .plate[data-layer="delivery"] .pl-hatch { opacity: .5; }
.stack[data-active="interfaces"] .plate[data-layer="interfaces"] .pl-edge,
.stack[data-active="systems"] .plate[data-layer="systems"] .pl-edge,
.stack[data-active="models"] .plate[data-layer="models"] .pl-edge,
.stack[data-active="data"] .plate[data-layer="data"] .pl-edge,
.stack[data-active="delivery"] .plate[data-layer="delivery"] .pl-edge { stroke: var(--blue-light); opacity: 1; }
.stack[data-active="interfaces"] .stack__label[data-layer="interfaces"],
.stack[data-active="systems"] .stack__label[data-layer="systems"],
.stack[data-active="models"] .stack__label[data-layer="models"],
.stack[data-active="data"] .stack__label[data-layer="data"],
.stack[data-active="delivery"] .stack__label[data-layer="delivery"] { opacity: 1; color: var(--ice); }

/* ---------- Section heads ---------- */

.section { padding-block: clamp(4.5rem, 9vw, 8rem); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: end;
  gap: 1.5rem clamp(2rem, 5vw, 5rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head__count {
  display: block;
  margin-bottom: 1.1rem;
}
.h2 {
  font-size: clamp(2.6rem, 1.4rem + 4vw, 4.75rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.055em;
}
.section-head p {
  max-width: 34rem;
  color: var(--ink-2);
  font-size: clamp(1.125rem, 1rem + .4vw, 1.375rem);
  line-height: 1.45;
  letter-spacing: -.03em;
}
.scene .section-head p { color: var(--ice-2); }

@media (max-width: 820px) {
  .section-head { grid-template-columns: minmax(0, 1fr); align-items: start; }
}

/* ---------- Intro ---------- */

.intro { padding-bottom: clamp(1.5rem, 4vw, 3rem); overflow: hidden; }

.intro__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.intro__copy p {
  max-width: 32rem;
  margin-top: 1.5rem;
  color: var(--ink-2);
  font-size: clamp(1.125rem, .95rem + .55vw, 1.375rem);
  line-height: 1.45;
  letter-spacing: -.03em;
}
.intro__copy .btn { margin-top: 2rem; }

/* Specification rows: framed label/value pairs */
.specs {
  border-top: 1px solid var(--ink);
}
.specs > div {
  display: grid;
  grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr);
  gap: .25rem 1.5rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--ink-line-2);
}
.specs dt {
  padding-top: .2rem;
  font: 400 .9rem/1.3 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  color: var(--ink-3);
}
.specs dd {
  font-size: 1.05rem;
  line-height: 1.4;
  letter-spacing: -.02em;
}
.scene .specs { border-top-color: var(--ice); }
.scene .specs > div { border-bottom-color: var(--ice-line); }
.scene .specs dt { color: var(--ice-3); }

@media (max-width: 900px) {
  .intro__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .specs > div { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
}

/* ---------- Work ---------- */

.work__layout {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.rail {
  position: sticky;
  top: calc(var(--header-h) + 28px);
}
.rail__count {
  display: block;
  margin-bottom: .9rem;
  font: 400 .95rem/1 var(--f-narrow);
  font-stretch: 75%;
  color: var(--ink-3);
}
.rail__count b { font-weight: 500; color: var(--ink); }
.rail ol { border-top: 1px solid var(--ink); }
.rail a {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  min-height: 44px;
  padding: .45rem 0;
  border-bottom: 1px solid var(--ink-line);
  font: 400 1rem/1.15 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-3);
  transition: color .3s;
}
.rail a span { color: inherit; }
.rail a:hover,
.rail a:focus-visible,
.rail a[aria-current] { color: var(--ink); }
.rail a[aria-current] { box-shadow: inset 3px 0 0 var(--blue); padding-left: .6rem; }

.projects { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }

.project {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ink-line-2);
  background: var(--paper-2) url("img/paper-light.jpg") repeat;
  background-size: 512px 512px;
}
.project.scene {
  border-color: var(--void);
  background: var(--void) url("img/void.jpg") repeat;
  background-size: 512px 512px;
}
.project.scene::before { opacity: .22; }

.project__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  padding: clamp(1.4rem, 3.5vw, 3rem);
}
.project__kicker {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
}
.project__kicker .num { color: inherit; opacity: 1; }
.project__title {
  margin-top: 1rem;
  font-size: clamp(2.4rem, 1.5rem + 3vw, 4rem);
  font-weight: 300;
  line-height: .98;
  letter-spacing: -.055em;
}
.project__lead {
  margin-top: .8rem;
  font-size: clamp(1.3rem, 1.05rem + .8vw, 1.7rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -.035em;
}
.project__body {
  max-width: 36rem;
  margin-top: 1.1rem;
  color: var(--ink-2);
}
.scene .project__body { color: var(--ice-2); }
.project .specs { margin-top: 1.6rem; }
.project .specs > div { grid-template-columns: minmax(5.5rem, 7.5rem) minmax(0, 1fr); }
.project__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.75rem;
}
.project__figure {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 1080px) {
  .project__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .work__layout { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .rail ol { display: flex; flex-wrap: wrap; gap: 0 1.25rem; border-top: 0; }
  .rail a { grid-template-columns: auto auto; gap: .45rem; border-bottom: 0; }
  .rail a[aria-current] { box-shadow: none; padding-left: 0; }
  .rail__count { display: none; }
}

/* compact project row (no case study) */
.project--row .project__grid {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}
@media (max-width: 760px) {
  .project--row .project__grid { grid-template-columns: minmax(0, 1fr); }
}

/* research spread */
.research {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.research .project__grid { grid-template-columns: minmax(0, 1fr); align-content: start; height: 100%; }
.research .project { display: flex; flex-direction: column; }
.research .project__title { font-size: clamp(2.1rem, 1.4rem + 2.2vw, 3.2rem); }
.research .project__actions { margin-top: auto; padding-top: 1.75rem; }
@media (max-width: 1080px) {
  .research { grid-template-columns: minmax(0, 1fr); }
}

.research-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-top: clamp(1rem, 2vw, 1.5rem);
  padding-top: 1rem;
  border-top: 1px solid var(--ink);
}
.research-head h3 {
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.05;
}

/* ---------- Flow schematics ---------- */

.flow-fig { width: 100%; }
.flow-fig figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem 1rem;
  margin-bottom: 1rem;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font: 400 .82rem/1.2 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  color: var(--ink-3);
}
.scene .legend li { color: var(--ice-3); }
.lg {
  flex: none;
  width: 16px;
  height: 12px;
  border: 1px solid currentColor;
}
.lg--mine { border-color: var(--ink); box-shadow: inset 0 3px 0 var(--blue); }
.scene .lg--mine { border-color: var(--ice); box-shadow: inset 0 3px 0 var(--blue-light); }
.lg--ext { border-style: dashed; }

.flow {
  display: grid;
  gap: 18px;
  counter-reset: step;
}
.flow > li {
  position: relative;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: .1rem .75rem;
  padding: .8rem .9rem .85rem;
  border: 1px solid var(--ink-line-2);
  background: var(--paper);
}
.scene .flow > li { border-color: var(--ice-line-2); background: var(--void-2); }
.flow > li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  grid-row: span 2;
  padding-top: .15rem;
  font: 400 .9rem/1 var(--f-narrow);
  font-stretch: 75%;
  color: var(--ink-3);
}
.scene .flow > li::before { color: var(--ice-3); }
.flow > li + li::after {
  content: "";
  position: absolute;
  left: 1.95rem;
  top: -19px;
  width: 1px;
  height: 18px;
  background: var(--ink-line-2);
}
.scene .flow > li + li::after { background: var(--ice-line-2); }

.flow .mine { border-color: var(--ink); box-shadow: inset 0 3px 0 var(--blue); }
.scene .flow .mine { border-color: var(--ice); box-shadow: inset 0 3px 0 var(--blue-light); }
.flow .ext { border-style: dashed; background: transparent; }
.scene .flow .ext { background: transparent; }

.flow strong {
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.flow .note {
  color: var(--ink-3);
  font-size: .92rem;
  line-height: 1.35;
}
.scene .flow .note { color: var(--ice-3); }
.flow .who {
  grid-column: 2;
  font: 400 .78rem/1.2 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  color: var(--ink-3);
}
.scene .flow .who { color: var(--ice-3); }

/* ---------- Capabilities ---------- */

.caps__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.caps__figure {
  position: sticky;
  top: calc(var(--header-h) + 32px);
}
.caps__figure figcaption {
  margin-top: 1rem;
  max-width: 28rem;
  color: var(--ice-3);
  font-size: .95rem;
}

.caps__list { border-top: 1px solid var(--ice); }
.cap {
  padding: 1.6rem 0 1.75rem;
  border-bottom: 1px solid var(--ice-line);
  transition: background-color .4s;
}
.cap__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.cap__num {
  font: 400 .95rem/1 var(--f-narrow);
  font-stretch: 75%;
  color: var(--ice-3);
}
.cap h3 {
  font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -.045em;
}
.cap__enable {
  margin-top: .5rem;
  color: var(--ice);
  font-size: 1.15rem;
  letter-spacing: -.025em;
}
.cap ul { margin-top: 1rem; }
.cap li {
  position: relative;
  padding: .4rem 0 .4rem 1.1rem;
  color: var(--ice-2);
  font-size: 1rem;
  line-height: 1.45;
}
.cap li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1rem;
  width: 6px;
  height: 1px;
  background: var(--ice-3);
}
.cap li a { color: var(--ice); }
.cap__tools {
  margin-top: .9rem;
  font: 400 .9rem/1.45 var(--f-narrow);
  font-stretch: 75%;
  color: var(--ice-3);
}
.cap__tools b { font-weight: 400; color: var(--ice-2); text-transform: uppercase; margin-right: .4rem; }
.cap.is-active .cap__num { color: var(--blue-light); }
.cap.is-active h3 { color: #fff; }

@media (max-width: 960px) {
  .caps__layout { grid-template-columns: minmax(0, 1fr); }
  .caps__figure { position: relative; top: 0; max-width: 34rem; }
}

/* ---------- Practice ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(2rem, 5vw, 4.5rem);
  counter-reset: step;
}
.step {
  padding: 1.4rem 0 1.6rem;
  border-top: 1px solid var(--ink);
}
.step__num {
  font: 400 .95rem/1 var(--f-narrow);
  font-stretch: 75%;
  color: var(--ink-3);
}
.step h3 {
  margin-top: .8rem;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.045em;
}
.step p {
  max-width: 30rem;
  margin-top: .6rem;
  color: var(--ink-2);
  font-size: 1.05rem;
}
@media (max-width: 760px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
}

.practice__lower {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  margin-top: clamp(3rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 960px) {
  .practice__lower { grid-template-columns: minmax(0, 1fr); }
}

.note-card {
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--void);
  background: var(--void) url("img/void.jpg") repeat;
  background-size: 512px 512px;
  color: var(--ice);
}
.note-card .label { color: var(--ice-3); }
.note-card h3 {
  margin-top: .8rem;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 300;
  letter-spacing: -.045em;
  line-height: 1.08;
}
.note-card p {
  margin-top: .9rem;
  color: var(--ice-2);
  font-size: 1.05rem;
}

.corrections h3 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.08;
}
.corrections > p {
  margin-top: .5rem;
  color: var(--ink-2);
  font-size: 1.05rem;
}
.rev-list { margin-top: 1.4rem; border-top: 1px solid var(--ink); }
.rev-list > div {
  display: grid;
  grid-template-columns: 2.4rem 8.5rem minmax(0, 1fr);
  gap: .25rem 1rem;
  padding: .95rem 0 1rem;
  border-bottom: 1px solid var(--ink-line-2);
}
.rev-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ink);
  font: 500 .9rem/1 var(--f-narrow);
  font-stretch: 75%;
}
.rev-where {
  padding-top: .3rem;
  font: 400 .9rem/1.2 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  color: var(--ink-3);
}
.rev-list dd { color: var(--ink-2); font-size: 1rem; }
.rev-list dd strong { color: var(--ink); font-weight: 500; }
@media (max-width: 560px) {
  .rev-list > div { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .rev-list dd { grid-column: 2; }
}

/* ---------- Record ---------- */

.record {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
@media (max-width: 960px) {
  .record { grid-template-columns: minmax(0, 1fr); }
}

.lead-note {
  max-width: 40rem;
  color: var(--ink-2);
  font-size: clamp(1.125rem, 1rem + .4vw, 1.3rem);
  line-height: 1.45;
  letter-spacing: -.03em;
}

.roles { margin-top: 2rem; border-top: 1px solid var(--ink); }
.role {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: .3rem 1.5rem;
  padding: 1.2rem 0 1.3rem;
  border-bottom: 1px solid var(--ink-line-2);
}
.role__when {
  padding-top: .35rem;
  font: 400 .95rem/1.3 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  color: var(--ink-3);
}
.role__org {
  font: 400 .9rem/1.3 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  color: var(--ink-3);
}
.role h3 {
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.15;
}
.role p { margin-top: .35rem; color: var(--ink-2); font-size: 1.02rem; }
.role--now h3::after {
  content: "Now";
  display: inline-block;
  margin-left: .7rem;
  padding: .2rem .45rem;
  vertical-align: .25em;
  border: 1px solid var(--blue-ink);
  color: var(--blue-ink);
  font: 500 .75rem/1 var(--f-narrow);
  font-stretch: 75%;
  letter-spacing: 0;
  text-transform: uppercase;
}
@media (max-width: 560px) {
  .role { grid-template-columns: minmax(0, 1fr); }
  .role__when { padding-top: 0; }
}

.side-block + .side-block { margin-top: 2.25rem; }
.side-block h3 {
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--ink);
  font: 400 .95rem/1.3 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  color: var(--ink-3);
}
.side-block li {
  padding: .95rem 0;
  border-bottom: 1px solid var(--ink-line-2);
}
.side-block .when {
  font: 400 .9rem/1.3 var(--f-narrow);
  font-stretch: 75%;
  color: var(--ink-3);
}
.side-block .what {
  margin-top: .15rem;
  font-size: 1.15rem;
  letter-spacing: -.025em;
  line-height: 1.25;
}
.side-block .detail { margin-top: .2rem; color: var(--ink-2); font-size: 1rem; }

.link {
  color: var(--blue-ink);
  text-decoration: underline;
  text-decoration-color: rgba(15, 70, 159, .45);
}
.link:hover { text-decoration-color: currentColor; }
.scene .link { color: var(--blue-light); text-decoration-color: rgba(143, 192, 255, .45); }
.scene .link:hover { text-decoration-color: currentColor; }
.ext-link::after { content: "\00a0\2197"; }

/* ---------- Closing and footer ---------- */

.closing {
  overflow: hidden;
  padding-block: clamp(5rem, 11vw, 9rem) clamp(4rem, 8vw, 6rem);
}
.closing::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: -45%;
  width: min(120vw, 1500px);
  aspect-ratio: 2.4;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(46, 120, 235, .48), rgba(20, 70, 160, .16) 55%, transparent);
  pointer-events: none;
}
.closing__title {
  max-width: 14ch;
  font-size: clamp(3rem, 1.4rem + 6vw, 7rem);
  font-weight: 200;
  line-height: .95;
  letter-spacing: -.055em;
}
.closing__text {
  max-width: 34rem;
  margin-top: 1.5rem;
  color: var(--ice-2);
  font-size: clamp(1.125rem, 1rem + .4vw, 1.35rem);
  letter-spacing: -.03em;
}
.closing__mail {
  display: inline-flex;
  font-family: var(--f-sans);
  font-stretch: 100%;
  font-weight: 400;
  text-transform: none;
  letter-spacing: -.02em;
  max-width: 100%;
  margin-top: 2.25rem;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: clamp(1.05rem, .8rem + 1.3vw, 1.6rem);
}
.closing__links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem 2rem;
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
  padding-top: 1.1rem;
  border-top: 1px solid var(--ice-line-2);
}
.closing__links dt {
  font: 400 .85rem/1.25 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  color: var(--ice-3);
}
.closing__links dd {
  margin-top: .3rem;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}
.closing__links a { color: var(--ice); text-decoration-color: var(--ice-line-2); }
.closing__links a:hover { text-decoration-color: var(--ice); }
@media (max-width: 820px) {
  .closing__links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .closing__links { grid-template-columns: minmax(0, 1fr); }
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .6rem 2rem;
  padding-block: 1.4rem max(1.6rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--ice-line);
  font: 400 .9rem/1.4 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  color: var(--ice-3);
}
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ice-2);
  text-decoration: none;
}
.site-footer a:hover { color: var(--ice); }

/* ---------- Reveal (progressive, never required) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal]:not(.is-in) {
    opacity: 0;
    transform: translateY(14px);
  }
  .js [data-reveal] {
    transition: opacity 1s var(--ease), transform 1.2s var(--ease);
  }
}

/* =====================================================================
   Case studies
   ===================================================================== */

.case-hero {
  overflow: hidden;
  padding-block: clamp(2rem, 4vw, 3rem) clamp(3.5rem, 7vw, 5.5rem);
}
.case-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -15%;
  top: 10%;
  width: min(80vw, 900px);
  aspect-ratio: 1.4;
  background: radial-gradient(closest-side, rgba(40, 110, 220, .26), rgba(20, 70, 160, .08) 55%, transparent);
  pointer-events: none;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem .7rem;
  font: 400 .92rem/1.3 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  color: var(--ice-3);
}
.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ice-2);
}
.case-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  margin-top: clamp(1.5rem, 4vw, 3rem);
}
.case-title {
  font-size: clamp(3.2rem, 1.4rem + 6.5vw, 7.5rem);
  font-weight: 200;
  line-height: .9;
  letter-spacing: -.055em;
}
.case-deck {
  max-width: 36rem;
  margin-top: 1.5rem;
  color: var(--ice);
  font-size: clamp(1.3rem, 1rem + 1vw, 1.9rem);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: -.04em;
}
@media (max-width: 1100px) {
  .case-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .case-hero .specs { max-width: 44rem; }
}

.case-figure {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--ice-line-2);
  background: rgba(13, 19, 26, .72);
}
.flow--row {
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 22px;
}
.flow--row > li {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}
.flow--row > li::before { grid-row: auto; padding: 0 0 .35rem; }
.flow--row > li + li::after {
  left: -23px;
  top: 50%;
  width: 22px;
  height: 1px;
}
.flow--row .who { grid-column: 1; margin-top: .45rem; }
@media (max-width: 980px) {
  .flow--row { grid-auto-flow: row; grid-auto-columns: auto; gap: 18px; }
  .flow--row > li { grid-template-columns: 2.25rem minmax(0, 1fr); }
  .flow--row > li::before { grid-row: span 3; padding-top: .15rem; }
  .flow--row > li + li::after { left: 1.95rem; top: -19px; width: 1px; height: 18px; }
  .flow--row .who { grid-column: 2; margin-top: 0; }
}

.case-section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.case-section + .case-section { padding-top: 0; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1.25rem clamp(2rem, 5vw, 5rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--ink);
}
.scene .split { border-top-color: var(--ice); }
.split h2 {
  font-size: clamp(1.9rem, 1.3rem + 2vw, 3rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -.05em;
}
.split .label { display: block; margin-bottom: .8rem; }
@media (max-width: 820px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}

.prose { max-width: 40rem; }
.prose p { color: var(--ink-2); }
.prose p + p { margin-top: 1rem; }
.prose strong { color: var(--ink); font-weight: 500; }
.scene .prose p { color: var(--ice-2); }
.scene .prose strong { color: var(--ice); }

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(2rem, 4vw, 3rem);
}
.notes-grid > li {
  padding: 1.3rem 0 1.6rem;
  border-top: 1px solid var(--ink);
}
.notes-grid .step__num { display: block; }
.notes-grid h3 {
  margin-top: .7rem;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -.04em;
}
.notes-grid p { margin-top: .55rem; color: var(--ink-2); font-size: 1.02rem; }
@media (max-width: 1000px) {
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .notes-grid { grid-template-columns: minmax(0, 1fr); }
}

.scope {
  max-width: 44rem;
  padding: 1.3rem 1.4rem 1.4rem;
  border: 1px dashed var(--ink-line-2);
}
.scope p { color: var(--ink-2); }
.scope p + p { margin-top: .8rem; }
.scope strong { color: var(--ink); font-weight: 500; }

.next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 2rem;
  padding-block: 1.5rem 0;
  border-top: 1px solid var(--ice-line-2);
}
.next a { display: block; padding-block: .4rem; text-decoration: none; }
.next a:last-child { text-align: right; }
.next strong {
  display: block;
  margin-top: .35rem;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -.045em;
}
.next a:hover strong { color: #fff; text-decoration: underline; text-decoration-thickness: 1px; }
@media (max-width: 560px) {
  .next { grid-template-columns: minmax(0, 1fr); }
  .next a:last-child { text-align: left; }
}

/* Sequence diagram (three participants) */
.seq { color: var(--ice); }
.seq__heads,
.seq__steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  max-width: 60rem;
  margin-inline: auto;
}
.seq__head {
  grid-column: span 2;
  margin-inline: .4rem;
  padding: .7rem .5rem;
  border: 1px solid var(--ice-line-2);
  text-align: center;
}
.seq__head.mine { border-color: var(--ice); box-shadow: inset 0 3px 0 var(--blue-light); background: var(--void-2); }
.seq__head.ext { border-style: dashed; }
.seq__head strong { display: block; font-size: 1rem; font-weight: 500; }
.seq__head span {
  display: block;
  margin-top: .2rem;
  font: 400 .75rem/1.2 var(--f-narrow);
  font-stretch: 75%;
  text-transform: uppercase;
  color: var(--ice-3);
}
.seq__steps {
  row-gap: .5rem;
  padding: 1.1rem 0 .4rem;
  background:
    repeating-linear-gradient(to bottom, var(--ice-line-2) 0 4px, transparent 4px 8px) 16.6667% 0 / 1px 100% no-repeat,
    linear-gradient(var(--ice-line-2), var(--ice-line-2)) 50% 0 / 1px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--ice-line-2) 0 4px, transparent 4px 8px) 83.3333% 0 / 1px 100% no-repeat;
}
.seq__msg {
  position: relative;
  padding: .3rem .5rem .7rem;
  color: var(--ice-2);
  font-size: .9rem;
  line-height: 1.3;
  text-align: center;
}
.seq__msg::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 9px;
  background: var(--ice-2);
  clip-path: polygon(0 calc(50% - .5px), calc(100% - 7px) calc(50% - .5px), calc(100% - 7px) 0, 100% 50%, calc(100% - 7px) 100%, calc(100% - 7px) calc(50% + .5px), 0 calc(50% + .5px));
}
.seq__msg.left::after {
  clip-path: polygon(100% calc(50% - .5px), 7px calc(50% - .5px), 7px 0, 0 50%, 7px 100%, 7px calc(50% + .5px), 100% calc(50% + .5px));
}
.seq__msg.c12 { grid-column: 2 / 4; }
.seq__msg.c23 { grid-column: 4 / 6; }
.seq__act {
  margin-inline: .3rem;
  padding: .55rem .6rem;
  border: 1px solid var(--ice);
  background: var(--void-2);
  font-size: .9rem;
  line-height: 1.3;
  text-align: center;
}
.seq__act.at1 { grid-column: 1 / 3; }
.seq__act.at2 { grid-column: 3 / 5; }
.seq__act.at3 { grid-column: 5 / 7; }
.seq__act.ext { border-style: dashed; border-color: var(--ice-line-2); background: var(--void); color: var(--ice-2); }
.seq__act.check { border-color: var(--blue-light); box-shadow: inset 0 0 0 1px var(--blue-light); }
@media (max-width: 640px) {
  .seq__head { margin-inline: .15rem; padding-inline: .25rem; }
  .seq__head strong { font-size: .85rem; }
  .seq__msg, .seq__act { font-size: .8rem; }
  .seq__msg { padding-inline: .15rem; }
  .seq__act { padding-inline: .4rem; }
  .seq__act.at1 { grid-column: 1 / 4; }
  .seq__act.at2 { grid-column: 2 / 6; }
  .seq__act.at3 { grid-column: 4 / 7; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- Forced colours ---------- */

@media (forced-colors: active) {
  .btn, .tag, .menu-btn, .project, .flow > li { border: 1px solid CanvasText; }
  .paper::before, .scene--grid::before, .hero::after, .closing::after, .case-hero::after { display: none; }
}

/* ---------- Print ---------- */

@media print {
  .strip, .site-header, .menu, .rail, .hero__actions, .skip-link, .toc,
  .hero__figure, .caps__figure { display: none !important; }
  html, body, .paper, .paper--light, .scene, .project, .project.scene, .note-card,
  .access, .case-figure, .flow > li, .seq__head, .seq__act, .site-footer {
    color: #000 !important;
    background: #fff !important;
    box-shadow: none !important;
  }
  .scene *, .note-card *, .access *, .project * { color: #000 !important; border-color: #888 !important; }
  .paper::before, .scene--grid::before, .hero::after, .closing::after, .case-hero::after { display: none !important; }
  .btn { background: #fff !important; color: #000 !important; border: 1px solid #000 !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  a { text-decoration: underline; }
}

/* =====================================================================
   Sub-page components
   ===================================================================== */

.case-hero .specs { margin-top: .4rem; }
.case-title__sub {
  display: block;
  margin-top: .35em;
  color: var(--ice-3);
  font-size: .42em;
  font-weight: 300;
  letter-spacing: -.04em;
}
.case-hero .hero__actions { margin-top: 1.75rem; }

.fig-cap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-bottom: 1.25rem;
}
.fig-sub { margin: 1.75rem 0 1rem; }
.case-figure .flow--row + .fig-sub + .flow--row { max-width: 46rem; }
.case-figure--paper {
  border-color: var(--ink-line-2);
  background: var(--paper-2);
}
.case-figure--paper .label { color: var(--ink-3); }

.split--head {
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}
.split--head h2 { grid-column: 2; }
.split--head .label { grid-column: 1; grid-row: 1; }
@media (max-width: 820px) {
  .split--head h2, .split--head .label { grid-column: 1; grid-row: auto; }
}
.case-section .notes-grid { margin-top: 0; }
.notes-grid > li:target { box-shadow: inset 0 3px 0 var(--blue); }

.prose--lead p {
  color: var(--ink-2);
  font-size: clamp(1.15rem, 1rem + .45vw, 1.4rem);
  line-height: 1.45;
  letter-spacing: -.03em;
}
.offset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1.25rem clamp(2rem, 5vw, 5rem);
}
.offset > * { grid-column: 2; }
@media (max-width: 820px) {
  .offset { grid-template-columns: minmax(0, 1fr); }
  .offset > * { grid-column: 1; }
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: clamp(2rem, 4vw, 3rem);
}
.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .35rem .8rem;
  border: 1px solid var(--ice-line-2);
  color: var(--ice);
  font: 400 .95rem/1 var(--f-narrow);
  font-stretch: 75%;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color .3s, background-color .3s;
}
.toc a:hover { border-color: var(--ice); background: rgba(220, 232, 242, .06); }

.access {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  align-items: end;
  gap: 1.5rem 3rem;
  padding: clamp(1.5rem, 4vw, 3rem);
}
.access h2 {
  margin-top: .9rem;
  font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.8rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -.05em;
}
.access p { max-width: 36rem; margin-top: .9rem; color: var(--ice-2); }
.access__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
@media (max-width: 860px) {
  .access { grid-template-columns: minmax(0, 1fr); }
}

.refs { border-top: 1px solid var(--ink); }
.refs li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: .3rem 2rem;
  padding: 1rem 0 1.1rem;
  border-bottom: 1px solid var(--ink-line-2);
}
.refs li span { color: var(--ink-2); font-size: 1rem; }
@media (max-width: 760px) {
  .refs li { grid-template-columns: minmax(0, 1fr); }
}

.prose .scope { margin-top: 1.25rem; }

.closing--case { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3.5rem, 7vw, 5rem); }
.closing__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  margin-top: clamp(3rem, 6vw, 5rem);
}
.closing__title--sm {
  max-width: 12ch;
  font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.6rem);
}
.closing__row .closing__mail { margin-top: 0; }

/* =====================================================================
   Film grain: one uniform analogue grain over every surface
   ===================================================================== */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  background-image: url("img/grain.png");
  background-size: 256px 256px;
  mix-blend-mode: overlay;
  opacity: var(--grain, .38);
}
@media print, (forced-colors: active) {
  body::after { display: none; }
}

/* =====================================================================
   Imagery (original, generated for this site; decorative)
   ===================================================================== */

/* Hero object: a photographed stack of five glass plates, with its legend beside it */
.hero-object {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.5rem, 2vw, 1.5rem);
}
.hero-object img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: lighten;
  -webkit-mask-image: radial-gradient(farthest-side, #000 80%, transparent 100%);
  mask-image: radial-gradient(farthest-side, #000 80%, transparent 100%);
}
.hero-legend {
  display: grid;
  gap: .7rem;
  padding-left: 1rem;
  border-left: 1px solid var(--ice-line-2);
}
.hero-legend li {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  color: var(--ice-2);
  font: 400 .95rem/1 var(--f-narrow);
  font-stretch: 75%;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero-legend b { font-weight: 400; color: var(--ice-3); }
@media (max-width: 900px) {
  .hero-object { max-width: 34rem; margin-inline: auto; }
}
@media (max-width: 520px) {
  .hero-object { grid-template-columns: minmax(0, 1fr); }
  .hero-legend {
    grid-template-columns: repeat(2, max-content);
    gap: .55rem 1.5rem;
    padding: .9rem 0 0;
    border-left: 0;
    border-top: 1px solid var(--ice-line-2);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-object img { animation: object-in 1.8s var(--ease) both .1s; }
  .hero-legend li { animation: rise .9s var(--ease) both; }
  .hero-legend li:nth-child(1) { animation-delay: .7s; }
  .hero-legend li:nth-child(2) { animation-delay: .78s; }
  .hero-legend li:nth-child(3) { animation-delay: .86s; }
  .hero-legend li:nth-child(4) { animation-delay: .94s; }
  .hero-legend li:nth-child(5) { animation-delay: 1.02s; }
}
@keyframes object-in {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* Blueprint drawn faintly behind the introduction */
.intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: max(-6vw, -90px);
  top: 50%;
  width: min(62vw, 980px);
  aspect-ratio: 1400 / 933;
  transform: translateY(-46%);
  background: url("img/blueprint-1400.webp") center / contain no-repeat;
  mix-blend-mode: multiply;
  opacity: .42;
  pointer-events: none;
}
@media (max-width: 900px) {
  .intro::before { top: auto; bottom: 0; transform: none; width: 110vw; opacity: .3; }
}

/* Image band at the top of a project panel */
.project__media {
  position: relative;
  aspect-ratio: 21 / 8;
  overflow: hidden;
  border-bottom: 1px solid var(--ink-line-2);
}
.project.scene .project__media { border-bottom-color: var(--ice-line); }
.project__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.6s var(--ease);
}
.research .project__media { aspect-ratio: 16 / 7; }
.project:hover .project__media img { transform: scale(1.025); }
.project__media--edge img { object-position: 70% 40%; }
.project__media--casework img { object-position: 50% 55%; }
.project__media--frames img { object-position: 30% 50%; }
.project__media--cards img { object-position: 50% 45%; }
@media (max-width: 640px) {
  .project__media { aspect-ratio: 16 / 9; }
}

/* Full-bleed image plate between a sub-page hero and its content */
.plate {
  position: relative;
  height: clamp(220px, 38vw, 560px);
  overflow: hidden;
  background: var(--void);
}
.plate img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.plate--edge img { object-position: 75% 40%; }
.plate--frames img { object-position: 30% 55%; }
.plate--casework img, .plate--cards img { object-position: 50% 50%; }
@media print {
  .project__media, .plate { display: none; }
}

/* =====================================================================
   Branching flow (TransFlower: two branches merging into one path)
   ===================================================================== */

.flow--plain > li { grid-template-columns: minmax(0, 1fr); }
.flow--plain > li::before { display: none; }
.flow--plain > li + li::after { left: 1.1rem; }

.branch__name {
  margin-bottom: .55rem;
  font: 400 .8rem/1.2 var(--f-narrow);
  font-stretch: 75%;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.scene .branch__name { color: var(--ice-3); }
.branch__name--later { margin-top: 1.4rem; }

.branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 18px;
}
.branch { display: flex; flex-direction: column; }
/* each branch runs down to a shared bracket */
.branch::after {
  content: "";
  flex: 1 0 18px;
  align-self: center;
  width: 1px;
  background: var(--ink-line-2);
}
.branches::after {
  content: "";
  position: absolute;
  left: 25%;
  right: 25%;
  bottom: 18px;
  height: 1px;
  background: var(--ink-line-2);
}
.scene .branch::after,
.scene .branches::after,
.scene .flow--merge::before { background: var(--ice-line-2); }

.flow--merge { position: relative; padding-top: 18px; }
.flow--merge::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 50%;
  width: 1px;
  height: 36px;
  background: var(--ink-line-2);
}
.flow--merge > li { z-index: 1; }

@media (max-width: 420px) {
  .branches { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .branch + .branch { margin-top: .4rem; }
  .branches::after { display: none; }
  .branch:first-child::after { display: none; }
}

/* =====================================================================
   Languages: switcher, right-to-left layout, Arabic and French typography
   ===================================================================== */

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 34px;
  padding: 0 .45rem;
  border: 1px solid transparent;
  font: 400 .9rem/1 var(--f-narrow);
  font-stretch: 75%;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: .72;
  transition: opacity .3s, border-color .3s;
}
.lang-switch a:hover { opacity: 1; }
.lang-switch a[aria-current] { opacity: 1; border-color: currentColor; }
.lang-switch a:lang(ar) {
  font-family: "Noto Sans Arabic", Tahoma, "Segoe UI", sans-serif;
  font-stretch: 100%;
  font-size: .95rem;
  letter-spacing: 0;
  text-transform: none;
}
.lang-switch--menu { margin-bottom: 1.25rem; gap: 8px; }
.lang-switch--menu a { min-width: 52px; min-height: 44px; border-color: var(--ice-line-2); font-size: 1rem; }
.lang-switch--menu a[aria-current] { border-color: var(--ice); }

@media (max-width: 560px) {
  .js .nav-list--end .lang-switch { display: none; }
}

/* ---------- Right-to-left mirroring (Arabic) ---------- */

[dir="rtl"] .skip-link { left: auto; right: var(--gutter); }
[dir="rtl"] .hero::after { right: auto; left: -10%; }
[dir="rtl"] .case-hero::after { right: auto; left: -15%; }
[dir="rtl"] .hero__eyebrow span + span::before { margin-right: 0; margin-left: 1.1rem; }
[dir="rtl"] .intro::before { right: auto; left: max(-6vw, -90px); }
[dir="rtl"] .hero-legend {
  padding-left: 0;
  padding-right: 1rem;
  border-left: 0;
  border-right: 1px solid var(--ice-line-2);
}
@media (max-width: 520px) {
  [dir="rtl"] .hero-legend { padding-right: 0; border-right: 0; }
}
[dir="rtl"] .rail a[aria-current] { box-shadow: inset -3px 0 0 var(--blue); padding-left: 0; padding-right: .6rem; }
@media (max-width: 860px) {
  [dir="rtl"] .rail a[aria-current] { box-shadow: none; padding-right: 0; }
}
[dir="rtl"] .flow > li + li::after { left: auto; right: 1.95rem; }
[dir="rtl"] .flow--plain > li + li::after { left: auto; right: 1.1rem; }
[dir="rtl"] .flow--row > li + li::after { left: auto; right: -23px; }
@media (max-width: 980px) {
  [dir="rtl"] .flow--row > li + li::after { right: 1.95rem; }
}
[dir="rtl"] .cap li { padding: .4rem 1.1rem .4rem 0; }
[dir="rtl"] .cap li::before { left: auto; right: 0; }
[dir="rtl"] .role--now h3::after { margin-left: 0; margin-right: .7rem; }
[dir="rtl"] .next a:last-child { text-align: left; }
@media (max-width: 560px) {
  [dir="rtl"] .next a:last-child { text-align: right; }
}
/* drawings keep the direction they were drawn in; their text still reads right to left */
[dir="rtl"] .stack,
[dir="rtl"] .seq { direction: ltr; }
[dir="rtl"] .seq li { direction: rtl; }
[dir="rtl"] .stack__label span { direction: rtl; unicode-bidi: isolate; }

/* ---------- Arabic typography ---------- */

html[lang="ar"] {
  --f-sans: "Archivo", "Noto Sans Arabic", Tahoma, "Segoe UI", sans-serif;
  --f-narrow: "Archivo", "Noto Sans Arabic", Tahoma, "Segoe UI", sans-serif;
}
/* Arabic letters join: never track them, never condense them */
html[lang="ar"] * { letter-spacing: 0 !important; font-stretch: 100% !important; }
html[lang="ar"] body { font-size: 1.15rem; line-height: 1.8; }
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .hero__lede,
html[lang="ar"] .case-deck,
html[lang="ar"] .project__lead,
html[lang="ar"] .cap__enable,
html[lang="ar"] .section-head p,
html[lang="ar"] .lead-note,
html[lang="ar"] .intro__copy p,
html[lang="ar"] .closing__text,
html[lang="ar"] .prose--lead p { line-height: 1.55; }
html[lang="ar"] .hero__title { line-height: .95; }
html[lang="ar"] .h2,
html[lang="ar"] .closing__title,
html[lang="ar"] .split h2,
html[lang="ar"] .case-head h2,
html[lang="ar"] .project__title,
html[lang="ar"] .case-title { line-height: 1.3; }
html[lang="ar"] .h2,
html[lang="ar"] .closing__title,
html[lang="ar"] .hero__lede,
html[lang="ar"] .case-deck,
html[lang="ar"] .project__lead,
html[lang="ar"] .cap h3,
html[lang="ar"] .access h2,
html[lang="ar"] .note-card h3 { font-weight: 400; }
html[lang="ar"] .label,
html[lang="ar"] .nav-link,
html[lang="ar"] .btn,
html[lang="ar"] .tag,
html[lang="ar"] .specs dt { font-size: .98rem; }
html[lang="ar"] .stack__label { font-size: clamp(.82rem, .66rem + .45vw, 1rem); }

/* ---------- French typography ---------- */

html[lang="fr"] p,
html[lang="fr"] li,
html[lang="fr"] dd { hyphens: auto; -webkit-hyphens: auto; }

/* long layer names (French, Arabic) wrap beside the drawing instead of overflowing */
.stack__label { right: 0; white-space: normal; }
.stack__label::before { flex: none; }
.stack__label span { min-width: 0; }

/* Arabic: no forced capitals on the Latin words inside Arabic text */
html[lang="ar"] * { text-transform: none !important; }

/* two-note variant (Avertix: models in the product) */
.notes-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .notes-grid--two { grid-template-columns: minmax(0, 1fr); } }
.notes-grid > li p + p { margin-top: .6rem; }

/* Livia: the product's own mark, recoloured to the site palette */
.project--row .project__grid { align-items: center; }
.livia-brand {
  display: grid;
  justify-items: stretch;
  gap: .75rem;
  width: 15rem;
  margin-top: 0;
}
.livia-tile {
  display: grid;
  place-items: center;
  gap: .9rem;
  padding: 1.6rem 1.25rem 1.4rem;
  border: 1px solid var(--void);
  background: var(--void) url("img/void.jpg") repeat;
  background-size: 512px 512px;
}
.livia-tile__mark { width: 86%; height: auto; }
.livia-tile__word { width: 44%; height: auto; }
.livia-brand .btn { width: 100%; }
@media (max-width: 760px) {
  .livia-brand { width: min(100%, 20rem); }
}
