/* ============================================================
   Omar M. Hammouda - Portfolio
   Hand-tuned static site. No framework, no build step.
   Theme: auto light/dark via CSS variables.
   ============================================================ */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/satoshi-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/satoshi-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/satoshi-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --ink: #191a1c;
  --muted: #5f6266;
  --line: rgba(25, 26, 28, 0.14);
  --line-soft: rgba(25, 26, 28, 0.08);
  --accent: #1f6b4c;
  --accent-contrast: #ffffff;
  --radius: 14px;
  --nav-h: 68px;
  --pad: clamp(20px, 4vw, 48px);
  --max: 1280px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101214;
    --surface: #17191c;
    --ink: #edece8;
    --muted: #9a9da3;
    --line: rgba(237, 236, 232, 0.17);
    --line-soft: rgba(237, 236, 232, 0.09);
    --accent: #6fc29a;
    --accent-contrast: #0d1f17;
  }
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Satoshi", "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav.scrolled {
  border-bottom-color: var(--line-soft);
}
.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-name {
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  list-style: none;
}
.nav-links a {
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.nav-links a:hover {
  color: var(--ink);
}
.nav-links a.nav-cta {
  color: var(--ink);
  font-weight: 700;
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(56px, 10vh, 96px) clamp(48px, 8vh, 88px);
  position: relative;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.4rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.06;
  position: relative;
  z-index: 1;
}
.hero-sub,
.hero-actions {
  position: relative;
  z-index: 1;
}
.hero h1 em {
  font-style: italic;
  line-height: 1.1;
  padding-bottom: 0.05em;
  color: var(--accent);
}
.hero-sub {
  margin-top: 24px;
  color: var(--muted);
  max-width: 44ch;
}
.hero-actions {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--ink);
}
.btn .arrow {
  transition: transform 0.25s var(--ease);
}
.btn:hover .arrow {
  transform: translateX(4px);
}

/* Hero entrance (load-in) */
@media (prefers-reduced-motion: no-preference) {
  .kicker,
  .standfirst,
  .byline {
    animation: rise-in 0.9s var(--ease) backwards;
  }
  .standfirst {
    animation-delay: 0.34s;
  }
  .byline {
    animation-delay: 0.46s;
  }
}
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Section scaffolding ---------- */
.section {
  padding-block: clamp(64px, 10vh, 128px);
}
.section-head {
  margin-bottom: clamp(32px, 5vh, 56px);
}
.section-head h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.section-head p {
  margin-top: 12px;
  color: var(--muted);
  max-width: 52ch;
}

