/* Portfolio v7 shared styles. Every page links this one file. */

/* ---------- Fonts (self hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("assets/fonts/hanken-grotesk-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Amiri";
  src: url("assets/fonts/amiri-arabic-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Serif Fallback";
  src: local("Times New Roman"), local("Georgia");
  size-adjust: 92%;
  ascent-override: 98%;
  descent-override: 26%;
}
@font-face {
  font-family: "Sans Fallback";
  src: local("Arial"), local("Helvetica");
  size-adjust: 100%;
}

/* ---------- Tokens (locked palette, 02-SPEC B) ---------- */
:root {
  --black: #000000;
  --red: #952820;
  --white: #eeeeee;
  --grey-1: #cfcfcf;
  --grey-2: #a7a7a5;
  --grey-3: #8c9094;
  --grey-4: #5a5d60;
  /* neutral darks for surfaces only (map land and panel), never as accents */
  --ink-1: #0b0b0b;
  --ink-2: #1a1a1a;
  --ink-3: #2b2b2b;
  --rule: 1px solid var(--grey-4);
  --rule-faint: 1px solid var(--ink-3);

  --serif: "Instrument Serif", "Serif Fallback", Georgia, serif;
  --sans: "Hanken Grotesk", "Sans Fallback", system-ui, sans-serif;
  --arabic: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 72px;
  --s9: 112px;

  --gutter: clamp(16px, 5vw, 96px);
  --measure: 40rem; /* about 66 characters of body text */
  --radius: 2px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-s: 400ms;
  --t-m: 650ms;
  --t-l: 900ms;
  --fixed-bar-h: 0px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
}
html.is-modal {
  overflow: hidden;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: var(--fixed-bar-h);
}
@media (min-width: 900px) {
  body {
    font-size: 1.125rem;
  }
}
img,
video,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
}
p {
  margin: 0;
}
:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}
.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;
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--white);
  color: var(--black);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}
[lang="ar"] {
  font-family: var(--arabic);
}
[hidden] {
  display: none !important;
}

/* ---------- Film grain (static, decorative) ---------- */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0.05;
  /* pre-rendered noise tile (cheap to paint, unlike a live SVG turbulence filter) */
  background: url("assets/img/grain.png") repeat;
  background-size: 128px 128px;
}

/* ---------- Top bar ---------- */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: 14px var(--gutter);
}
.wordmark {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.topnav {
  display: none;
}
.lang {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--grey-2);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--t-s) var(--ease), border-color var(--t-s) var(--ease);
}
.lang:hover {
  color: var(--white);
  border-color: var(--grey-4);
}
.lang [lang="ar"] {
  font-size: 1.05rem;
  line-height: 1;
}

/* ---------- Buttons (02-SPEC D2) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--t-s) var(--ease), border-color var(--t-s) var(--ease), color var(--t-s) var(--ease),
    box-shadow var(--t-s) var(--ease), transform 120ms var(--ease);
}
.btn:active {
  transform: translateY(1px);
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
}
.btn-primary:hover {
  box-shadow: inset 0 0 0 1px rgba(238, 238, 238, 0.55);
}
.btn-primary:disabled {
  background: var(--ink-3);
  color: var(--grey-3);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.btn-outline {
  background: transparent;
  border-color: var(--white);
  color: var(--white);
}
.btn-outline:hover {
  background: var(--white);
  color: var(--black);
}
.btn-outline-red {
  background: transparent;
  border-color: var(--red);
  color: var(--white);
}
.btn-outline-red:hover {
  background: rgba(149, 40, 32, 0.22);
}
.btn-ghost {
  background: transparent;
  border-color: var(--grey-4);
  color: var(--grey-1);
}
.btn-ghost:hover {
  border-color: var(--grey-1);
  color: var(--white);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

/* ---------- Fixed CTA pair (02-SPEC D1) ---------- */
.cta-fixed {
  position: fixed;
  z-index: 50;
  display: flex;
  align-items: stretch;
  gap: var(--s2);
  transition: opacity var(--t-s) var(--ease), transform var(--t-s) var(--ease), visibility 0s linear 0s;
}
.cta-fixed.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--t-s) var(--ease), transform var(--t-s) var(--ease), visibility 0s linear var(--t-s);
}
.cta-book {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow var(--t-s) var(--ease), transform 120ms var(--ease);
}
.cta-book:hover {
  box-shadow: inset 0 0 0 1px rgba(238, 238, 238, 0.55);
}
.cta-wa {
  flex: none;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: var(--rule);
  background: rgba(0, 0, 0, 0.6);
  color: var(--grey-1);
  transition: border-color var(--t-s) var(--ease), color var(--t-s) var(--ease), transform 120ms var(--ease);
}
.cta-wa:hover {
  border-color: var(--grey-1);
  color: var(--white);
}
.cta-book:active,
.cta-wa:active {
  transform: translateY(1px);
}
.cta-wa svg {
  width: 18px;
  height: 18px;
}
@media (min-width: 900px) {
  .cta-fixed {
    top: 14px;
    right: var(--gutter);
  }
  .topbar-right {
    margin-right: 228px; /* room for the fixed CTA pair */
  }
}
@media (max-width: 899px) {
  :root {
    --fixed-bar-h: calc(68px + env(safe-area-inset-bottom));
  }
  .cta-fixed {
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.9);
    border-top: var(--rule-faint);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
  .cta-fixed.is-hidden {
    transform: translateY(12px);
  }
  .cta-book {
    flex: 1;
    font-size: 1rem;
  }
}

