/* ==========================================================================
   isaiah.me.tz — Editorial Dossier
   Hand-written stylesheet. No frameworks.
   © Isaiah Nyalali
   ========================================================================== */

/* ---------- 1. Fonts (self-hosted, latin subset) ---------- */
@font-face { font-family: "Crimson Pro"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(../fonts/crimson-pro-normal-300_700.woff2) format("woff2"); }
@font-face { font-family: "Crimson Pro"; font-style: italic; font-weight: 300 700; font-display: swap;
  src: url(../fonts/crimson-pro-italic-300_700.woff2) format("woff2"); }
@font-face { font-family: "Josefin Sans"; font-style: normal; font-weight: 600 700; font-display: swap;
  src: url(../fonts/josefin-sans-normal-600.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/ibm-plex-mono-normal-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/ibm-plex-mono-normal-500.woff2) format("woff2"); }

/* ---------- 2. Tokens ---------- */
:root {
  --paper: #f5f1ea;
  --paper-2: #ece6dc;
  --paper-3: #e3dbce;
  --ink: #151311;
  --ink-2: #36312c;
  --graphite: #5d564e;
  --rule: #d9d0c3;
  --rule-strong: #b7ab9a;
  --bronze: #bb9e7d;         /* decoration only — fails AA as text */
  --bronze-ink: #7a5a3a;     /* text-safe bronze (5.6:1 on paper) */
  --seal: #a8111c;           /* brand red, used sparingly */
  --on-ink: #f5f1ea;

  --f-serif: "Crimson Pro", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-label: "Josefin Sans", "Futura", "Century Gothic", "Trebuchet MS", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --plate-w: clamp(340px, 41vw, 780px);
  --mast-h: 68px;
  --pad: clamp(1.25rem, 4.6vw, 5.5rem);
  --measure: 38rem;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);

  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #13110e;
  --paper-2: #1b1814;
  --paper-3: #24201b;
  --ink: #efe8dc;
  --ink-2: #d6cdbf;
  --graphite: #a69c8e;
  --rule: #322d27;
  --rule-strong: #4b443b;
  --bronze: #c9ab86;
  --bronze-ink: #d5b58e;
  --seal: #e5535d;
  --on-ink: #13110e;
  color-scheme: dark;
}

/* ---------- 3. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--mast-h) + 1rem); }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
ol[class], ul[class] { list-style: none; padding: 0; }
img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- 4. Base ---------- */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-serif);
  font-size: clamp(1.125rem, 1.02rem + .35vw, 1.3125rem);
  line-height: 1.55;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* paper grain — barely there */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::before { opacity: .07; mix-blend-mode: screen; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: .75rem 1rem; font-family: var(--f-label); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; transition: top .2s var(--ease);
}
.skip:focus { top: 1rem; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 1.5rem; } .mt-3 { margin-top: 2.5rem; } .mt-4 { margin-top: 4rem; }
.mb-2 { margin-bottom: 1.5rem; } .mb-3 { margin-bottom: 2.5rem; }