/* ---------- Work grid ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(16px, 2.5vw, 28px);
}
.work-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  grid-column: span 12;
}
.work-card.span-7 {
  grid-column: span 7;
}
.work-card.span-5 {
  grid-column: span 5;
}
.cover {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0b0c0e;
  aspect-ratio: 21 / 9;
}
.cover > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Live covers: real screen layers with entrance stagger + hover parallax */
.cover-live {
  container-type: size;
  background: var(--cbg);
}
.cover-live .stage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: max(100cqw, 184.6cqh);
  height: max(100cqh, 54.2cqw);
}
.cover-live .ly {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: auto;
  transform: translate(-50%, -50%) rotate(var(--r));
  filter: drop-shadow(0 16px 22px rgba(6, 8, 7, 0.28));
  will-change: transform;
  transition: transform 0.7s var(--ease), opacity 0.7s var(--ease);
}
/* settle-in: layers rise into their tilt as the card reveals */
html.js .work-card .cover-live .ly {
  opacity: 0;
  transform: translate(-50%, -38%) rotate(calc(var(--r) * 0.25));
}
html.js .work-card.in .cover-live .ly {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(var(--r));
}
.work-card.in .cover-live .ly:nth-child(2) {
  transition-delay: 0.09s;
}
.work-card.in .cover-live .ly:nth-child(3) {
  transition-delay: 0.18s;
}
@media (hover: hover) {
  .work-card:hover .cover-live .ly:nth-child(1),
  .work-card:focus-visible .cover-live .ly:nth-child(1) {
    transform: translate(-52.5%, -51.5%) rotate(calc(var(--r) - 2deg)) scale(1.02);
    transition-delay: 0s;
  }
  .work-card:hover .cover-live .ly:nth-child(2),
  .work-card:focus-visible .cover-live .ly:nth-child(2) {
    transform: translate(-47%, -48.5%) rotate(calc(var(--r) + 2.5deg)) scale(1.04);
    transition-delay: 0s;
  }
  .work-card:hover .cover-live .ly:nth-child(3),
  .work-card:focus-visible .cover-live .ly:nth-child(3) {
    transform: translate(-45%, -52%) rotate(calc(var(--r) + 3deg)) scale(1.03);
    transition-delay: 0s;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cover-live .ly,
  .work-card .cover-live .ly {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--r));
    transition: none;
  }
}
.work-card.wide-tall .cover {
  aspect-ratio: 2 / 1;
}
@media (min-width: 861px) {
  /* Split rows: covers stretch so both cards in a row share one height. */
  .work-card.span-7 .cover,
  .work-card.span-5 .cover {
    aspect-ratio: auto;
    flex: 1;
    min-height: 420px;
  }
}
@media (hover: hover) {
  .cover > img {
    transition: transform 0.6s var(--ease);
  }
  .work-card:hover .cover > img,
  .work-card:focus-visible .cover > img {
    transform: scale(1.03);
  }
}
.work-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  padding: 14px 4px 0;
  align-items: baseline;
}
.w-head {
  display: flex;
  align-items: center;
  gap: 9px;
}
.chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--chip);
  flex: none;
}
.work-meta .w-name {
  font-weight: 700;
}
.work-meta .w-desc {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.95rem;
}
.work-meta .w-cat {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

/* ---------- Index of remaining work ---------- */
.index-thumb {
  width: 104px;
  height: 66px;
  object-fit: cover;
  border-radius: 10px;
  flex: none;
}
.index-swatch {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex: none;
  background: var(--chip);
}
.index-body {
  flex: 1;
  min-width: 0;
}
.index-body .i-name {
  font-weight: 700;
}
.index-body .i-cat {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.about-grid h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.15;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.about-body p + p {
  margin-top: 1em;
}
.about-body .lede {
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 500;
}
.stats {
  margin-top: 36px;
}
.hero-stats {
  margin-top: clamp(44px, 8vh, 72px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-block: 24px;
  border-block: 1px solid var(--line-soft);
}
.stat-num {
  display: block;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--accent);
}
.stat-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.chips {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
}
.chips li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---------- Contact ---------- */
.contact {
  border-top: 1px solid var(--line-soft);
}
.contact .big-mail {
  display: inline-block;
  margin-top: 8px;
  font-size: clamp(1.6rem, 4.6vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  word-break: break-all;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.4s var(--ease), color 0.2s var(--ease);
}
.contact .big-mail:hover {
  color: var(--accent);
  background-size: 100% 2px;
}
.contact-links {
  margin-top: 36px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--muted);
}
.contact-links a {
  transition: color 0.2s var(--ease);
}
.contact-links a:hover {
  color: var(--ink);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line-soft);
  padding-block: 28px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer a:hover {
  color: var(--ink);
}

/* ---------- Case study pages ---------- */
.case-hero {
  background: var(--c-bg);
  color: var(--c-ink);
  padding-block: clamp(64px, 12vh, 128px);
  position: relative;
  overflow: hidden;
}
.case-hero .case-ghost {
  position: absolute;
  right: -0.06em;
  top: -0.14em;
  font-size: clamp(6rem, 18vw, 15rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  opacity: 0.12;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.case-hero .wrap {
  position: relative;
}
.case-hero h1 {
  margin-top: 10px;
  font-size: clamp(2.6rem, 6.5vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.case-hero .case-lede {
  margin-top: 20px;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  max-width: 46ch;
  opacity: 0.9;
}
.case-body {
  padding-block: clamp(48px, 8vh, 88px);
  display: grid;
  gap: clamp(48px, 8vh, 80px);
}
.case-section h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.case-section p {
  max-width: 68ch;
  color: var(--ink);
}
.case-section p + p {
  margin-top: 1em;
}
/* Componentized case-study stream */
.case-featured {
  margin-top: clamp(-72px, -6vh, -40px);
  position: relative;
  z-index: 2;
}
.case-stream .case-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 28px 0 10px;
}
.case-stream .case-section h2 + h3 {
  margin-top: 4px;
}
.case-fig {
  margin-top: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: #050505;
}
.case-fig img {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 860px) {
}


.show-sm {
  display: none;
}
@media (max-width: 860px) {
  .show-sm {
    display: block;
  }
}

/* ---------- Reveal on scroll (JS-gated: content is visible without JS) ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
html.js .reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .cover,
  .btn {
    transition: none;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .work-card.span-7,
  .work-card.span-5 {
    grid-column: span 12;
  }
  .work-card .cover,
  .work-card.wide-tall .cover {
    aspect-ratio: 16 / 10;
  }
  .index-thumb {
    width: 84px;
    height: 54px;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-grid h2 {
    position: static;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .nav-links .hide-sm {
    display: none;
  }
}

/* ============================================================
   v10 redesign: editorial homepage + senior case chrome
   ============================================================ */

/* Hero: feature opener */
.kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(3rem, 8.4vw, 7.2rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  max-width: none;
}
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}
.line-in {
  display: inline-block;
}
.line-accent .line-in {
  color: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .line-in {
    transform: translateY(112%);
    animation: line-up 0.75s var(--ease) forwards;
  }
  .line:nth-child(2) .line-in {
    animation-delay: 0.1s;
  }
}
@keyframes line-up {
  to {
    transform: none;
  }
}
.standfirst-row {
  display: grid;
  grid-template-columns: 5fr 7fr;
  margin-top: clamp(28px, 4vh, 44px);
}
.standfirst {
  grid-column: 2;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.55;
  max-width: 46ch;
  padding-left: 20px;
  border-left: 2px solid var(--accent);
}
.byline {
  margin-top: clamp(28px, 5vh, 44px);
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* By the numbers band */
.numbers {
  background: var(--surface);
  border-block: 1px solid var(--line-soft);
  padding-block: clamp(36px, 6vh, 56px);
}
.band-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 20px;
}
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.numbers .stat-num {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

/* Professional work */
.xp {
  border-top: 1px solid var(--line-soft);
}
.xp-row {
  display: grid;
  grid-template-columns: 3fr 9fr;
  gap: 24px;
  padding-block: 30px;
  border-bottom: 1px solid var(--line-soft);
}
.xp-row.reveal {
  transition-delay: calc(var(--i, 0) * 90ms);
}
.xp-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.xp-co {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}
.xp-role,
.xp-when {
  color: var(--muted);
  font-size: 0.88rem;
}
.xp-what {
  max-width: 62ch;
}
.metric {
  color: var(--accent);
  font-weight: 700;
}
.xp-earlier {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 72ch;
}
.xp-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Editor's note */
.note {
  padding-block: clamp(80px, 12vh, 140px);
}
.note-quote {
  position: relative;
  max-width: 30ch;
  margin-inline: auto;
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.32;
}
.note-quote::before {
  content: "\201C";
  position: absolute;
  top: -0.55em;
  left: -0.35em;
  font-size: 3em;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.2;
  line-height: 1;
}
.note-attr {
  margin-top: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Selected stories grid additions */
.work-card.span-6 {
  grid-column: span 6;
}
@media (min-width: 861px) {
  .work-card.span-6 .cover {
    aspect-ratio: auto;
    flex: 1;
    min-height: 400px;
  }
}
.ghost-cell {
  grid-column: span 5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.ghost-cell span {
  font-size: clamp(8rem, 18vw, 17rem);
  font-weight: 900;
  line-height: 1;
  color: var(--chip);
  opacity: 0.12;
  user-select: none;
}
.w-cat {
  position: relative;
  display: inline-grid;
}
.w-cat-a,
.w-cat-b {
  grid-area: 1 / 1;
  white-space: nowrap;
  transition: opacity 0.3s var(--ease);
  text-align: right;
}
.w-cat-b {
  opacity: 0;
  color: var(--ink);
  font-weight: 700;
}
@media (hover: hover) {
  .work-card:hover .w-cat-a { opacity: 0; }
  .work-card:hover .w-cat-b { opacity: 1; }
  .work-card .w-name {
    background-image: linear-gradient(var(--chip), var(--chip));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 0.35s var(--ease);
    padding-bottom: 2px;
  }
  .work-card:hover .w-name {
    background-size: 100% 2px;
  }
  .work-card:hover .cover-live {
    filter: saturate(1.12);
  }
}
@media (prefers-reduced-motion: no-preference) {
  html.js .work-card.drift-l.reveal {
    transform: translate(-16px, 22px);
  }
  html.js .work-card.drift-r.reveal {
    transform: translate(16px, 22px);
  }
  .work-card.drift-l.reveal.in,
  .work-card.drift-r.reveal.in {
    transform: none;
  }
}

/* Palette strip */
.palette-strip {
  display: flex;
  gap: 4px;
  height: clamp(120px, 18vh, 180px);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: clamp(36px, 6vh, 56px);
}
.palette-strip a {
  flex: 1;
  background: var(--sw);
  display: flex;
  align-items: flex-end;
  padding: 14px;
  min-width: 0;
  transition: flex-grow 0.45s var(--ease);
}
.palette-strip a span {
  font-weight: 900;
  font-size: clamp(1rem, 2.4vw, 1.7rem);
  letter-spacing: -0.02em;
  color: var(--chip);
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.3s var(--ease) 0.12s;
}
.palette-strip a:hover,
.palette-strip a:focus-visible {
  flex-grow: 3.2;
}
.palette-strip a:hover span,
.palette-strip a:focus-visible span {
  opacity: 1;
}

/* Numbered contents rows */
.contents {
  list-style: none;
  border-top: 1px solid var(--line-soft);
}
.contents li.reveal {
  transition-delay: calc(var(--i, 0) * 60ms);
}
.contents a {
  display: grid;
  grid-template-columns: 44px 104px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 10px;
  transition: background 0.25s var(--ease);
}
.c-num {
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--ink);
  opacity: 0.3;
}
.c-body {
  min-width: 0;
}
.c-body .i-name {
  display: block;
  font-weight: 700;
}
.c-body .i-cat {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}
.contents a .index-thumb {
  transition: transform 0.3s var(--ease);
}
@media (hover: hover) {
  .contents a:hover {
    background: color-mix(in srgb, var(--chip) 8%, transparent);
  }
  .contents a:hover .index-thumb {
    transform: scale(1.06);
  }
  .contents a:hover .i-go {
    transform: translateX(4px);
    color: var(--ink);
  }
}

/* About stats */
.about-stats {
  grid-template-columns: repeat(3, 1fr);
}

/* Contact */
.contact-eyebrow {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-bottom: 18px;
}
.big-mail {
  font-size: clamp(2rem, 7vw, 5.8rem);
}
.big-mail .m1,
.big-mail .m2,
.big-mail .m3 {
  display: inline-block;
}
.reveal.big-mail .m2 {
  transition-delay: 0.08s;
}
.reveal.big-mail .m3 {
  transition-delay: 0.16s;
}
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal.big-mail .m1,
  html.js .reveal.big-mail .m2,
  html.js .reveal.big-mail .m3 {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  }
  .reveal.in.big-mail .m1,
  .reveal.in.big-mail .m2,
  .reveal.in.big-mail .m3 {
    opacity: 1;
    transform: none;
  }
}

/* Footer colophon */
.colophon {
  font-size: 0.85rem;
}

/* Mobile adjustments for v10 */
@media (max-width: 860px) {
  .standfirst-row {
    grid-template-columns: 1fr;
  }
  .standfirst {
    grid-column: 1;
  }
  .byline {
    flex-direction: column;
    align-items: flex-start;
  }
  .numbers-grid {
    grid-template-columns: 1fr 1fr;
  }
  .xp-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .work-card.span-6 {
    grid-column: span 12;
  }
  .ghost-cell {
    display: none;
  }
  .palette-strip {
    height: 56px;
  }
  .palette-strip a {
    padding: 6px;
  }
  .palette-strip a span {
    display: none;
  }
  .contents a {
    grid-template-columns: 30px 84px 1fr auto;
    gap: 12px;
  }
  .about-stats {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   Case pages v10: chaptered editorial template
   ============================================================ */

/* Reading progress bar (under the sticky nav) */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--chip, var(--accent));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* Hero refinements */
.case-kicker {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.72;
}
.case-mins {
  margin-top: 18px;
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0.6;
}
.cover-fig {
  margin-top: 0;
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.35);
}

/* At-a-glance strip */
.glance {
  padding-block: clamp(28px, 5vh, 44px);
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  gap: 22px;
}
.glance-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px 24px;
}
.glance .m-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.glance .m-value {
  font-weight: 700;
  margin-top: 4px;
  font-size: 0.98rem;
}
.glance-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  align-items: baseline;
}
.glance-row p {
  max-width: 72ch;
  color: var(--ink);
  font-size: 1rem;
}

/* Shell: sticky chapter rail + body */
.case-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}
.chapter-rail {
  display: none;
}
@media (min-width: 1080px) {
  .case-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .chapter-rail {
    position: sticky;
    top: calc(var(--nav-h) + 48px);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: clamp(48px, 8vh, 88px);
  }
  .chapter-rail a {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 9px 0 9px 14px;
    border-left: 2px solid var(--line-soft);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
  }
  .chapter-rail a span {
    font-size: 0.78rem;
    opacity: 0.6;
    font-variant-numeric: tabular-nums;
  }
  .chapter-rail a:hover {
    color: var(--ink);
  }
  .chapter-rail a[aria-current="true"] {
    color: var(--ink);
    border-left-color: var(--chip, var(--accent));
  }
}

/* Chapter anatomy */
.chapter {
  position: relative;
}
.chapter .ch-num {
  position: absolute;
  top: -0.32em;
  left: -0.04em;
  font-size: clamp(4.6rem, 9vw, 7.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
}
.chapter h2 {
  position: relative;
  max-width: 24ch;
}
.chapter > p:first-of-type {
  position: relative;
}

/* Problem chapter */
.pain-list {
  list-style: none;
  margin-top: 22px;
  display: grid;
  gap: 12px;
  max-width: 68ch;
}
.pain-list li {
  padding-left: 18px;
  position: relative;
  font-size: 1rem;
}
.pain-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.46em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--chip, var(--accent));
}
.research-note {
  margin-top: 22px;
  font-size: 0.95rem;
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding-left: 16px;
  max-width: 62ch;
}

/* Pull quote band */
.pull-quote {
  margin: 34px 0 8px;
  padding: clamp(26px, 4vw, 42px) clamp(24px, 4vw, 44px);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--c-bg, var(--surface)) 38%, var(--bg));
  border: 1px solid var(--line-soft);
}
.pull-quote p {
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.32;
  max-width: 30ch;
  position: relative;
  padding-left: 0.9em;
}
.pull-quote p::before {
  content: "\201C";
  position: absolute;
  left: 0;
  top: -0.05em;
  color: var(--chip, var(--accent));
  font-size: 1.5em;
  font-weight: 900;
  line-height: 1;
}