/* ---------- Reveal on view (runs once; content visible without JS) ---------- */
/* app.js adds .pre only to elements below the fold, so first-screen text paints at once. */
.rv {
  transition: opacity var(--t-l) var(--ease), transform var(--t-l) var(--ease);
  transition-delay: var(--d, 0ms);
}
.rv.pre {
  opacity: 0;
  transform: translateY(16px);
}
.rv-fade {
  transition: opacity var(--t-l) var(--ease);
  transition-delay: var(--d, 0ms);
}
.rv-fade.pre {
  opacity: 0;
}

/* ---------- Hero (Welcome) ---------- */
.hero {
  position: relative;
  isolation: isolate;
}
.hero-media {
  position: relative;
  overflow: hidden;
  background: #070707;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 16%;
  transform-origin: 55% 30%;
  animation: slowzoom 26s var(--ease) both;
}
.hero.is-still .hero-media img {
  animation-play-state: paused;
}
@keyframes slowzoom {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 60% 30%, transparent 45%, rgba(0, 0, 0, 0.75) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, transparent 18%, transparent 45%, rgba(0, 0, 0, 0.85) 78%, #000 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 var(--gutter) var(--s6);
}
.greet {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  font-size: 0.9375rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-1);
  line-height: 32px;
  height: 32px;
}
.greet .ar {
  font-size: 1.375rem;
  letter-spacing: 0;
  text-transform: none;
  line-height: 32px;
}
.greet-sep {
  width: 1px;
  height: 14px;
  background: var(--grey-4);
}
.redline {
  display: block;
  width: 64px;
  height: 1px;
  background: var(--red);
  margin: 0 0 26px;
  transform-origin: left center;
  animation: draw var(--t-l) var(--ease) 0.35s both;
}
.statement {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.1rem + 2.4vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin: 0 0 26px;
  color: var(--white);
  text-wrap: pretty;
}
.thanks {
  margin: 0 0 32px;
  max-width: 34rem;
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  color: var(--grey-2);
}
.thanks strong {
  display: block;
  margin-top: 6px;
  font-weight: 500;
  color: var(--white);
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  max-width: 40rem;
}
.actions .btn-primary,
.actions .btn-outline {
  grid-column: 1 / -1;
}
.reveal {
  animation: rise 0.8s var(--ease) both;
}
.d1 { animation-delay: 0.1s; }
.d3 { animation-delay: 0.55s; }
.d4 { animation-delay: 1s; }
.d5 { animation-delay: 1.3s; }
.d6 { animation-delay: 1.6s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@media (max-width: 899px) {
  .hero-media {
    height: 58vh;
    height: 58svh;
    min-height: 380px;
  }
  .hero-media::after {
    background:
      radial-gradient(120% 90% at 60% 30%, transparent 45%, rgba(0, 0, 0, 0.75) 100%),
      linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, transparent 16%, transparent 38%, rgba(0, 0, 0, 0.88) 70%, #000 100%);
  }
  .hero-content {
    margin-top: -22svh;
  }
  .greet { margin-bottom: 14px; }
  .redline { margin-bottom: 18px; }
  .statement { margin-bottom: 18px; }
  .thanks {
    margin-bottom: 22px;
    font-size: 0.9688rem;
  }
  .thanks strong { margin-top: 4px; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .hero-media { height: 72svh; }
  .hero-content {
    margin-top: -26svh;
    max-width: 44rem;
  }
}
@media (min-width: 900px) {
  .hero {
    display: flex;
    align-items: flex-end;
    min-height: min(860px, 88svh);
  }
  .hero-media {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 54%;
  }
  .hero-media img {
    object-position: 55% 14%;
  }
  .hero-media::after {
    background:
      linear-gradient(to right, #000 0%, rgba(0, 0, 0, 0.85) 14%, rgba(0, 0, 0, 0.25) 42%, transparent 62%),
      linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, transparent 22%, transparent 66%, #000 100%),
      radial-gradient(120% 100% at 65% 35%, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
  }
  .hero-content {
    width: 60%;
    max-width: 56rem;
    padding: 112px var(--gutter) var(--s6);
  }
  .actions {
    display: flex;
    flex-wrap: wrap;
    max-width: none;
  }
}
@media (min-width: 1700px) {
  .hero-content { max-width: 62rem; }
}

/* ---------- Photo strip (02-SPEC D4) ---------- */
.strip-wrap {
  position: relative;
  padding: 0 0 var(--s6);
}
.strip-proof {
  padding: 0 var(--gutter) var(--s3);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey-2);
}
.strip {
  --h: 140px;
  position: relative;
  height: calc(var(--h) + 1px);
  overflow: hidden;
  border-bottom: 1px solid var(--red);
  outline-offset: -2px;
}
@media (min-width: 900px) {
  .strip { --h: 220px; }
}
.strip::before,
.strip::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14%;
  z-index: 2;
  pointer-events: none;
}
.strip::before { left: 0; background: linear-gradient(to right, #000, transparent); }
.strip::after { right: 0; background: linear-gradient(to left, #000, transparent); }
.strip-viewport {
  height: 100%;
  overflow: hidden;
}
.strip-track {
  display: flex;
  gap: 6px;
  width: max-content;
  list-style: none;
  margin: 0;
  padding: 0;
}
.strip.is-running .strip-track {
  animation: drift var(--loop, 60s) linear infinite;
}
.strip:hover .strip-track,
.strip:focus-within .strip-track,
.strip:focus .strip-track,
.strip.is-paused .strip-track {
  animation-play-state: paused;
}
@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.strip-tile {
  position: relative;
  flex: none;
  width: calc(var(--h) * 0.8);
  height: var(--h);
  background: var(--ink-2);
  overflow: hidden;
}
.strip-tile img,
.strip-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85);
}
.strip-date {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  font-size: 0.625rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
  color: var(--white);
  background: rgba(0, 0, 0, 0.6);
  border-left: 2px solid var(--red);
  pointer-events: none;
}
@media (min-width: 900px) {
  .strip-date { font-size: 0.6875rem; left: 8px; bottom: 8px; }
}
.results {
  padding: var(--s5) var(--gutter) var(--s8);
}
.results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3) 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--grey-2);
  max-width: 72rem;
}
.results-list li {
  max-width: 34rem;
}
.results-list li + li {
  margin-left: var(--s5);
  padding-left: var(--s5);
  border-left: var(--rule);
}
@media (max-width: 899px) {
  .results-list {
    flex-direction: column;
  }
  .results-list li,
  .results-list li + li {
    margin: 0;
    padding: 0 0 0 var(--s4);
    border-left: var(--rule);
  }
}

/* ---------- Select options panel (02-SPEC D3) ---------- */
.panel {
  padding: 0;
  border: var(--rule-faint);
  background: var(--ink-1);
  color: var(--white);
  width: min(560px, calc(100vw - 32px));
  max-height: min(92vh, 760px);
  border-radius: 4px;
  overflow: hidden;
}
.panel::backdrop {
  background: rgba(0, 0, 0, 0.8);
}
.panel[open] {
  display: flex;
  flex-direction: column;
  animation: panelin 90ms linear both;
}
@keyframes panelin {
  from { opacity: 0; }
  to { opacity: 1; }
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: 18px 20px 12px;
}
.panel-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
  line-height: 1.15;
}
.icon-btn {
  flex: none;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: var(--rule-faint);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--grey-1);
}
.icon-btn:hover {
  border-color: var(--grey-2);
  color: var(--white);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.toggles {
  list-style: none;
  margin: 0;
  padding: 4px 20px 16px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
}
.toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 16px;
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: 3px;
  text-align: left;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--grey-1);
  cursor: pointer;
  transition: border-color var(--t-s) var(--ease), transform 160ms var(--ease), box-shadow var(--t-s) var(--ease), color var(--t-s) var(--ease);
}
.toggle:hover {
  transform: translateY(-1px);
  border-color: var(--grey-4);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.toggle:active {
  transform: translateY(1px);
  box-shadow: none;
}
.toggle-box {
  flex: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--grey-3);
  border-radius: 2px;
  display: grid;
  place-items: center;
}
.toggle-box::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
  opacity: 0;
}
.toggle-dot {
  margin-left: auto;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--grey-4);
}
.toggle[aria-pressed="true"] {
  border-color: var(--red);
  color: var(--white);
}
.toggle[aria-pressed="true"] .toggle-box {
  border-color: var(--red);
  background: var(--red);
}
.toggle[aria-pressed="true"] .toggle-box::after {
  opacity: 1;
}
.toggle[aria-pressed="true"] .toggle-dot {
  background: var(--red);
  border-color: var(--red);
}
.panel-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: var(--rule-faint);
}
.panel-foot .btn {
  padding: 0 12px;
  white-space: normal;
  text-align: center;
}
@media (max-width: 599px) {
  .panel {
    width: 100vw;
    max-width: 100vw;
    max-height: 100svh;
    margin: auto 0 0;
    border-radius: 10px 10px 0 0;
    border-width: 1px 0 0;
  }
  .panel-head,
  .toggles,
  .panel-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
  .panel-foot {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--fixed-bar-h) + 20px);
  z-index: 60;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  background: var(--ink-2);
  border: var(--rule-faint);
  border-left: 2px solid var(--red);
  color: var(--grey-1);
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-s) var(--ease);
}
.toast.is-on {
  opacity: 1;
}