/* ---------- 5. Typography primitives ---------- */
.label {
  font-family: var(--f-label);
  font-weight: 600;
  font-size: .72rem;
  line-height: 1.3;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.mono {
  font-family: var(--f-mono);
  font-size: .78rem;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.kicker { color: var(--bronze-ink); display: flex; align-items: center; gap: .75rem; }
.kicker::before { content: ""; width: 2.25rem; height: 1px; background: currentColor; }

.display {
  font-weight: 300;
  font-size: clamp(2.6rem, 1.4rem + 4.6vw, 6rem);
  line-height: .98;
  letter-spacing: -.022em;
  font-variant-numeric: lining-nums;
  text-wrap: balance;
}
.display em { font-style: italic; font-weight: 400; color: var(--bronze-ink); }

.h2 {
  font-weight: 300;
  font-size: clamp(2rem, 1.3rem + 2.4vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.h2 em { font-style: italic; font-weight: 400; }
.h3 { font-weight: 500; font-size: clamp(1.35rem, 1.15rem + .6vw, 1.75rem); line-height: 1.18; letter-spacing: -.005em; }

.lede {
  font-size: clamp(1.25rem, 1.1rem + .55vw, 1.6rem);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: var(--measure);
  text-wrap: pretty;
}
.prose { max-width: var(--measure); color: var(--ink-2); text-wrap: pretty; hanging-punctuation: first; }
.prose p + p { margin-top: 1em; }
.prose strong { color: var(--ink); font-weight: 600; }
.dropcap::first-letter {
  float: left;
  font-size: 4.4em;
  line-height: .8;
  padding: .06em .09em 0 0;
  font-weight: 400;
  color: var(--ink);
}
.muted { color: var(--graphite); }
.smallcaps { font-variant-caps: all-small-caps; letter-spacing: .04em; }

.link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: var(--rule-strong);
  transition: text-decoration-color .25s var(--ease), color .25s var(--ease);
}
.link:hover { text-decoration-color: var(--ink); }
.link--bronze { color: var(--bronze-ink); text-decoration-color: currentColor; }

sup.fn a { font-family: var(--f-mono); font-size: .62em; color: var(--bronze-ink); text-decoration: none; margin-left: .1em; }

/* ---------- 6. Buttons ---------- */
.btn {
  --btn-bg: var(--ink); --btn-fg: var(--paper);
  position: relative;
  display: inline-flex; align-items: center; gap: .85rem;
  padding: 1.05rem 1.5rem 1rem;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--ink);
  font-family: var(--f-label); font-weight: 600; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; line-height: 1;
  white-space: nowrap; flex-shrink: 0;
  overflow: hidden; isolation: isolate;
  transition: color .35s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--bronze-ink);
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease);
}
.btn:hover::before { transform: scaleX(1); transform-origin: left; }
.btn .arrow { transition: transform .35s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); }
.btn--ghost:hover { color: var(--paper); }
.btn--sm { padding: .78rem 1.05rem .74rem; font-size: .7rem; gap: .6rem; white-space: nowrap; flex-shrink: 0; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.arrow { display: inline-block; width: 1.1em; height: .7em; flex: none; }

/* ---------- 7. Masthead ---------- */
.mast {
  position: fixed; top: 0; right: 0; left: var(--plate-w);
  height: var(--mast-h);
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: .85rem;
  padding: 0 var(--pad);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid transparent;
  flex-wrap: nowrap;
  transition: border-color .3s var(--ease), transform .4s var(--ease);
}
.mast.is-scrolled { border-bottom-color: var(--rule); }
.mast__brand { display: flex; align-items: center; gap: .35rem; text-decoration: none; flex-shrink: 0; }
.mast__seal { width: 33px; height: 33px; border-radius: 50%; flex-shrink: 0; }
.mast__name {
  font-size: 1.18rem; font-style: italic; letter-spacing: -.01em; line-height: 1;
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: clamp(.45rem, 1.1vw, 1.5rem); flex-shrink: 1; min-width: 0; }
.nav a {
  position: relative; text-decoration: none; color: var(--ink-2);
  font-family: var(--f-label); font-weight: 600; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .5rem 0;
  white-space: nowrap;
}
.nav a sup { font-family: var(--f-mono); font-size: .56rem; letter-spacing: 0; color: var(--bronze-ink); margin-right: .25rem; vertical-align: .45em; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .2rem; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav a[aria-current="page"] { color: var(--ink); }

.tools { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; flex-wrap: nowrap; }
.lang {
  display: inline-flex; border: 1px solid var(--rule-strong);
  font-family: var(--f-mono); font-size: .7rem;
  flex-shrink: 0;
}
.lang button { padding: .45rem .55rem; color: var(--graphite); transition: background .2s, color .2s; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.icon-btn {
  width: 36px; height: 36px; min-width: 36px; min-height: 36px;
  flex: 0 0 36px;
  display: grid; place-items: center;
  border: 1px solid var(--rule-strong); color: var(--ink);
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--ink); color: var(--paper); }
.icon-btn svg { width: 16px; height: 16px; }
.theme-ico--sun { display: none; }
[data-theme="dark"] .theme-ico--sun { display: block; }
[data-theme="dark"] .theme-ico--moon { display: none; }

.menu-btn { display: none; }

/* ---------- 8. Frame: plate + sheet ---------- */
.frame { display: grid; grid-template-columns: var(--plate-w) minmax(0, 1fr); min-height: 100svh; }

.plate {
  position: sticky; top: 0;
  height: 100svh;
  overflow: hidden;
  background: #111;
  color: #f5f1ea;
  isolation: isolate;
}
.plate__img {
  position: absolute; inset: 0;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.05s var(--ease-in-out);
  z-index: 1;
}
.plate__img.is-active { clip-path: inset(0 0 0 0); z-index: 2; view-transition-name: plate; }
.plate__img.is-leaving { clip-path: inset(0 0 0 0); z-index: 1; }
.plate__img picture {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.plate__img img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: top;
  filter: grayscale(1) contrast(1.04);
  transform: scale(1.06);
  transition: transform 2.4s var(--ease);
}
.plate__img.is-active img { transform: scale(1); }
.plate__img[data-focus="top"] img { object-position: 50% 20%; }

.plate::after { /* bottom vignette for legibility */
  content: ""; position: absolute; inset: auto 0 0 0; height: 45%; z-index: 3;
  background: linear-gradient(to top, rgba(10, 9, 8, .62), transparent);
  pointer-events: none;
}
.plate__folio {
  position: absolute; left: clamp(1rem, 2.4vw, 2.5rem); bottom: clamp(3.2rem, 7vh, 5rem); z-index: 4;
  font-style: italic; font-weight: 300;
  font-size: clamp(5.5rem, 11vw, 11.5rem); line-height: .8;
  letter-spacing: -.04em; font-variant-numeric: lining-nums;
  color: #f5f1ea;
  mix-blend-mode: difference;
  pointer-events: none;
}
.plate__cap {
  position: absolute; left: clamp(1rem, 2.4vw, 2.5rem); right: clamp(1rem, 2.4vw, 2.5rem); bottom: clamp(1rem, 2.6vh, 1.75rem); z-index: 4;
  display: flex; justify-content: space-between; gap: 1rem;
  color: rgba(245, 241, 234, .86);
  border-top: 1px solid rgba(245, 241, 234, .3);
  padding-top: .6rem;
}
.plate__cap span:last-child { text-align: right; }
.plate__rail {
  position: absolute; top: clamp(1rem, 2.4vw, 2.5rem); left: clamp(1rem, 2.4vw, 2.5rem); z-index: 4;
  writing-mode: vertical-rl; transform: rotate(180deg);
  color: rgba(245, 241, 234, .75);
}

.sheet { position: relative; min-width: 0; padding-top: var(--mast-h); }

/* ---------- 9. Sections ---------- */
.section { padding: clamp(4rem, 9vw, 8.5rem) var(--pad); border-top: 1px solid var(--rule); position: relative; }
.section:first-child { border-top: 0; }
.section--tight { padding-block: clamp(2.75rem, 6vw, 5rem); }
.section--ink { background: var(--ink); color: var(--paper); border-top-color: var(--ink); }
.section--ink .muted, .section--ink .lede, .section--ink .prose { color: color-mix(in srgb, var(--paper) 74%, transparent); }
.section--ink .kicker { color: var(--bronze); }
.section--ink .btn { --btn-bg: var(--paper); --btn-fg: var(--ink); border-color: var(--paper); }
.section--ink .btn:hover { color: var(--paper); }
.section--ink .btn--ghost { --btn-bg: transparent; --btn-fg: var(--paper); }
.section--ink .link { color: var(--paper); text-decoration-color: rgba(245, 241, 234, .4); }

.sec-head { display: grid; gap: 1.1rem; margin-bottom: clamp(2.25rem, 4.5vw, 4rem); max-width: 48rem; }
.sec-num { font-family: var(--f-mono); font-size: .75rem; color: var(--graphite); }

.watermark {
  position: absolute; right: var(--pad); top: clamp(2rem, 5vw, 4rem);
  font-family: var(--f-label); font-weight: 700; text-transform: uppercase;
  font-size: clamp(6rem, 14vw, 13rem); line-height: .8;
  color: var(--ink); opacity: .045;
  pointer-events: none; user-select: none;
}

/* ---------- 10. Hero ---------- */
.hero { padding-top: clamp(3rem, 9vh, 7rem); min-height: calc(100svh - var(--mast-h)); display: flex; flex-direction: column; justify-content: center; gap: clamp(1.5rem, 3vw, 2.4rem); }
.hero .display { max-width: 15ch; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; }
.fieldlog {
  display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; align-items: center;
  padding-top: 1.25rem; border-top: 1px solid var(--rule);
  color: var(--graphite);
}
.fieldlog > span { display: inline-flex; align-items: center; gap: .55rem; }

/* availability: four signal bars, a nod to RAN work */
.signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.signal i { display: block; width: 3px; background: var(--rule-strong); }
.signal i:nth-child(1) { height: 25%; } .signal i:nth-child(2) { height: 50%; }
.signal i:nth-child(3) { height: 75%; } .signal i:nth-child(4) { height: 100%; }
.signal[data-level="1"] i:nth-child(-n+1),
.signal[data-level="2"] i:nth-child(-n+2),
.signal[data-level="3"] i:nth-child(-n+3),
.signal[data-level="4"] i { background: var(--seal); }

/* ---------- 11. Two doors (founders / recruiters) ---------- */
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--rule-strong); }
.door {
  position: relative; display: grid; gap: .9rem; align-content: start;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  text-decoration: none; color: var(--ink);
  transition: background .4s var(--ease), color .4s var(--ease);
}
.door + .door { border-left: 1px solid var(--rule-strong); }
.door:hover { background: var(--ink); color: var(--paper); }
.door:hover .muted, .door:hover .kicker { color: color-mix(in srgb, var(--paper) 75%, transparent); }
.door__go { display: inline-flex; align-items: center; gap: .6rem; margin-top: .4rem; }
.door__go .arrow { transition: transform .35s var(--ease); }
.door:hover .door__go .arrow { transform: translateX(6px); }

