/* Dr. Ali Heidari — site styles
   Light editorial base with deep-navy bands. Fonts: Newsreader (display/reading), Geist (UI), Geist Mono (labels). */

:root {
  --paper: #F6F3EC;
  --paper-2: #EDE8DE;
  --card: #FFFDF8;
  --ink: #0D1B2A;
  --ink-2: #2A3644;
  --muted: #59636F;
  --faint: #8A9199;
  --line: rgba(13, 27, 42, .12);
  --line-2: rgba(13, 27, 42, .22);
  --gold: #B48B3C;
  --gold-ink: #8A6826;
  --gold-soft: #E8C87A;
  --teal: #0F6B63;

  --night: #0A1520;
  --night-2: #102233;
  --on-night: #EEF2F6;
  --on-night-2: #B9C4CF;
  --on-night-3: #8494A3;
  --night-line: rgba(238, 242, 246, .12);

  --sa: #0D1B2A;
  --uk: #0F6E66;
  --cr: #1C5B70;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --maxw: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 76px;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --shadow: 0 1px 2px rgba(13, 27, 42, .05), 0 14px 34px -14px rgba(13, 27, 42, .2);
  --shadow-lg: 0 2px 6px rgba(13, 27, 42, .06), 0 44px 80px -32px rgba(13, 27, 42, .5);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 380;
  color: var(--ink);
  letter-spacing: -.015em;
  line-height: 1.08;
  text-wrap: balance;
}
h1 em, h2 em, h3 em { font-style: italic; font-weight: 340; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--gold-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible { outline-color: var(--gold-soft); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-sm);
  font-weight: 500; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: calc(var(--maxw) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(760px + var(--gutter) * 2); }
.section { padding: clamp(72px, 10vw, 136px) 0; }
.section--tight { padding: clamp(56px, 7vw, 96px) 0; }
.section--paper2 { background: var(--paper-2); }
.section--dark { background: var(--night); color: var(--on-night-2); }
.section--dark h2, .section--dark h3 { color: var(--on-night); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Type helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font: 500 .75rem/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 22px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gold); flex: none; }
.on-dark .eyebrow, .section--dark .eyebrow { color: var(--gold-soft); }
.display { font-size: clamp(2.9rem, 6vw, 5.5rem); line-height: 1; letter-spacing: -.025em; }
.h1 { font-size: clamp(2.6rem, 5.4vw, 4.6rem); line-height: 1.02; letter-spacing: -.022em; }
.h2 { font-size: clamp(2rem, 3.6vw, 3.15rem); line-height: 1.06; }
.h3 { font-size: clamp(1.4rem, 2vw, 1.75rem); line-height: 1.18; }
.lead { font-size: clamp(1.12rem, 1.5vw, 1.3rem); line-height: 1.6; color: var(--ink-2); }
.on-dark .lead { color: var(--on-night-2); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.gold { color: var(--gold-ink); }
.on-dark .gold, .section--dark .gold { color: var(--gold-soft); }
.kicker { font: 500 .78rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.on-dark strong { color: var(--on-night); font-weight: 500; }
.mt-s { margin-top: 20px; }
.mt-m { margin-top: 32px; }
.mt-l { margin-top: clamp(40px, 5vw, 56px); }
.mt-xl { margin-top: clamp(56px, 7vw, 88px); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px; border-radius: 10px;
  font: 500 .98rem/1 var(--sans); text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: background .25s var(--ease), color .25s, border-color .25s, transform .25s var(--ease);
}
.btn svg { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #1B2E42; }
.btn--gold { background: var(--gold-soft); color: var(--ink); }
.btn--gold:hover { background: #F0D592; }
.btn--ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); }
.on-dark .btn--ghost { border-color: rgba(238, 242, 246, .3); color: var(--on-night); }
.on-dark .btn--ghost:hover { border-color: var(--on-night); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 .98rem/1.3 var(--sans); color: var(--ink); text-decoration: none;
  padding-bottom: 4px; border-bottom: 1px solid var(--line-2);
  transition: border-color .25s;
}
.link-arrow::after { content: "→"; transition: transform .25s var(--ease); }
.link-arrow:hover { border-color: var(--ink); }
.link-arrow:hover::after { transform: translateX(4px); }
.on-dark .link-arrow, .section--dark .link-arrow { color: var(--on-night); border-color: rgba(238, 242, 246, .3); }

.prose a, .text-link { color: var(--teal); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover, .text-link:hover { color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(246, 243, 236, .86);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line); color: var(--ink);
  transition: background .35s, border-color .35s, color .35s;
}
.has-dark-hero .site-header { position: fixed; left: 0; right: 0; background: transparent; border-color: transparent; color: var(--on-night); -webkit-backdrop-filter: none; backdrop-filter: none; }
.has-dark-hero .site-header.is-solid { background: rgba(246, 243, 236, .9); border-color: var(--line); color: var(--ink); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
body.menu-open .site-header { background: transparent !important; border-color: transparent !important; color: var(--on-night) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.header-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand-mark { display: block; flex: none; width: 40px; height: 40px; border-radius: 50%; }
.brand-emblem { display: block; flex: none; width: auto; height: 60px; }
.brand-name { font: 450 1.18rem/1 var(--serif); letter-spacing: -.005em; }
.brand-name small { font: 500 .62rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; display: block; margin-top: 5px; opacity: .65; }
.nav { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav a {
  position: relative; display: block; padding: 10px 14px; text-decoration: none;
  font: 500 .95rem/1 var(--sans); opacity: .78; transition: opacity .2s;
}
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; background: var(--gold); border-radius: 2px; }
.header-cta { min-height: 42px; padding: 0 18px; font-size: .92rem; }
.has-dark-hero .site-header:not(.is-solid) .header-cta { background: var(--gold-soft); color: var(--ink); }
.menu-toggle {
  display: none; width: 46px; height: 46px; margin-right: -8px; border: 0; background: transparent; cursor: pointer;
  align-items: center; justify-content: center; border-radius: 10px;
}
.menu-toggle span { position: relative; width: 22px; height: 1.5px; background: currentColor; transition: background .2s; }
.menu-toggle span::before, .menu-toggle span::after { content: ""; position: absolute; left: 0; width: 22px; height: 1.5px; background: currentColor; transition: transform .3s var(--ease); }
.menu-toggle span::before { transform: translateY(-7px); }
.menu-toggle span::after { transform: translateY(7px); }
.menu-toggle[aria-expanded="true"] span { background: transparent; }
.menu-toggle[aria-expanded="true"] span::before { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span::after { transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 45; background: var(--night); color: var(--on-night);
  padding: calc(var(--header-h) + 32px) var(--gutter) 40px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu ul { list-style: none; border-top: 1px solid var(--night-line); }
.mobile-menu li a {
  display: flex; justify-content: space-between; align-items: baseline; padding: 18px 0;
  border-bottom: 1px solid var(--night-line); text-decoration: none;
  font: 380 2rem/1.1 var(--serif);
}
.mobile-menu li a span { font: 500 .72rem/1 var(--mono); letter-spacing: .14em; color: var(--on-night-3); }
.mobile-menu li a[aria-current="page"] { color: var(--gold-soft); }
.mobile-menu .mm-foot { margin-top: auto; padding-top: 40px; display: grid; gap: 10px; font-size: .95rem; color: var(--on-night-2); }
.mobile-menu .mm-foot a { text-decoration: none; }
body.menu-open { overflow: hidden; }

@media (max-width: 920px) {
  .nav, .header-cta { display: none; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 480px) {
  .brand-name small { display: none; }
  .brand-mark { width: 36px; height: 36px; }
}

/* ---------- Home hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--night); color: var(--on-night-2);
  padding: calc(var(--header-h) + clamp(40px, 7vw, 96px)) 0 0;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(48% 55% at 78% 22%, rgba(232, 200, 122, .11), transparent 62%),
    radial-gradient(44% 50% at 6% 92%, rgba(15, 107, 99, .22), transparent 64%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(238, 242, 246, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(238, 242, 246, .045) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 30%, #000 30%, transparent 85%); mask-image: radial-gradient(80% 70% at 50% 30%, #000 30%, transparent 85%);
}
.hero h1 { color: var(--on-night); }
.hero h1 em { color: var(--gold-soft); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.hero-copy .lead { max-width: 36em; margin: 28px 0 36px; }
.hero-cred { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 40px; font: 500 .8rem/1.4 var(--mono); letter-spacing: .04em; color: var(--on-night-3); }
.hero-cred span { display: inline-flex; align-items: center; gap: 10px; }
.hero-cred span + span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); margin-right: 12px; }
.hero-cred span + span { gap: 0; }

.portrait-wrap { position: relative; max-width: 470px; margin-left: auto; width: 100%; }
.portrait-wrap::before {
  content: ""; position: absolute; inset: -16px 16px 16px -16px; border: 1px solid rgba(232, 200, 122, .38);
  border-radius: calc(var(--r-lg) + 6px); pointer-events: none;
}
.portrait { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-lg); overflow: hidden; background: #0C1823; margin: 0; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }
.portrait img.pos-desk { object-position: 62% 40%; }
.now-card {
  position: absolute; left: -36px; bottom: 34px; max-width: 290px;
  background: rgba(10, 21, 32, .82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--night-line); border-radius: var(--r); padding: 16px 18px;
  font-size: .9rem; line-height: 1.45; color: var(--on-night-2);
}
.now-card strong { display: block; color: var(--on-night); font-weight: 500; margin-bottom: 2px; }
.now-card .kicker { color: var(--gold-soft); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .68rem; }
.now-card .kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4FD1A5; box-shadow: 0 0 0 4px rgba(79, 209, 165, .16); }

.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(64px, 9vw, 120px); border-top: 1px solid var(--night-line); }
.hero-stats > div { padding: 30px 24px 38px 0; }
.hero-stats > div + div { padding-left: 24px; border-left: 1px solid var(--night-line); }
.stat-num { font: 360 clamp(2.1rem, 3.4vw, 3rem)/1 var(--serif); color: var(--on-night); letter-spacing: -.02em; }
.stat-num sup { font-size: .5em; color: var(--gold-soft); vertical-align: super; margin-left: 2px; }
.stat-label { margin-top: 10px; font-size: .9rem; line-height: 1.4; color: var(--on-night-3); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait-wrap { margin: 8px auto 0 16px; max-width: 420px; }
  .now-card { left: -16px; bottom: 20px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .hero-stats > div:nth-child(n+3) { border-top: 1px solid var(--night-line); }
}
@media (max-width: 520px) {
  .portrait-wrap { margin-left: 16px; margin-right: 0; }
  .now-card { position: relative; left: auto; bottom: auto; margin: -56px 12px 0 -4px; max-width: none; }
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: clamp(48px, 6.5vw, 96px) 0 clamp(40px, 5vw, 72px); }
.page-hero .lead { max-width: 40em; margin-top: 24px; }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: clamp(32px, 6vw, 96px); align-items: end; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font: 500 .78rem/1.3 var(--mono); letter-spacing: .06em; color: var(--muted); margin-bottom: 28px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs span[aria-hidden] { opacity: .5; }
@media (max-width: 860px) { .page-hero-grid { grid-template-columns: 1fr; align-items: start; } }

/* ---------- Section heads ---------- */
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; margin-bottom: clamp(40px, 5vw, 72px); }
.section-head > p { max-width: 34em; margin: 0; color: var(--muted); font-size: 1.08rem; }
.section--dark .section-head > p { color: var(--on-night-3); }
@media (max-width: 820px) { .section-head { grid-template-columns: 1fr; } }

/* ---------- Device frames ---------- */
.frame { margin: 0; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid rgba(13, 27, 42, .1); box-shadow: var(--shadow-lg); }
.frame-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: #F2EFE9; border-bottom: 1px solid rgba(13, 27, 42, .08); }
.frame-bar i { width: 8px; height: 8px; border-radius: 50%; background: #D3CEC4; }
.frame-url { margin: 0 auto; transform: translateX(-20px); font: 400 .68rem/1 var(--mono); color: var(--muted); background: #fff; border: 1px solid rgba(13, 27, 42, .08); border-radius: 6px; padding: 5px 14px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame img { width: 100%; }
.frame--dark { background: #0D1B2A; border-color: rgba(255, 255, 255, .08); }
.frame--dark .frame-bar { background: #16263A; border-color: rgba(255, 255, 255, .06); }
.frame--dark .frame-bar i { background: #33465C; }
.frame--dark .frame-url { background: #0D1B2A; color: #8DA0B3; border-color: rgba(255, 255, 255, .08); }
.phone { margin: 0; border-radius: 28px; border: 7px solid #0B1520; background: #0B1520; overflow: hidden; box-shadow: var(--shadow-lg); }
.phone img { width: 100%; border-radius: 20px; }

/* ---------- Project features ---------- */
.projects { display: grid; gap: clamp(88px, 11vw, 160px); }
.project { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(36px, 6vw, 88px); align-items: center; }
.project:nth-child(even) .project-visual { order: -1; }
.project-index { font: 500 .78rem/1 var(--mono); letter-spacing: .14em; color: var(--muted); display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.project-index::after { content: ""; flex: 1; height: 1px; background: var(--line); max-width: 120px; }
.project-logo { height: 34px; width: auto; margin-bottom: 26px; }
.project h3 { font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1.08; margin-bottom: 14px; }
.project-tags { font: 500 .8rem/1.4 var(--mono); letter-spacing: .06em; color: var(--teal); margin-bottom: 18px; }
.project p { color: var(--muted); }
.ticks { list-style: none; display: grid; gap: 10px; margin: 22px 0 30px; }
.ticks li { position: relative; padding-left: 26px; font-size: .98rem; line-height: 1.5; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: .72em; width: 12px; height: 1px; background: var(--gold); }
.project-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding-top: 22px; border-top: 1px solid var(--line); }

.status { display: inline-flex; align-items: center; gap: 9px; font: 500 .7rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, .4); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--gold)); }
.status--dev { --dot: #D49B2C; }
.status--preview { --dot: #1A9C8C; }
.status--pilot { --dot: #3B82A6; }
.status--live { --dot: #2EA36B; }
.on-dark .status { color: var(--on-night-2); border-color: rgba(238, 242, 246, .25); background: transparent; }

.project-visual {
  position: relative; display: block; aspect-ratio: 7 / 5.2; border-radius: var(--r-lg); overflow: hidden;
  padding: 8% 8% 0; text-decoration: none; isolation: isolate;
}
.project-visual::before { content: ""; position: absolute; inset: 0; z-index: -1; }
.project-visual .frame { border-radius: 12px 12px 0 0; transition: transform .7s var(--ease); }
.project-visual .phone { position: absolute; right: 5.5%; bottom: -10%; width: 21%; transition: transform .7s var(--ease); }
.project-visual:hover .frame { transform: translateY(-8px); }
.project-visual:hover .phone { transform: translateY(-14px); }
.pv-sa::before { background: radial-gradient(70% 80% at 85% 10%, rgba(232, 200, 122, .28), transparent 60%), linear-gradient(160deg, #13263A, #0A1520 70%); }
.pv-uk::before { background: radial-gradient(70% 80% at 85% 10%, rgba(255, 255, 255, .55), transparent 60%), linear-gradient(160deg, #CFE6E1, #A9D0C8 80%); }
.pv-cr::before { background: radial-gradient(70% 80% at 85% 10%, rgba(255, 255, 255, .5), transparent 60%), linear-gradient(160deg, #D7E3E8, #AFC7D1 80%); }
.pv-ds { display: grid; place-items: center; padding: 7%; }
.pv-ds .frame { border-radius: 12px; }
.pv-ds::before { background: radial-gradient(70% 80% at 85% 10%, rgba(232, 200, 122, .2), transparent 60%), linear-gradient(160deg, #1A2A3B, #0B1621 70%); }

@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .project-visual { order: 0; }
  .project-visual { order: -1 !important; }
}

/* ---------- Cards / grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 32px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 32px); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 28px); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(22px, 2.6vw, 32px); }
.card h3 { font-size: 1.45rem; line-height: 1.2; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: .98rem; margin: 0; }
.card .num { font: 500 .74rem/1 var(--mono); letter-spacing: .12em; color: var(--gold-ink); margin-bottom: 26px; display: block; }
.card--dark { background: var(--night-2); border-color: var(--night-line); }
.card--dark h3 { color: var(--on-night); }
.card--dark p { color: var(--on-night-3); }
.card-q { font: italic 400 1.08rem/1.45 var(--serif); color: var(--ink-2); margin: 4px 0 18px !important; }

.principles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.principles > div { padding: 28px 28px 8px 0; }
.principles > div + div { padding-left: 28px; border-left: 1px solid var(--line); }
.principles h3 { font-size: 1.5rem; margin-bottom: 10px; }
.principles p { color: var(--muted); font-size: .98rem; }
.principles .num { font: 500 .74rem/1 var(--mono); color: var(--gold-ink); letter-spacing: .12em; display: block; margin-bottom: 18px; }
.section--dark .principles { border-color: var(--night-line); }
.section--dark .principles > div + div { border-color: var(--night-line); }
.section--dark .principles p { color: var(--on-night-3); }
.section--dark .principles .num { color: var(--gold-soft); }
@media (max-width: 960px) {
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principles > div:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 560px) {
  .principles { grid-template-columns: 1fr; }
  .principles > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .section--dark .principles > div + div { border-top-color: var(--night-line); }
}

.quote { max-width: 980px; }
.quote blockquote { margin: 0; font: italic 330 clamp(1.8rem, 3.6vw, 3rem)/1.18 var(--serif); color: var(--ink); letter-spacing: -.015em; text-wrap: balance; }
.quote blockquote::before { content: "“"; display: block; font: 400 4.5rem/0.6 var(--serif); color: var(--gold); margin-bottom: 12px; }
.quote figcaption { margin-top: 26px; font: 500 .8rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.section--dark .quote blockquote { color: var(--on-night); }

/* ---------- Atlas ---------- */
.atlas-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.atlas-card { display: block; text-decoration: none; }
.atlas-card .thumb { display: block; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: #fff; border: 1px solid var(--line); }
.atlas-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .7s var(--ease); }
.atlas-card:hover img { transform: scale(1.04); }
.atlas-card .cap { display: block; margin-top: 12px; font: 500 .72rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--teal); }
.atlas-card .ttl { display: block; margin-top: 4px; font: 400 1.18rem/1.25 var(--serif); color: var(--ink); }
@media (max-width: 900px) { .atlas-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.masonry { columns: 3 300px; column-gap: 24px; }
.masonry .atlas-card { break-inside: avoid; margin-bottom: 32px; }
.masonry .atlas-card .thumb { aspect-ratio: auto; }
.masonry .atlas-card img { height: auto; }

/* ---------- About teaser / split ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
.split--wide-left { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.split--photo { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); }
.photo { margin: 0; border-radius: var(--r-lg); overflow: hidden; background: #0C1823; position: relative; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.portrait-tall { aspect-ratio: 4 / 5; max-width: 460px; justify-self: end; width: 100%; }
.portrait-tall img { object-position: 50% 30%; }
.thumb-wide { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; margin-bottom: 22px; border: 1px solid var(--line); background: #fff; }
.thumb-wide img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .7s var(--ease); }
a.card { transition: border-color .25s, box-shadow .35s; }
a.card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
a.card:hover .thumb-wide img { transform: scale(1.03); }
a.card .link-arrow { display: inline-flex; }
.split > .portrait-tall:first-child { justify-self: start; }
@media (max-width: 860px) { .portrait-tall { justify-self: start; } }
.photo figcaption { position: absolute; left: 16px; bottom: 14px; font: 500 .7rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(238, 242, 246, .75); }
@media (max-width: 860px) { .split, .split--wide-left, .split--photo { grid-template-columns: 1fr; } }

.mini-timeline { list-style: none; margin: 28px 0 34px; border-top: 1px solid var(--line); }
.mini-timeline li { display: grid; grid-template-columns: 88px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .98rem; }
.mini-timeline .yr { font: 500 .82rem/1.6 var(--mono); color: var(--gold-ink); }
.mini-timeline strong { font-weight: 500; color: var(--ink); }

/* ---------- Writing ---------- */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 36px; }
.post-card { display: flex; flex-direction: column; border-top: 1px solid var(--line-2); padding-top: 22px; text-decoration: none; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 500 .72rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-bottom: 14px; }
.post-meta span + span { color: var(--faint); }
.post-card h3 { font-size: 1.5rem; line-height: 1.2; margin-bottom: 12px; transition: color .2s; }
.post-card p { color: var(--muted); font-size: .97rem; margin-bottom: 18px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .more { margin-top: auto; font: 500 .9rem/1 var(--sans); color: var(--ink); }
.post-card .more::after { content: " →"; }
.post-card:hover h3 { color: var(--teal); }
.post-card[hidden] { display: none; }
@media (max-width: 960px) { .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .posts { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 48px; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font: 500 .88rem/1 var(--sans); color: var(--ink-2); transition: all .2s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* Article */
.article-head { padding: clamp(48px, 7vw, 96px) 0 0; }
.article-head h1 { font-size: clamp(2.3rem, 4.6vw, 3.7rem); line-height: 1.06; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 26px 0 0; padding: 0 0 28px; border-bottom: 1px solid var(--line); font: 500 .78rem/1.3 var(--mono); letter-spacing: .06em; color: var(--muted); }
.article-lead { font: italic 380 clamp(1.3rem, 2vw, 1.55rem)/1.55 var(--serif); color: var(--ink); margin: 36px 0 12px; }
.prose { font: 400 1.18rem/1.78 var(--serif); color: #23303D; }
.prose p { margin: 0 0 1.15em; }
.prose h3 { font-size: 1.7rem; line-height: 1.2; margin: 1.9em 0 .55em; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose .pearl { margin: 2em 0; padding: 22px 26px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 0 var(--r) var(--r) 0; }
.prose .pearl-label { display: block; font: 500 .72rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: 10px; }
.prose .pearl p { margin: 0; font-size: 1.08rem; }
.author-card { display: flex; align-items: center; gap: 18px; margin: 56px 0 0; padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.author-card img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; }
.author-card strong { display: block; font: 450 1.2rem/1.2 var(--serif); color: var(--ink); }
.author-card span { font-size: .92rem; color: var(--muted); }

/* ---------- Case study ---------- */
.cs-hero { padding: clamp(48px, 7vw, 96px) 0 0; }
.cs-logo { height: 40px; width: auto; margin-bottom: 30px; }
.cs-hero h1 { max-width: 15em; }
.cs-hero .lead { max-width: 40em; margin-top: 24px; }
.cs-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: clamp(40px, 5vw, 64px) 0 0; border-top: 1px solid var(--line-2); }
.cs-meta > div { padding: 20px 20px 0 0; }
.cs-meta > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.cs-meta dt { font: 500 .72rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.cs-meta dd { margin: 0; font-size: .98rem; line-height: 1.5; color: var(--ink); }
@media (max-width: 860px) {
  .cs-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-meta > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .cs-meta > div:nth-child(n+3) { margin-top: 20px; }
}
.cs-stage { margin-top: clamp(48px, 6vw, 80px); }
.cs-stage .project-visual { aspect-ratio: 16 / 9.6; padding: 6% 9% 0; }
.cs-stage .project-visual .phone { width: 17%; right: 4.5%; bottom: -14%; }
@media (max-width: 640px) { .cs-stage .project-visual { aspect-ratio: 4 / 3.4; padding: 8% 6% 0; } .cs-stage .project-visual .phone { width: 24%; } }

.sticky-split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); }
.sticky-split > :first-child { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
.sticky-split .prose-sans p { font-size: 1.12rem; line-height: 1.7; color: var(--ink-2); }
.sticky-split .prose-sans p:first-child { font: 400 1.45rem/1.5 var(--serif); color: var(--ink); }
@media (max-width: 860px) { .sticky-split { grid-template-columns: 1fr; } .sticky-split > :first-child { position: static; } }

.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.feature + .feature { margin-top: clamp(72px, 9vw, 128px); }
.feature:nth-child(even) > :last-child { order: -1; }
.feature h3 { font-size: clamp(1.7rem, 2.6vw, 2.25rem); margin-bottom: 16px; }
.feature p { color: var(--muted); }
.feature .frame { box-shadow: var(--shadow); }
.shot { display: block; border-radius: 12px; cursor: zoom-in; text-decoration: none; }
.shot .frame { transition: transform .5s var(--ease), box-shadow .5s; }
.shot:hover .frame { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
@media (max-width: 900px) { .feature { grid-template-columns: 1fr; } .feature:nth-child(even) > :last-child { order: 0; } }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.gallery figure { margin: 0; }
.gallery figcaption { margin-top: 12px; font-size: .9rem; color: var(--muted); }
.gallery figcaption b { font: 500 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-right: 8px; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } }

.numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--night-line); }
.numbers > div { padding: 30px 24px 10px 0; }
.numbers > div + div { padding-left: 24px; border-left: 1px solid var(--night-line); }
.numbers .stat-label { color: var(--on-night-3); }
@media (max-width: 860px) {
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .numbers > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .numbers > div:nth-child(n+3) { border-top: 1px solid var(--night-line); }
}

.note {
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start;
  padding: 24px 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
}
.note svg { width: 22px; height: 22px; color: var(--teal); margin-top: 3px; }
.note p { margin: 0; color: var(--ink-2); font-size: 1rem; }
.note strong { color: var(--ink); font-weight: 600; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tag-list li { font: 500 .8rem/1 var(--mono); padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 8px; color: var(--ink-2); background: var(--card); }

.next-project { display: block; text-decoration: none; padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--line); }
.next-project .kicker { margin-bottom: 18px; display: block; }
.next-project h2 { font-size: clamp(2.2rem, 5vw, 4.2rem); transition: color .25s; }
.next-project h2::after { content: "→"; margin-left: .3em; color: var(--gold); display: inline-block; transition: transform .35s var(--ease); }
.next-project:hover h2 { color: var(--teal); }
.next-project:hover h2::after { transform: translateX(10px); }

/* ---------- About ---------- */
.timeline { list-style: none; position: relative; }
.timeline li { display: grid; grid-template-columns: 140px 1fr; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline .yr { font: 500 .9rem/1.5 var(--mono); color: var(--gold-ink); }
.timeline .yr small { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-top: 4px; }
.timeline h3 { font-size: 1.5rem; margin-bottom: 6px; }
.timeline p { margin: 0; color: var(--muted); }
.timeline .is-now .yr { color: var(--teal); }
@media (max-width: 600px) { .timeline li { grid-template-columns: 1fr; gap: 8px; } }

.lang-list { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.lang-list li { padding: 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.lang-list strong { display: block; font: 400 1.35rem/1.2 var(--serif); color: var(--ink); }
.lang-list span { font: 500 .72rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
@media (max-width: 760px) { .lang-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Studio ---------- */
.site-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 48px); }
.site-card figure { margin: 0 0 16px; }
.site-card h3 { font-size: 1.35rem; margin-bottom: 4px; }
.site-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.site-card .kicker { display: block; margin-bottom: 8px; color: var(--teal); }
@media (max-width: 900px) { .site-cards { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact-list { list-style: none; border-top: 1px solid var(--line-2); }
.contact-list a {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 18px; align-items: center;
  padding: 22px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .2s, padding .3s var(--ease);
}
.contact-list a:hover { background: var(--card); padding-left: 14px; }
.contact-list .ic { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--teal); }
.contact-list .ic svg { width: 19px; height: 19px; }
.contact-list .k { display: block; font: 500 .72rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.contact-list .v { font: 400 1.3rem/1.25 var(--serif); color: var(--ink); word-break: break-word; }
.contact-list .arr { color: var(--faint); font-size: 1.2rem; }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { font: 500 .78rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; font: 400 1rem/1.4 var(--sans); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 13px 14px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 107, 99, .16); }
.form-note { font-size: .86rem; color: var(--muted); margin: 0; }

/* ---------- Exam guides ---------- */
.exam { --accent: var(--teal); }
.pill { display: inline-flex; align-items: center; font: 500 .72rem/1 var(--mono); letter-spacing: .04em; padding: 6px 10px; border-radius: 999px; background: rgba(15, 107, 99, .09); color: var(--teal); white-space: nowrap; }
.pill--gold { background: rgba(180, 139, 60, .14); color: var(--gold-ink); }
.pill--ink { background: var(--ink); color: var(--paper); }
.toc { margin: 32px 0 0; }
.toc .chip { display: inline-flex; align-items: center; text-decoration: none; }
.exam [id] { scroll-margin-top: calc(var(--header-h) + 16px); }

.exam-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 28px); }
.exam-card {
  display: flex; flex-direction: column; text-decoration: none; background: var(--card); border: 1px solid var(--line);
  border-top: 3px solid var(--accent, var(--teal)); border-radius: var(--r); padding: clamp(24px, 2.8vw, 34px);
  transition: transform .35s var(--ease), box-shadow .35s;
}
.exam-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.exam-card .kicker { margin-bottom: 18px; }
.exam-card h3 { font-size: clamp(2rem, 3vw, 2.6rem); line-height: 1; }
.exam-card .sub { font: italic 400 1.08rem/1.4 var(--serif); color: var(--ink-2); margin: 8px 0 18px; }
.exam-card p { color: var(--muted); font-size: .98rem; }
.exam-card .tag-list { margin: 4px 0 26px; }
.exam-card .link-arrow { margin-top: auto; align-self: flex-start; }
.section--dark .exam-card { background: var(--night-2); border-color: var(--night-line); border-top-color: var(--accent, var(--gold-soft)); }
.section--dark .exam-card h3 { color: var(--on-night); }
.section--dark .exam-card .sub { color: var(--on-night-2); }
.section--dark .exam-card p, .section--dark .exam-card .kicker { color: var(--on-night-3); }
.section--dark .exam-card .tag-list li { background: transparent; border-color: var(--night-line); color: var(--on-night-2); }
@media (max-width: 960px) { .exam-cards { grid-template-columns: 1fr; } }

/* Data tables (comparison, dates): rows stack into labelled cards on small screens */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: .98rem; line-height: 1.5; }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: 16px 20px; border-top: 1px solid var(--line); }
.data-table thead th { border-top: 0; background: var(--paper-2); font: 500 .72rem/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.data-table tbody th { font: 500 .72rem/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--teal); }
.data-table td { color: var(--ink-2); }
.data-table td strong { color: var(--ink); font-weight: 550; }
.data-table .pill { margin: 0 0 0 8px; vertical-align: 1px; }
.compare thead th { font: 400 1.5rem/1.1 var(--serif); letter-spacing: -.01em; text-transform: none; color: var(--ink); }
.compare thead th a { text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.compare thead th:first-child, .compare tbody th { width: 15%; }
.dates tr.is-past td { color: var(--faint); }
.dates tr.is-past td strong { color: var(--faint); font-weight: 450; text-decoration: line-through; text-decoration-thickness: 1px; }
.dates tr.is-next { background: rgba(15, 107, 99, .05); box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 760px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table th, .data-table td { display: block; width: auto !important; }
  .data-table tr { padding: 18px 18px 12px; border-top: 1px solid var(--line); }
  .data-table tbody tr:first-child { border-top: 0; }
  .data-table tbody th { padding: 0 0 10px; border: 0; }
  .data-table td { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; padding: 6px 0; border: 0; }
  .data-table td::before { content: attr(data-label); font: 500 .68rem/1.9 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .data-table td:not([data-label]) { display: block; }
  .data-table td:not([data-label])::before { content: none; }
}

/* Compact routes on the overview */
.routes-list { border-bottom: 1px solid var(--line); }
.route { display: grid; grid-template-columns: minmax(0, 15em) minmax(0, 1fr); gap: 14px 32px; padding: 26px 0; border-top: 1px solid var(--line); align-items: baseline; }
.route h3 { font-size: 1.35rem; }
.route h3 small { display: block; font: 500 .72rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-top: 8px; }
.route ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 0; }
.route li { display: inline-flex; align-items: center; font: 500 .92rem/1.2 var(--sans); color: var(--ink); }
.route li span { padding: 9px 13px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); }
.route li:not(:last-child)::after { content: "→"; color: var(--gold); margin: 0 9px; }
.route li.is-exam span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (max-width: 760px) { .route { grid-template-columns: 1fr; } }

/* Step-by-step pathway */
.route-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(36px, 5vw, 72px); }
.route-cols > div > .kicker { display: block; margin-bottom: 26px; color: var(--teal); }
@media (max-width: 860px) { .route-cols { grid-template-columns: 1fr; } }
.path { list-style: none; counter-reset: step; }
.path li { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 20px; padding-bottom: 30px; }
.path li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero); position: relative; z-index: 1;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card);
  display: grid; place-items: center; font: 500 .74rem/1 var(--mono); color: var(--gold-ink);
}
.path li::after { content: ""; position: absolute; left: 22.5px; top: 46px; bottom: 0; width: 1px; background: var(--line-2); }
.path li:last-child { padding-bottom: 0; }
.path li:last-child::after { display: none; }
.path li.is-exam::before { background: var(--ink); border-color: var(--ink); color: var(--gold-soft); }
.path h3 { font-size: 1.32rem; line-height: 1.25; margin: 10px 0 6px; }
.path p { margin: 0; color: var(--muted); font-size: .98rem; }
.path .pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* Exam parts */
.parts { display: grid; gap: clamp(20px, 3vw, 32px); }
.part { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(24px, 3.4vw, 44px); }
.part-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 24px; margin-bottom: 26px; }
.part-head .kicker { display: block; color: var(--teal); margin-bottom: 12px; }
.part-head h3 { font-size: clamp(1.75rem, 2.6vw, 2.3rem); }
.part-head h3 small { font: italic 400 .62em/1.2 var(--serif); color: var(--muted); margin-left: .35em; }
.spec { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line-2); }
.spec > div { padding: 18px 18px 0 0; }
.spec > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.spec dt { font: 500 .7rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.spec dd { margin: 0; font: 400 1.45rem/1.2 var(--serif); color: var(--ink); }
.spec dd small { display: block; margin-top: 6px; font: 400 .9rem/1.45 var(--sans); color: var(--muted); }
@media (max-width: 860px) {
  .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .spec > div:nth-child(n+3) { margin-top: 18px; }
}
.part-notes { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 32px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.part-notes li { position: relative; padding-left: 22px; font-size: .96rem; color: var(--ink-2); }
.part-notes li::before { content: ""; position: absolute; left: 0; top: .62em; width: 10px; height: 1px; background: var(--gold); }
@media (max-width: 760px) { .part-notes { grid-template-columns: 1fr; } }

/* The exam day, drawn to scale: each segment's flex-grow is its length in minutes */
.day { margin-top: 30px; }
.day-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; margin-bottom: 12px; }
.day-head .kicker { color: var(--ink-2); }
.daybar { list-style: none; display: flex; gap: 3px; height: 58px; }
.daybar li {
  flex: var(--m) 1 0; min-width: 4px; container-type: inline-size; overflow: hidden; border-radius: 6px;
  background: var(--accent); color: #fff; display: flex; flex-direction: column; justify-content: center;
}
.daybar b, .daybar small { padding: 0 8px; }
.daybar li.is-break { background: repeating-linear-gradient(135deg, rgba(13, 27, 42, .07) 0 5px, transparent 5px 10px); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); }
.daybar li.is-extra { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.daybar b { font: 500 .78rem/1.2 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daybar small { font: 400 .68rem/1.3 var(--mono); opacity: .78; white-space: nowrap; overflow: hidden; }
@container (max-width: 54px) { .daybar b, .daybar small { display: none; } }
@media (max-width: 640px) { .daybar { gap: 2px; height: 46px; } }
.day-key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; font-size: .88rem; color: var(--muted); }
.day-key span { display: inline-flex; align-items: center; gap: 8px; }
.day-key i { width: 14px; height: 10px; border-radius: 3px; background: var(--accent); }
.day-key i.is-break { background: repeating-linear-gradient(135deg, rgba(13, 27, 42, .14) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--line-2); }
.day-key i.is-extra { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line-2); }

/* Curriculum */
.syllabus { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 32px); }
.syllabus .card h3 { font-size: 1.5rem; margin-bottom: 18px; }
.syllabus .card > p { margin-bottom: 20px; }
.syllabus .card > p.src-link { margin: 20px 0 0; }
.syllabus .tag-list li { background: var(--paper); }
.syllabus .card--wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .syllabus { grid-template-columns: 1fr; } }
.weights { list-style: none; display: grid; gap: 13px; }
.weights li { display: grid; grid-template-columns: minmax(0, 17em) minmax(0, 1fr) 4.6em; gap: 18px; align-items: center; font-size: .96rem; color: var(--ink-2); }
.weights .bar { position: relative; height: 10px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.weights .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; }
.weights .bar .hi { width: var(--hi); background: color-mix(in srgb, var(--accent) 34%, transparent); }
.weights .bar .lo { width: var(--lo); background: var(--accent); }
.weights .pct { font: 500 .8rem/1 var(--mono); color: var(--ink); text-align: right; white-space: nowrap; }
@media (max-width: 640px) {
  .weights li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .weights .bar { grid-column: 1 / -1; grid-row: 2; }
}

.sources { list-style: none; border-top: 1px solid var(--line-2); }
.sources a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 16px 2px; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding .3s var(--ease); }
.sources a:hover { padding-left: 10px; }
.sources b { font: 400 1.12rem/1.35 var(--serif); color: var(--ink); }
.sources small { display: block; margin-top: 3px; font: 400 .78rem/1.3 var(--mono); color: var(--muted); word-break: break-all; }
.sources a::after { content: "↗"; color: var(--gold); }

.exam-product { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px 36px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(24px, 3.4vw, 40px); }
.exam-product img { height: 38px; width: auto; }
.exam-product h3 { font-size: 1.5rem; margin-bottom: 6px; }
.exam-product p { margin: 0; color: var(--muted); }
@media (max-width: 860px) { .exam-product { grid-template-columns: 1fr; justify-items: start; } }

/* ---------- CTA band & footer ---------- */
.cta-band { background: var(--night); color: var(--on-night-2); position: relative; overflow: hidden; isolation: isolate; }
.cta-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(50% 80% at 90% 0%, rgba(232, 200, 122, .12), transparent 60%), radial-gradient(40% 70% at 0% 100%, rgba(15, 107, 99, .2), transparent 60%); }
.cta-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 40px; align-items: end; padding: clamp(72px, 9vw, 120px) 0; }
.cta-inner h2 { color: var(--on-night); font-size: clamp(2.2rem, 4.4vw, 3.8rem); max-width: 14em; }
.cta-inner h2 em { color: var(--gold-soft); }
@media (max-width: 860px) { .cta-inner { grid-template-columns: 1fr; align-items: start; } }

.site-footer { background: var(--night); color: var(--on-night-3); font-size: .95rem; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 40px; padding: 64px 0 48px; border-top: 1px solid var(--night-line); }
.footer-top h4 { font: 500 .72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--on-night-2); margin-bottom: 18px; }
.footer-top ul { list-style: none; display: grid; gap: 10px; }
.footer-top a { text-decoration: none; transition: color .2s; }
.footer-top a:hover { color: var(--on-night); }
.footer-brand .brand { color: var(--on-night); margin-bottom: 18px; }
.footer-brand p { max-width: 26em; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 22px 0 32px; border-top: 1px solid var(--night-line); font: 400 .8rem/1.4 var(--mono); letter-spacing: .03em; }
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; max-width: none; max-height: none; width: 100vw; height: 100vh; background: rgba(6, 12, 19, .94); color: var(--on-night); }
.lightbox::backdrop { background: rgba(6, 12, 19, .7); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font: 500 .78rem/1 var(--mono); letter-spacing: .08em; color: var(--on-night-3); }
.lb-stage { display: grid; place-items: center; padding: 0 64px; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 140px); width: auto; height: auto; border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.lb-cap { text-align: center; padding: 14px 18px 22px; font-size: .95rem; color: var(--on-night-2); }
.lb-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(238, 242, 246, .2); background: rgba(238, 242, 246, .04); color: var(--on-night); cursor: pointer; display: grid; place-items: center; font-size: 1.2rem; transition: background .2s; }
.lb-btn:hover { background: rgba(238, 242, 246, .12); }
.lb-prev, .lb-next { position: fixed; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
@media (max-width: 640px) { .lb-stage { padding: 0 10px; } .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; } }

/* ---------- Page transitions ---------- */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-group(site-header) { animation-duration: .4s; }
::view-transition-old(root) { animation: vt-out .3s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .55s var(--ease) both; }
::view-transition-group(cs-logo), ::view-transition-group(cs-visual) { animation-duration: .7s; animation-timing-function: var(--ease); }
::view-transition-old(cs-visual), ::view-transition-new(cs-visual) { height: 100%; object-fit: cover; object-position: top; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ---------- Home hero entrance ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero h1 .w { display: inline-block; animation: word-in 1s var(--ease) both; animation-delay: calc(.15s + var(--i) * .075s); }
  .hero .eyebrow { animation: rise-in .9s var(--ease) .05s both; }
  .hero .lead { animation: rise-in 1s var(--ease) .7s both; }
  .hero .btn-row { animation: rise-in 1s var(--ease) .82s both; }
  .hero-cred { animation: rise-in 1s var(--ease) .94s both; }
  .portrait { animation: unveil 1.4s var(--ease) .25s both; }
  .portrait img { animation: settle 2.2s var(--ease) .25s both; }
  .portrait-wrap::before { animation: rise-in 1.2s var(--ease) .75s both; }
  .now-card { animation: slide-in 1s var(--ease) 1.05s both; }
  .hero-stats > div { animation: rise-in 1s var(--ease) both; animation-delay: calc(1s + var(--n, 0) * .08s); }
  .hero-stats > div:nth-child(2) { --n: 1; } .hero-stats > div:nth-child(3) { --n: 2; } .hero-stats > div:nth-child(4) { --n: 3; }
}
@keyframes word-in { from { opacity: 0; transform: translateY(.38em); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@keyframes unveil { from { clip-path: inset(10% 12% 14% 12% round var(--r-lg)); opacity: 0; } to { clip-path: inset(0 round var(--r-lg)); opacity: 1; } }
@keyframes settle { from { transform: scale(1.14); } to { transform: none; } }
.stat-num { font-variant-numeric: tabular-nums lining-nums; }

/* Portrait tilt (pointer-driven in main.js via --rx/--ry/--gx/--gy; only with a fine pointer and motion allowed) */
.portrait-wrap.can-tilt { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); will-change: transform; }
.portrait-wrap.can-tilt .now-card { translate: calc(var(--px, 0) * 12px) calc(var(--py, 0) * 8px); }
.portrait-wrap.can-tilt .portrait::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(60% 50% at var(--gx, 50%) var(--gy, 30%), rgba(255, 244, 214, .22), transparent 70%);
  mix-blend-mode: soft-light; opacity: var(--glare, 0); transition: opacity .5s;
}

/* ---------- Product demo videos (inside .frame) ---------- */
.frame-media { position: relative; }
.frame-media img { width: 100%; }
.frame-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .7s var(--ease); }
.frame-media.is-playing video { opacity: 1; }

/* ---------- Stacking project showcase ---------- */
/* --enter (0→1 as a card scrolls in) and --cover (0→1 as the next card slides over it) are set by main.js. */
.projects--stack .project-visual .frame { translate: 0 calc((1 - var(--enter, 1)) * 64px); }
.projects--stack .project-visual .phone { translate: 0 calc((1 - var(--enter, 1)) * 150px); }
@media (min-width: 1100px) and (min-height: 760px) {
  /* Equal-height cards so each one fully covers the one beneath; compact enough to fit a laptop screen. */
  .projects--stack { gap: 14vh; grid-auto-rows: 1fr; }
  .projects--stack .project {
    position: sticky; top: calc(var(--header-h) + 24px + var(--i, 0) * 16px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 56px;
    padding: 40px 44px; background: var(--card); border: 1px solid var(--line); border-radius: 28px;
    box-shadow: 0 1px 2px rgba(13, 27, 42, .04), 0 40px 70px -40px rgba(13, 27, 42, .32);
    transform-origin: 50% 0; scale: calc(1 - var(--cover, 0) * .05); filter: brightness(calc(1 - var(--cover, 0) * .06));
  }
  .projects--stack .project-index { position: absolute; top: 30px; right: 44px; margin: 0; }
  .projects--stack .project:nth-child(even) .project-copy { padding-top: 26px; }
  .projects--stack .project-index::after { order: -1; }
  .projects--stack .project-logo { margin-bottom: 20px; }
  .projects--stack .project h3 { font-size: clamp(1.8rem, 2.3vw, 2.25rem); }
  .projects--stack .ticks { margin: 18px 0 24px; gap: 8px; }
  .projects--stack .project-foot { padding-top: 18px; }
  .projects--stack .project-visual { aspect-ratio: 7 / 4.7; align-self: center; }
}

/* A lone last gallery screen spans the full width */
.gallery > figure:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal-d1 { transition-delay: .08s; } .js .reveal-d2 { transition-delay: .16s; } .js .reveal-d3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- 404 ---------- */
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 80px 0; }
.notfound .display { font-size: clamp(5rem, 16vw, 11rem); color: var(--gold); }

/* ---------- Print ---------- */
@media print {
  .site-header, .mobile-menu, .cta-band, .site-footer, .menu-toggle { display: none !important; }
  body { background: #fff; }
  .js .reveal { opacity: 1; transform: none; }
}