/* =====================================================================
   Portfolio page (all.html)
   ===================================================================== */
.page {
  padding-top: 96px;
}
@media (min-width: 1280px) {
  .topnav {
    display: flex;
    gap: var(--s1);
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .topnav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    color: var(--grey-2);
    text-decoration: none;
    transition: color var(--t-s) var(--ease);
  }
  .topnav a:hover {
    color: var(--white);
  }
}
.summary-head {
  max-width: 84rem;
  margin: 0 auto;
  padding: var(--s7) var(--gutter) 0;
}
.summary-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem);
  line-height: 1.05;
}

/* Section shell (02-SPEC B) */
.sec {
  padding: var(--s8) var(--gutter) var(--s8);
  max-width: 84rem;
  margin: 0 auto;
}
.sec + .sec {
  margin-top: var(--s4);
}
/* Off-screen sections skip layout and paint until they come near the viewport. */
.sec ~ .sec {
  content-visibility: auto;
  contain-intrinsic-size: auto 2400px;
}
@media (min-width: 900px) {
  .sec {
    padding-top: var(--s9);
    padding-bottom: var(--s9);
  }
}
.sec-line {
  display: block;
  width: 72px;
  height: 1px;
  background: var(--red);
  margin-bottom: var(--s5);
  transform-origin: left center;
}
.js .sec-line {
  transform: scaleX(0);
  transition: transform var(--t-l) var(--ease);
}
.js .sec.in .sec-line {
  transform: scaleX(1);
}
.eyebrow {
  margin: 0 0 var(--s4);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey-2);
}
.kicker {
  margin: 0 0 var(--s4);
  max-width: var(--measure);
  color: var(--grey-2);
}
.sec-h {
  margin: 0 0 var(--s6);
  max-width: 22ch;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.3rem + 3vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.sec-h--wide {
  max-width: 28ch;
}
.lead {
  max-width: var(--measure);
  color: var(--grey-1);
}
.lead + .lead {
  margin-top: var(--s4);
}
.sub-h {
  margin: 0 0 var(--s5);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem);
  line-height: 1.1;
}
.label-h {
  margin: 0 0 var(--s3);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey-2);
}
.block {
  margin-top: var(--s8);
}
@media (min-width: 900px) {
  .block {
    margin-top: var(--s9);
  }
}
.muted {
  color: var(--grey-2);
}
.small {
  font-size: 0.9375rem;
}
/* Section photos (Story, How I can help), added 2026-11-16 on Ahmad's picks */
.sec-photo {
  margin-left: 0;
  margin-right: 0;
  position: relative;
}
.sec-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 2px solid var(--red);
}
.sec-photo--portrait { max-width: min(380px, 80vw); }
.sec-photo--wide { max-width: min(640px, 100%); }
.sec-photo--small { max-width: min(340px, 80vw); } /* source is only 340 px wide */
.pull {
  max-width: 34ch;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  line-height: 1.2;
  color: var(--white);
}
.end-bar {
  margin-top: var(--s8);
  padding-top: var(--s6);
  border-top: var(--rule-faint);
}
.end-bar .close {
  max-width: var(--measure);
  margin-bottom: var(--s5);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.85rem);
  line-height: 1.3;
}
.close-pending {
  /* second sentence of the Help close waits for Ahmad's yes (README) */
}
/* "View full portfolio" leads nowhere new while the full portfolio is open */
body:not(.is-summary) [data-full-link] {
  display: none;
}
.summary-end {
  padding: 0 var(--gutter) var(--s9);
  max-width: 84rem;
  margin: calc(var(--s8) * -1 + var(--s2)) auto 0; /* sits right under the last section's close line */
}
.text-link {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.text-link:hover {
  text-decoration-thickness: 2px;
}

/* ---------- Expertise timeline (02-SPEC D6) ---------- */
.tl {
  --rail: 64px;
  --lanes: 64px;
  position: relative;
  display: grid;
  grid-template-columns: var(--rail) var(--lanes) minmax(0, 1fr);
  margin-top: var(--s7);
  max-width: 62rem;
}
@media (max-width: 599px) {
  .tl {
    --rail: 44px;
    --lanes: 44px;
  }
}
.tl-lanes {
  grid-column: 2;
  grid-row: 1 / 6;
  position: relative;
}
.tl-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: visible;
  pointer-events: none;
}
.tl-svg path,
.tl-svg line {
  fill: none;
  stroke: var(--grey-4);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.tl-svg .tl-faint {
  stroke: var(--ink-3);
}
.tl-svg .tl-progress {
  stroke: var(--red);
  stroke-width: 2;
}
.tl-svg .tl-dot {
  fill: var(--black);
  stroke: var(--grey-3);
  stroke-width: 1.5;
}
.tl-svg .tl-dot--ai {
  fill: var(--red);
  stroke: var(--red);
}
.tl-svg .tl-dot--teach {
  fill: var(--black);
  stroke: var(--grey-2);
}
.tl-node {
  grid-column: 3;
  padding: 0 0 var(--s7) var(--s4);
  max-width: 40rem;
}
.tl-node:last-child {
  padding-bottom: 0;
}
.tl-year {
  grid-column: 1;
  padding-top: 10px;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--grey-3);
}
.tl-discipline {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  line-height: 1.15;
}
.tl-years {
  margin: 2px 0 var(--s3);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-3);
}
.tl-did {
  color: var(--grey-2);
}
.tl-proof {
  margin-top: var(--s2);
  color: var(--white);
}
.tl-node--teach {
  margin-top: var(--s5);
  padding-top: var(--s5);
  border-top: var(--rule-faint);
}
.sectors {
  margin-top: var(--s7);
  max-width: var(--measure);
  color: var(--grey-2);
}