/* Figures */
.case-fig figcaption {
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
}
.case-fig[data-frame="light"] {
  background: #f4f3ef;
}
.fig-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2.5vw, 28px);
  align-items: start;
}
.fig-duo .case-fig {
  margin-top: 24px;
}

/* Validation chapter */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 22px;
  max-width: 720px;
}
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 700;
}
html.js .pill {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease) calc(var(--i, 0) * 70ms),
    transform 0.5s var(--ease) calc(var(--i, 0) * 70ms);
}
html.js .chapter.in .pill {
  opacity: 1;
  transform: none;
}
.changed-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
  max-width: 68ch;
}
.changed-list li {
  padding-left: 26px;
  position: relative;
  font-size: 1rem;
}
.changed-list li::before {
  content: "\21B3";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--chip, var(--accent));
  font-weight: 900;
}
.limit-line {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 62ch;
}

/* Appendix */
.appendix {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}
.appendix summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.appendix summary::-webkit-details-marker {
  display: none;
}
.appendix summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--muted);
  transition: transform 0.3s var(--ease);
}
.appendix[open] summary::after {
  transform: rotate(45deg);
}
.appendix > p {
  padding: 0 24px;
  max-width: 68ch;
  color: var(--muted);
  font-size: 0.98rem;
}
.appendix .case-fig {
  margin: 24px;
}
.appendix .case-fig:last-child {
  margin-bottom: 28px;
}