/* ---------- 12. Proof strip ---------- */
.proof { display: grid; gap: 1.5rem; }
.proof__row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: clamp(1.25rem, 3vw, 2.75rem);
  padding-block: 1.5rem; border-block: 1px solid var(--rule);
}
.proof__row img {
  height: clamp(26px, 3vw, 38px); width: auto;
  filter: grayscale(1) contrast(1.1);
  mix-blend-mode: multiply;
  opacity: .78;
  transition: opacity .3s, filter .3s;
}
.proof__row img:hover { opacity: 1; filter: grayscale(0); }
.proof__row img.is-square { height: clamp(36px, 4vw, 50px); }
[data-theme="dark"] .proof__row img { mix-blend-mode: normal; filter: grayscale(1) invert(1) brightness(1.4) contrast(.9); }
[data-theme="dark"] .proof__row img:hover { filter: grayscale(1) invert(1) brightness(1.7); }
.proof__note { font-size: .9rem; color: var(--graphite); }

/* ---------- 13. Contents (table of contents with leaders) ---------- */
.contents { border-top: 1px solid var(--ink); counter-reset: toc; }
.contents a {
  display: grid; grid-template-columns: 3.2rem auto 1fr auto; align-items: baseline; gap: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem) 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--ink);
  transition: padding .45s var(--ease), color .3s;
}
.contents a:hover, .contents a:focus-visible { padding-left: .9rem; }
.contents__n { font-family: var(--f-mono); font-size: .8rem; color: var(--bronze-ink); }
.contents__t { font-size: clamp(1.6rem, 1.1rem + 1.9vw, 2.8rem); font-weight: 300; line-height: 1.05; letter-spacing: -.012em; }
.contents a:hover .contents__t { font-style: italic; }
.contents__lead { border-bottom: 1px dotted var(--rule-strong); transform: translateY(-.35em); min-width: 1rem; }
.contents__d { color: var(--graphite); font-size: .95rem; text-align: right; }

/* ---------- 14. Case files (dossiers) ---------- */
.cases { display: grid; }
.case {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr); gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: clamp(2rem, 4vw, 3.25rem);
  border-top: 1px solid var(--rule-strong);
}
.case:last-child { border-bottom: 1px solid var(--rule-strong); }
.case__meta { display: grid; gap: .6rem; align-content: start; }
.case__no { font-family: var(--f-mono); font-size: .78rem; color: var(--graphite); }
.case__body { display: grid; gap: 1.1rem; min-width: 0; }
.case__ctx { color: var(--bronze-ink); }
.case__title { font-weight: 400; font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.6rem); line-height: 1.05; letter-spacing: -.012em; }
.case__title a { text-decoration: none; }
.case__title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.case__sum { color: var(--ink-2); max-width: 42rem; }

.pao { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin-top: .5rem; }
.pao h4 { margin-bottom: .45rem; color: var(--graphite); }
.pao p { font-size: .98rem; line-height: 1.5; color: var(--ink-2); }