/* ---------- World map (02-SPEC D7) ---------- */
.map-wrap {
  position: relative;
  max-width: 900px;
  margin: var(--s7) auto 0;
}
.map-frame {
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: auto 468px;
}
.map-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, #000 100%);
}
.world-map {
  width: 100%;
  height: auto;
}
.world-map .land {
  fill: var(--ink-2);
  stroke: var(--grey-4);
  stroke-width: 0.5;
  stroke-opacity: 0.6;
}
.world-map .land--active {
  fill: var(--ink-3);
}
.world-map .dot {
  cursor: pointer;
}
.world-map .dot__core {
  fill: var(--red);
}
.world-map .dot__pulse {
  fill: var(--red);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.world-map .dot__hit {
  fill: transparent;
}
/* Travel route: each leg draws from one dot to the next, then a light keeps travelling the whole route. */
.world-map .route,
.world-map .route-run {
  fill: none;
  stroke-linecap: round;
  pointer-events: none;
}
.world-map .route {
  stroke: var(--red);
  stroke-width: 1.3;
  stroke-opacity: 0.6;
}
.world-map .route-run {
  stroke: var(--white);
  stroke-width: 1.6;
  stroke-opacity: 0.85;
  stroke-dasharray: 2.5 97.5;
  stroke-dashoffset: 100;
  opacity: 0;
}
.js .world-map .route {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 300ms linear;
  transition-delay: calc((var(--i) - 1) * 300ms + 150ms);
}
.js .map-wrap.in .world-map .route {
  stroke-dashoffset: 0;
}
.map-wrap.in .world-map .route-run {
  opacity: 1;
  transition: opacity 400ms linear 6.4s;
  animation: route-run 14s linear 6.4s infinite;
}
@keyframes route-run {
  to { stroke-dashoffset: 0; }
}
.js .world-map .dot {
  opacity: 0;
  transition: opacity var(--t-s) var(--ease);
  transition-delay: calc(var(--i) * 300ms);
}
.js .map-wrap.in .world-map .dot {
  opacity: 1;
}
.map-wrap.in .world-map .dot:last-of-type .dot__pulse {
  animation: pulse 2.8s var(--ease) 6.2s infinite;
}
@keyframes pulse {
  0% { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0; transform: scale(3.2); }
}
@media (max-width: 599px) {
  .world-map .dot__core { r: 6; }
  .world-map .dot__pulse { r: 7; }
}
.map-tip {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, calc(-100% - 12px));
  padding: 6px 10px;
  background: var(--ink-2);
  border: var(--rule);
  font-size: 0.8125rem;
  color: var(--white);
  white-space: nowrap;
  pointer-events: none;
}
.map-count {
  margin-top: var(--s5);
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.85rem);
}