/* Exit */
.all-link {
  padding-block: 8px clamp(40px, 7vh, 64px);
}
.all-link a {
  font-weight: 700;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.all-link a:hover {
  color: var(--ink);
}
.next-band {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--c-bg);
  color: var(--c-ink);
  padding-block: clamp(52px, 9vh, 96px);
}
.next-band .case-ghost {
  position: absolute;
  right: -0.06em;
  top: -0.14em;
  font-size: clamp(5rem, 15vw, 12rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  opacity: 0.1;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  transition: transform 0.6s var(--ease);
}
.next-band:hover .case-ghost {
  transform: translateX(-14px);
}
.next-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.next-band .n-label {
  font-size: 0.92rem;
  font-weight: 700;
  opacity: 0.65;
}
.next-band .n-name {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  transition: transform 0.4s var(--ease);
}
.next-band:hover .n-name {
  transform: translateX(10px);
}

/* Reduced motion & mobile for case pages */
@media (prefers-reduced-motion: reduce) {
  .pill {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .progress,
  .next-band .case-ghost,
  .next-band .n-name {
    transition: none;
  }
}
@media (max-width: 860px) {
  .glance-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .glance-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .fig-duo {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .chapter .ch-num {
    font-size: 4rem;
    top: -0.5em;
  }
  .appendix .case-fig {
    margin: 16px;
  }
}


/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  transition: top 0.2s var(--ease);
}
.skip-link:focus-visible {
  top: 12px;
}