.metric { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; padding: 1rem 0; border-block: 1px dashed var(--rule-strong); }
.metric__item { display: grid; gap: .15rem; }
.metric__fig { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.9rem); font-weight: 300; line-height: 1; letter-spacing: -.02em; font-variant-numeric: lining-nums; }
.metric__fig s { text-decoration-thickness: 1px; color: var(--graphite); font-size: .62em; margin-right: .3em; }
.metric__lbl { color: var(--graphite); }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tags li {
  font-family: var(--f-mono); font-size: .7rem; color: var(--ink-2);
  border: 1px solid var(--rule-strong); padding: .28rem .55rem .24rem;
}
.case__links { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }

.stamp {
  display: inline-block; justify-self: start;
  font-family: var(--f-mono); font-size: .64rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--seal);
  border: 1.5px solid currentColor; outline: 1px solid currentColor; outline-offset: 2px;
  padding: .3rem .5rem .26rem;
  transform: rotate(-3deg);
  opacity: .9;
}
.stamp--quiet { color: var(--graphite); }

.case--compact .case__title { font-size: clamp(1.35rem, 1.1rem + .9vw, 1.85rem); }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.chip {
  font-family: var(--f-label); font-weight: 600; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .7rem .95rem .62rem; border: 1px solid var(--rule-strong); color: var(--ink-2);
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"], .chip:has(input:checked) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.case.is-filtered { display: none; }

/* ---------- 15. Offers / engagements ---------- */
.offers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.offer {
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 1rem;
  padding: clamp(1.4rem, 2.4vw, 2.2rem) clamp(1rem, 2vw, 1.75rem) clamp(1.4rem, 2.4vw, 2rem);
  border-bottom: 1px solid var(--rule-strong);
}
.offer + .offer { border-left: 1px solid var(--rule); }
.offer__tag { color: var(--bronze-ink); }
.offer__name { font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); font-weight: 400; line-height: 1.05; letter-spacing: -.01em; }
.offer ul { display: grid; gap: .5rem; font-size: .98rem; color: var(--ink-2); }
.offer li { padding-left: 1.2rem; position: relative; line-height: 1.4; }
.offer li::before { content: "—"; position: absolute; left: 0; color: var(--bronze-ink); }
.offer__foot { display: grid; gap: .3rem; padding-top: 1rem; border-top: 1px dashed var(--rule-strong); color: var(--graphite); }
.offer--feature { background: var(--paper-2); }

/* ---------- 16. Scorecard (illustrative audit) ---------- */
.scorecard { border: 1px solid var(--ink); background: var(--paper); }
.scorecard__head {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--ink); background: var(--paper-2);
}
.score { display: grid; grid-template-columns: minmax(9rem, 13rem) 1fr 2.5rem 6.5rem; align-items: center; gap: 1rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--rule); }
.score:last-child { border-bottom: 0; }
.score__name { font-size: 1rem; }
.score__bar { height: 8px; background: var(--paper-3); position: relative; overflow: hidden; }
.score__bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--v, 0) * 20%); background: var(--ink); transform-origin: left; transform: scaleX(0); transition: transform 1.1s var(--ease); }
.is-in .score__bar i { transform: scaleX(1); }
.score__val { font-family: var(--f-mono); font-size: .8rem; text-align: right; }
.risk { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; text-align: center; padding: .2rem .3rem; border: 1px solid currentColor; }
.risk--high { color: var(--seal); }
.risk--med { color: var(--bronze-ink); }
.risk--low { color: var(--graphite); }

/* ---------- 16b. Modern 60-Second Tech Debt & Stack Health Diagnostic ---------- */
.diagnostic {
  border: 1px solid var(--ink);
  background: var(--paper);
  margin-top: 1.5rem;
}
.diagnostic__intro {
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
}
.diagnostic__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}
.diag-card {
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.diag-card:nth-child(odd) {
  border-right: 1px solid var(--rule);
}
.diag-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
}
.diag-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
}
.diag-card__tag {
  font-family: var(--f-mono);
  font-size: .68rem;
  color: var(--bronze-ink);
  white-space: nowrap;
}
.diag-card__q {
  font-size: .88rem;
  color: var(--ink-2);
  line-height: 1.4;
  margin: 0;
}
.diag-options {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: auto;
}
.diag-opt {
  display: grid;
  grid-template-columns: 1.2rem 1fr;
  align-items: start;
  gap: .55rem;
  padding: .45rem .6rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  cursor: pointer;
  background: var(--paper);
  transition: border-color .2s ease, background-color .2s ease;
  font-size: .82rem;
  line-height: 1.35;
}
.diag-opt:hover {
  border-color: var(--ink);
}
.diag-opt input {
  margin-top: 3px;
  accent-color: var(--ink);
  cursor: pointer;
}
.diag-opt.is-selected {
  background: var(--paper-3);
  border-color: var(--ink);
  font-weight: 500;
}

/* Diagnostic Live Meter / Results Area */
.diagnostic__meter {
  padding: 1.5rem 1.4rem;
  background: var(--paper-2);
  border-top: 1px solid var(--ink);
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 1.5rem;
  align-items: center;
}
.meter-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  text-align: center;
}
.meter-score {
  font-family: var(--f-mono);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}
.meter-grade {
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: .4rem;
  color: var(--bronze-ink);
}
.meter-details {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.meter-details h4 {
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.2;
}
.meter-details p {
  font-size: .9rem;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.45;
}
.meter-weakest {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--f-mono);
  font-size: .75rem;
  padding: .25rem .5rem;
  background: var(--paper-3);
  border-left: 2px solid var(--seal);
  width: fit-content;
}
.meter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .4rem;
}