/* ---------- Projects (02-SPEC D8, D9) ---------- */
.script {
  max-width: 40ch;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem);
  line-height: 1.3;
  color: var(--white);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: var(--s5) 0 var(--s6);
}
.chip {
  min-height: 44px;
  padding: 0 16px;
  background: transparent;
  border: var(--rule);
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--grey-1);
  cursor: pointer;
  transition: border-color var(--t-s) var(--ease), color var(--t-s) var(--ease), background-color var(--t-s) var(--ease);
}
.chip:hover {
  border-color: var(--grey-1);
  color: var(--white);
}
.chip[aria-pressed="true"] {
  border-color: var(--red);
  background: rgba(149, 40, 32, 0.18);
  color: var(--white);
}
/* Hairline grids: each cell draws its own border and overlaps its neighbour by 1px,
   so a short last row leaves black space, not a grey block. */
.cards,
.certs {
  list-style: none;
  margin: 0;
  padding: 0 1px 1px 0;
  display: grid;
}
.cards > li,
.certs > li {
  border: var(--rule-faint);
  margin: 0 -1px -1px 0;
}
.cards {
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 700px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1040px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .card:last-child {
    grid-column: span 2; /* 10 cards with the wide factory card fill four full rows */
  }
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s6) var(--s5);
  background: var(--black);
  transition: opacity var(--t-m) var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-m) var(--ease);
}
.card:hover::before {
  transform: scaleX(1);
}
.card.is-out {
  opacity: 0.14;
}
@media (min-width: 700px) {
  .card--wide {
    grid-column: span 2;
  }
}
.card-k {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-2);
}
.card-fact {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem);
  line-height: 1.1;
  color: var(--white);
}
.card-line {
  font-size: 0.9688rem;
  color: var(--grey-2);
}
.tag {
  align-self: flex-start;
  margin-top: auto;
  padding: 3px 10px;
  border: 1px solid var(--grey-4);
  border-radius: var(--radius);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--grey-2);
}
.tag--measured {
  border-color: var(--white);
  color: var(--white);
}
.record {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s6) var(--s5);
}
.record li {
  border-top: var(--rule);
  padding-top: var(--s4);
}
.record-n {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 1.8rem + 2.6vw, 4.2rem);
  line-height: 1;
  color: var(--white);
}
.record-l {
  display: block;
  margin-top: var(--s2);
  font-size: 0.9375rem;
  color: var(--grey-2);
}
.systems-line {
  margin-top: var(--s6);
  max-width: var(--measure);
  color: var(--grey-2);
}