/* ---------- 16c. Interactive Redacted Client Audit Teardown ---------- */
.teardown {
  border: 1px solid var(--ink);
  background: var(--paper);
  margin-top: 1.75rem;
}
.teardown__meta {
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  font-family: var(--f-mono);
  font-size: .72rem;
  color: var(--ink-2);
}
.teardown__nav {
  display: flex;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-2);
  overflow-x: auto;
}
.teardown-tab {
  padding: .85rem 1.4rem;
  font-family: var(--f-mono);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--rule);
  cursor: pointer;
  color: var(--ink-2);
  white-space: nowrap;
  transition: all .2s ease;
}
.teardown-tab:hover {
  background: var(--paper);
  color: var(--ink);
}
.teardown-tab.is-active {
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  border-bottom: 2px solid var(--ink);
  margin-bottom: -1px;
}
.teardown-panel {
  padding: 1.5rem 1.4rem;
}
.teardown-panel[hidden] {
  display: none !important;
}

/* Risk Register Filters & Cards */
.risk-filters {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.risk-filter-btn {
  font-family: var(--f-mono);
  font-size: .7rem;
  padding: .3rem .7rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
  border-radius: 2px;
  transition: all .15s ease;
}
.risk-filter-btn:hover {
  border-color: var(--ink);
}
.risk-filter-btn.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.risk-list {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.risk-item {
  border: 1px solid var(--rule);
  background: var(--paper);
  transition: border-color .2s ease;
}
.risk-item:hover {
  border-color: var(--ink);
}
.risk-item summary {
  padding: .9rem 1.1rem;
  cursor: pointer;
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  align-items: center;
  gap: .75rem;
  list-style: none;
  font-size: .95rem;
  font-weight: 600;
}
.risk-item summary::-webkit-details-marker {
  display: none;
}
.risk-pill {
  font-family: var(--f-mono);
  font-size: .66rem;
  padding: .2rem .4rem;
  text-align: center;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.risk-pill--p0 {
  color: #b01818;
  border-color: #b01818;
  background: rgba(176, 24, 24, 0.06);
}
.risk-pill--p1 {
  color: #a35d10;
  border-color: #a35d10;
  background: rgba(163, 93, 16, 0.06);
}
.risk-pill--p2 {
  color: #55524e;
  border-color: #7a756f;
  background: rgba(85, 82, 78, 0.06);
}
.risk-content {
  padding: 0 1.1rem 1.1rem 1.1rem;
  border-top: 1px dashed var(--rule);
  font-size: .9rem;
  line-height: 1.5;
  color: var(--ink-2);
  display: grid;
  gap: .75rem;
}
.risk-content dl {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: .4rem .75rem;
  margin: 0;
}
.risk-content dt {
  font-family: var(--f-mono);
  font-size: .72rem;
  text-transform: uppercase;
  color: var(--bronze-ink);
}
.risk-content dd {
  margin: 0;
  color: var(--ink);
}
.risk-prescription {
  background: var(--paper-2);
  padding: .75rem .9rem;
  border-left: 2px solid var(--ink);
  font-size: .88rem;
}

/* Roadmap Grid */
.roadmap-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.roadmap-col {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.roadmap-col__badge {
  font-family: var(--f-mono);
  font-size: .68rem;
  color: var(--bronze-ink);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.roadmap-col__title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}
.roadmap-col ul {
  list-style: none;
  padding: 0;
  margin: .5rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font-size: .86rem;
  color: var(--ink-2);
}
.roadmap-col li {
  position: relative;
  padding-left: 1rem;
  line-height: 1.4;
}
.roadmap-col li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ink);
  font-family: var(--f-mono);
}

/* ---------- 16d. Editorial Field Notes & Technical Articles ---------- */
.fieldnotes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.note-card {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s ease, transform .2s ease;
}
.note-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}
.note-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--f-mono);
  font-size: .72rem;
  color: var(--bronze-ink);
}
.note-card__title {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}
.note-card__abstract {
  font-size: .95rem;
  color: var(--ink-2);
  line-height: 1.45;
  margin: 0;
}
.note-card__cta {
  margin-top: auto;
  font-family: var(--f-mono);
  font-size: .75rem;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
}

/* Essay Reader / Article Styles */
.article-header {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2rem;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-family: var(--f-mono);
  font-size: .78rem;
  color: var(--ink-2);
  margin-top: 1.25rem;
}
.article-body {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--ink);
  max-width: 68ch;
}
.article-body h2 {
  font-size: 1.6rem;
  margin-top: 2.25rem;
  margin-bottom: .85rem;
  line-height: 1.3;
}
.article-body h3 {
  font-size: 1.25rem;
  margin-top: 1.75rem;
  margin-bottom: .6rem;
  line-height: 1.35;
}
.article-body p {
  margin-bottom: 1.4rem;
}
.article-body blockquote {
  border-left: 2px solid var(--ink);
  padding-left: 1.25rem;
  margin: 1.75rem 0;
  font-style: italic;
  color: var(--ink-2);
}
.article-body pre {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 1.1rem;
  overflow-x: auto;
  font-family: var(--f-mono);
  font-size: .84rem;
  line-height: 1.45;
  margin: 1.5rem 0;
}
.article-body code {
  font-family: var(--f-mono);
  font-size: .88em;
  background: var(--paper-3);
  padding: .15em .35em;
  border-radius: 2px;
}
.article-body pre code {
  background: transparent;
  padding: 0;
}
.article-callout {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--bronze-ink);
  padding: 1.1rem 1.25rem;
  margin: 1.75rem 0;
  font-size: .95rem;
  line-height: 1.55;
}
.article-callout h4 {
  margin: 0 0 .4rem 0;
  font-family: var(--f-mono);
  font-size: .82rem;
  text-transform: uppercase;
  color: var(--bronze-ink);
}