/* ---------- Approach loop (02-SPEC D10) ---------- */
.loop {
  display: grid;
  gap: var(--s7);
  margin-top: var(--s7);
}
.loop-svg {
  display: none;
}
@media (min-width: 960px) {
  .loop {
    grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
    align-items: center;
    gap: var(--s8);
  }
  .loop-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
  }
}
.loop-svg .loop-ring {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1;
}
.loop-svg .loop-draw {
  fill: none;
  stroke: var(--red);
  stroke-width: 1.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.js .loop-svg .loop-draw {
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.6s var(--ease);
}
.js .loop.in .loop-svg .loop-draw {
  stroke-dashoffset: 0;
}
.loop-svg .loop-arrow {
  fill: var(--red);
}
.js .loop-svg .loop-arrow {
  opacity: 0;
  transition: opacity var(--t-s) var(--ease) 1.5s;
}
.js .loop.in .loop-svg .loop-arrow {
  opacity: 1;
}
.loop-svg .loop-node circle {
  fill: var(--black);
  stroke: var(--grey-4);
  stroke-width: 1.5;
  transition: fill var(--t-m) var(--ease), stroke var(--t-m) var(--ease);
}
.loop-svg .loop-node text {
  fill: var(--grey-2);
  font-family: var(--sans);
  font-size: 17px;
  letter-spacing: 0.04em;
  transition: fill var(--t-m) var(--ease);
}
.loop-svg .loop-node .loop-num {
  fill: var(--grey-1);
  font-size: 12px;
  font-weight: 600;
}
.loop-node.is-lit circle,
.loop:not(.js-loop) .loop-node circle {
  fill: var(--red);
  stroke: var(--red);
}
.loop-node.is-lit text {
  fill: var(--white);
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  position: relative;
}
.step {
  position: relative;
  padding: var(--s4) 0 var(--s5) var(--s7);
  border-left: 1px solid var(--ink-3);
}
.step::before {
  content: attr(data-n);
  position: absolute;
  left: -15px;
  top: var(--s4);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--black);
  border: 1.5px solid var(--grey-4);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-1);
  transition: background-color var(--t-m) var(--ease), border-color var(--t-m) var(--ease);
}
.step.is-lit::before {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}
@media (min-width: 960px) {
  .step {
    border-left: 0;
    padding-left: 0;
    padding-bottom: var(--s4);
  }
  .step + .step {
    border-top: var(--rule-faint);
  }
  .step::before {
    display: none;
  }
}
.step-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.8rem);
  line-height: 1.15;
  transition: color var(--t-m) var(--ease);
}
.step.is-lit .step-name {
  color: var(--white);
}
.doubt {
  margin: var(--s1) 0 var(--s2);
  font-style: italic;
  font-size: 0.9688rem;
  color: var(--grey-3);
}
.step-a {
  color: var(--grey-1);
}
.loop-caption {
  margin-top: var(--s5);
  color: var(--grey-2);
  font-size: 0.9375rem;
}