/* Dossier Badge */
.dossier-banner {
  border: 1px dashed var(--bronze-ink);
  background: var(--paper-2);
  padding: .9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.dossier-banner p {
  margin: 0;
  font-size: .92rem;
}

/* ---------- 17. Lists, steps, signals ---------- */
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--ink); counter-reset: step; }
.step { padding: 1.25rem 1rem 1.25rem 0; display: grid; gap: .5rem; align-content: start; }
.step + .step { padding-left: 1rem; border-left: 1px solid var(--rule); }
.step__n { font-family: var(--f-mono); font-size: .75rem; color: var(--bronze-ink); }
.step__t { font-size: 1.2rem; line-height: 1.2; font-weight: 500; }
.step p { font-size: .95rem; color: var(--ink-2); line-height: 1.45; }

.checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.5rem; }
.checklist li { display: grid; grid-template-columns: 1.6rem 1fr; gap: .6rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); line-height: 1.45; }
.checklist li::before { content: "✕"; font-family: var(--f-mono); font-size: .8rem; color: var(--seal); padding-top: .2rem; }
.checklist--tick li::before { content: "✓"; color: var(--bronze-ink); }

.specialties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.5rem; }
.specialty { padding: 1.4rem 0; border-top: 1px solid var(--rule); display: grid; gap: .5rem; }
.specialty p { color: var(--ink-2); font-size: 1rem; line-height: 1.5; }

.also { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .9rem; padding: 1.25rem 0; border-block: 1px solid var(--rule); color: var(--graphite); font-size: 1rem; }
.also strong { color: var(--ink); font-weight: 500; margin-right: .3rem; }
.also span + span::before { content: "·"; margin-right: .9rem; color: var(--rule-strong); }

/* FAQ */
.faq { border-top: 1px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: baseline;
  padding: 1.25rem 0; font-size: clamp(1.15rem, 1.05rem + .4vw, 1.4rem); line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-mono); font-size: 1rem; color: var(--bronze-ink); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 1.4rem; max-width: var(--measure); color: var(--ink-2); }

/* Pull quote */
.pull { position: relative; padding-left: clamp(1.5rem, 3vw, 3rem); border-left: 1px solid var(--bronze); max-width: 46rem; }
.pull p { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.6rem); line-height: 1.18; font-weight: 300; font-style: italic; letter-spacing: -.01em; text-wrap: balance; }
.pull p::before { content: "“"; position: absolute; left: -.05em; top: -.25em; font-size: 4em; line-height: 1; color: var(--bronze); font-style: normal; transform: translateX(-60%); }
.pull cite { display: block; margin-top: 1rem; font-style: normal; color: var(--graphite); }

/* ---------- 18. About: roles, record, capabilities ---------- */
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--ink); }
.role { padding: 1.25rem 1rem 1.25rem 0; display: grid; gap: .35rem; }
.role + .role { padding-left: 1rem; border-left: 1px solid var(--rule); }
.role__t { font-size: 1.3rem; font-style: italic; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rule-strong); }
.facts div { padding: .9rem 0; border-bottom: 1px solid var(--rule); display: grid; gap: .2rem; }
.facts div:nth-child(odd) { padding-right: 1rem; }
.facts div:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--rule); }
.facts dt { color: var(--graphite); }
.facts dd { font-size: 1.05rem; }

.record { border-top: 1px solid var(--ink); }
.entry { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1.5rem; padding: 1.6rem 0; border-bottom: 1px solid var(--rule); }
.entry__when { color: var(--graphite); padding-top: .35rem; }
.entry__role { font-size: clamp(1.25rem, 1.1rem + .5vw, 1.55rem); font-weight: 500; line-height: 1.2; }
.entry__org { color: var(--bronze-ink); margin: .2rem 0 .6rem; font-style: italic; }
.entry p { color: var(--ink-2); font-size: 1rem; line-height: 1.55; max-width: 42rem; }
.entry--edu .entry__role::before { content: "Edu · "; font-family: var(--f-mono); font-size: .7rem; color: var(--graphite); vertical-align: .25em; }
html[lang="sw"] .entry--edu .entry__role::before { content: "Elimu · "; }

.caps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.cap { padding: 1.4rem 1.25rem 1.4rem 0; display: grid; gap: .9rem; align-content: start; }
.cap + .cap { padding-left: 1.25rem; border-left: 1px solid var(--rule); }
.cap__t { font-size: 1.6rem; font-style: italic; font-weight: 400; }
.cap ul { display: grid; gap: .35rem; font-size: 1rem; color: var(--ink-2); }

.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.5rem; counter-reset: pr; }
.principle { padding: 1.5rem 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 2.5rem 1fr; gap: .4rem 1rem; }
.principle::before { counter-increment: pr; content: counter(pr, upper-roman) "."; font-family: var(--f-mono); font-size: .8rem; color: var(--bronze-ink); padding-top: .4rem; grid-row: span 2; }
.principle h3 { font-size: 1.3rem; font-weight: 500; }
.principle p { color: var(--ink-2); font-size: 1rem; line-height: 1.5; }

/* ---------- 19. Booking form ---------- */
.booking { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 19rem); gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.booking__aside { position: sticky; top: calc(var(--mast-h) + 1.5rem); display: grid; gap: 1.5rem; }
.next { border-top: 1px solid var(--ink); }
.next li { display: grid; grid-template-columns: 1.8rem 1fr; gap: .5rem; padding: .85rem 0; border-bottom: 1px solid var(--rule); font-size: 1rem; color: var(--ink-2); line-height: 1.45; }
.next li span:first-child { font-family: var(--f-mono); font-size: .75rem; color: var(--bronze-ink); padding-top: .2rem; }
.hours { padding: 1rem; border: 1px solid var(--rule-strong); display: grid; gap: .35rem; }