/* ---------- Interactive equation (02-SPEC D11) ---------- */
.eq {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.1rem + 4.4vw, 5.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.eq-term {
  display: inline-block;
  transition: color var(--t-m) var(--ease);
}
.eq-term.is-on {
  color: var(--red);
}
.eq-op {
  color: var(--grey-3);
}
.eq-play {
  margin-top: var(--s6);
  display: grid;
  gap: var(--s6);
  max-width: 62rem;
}
@media (min-width: 900px) {
  .eq-play {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: end;
  }
}
.sliders {
  display: grid;
  gap: var(--s5);
}
.slider label {
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  font-size: 0.9375rem;
  color: var(--grey-1);
}
.slider output {
  font-variant-numeric: tabular-nums;
  color: var(--white);
  white-space: nowrap;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--grey-4);
}
input[type="range"]::-moz-range-track {
  height: 1px;
  background: var(--grey-4);
}
input[type="range"]::-moz-range-progress {
  height: 2px;
  background: var(--red);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--white) 0 8px, rgba(238, 238, 238, 0.08) 9px 21px, transparent 22px);
  border: 0;
}
input[type="range"]::-moz-range-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--white) 0 8px, rgba(238, 238, 238, 0.08) 9px 21px, transparent 22px);
  border: 0;
}
input[type="range"]:focus-visible {
  outline-offset: 0;
}
.eq-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s5);
  margin: 0;
}
.eq-results div {
  border-top: var(--rule);
  padding-top: var(--s3);
}
.eq-results dt {
  font-size: 0.875rem;
  color: var(--grey-2);
}
.eq-results dd {
  margin: var(--s1) 0 0;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 1.8rem + 2vw, 3.6rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.eq-note {
  grid-column: 1 / -1;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-3);
}
.plain-line {
  margin-top: var(--s6);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.85rem);
  line-height: 1.3;
}
.parts {
  list-style: none;
  margin: var(--s7) 0 0;
  padding: 0;
  display: grid;
  gap: var(--s6);
}
@media (min-width: 900px) {
  .parts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s5);
  }
}
.part {
  border-top: var(--rule);
  padding-top: var(--s4);
}
.part-name {
  margin: 0 0 var(--s3);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.1;
}
.part dl {
  margin: 0;
  display: grid;
  gap: var(--s3);
}
.part dt {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey-3);
}
.part dd {
  margin: 2px 0 0;
  font-size: 0.9688rem;
  color: var(--grey-1);
}