.form { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; padding: 1rem 0 1.5rem; }
.progress li { display: grid; gap: .45rem; color: var(--graphite); }
.progress li::before { content: ""; height: 2px; background: var(--rule); transition: background .4s var(--ease); }
.progress li.is-done::before, .progress li.is-current::before { background: var(--ink); }
.progress li.is-current { color: var(--ink); }

.step-panel { display: grid; gap: 1.75rem; animation: panel-in .6s var(--ease) both; }
.step-panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.step-panel legend, .fs-legend { font-size: clamp(1.4rem, 1.2rem + .8vw, 2rem); font-weight: 400; line-height: 1.15; padding: 0; margin-bottom: 1rem; letter-spacing: -.01em; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.choice span {
  display: grid; gap: .25rem; height: 100%;
  padding: 1rem 1.1rem; border: 1px solid var(--rule-strong);
  transition: background .2s, color .2s, border-color .2s;
}
.choice small { color: var(--graphite); font-size: .88rem; line-height: 1.35; }
.choice b { font-weight: 500; font-size: 1.12rem; }
.choice input:hover + span { border-color: var(--ink); }
.choice input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.choice input:checked + span small { color: color-mix(in srgb, var(--paper) 72%, transparent); }
.choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

.dates { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(4.6rem, 1fr); gap: .45rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.dates .choice span { text-align: center; padding: .75rem .4rem; gap: .1rem; scroll-snap-align: start; }
.dates .choice b { font-size: 1.6rem; font-weight: 300; line-height: 1; font-variant-numeric: lining-nums; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr)); gap: .45rem; }
.slots .choice span { text-align: center; padding: .8rem .4rem; font-family: var(--f-mono); font-size: .85rem; }
.slots .choice small { font-family: var(--f-mono); font-size: .66rem; }
.slots .choice input:disabled + span { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.tz-note { color: var(--graphite); font-size: .95rem; }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1.5rem; }
.field { display: grid; gap: .45rem; }
.field--full { grid-column: 1 / -1; }
.field label { color: var(--graphite); }
.field label .req { color: var(--seal); }
.input {
  width: 100%;
  padding: .85rem 0 .7rem;
  background: transparent;
  border: 0; border-bottom: 1px solid var(--rule-strong);
  border-radius: 0;
  font-size: 1.15rem;
  color: var(--ink);
  transition: border-color .25s;
  appearance: none;
}
.input::placeholder { color: color-mix(in srgb, var(--graphite) 70%, transparent); font-style: italic; }
.input:focus { outline: none; border-bottom-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
textarea.input { resize: vertical; min-height: 8rem; line-height: 1.5; }
select.input { background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 1.5rem; }
select.input option { background: var(--paper); color: var(--ink); }
.field.has-error .input { border-bottom-color: var(--seal); }
.field__err { color: var(--seal); font-size: .9rem; min-height: 0; }
.consent { display: grid; grid-template-columns: auto 1fr; gap: .75rem; align-items: start; font-size: .98rem; color: var(--ink-2); }
.consent input { width: 1.1rem; height: 1.1rem; margin-top: .25rem; accent-color: var(--ink); }

.summary { padding: 1rem 1.1rem; border: 1px dashed var(--rule-strong); display: grid; gap: .35rem; background: var(--paper-2); }
.summary__line { font-size: 1.1rem; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.form-alert { padding: .9rem 1rem; border-left: 2px solid var(--seal); background: color-mix(in srgb, var(--seal) 7%, transparent); color: var(--ink); font-size: 1rem; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.confirm { display: grid; gap: 1.5rem; padding: clamp(1.5rem, 3vw, 2.5rem); border: 1px solid var(--ink); animation: panel-in .7s var(--ease) both; }
.confirm .stamp { font-size: .75rem; }
.ticket { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rule-strong); }
.ticket div { padding: .8rem 0; border-bottom: 1px solid var(--rule); display: grid; gap: .15rem; }
.ticket dt { color: var(--graphite); }

.spinner { width: 14px; height: 14px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 20. Closing CTA ---------- */
.closing { display: grid; gap: 2rem; }
.closing .display { font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.8rem); max-width: 16ch; }

/* ---------- 21. Colophon ---------- */
.colophon { padding: clamp(3rem, 6vw, 5rem) var(--pad) 2rem; border-top: 1px solid var(--ink); display: grid; gap: 2.5rem; }
.colophon__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.colophon__sig { font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.8rem); font-style: italic; font-weight: 300; line-height: 1.05; }
.colophon h2 { margin-bottom: .9rem; color: var(--graphite); }
.colophon ul { display: grid; gap: .45rem; }
.colophon a { text-decoration: none; color: var(--ink-2); }
.colophon a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.colophon__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--graphite); }
kbd { font-family: var(--f-mono); font-size: .7rem; border: 1px solid var(--rule-strong); border-bottom-width: 2px; padding: .05rem .35rem; }

/* ---------- 22. Mobile CTA dock ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: none; gap: .5rem; padding: .65rem .75rem calc(.65rem + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--ink);
  transform: translateY(110%); transition: transform .45s var(--ease);
}
.dock.is-visible { transform: none; }
.dock .btn { flex: 1; justify-content: center; }

/* ---------- 23. Menu overlay (mobile) ---------- */
.menu {
  position: fixed; inset: 0; z-index: 70;
  background: var(--paper);
  display: grid; grid-template-rows: auto 1fr auto;
  padding: 0 var(--pad) calc(1.5rem + env(safe-area-inset-bottom));
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path .6s var(--ease-in-out), visibility 0s linear .6s;
}
.menu.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .6s var(--ease-in-out), visibility 0s; }
.menu__top { height: var(--mast-h); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--rule); }
.menu .contents { align-self: center; border-top: 0; }
.menu .contents__t { font-size: clamp(2rem, 8vw, 3rem); }
.menu__foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ---------- 24. Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); 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; }

/* Swahili loading guard (max 1.2s, then reveal regardless) */
.i18n-pending [data-i18n] { visibility: hidden; animation: i18n-guard 0s linear 1.2s forwards; }
@keyframes i18n-guard { to { visibility: visible; } }

/* ---------- 25. Error pages ---------- */
.err { min-height: calc(100svh - var(--mast-h)); display: flex; flex-direction: column; justify-content: center; gap: 1.75rem; }
.err__code { font-family: var(--f-mono); color: var(--seal); }
.err .display { max-width: 14ch; }
.err__links { display: flex; flex-wrap: wrap; gap: 1rem 2rem; }

/* ---------- 26. View transitions (cross-document) ---------- */
@view-transition { navigation: auto; }
.sheet { view-transition-name: sheet; }
.mast { view-transition-name: mast; }
::view-transition-old(plate) { animation: vt-plate-out .7s var(--ease-in-out) both; }
::view-transition-new(plate) { animation: vt-plate-in .9s var(--ease-in-out) both; }
::view-transition-old(sheet) { animation: vt-fade-out .35s var(--ease) both; }
::view-transition-new(sheet) { animation: vt-sheet-in .6s var(--ease) .1s both; }
@keyframes vt-plate-out { to { transform: scale(1.04); filter: brightness(.6); } }
@keyframes vt-plate-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-sheet-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- 27. Responsive ---------- */
@media (max-width: 1280px) {
  :root { --plate-w: clamp(320px, 36vw, 520px); }
  .mast { gap: .6rem; }
  .mast__role-sec { display: none; }
  .nav { gap: clamp(.4rem, 1vw, 1.1rem); }
  .nav a { font-size: .68rem; letter-spacing: .09em; }
  .nav a sup { display: none; }
  .offers { grid-template-columns: 1fr; }
  .offer + .offer { border-left: 0; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step, .step + .step { padding: 1.25rem 1rem 1.25rem 0; border-left: 0; border-bottom: 1px solid var(--rule); }
  .step:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--rule); }
  .booking { grid-template-columns: 1fr; }
  .booking__aside { position: static; }
  .colophon__grid { grid-template-columns: 1fr 1fr; }
  .colophon__grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 1100px) {
  .nav { display: none; }
  .menu-btn { display: grid; }
  .pao { grid-template-columns: 1fr; gap: 1rem; }
  .caps { grid-template-columns: 1fr; }
  .cap, .cap + .cap { padding: 1.25rem 0; border-left: 0; border-bottom: 1px solid var(--rule); }
}

@media (max-width: 900px) {
  :root { --mast-h: 60px; }
  .mast { left: 0; padding: 0 1.1rem; }
  .frame { grid-template-columns: 1fr; padding-top: var(--mast-h); }
  .plate { position: relative; height: 58svh; min-height: 340px; top: auto; }
  body[data-page="home"] .plate { height: 72svh; }
  .plate__img:not(:first-child) { display: none; }
  .plate__img:first-child { clip-path: none; }
  .plate__img img { transform: none; }
  .plate__rail { display: none; }
  .sheet { padding-top: 0; }
  .hero { min-height: auto; padding-top: clamp(2.5rem, 7vw, 4rem); }
  .dock { display: flex; }
  body[data-page="contact"] .dock { display: none; }
  .colophon { padding-bottom: 6rem; }
}

@media (max-width: 720px) {
  .lang, .mast .btn, .mast__name small { display: none; }
  .doors { grid-template-columns: 1fr; }
  .door + .door { border-left: 0; border-top: 1px solid var(--rule-strong); }
  .contents a { grid-template-columns: 2.4rem 1fr; }
  .contents__lead { display: none; }
  .contents__d { grid-column: 2; text-align: left; margin-top: -.6rem; }
  .case { grid-template-columns: 1fr; gap: .9rem; }
  .case__meta { grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .checklist, .specialties, .principles, .fields, .choices { grid-template-columns: 1fr; }
  .roles { grid-template-columns: 1fr; }
  .role, .role + .role { padding: 1rem 0; border-left: 0; border-bottom: 1px solid var(--rule); }
  .role:last-child { border-bottom: 0; }
  .facts, .ticket { grid-template-columns: 1fr; }
  .facts div:nth-child(even), .facts div:nth-child(odd) { padding-inline: 0; border-left: 0; }
  .entry { grid-template-columns: 1fr; gap: .4rem; }
  .steps { grid-template-columns: 1fr; }
  .step:nth-child(even) { padding-left: 0; border-left: 0; }
  .score { grid-template-columns: 1fr 2.5rem 4.5rem; row-gap: .4rem; }
  .score__bar { grid-column: 1 / -1; grid-row: 2; }
  .diagnostic__grid { grid-template-columns: 1fr; }
  .diag-card:nth-child(odd) { border-right: 0; }
  .diagnostic__meter { grid-template-columns: 1fr; }
  .teardown-tab { padding: .75rem 1rem; font-size: .72rem; }
  .roadmap-timeline { grid-template-columns: 1fr; }
  .fieldnotes-grid { grid-template-columns: 1fr; }
  .risk-item summary { grid-template-columns: auto 1fr; }
  .risk-content dl { grid-template-columns: 1fr; }
  .colophon__grid { grid-template-columns: 1fr; }
  .watermark { display: none; }
  .fieldlog { gap: .6rem 1.25rem; }
}

@media (max-width: 380px) {
  .mast__name { font-size: 1rem; }
  .hero__cta .btn { width: 100%; justify-content: center; }
}

/* ---------- 28. Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}

@media print {
  body::before, .mast, .dock, .menu, .plate, .btn, .filters, .tools { display: none !important; }
  .frame { display: block; }
  .sheet { padding: 0; }
  .section { padding: 1.5rem 0; break-inside: avoid; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; }
}