/* ---------- Objection tables (02-SPEC D12) ---------- */
.objections {
  margin: 0;
  border-top: var(--rule);
}
.objection {
  display: grid;
  gap: var(--s2) var(--s6);
  padding: var(--s5) 0;
  border-bottom: var(--rule);
}
@media (min-width: 800px) {
  .objection {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  }
}
.objection dt {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
  line-height: 1.25;
  color: var(--grey-1);
}
.objection dd {
  margin: 0;
  color: var(--grey-1);
}

/* ---------- Story ---------- */
.story-proof {
  margin: 0 0 var(--s4);
  max-width: 48rem;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--grey-2);
}
.aside-note {
  margin-top: var(--s3);
  max-width: var(--measure);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--grey-3);
}
.prose {
  max-width: var(--measure);
}
.prose p + p {
  margin-top: var(--s4);
}
.prose p {
  color: var(--grey-1);
}
.eq-inline {
  margin: var(--s5) 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem);
  line-height: 1.15;
  color: var(--white);
}
.certs {
  margin-top: var(--s6);
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.cert {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s5);
  background: var(--black);
  outline-offset: -2px;
}
.cert-logo {
  height: 28px;
  display: flex;
  align-items: center;
  gap: var(--s3);
  color: var(--grey-1);
  transition: color var(--t-s) var(--ease);
}
.cert:hover .cert-logo,
.cert:focus .cert-logo,
.cert:focus-within .cert-logo {
  color: var(--white);
}
.cert-logo svg {
  height: 100%;
  width: auto;
  fill: currentColor;
}
.cert-logo .logo-mask {
  height: 100%;
  aspect-ratio: var(--ar, 1);
  background: currentColor;
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
}
.cert-logo .logo-text {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.2;
}
@media (max-width: 599px) {
  .cert-logo {
    height: 22px;
  }
}
.cert-name {
  color: var(--white);
  font-size: 0.9688rem;
  line-height: 1.45;
}
.cert-year {
  margin-top: auto;
  font-size: 0.8125rem;
  color: var(--grey-3);
  font-variant-numeric: tabular-nums;
}

/* ---------- Help ---------- */
.fit {
  display: grid;
  gap: var(--s7);
}
@media (min-width: 900px) {
  .fit {
    grid-template-columns: 1fr 1fr;
    gap: var(--s8);
  }
}
.ticks {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: var(--rule);
}
.ticks li {
  position: relative;
  padding: var(--s4) 0 var(--s4) var(--s6);
  border-bottom: var(--rule-faint);
  color: var(--grey-1);
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: calc(var(--s4) + 0.75em);
  width: 12px;
  height: 1px;
  background: var(--red);
}
.ticks--not li::before {
  background: var(--grey-4);
}
.trio {
  display: grid;
  gap: var(--s6);
}
@media (min-width: 900px) {
  .trio {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s5);
  }
}
.trio > div {
  border-top: var(--rule);
  padding-top: var(--s4);
}
.trio p {
  color: var(--grey-1);
}
.numbered {
  list-style: none;
  counter-reset: n;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s5);
  max-width: 48rem;
}
.numbered li {
  counter-increment: n;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: var(--s3);
  color: var(--grey-1);
}
.numbered li::before {
  content: counter(n, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--red);
}

/* ---------- Debug page ---------- */
.debug {
  padding: 32px var(--gutter);
}
.debug table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.debug th,
.debug td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: var(--rule-faint);
  vertical-align: top;
}
.debug th {
  color: var(--grey-2);
  font-weight: 500;
}
.debug code {
  color: var(--grey-1);
  word-break: break-word;
}
.debug .table-wrap {
  overflow-x: auto;
}
.stub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Reduced motion: every element in its final state ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .rv.pre,
  .rv-fade.pre,
  .js .world-map .dot,
  .js .loop-svg .loop-arrow {
    opacity: 1;
    transform: none;
  }
  .js .world-map .route {
    stroke-dashoffset: 0;
  }
  .world-map .route-run {
    display: none;
  }
  .js .sec-line {
    transform: none;
  }
  .js .loop-svg .loop-draw {
    stroke-dashoffset: 0;
  }
  .strip {
    height: auto;
  }
  .strip-viewport {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0 var(--gutter);
  }
}
