/* ═══════════════════════════════════════════════════════════════
   CASE-04 — Fior (Drinking Water Compliance)
   Case-specific styles. Base tokens live in case-study.css.
   ═══════════════════════════════════════════════════════════════ */

    /* Base case study tokens → case-study.css (no case-04-specific tokens needed).
       Accent inherits from DS (--accent: #00E87A from global.css). */
    .case-study {
      position: relative;
      z-index: 1;
    }

    /* ═══ BACK LINK ═══
       nav is sticky; no need to offset by its height (caused ~80px of empty space on mobile). */
    .back-link {
      max-width: var(--cs-content-max); margin: 0 auto;
      padding: 1.25rem var(--cs-gutter) 0;
      font-family: var(--f-mono); font-size: 0.68rem;
      letter-spacing: 0.18em; text-transform: uppercase;
    }
    .back-link a { color: var(--accent-on-light); text-decoration: none; transition: color 0.2s; }
    .back-link a:hover { color: var(--ink); }

    /* ═══ HERO ═══ */
    .cs-hero {
      display: grid;
      grid-template-columns: 55fr 45fr;
      gap: 5rem;
      align-items: start;
      padding: 2.5rem var(--cs-gutter) var(--cs-section-gap);
      max-width: var(--cs-content-max); margin: 0 auto;
      position: relative; overflow: hidden;
    }
    .cs-hero-content { display: flex; flex-direction: column; position: relative; z-index: 1; }

    .cs-hero-number {
      font-family: var(--f-mono); font-size: 0.68rem; color: var(--accent-on-light);
      letter-spacing: 0.18em; text-transform: uppercase;
      margin-bottom: var(--cs-element-gap);
      opacity: 0; animation: slideUp 0.8s var(--ease) 0.1s forwards;
    }
    .cs-hero-title {
      font-family: var(--f-display); font-size: clamp(2rem, 3.5vw, 3.5rem);
      font-weight: 700; line-height: 1.05;
      margin-bottom: 0.75rem; letter-spacing: 0.05em;
      text-transform: uppercase;
      opacity: 0; animation: slideUp 0.8s var(--ease) 0.2s forwards;
    }
    .cs-hero-etymology {
      font-family: var(--f-mono);
      font-size: 0.78rem;
      font-style: italic;
      letter-spacing: 0.22em;
      color: var(--accent-on-light);
      margin-bottom: var(--cs-inner-gap);
      opacity: 0; animation: slideUp 0.8s var(--ease) 0.25s forwards;
    }
    .cs-tags {
      display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: var(--cs-inner-gap);
      opacity: 0; animation: slideUp 0.8s var(--ease) 0.3s forwards;
    }
    .cs-tag {
      font-family: var(--f-mono); font-size: 0.62rem; padding: 0.5rem 1rem;
      border: 1px solid var(--ink); border-radius: 0;
      text-transform: uppercase; letter-spacing: 0.18em; transition: all 0.3s var(--ease);
    }
    .cs-tag:hover { background: var(--ink); color: var(--bg); }
    .cs-hero-description {
      font-family: var(--f-body); font-size: 1rem; line-height: 1.8;
      font-weight: 300;
      margin-bottom: var(--cs-inner-gap); max-width: 640px;
      opacity: 0; animation: slideUp 0.8s var(--ease) 0.4s forwards;
    }
    .cs-hero-description strong { color: var(--ink); font-weight: 500; }
    .cs-hero-description em { color: var(--ink); font-style: normal; font-weight: 700; }

    .cs-hero-meta {
      display: grid; grid-template-columns: repeat(4, auto);
      justify-content: start;
      gap: 0.5rem 2.5rem;
      opacity: 0; animation: slideUp 0.8s var(--ease) 0.5s forwards;
    }
    .cs-meta-item { font-family: var(--f-mono); }
    .cs-meta-label {
      color: var(--accent-on-light); text-transform: uppercase; letter-spacing: 0.18em;
      font-size: 0.58rem; margin-bottom: 0.35rem; display: block;
    }
    .cs-meta-value {
      color: var(--ink); font-size: 0.75rem; letter-spacing: 0.05em;
      white-space: nowrap;
    }

    /* ═══ HERO VISUAL · ANIMATED DEVICE ═══ */
    .cs-hero-visual {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      gap: 1rem;
      z-index: 1;
      padding-top: 0.5rem;
    }
    .fior-device {
      position: relative;
      width: min(260px, 100%);
      aspect-ratio: 9 / 19.5;
      border-radius: 42px;
      background: #0a0a0a;
      padding: 10px;
      box-shadow:
        0 0 0 2px #1a1a1a,
        0 30px 60px -20px rgba(0, 0, 0, 0.3),
        0 0 80px -10px rgba(0, 232, 122, 0.15);
      overflow: hidden;
    }
    .fior-device::before {
      content: '';
      position: absolute;
      top: 10px; left: 50%;
      transform: translateX(-50%);
      width: 82px; height: 24px;
      background: #000;
      border-radius: 16px;
      z-index: 10;
    }
    /* Fior internal palette (per Project Bible — true product colours) */
    .fior-screen {
      --f-blue:    #2B8FD9;
      --f-primary: #1A70B4;
      --f-teal:    #1FC8C8;
      --f-green:   #1AC863;
      --f-yellow:  #FFB200;
      --f-ink:     #0D1E2E;
      --f-bg:      #F4F6F8;

      width: 100%; height: 100%;
      background: var(--f-bg);
      border-radius: 32px;
      padding: 32px 10px 10px;
      color: var(--f-ink);
      display: flex;
      flex-direction: column;
      gap: 8px;
      overflow: hidden;
    }
    .fior-statusbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-family: var(--f-mono);
      font-size: 8.5px;
      font-weight: 500;
      color: var(--f-ink);
      padding: 0 4px;
    }
    .fior-icons {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .fior-icons svg { display: block; }

    /* Header — avatar + greeting */
    .fior-header {
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 0 2px;
    }
    .fior-avatar {
      width: 22px; height: 22px;
      border-radius: 50%;
      background: var(--f-blue);
      color: #fff;
      font-family: var(--f-display);
      font-size: 10px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .fior-user h2 {
      font-family: var(--f-display);
      font-size: 10px;
      font-weight: 700;
      margin: 0;
      color: var(--f-ink);
      line-height: 1.2;
    }
    .fior-user p {
      font-family: var(--f-body);
      font-size: 7.5px;
      color: #6B7C90;
      margin: 1px 0 0;
      line-height: 1.2;
    }

    /* Score card — gradient */
    .fior-score-card {
      position: relative;
      background: linear-gradient(135deg, var(--f-primary) 0%, var(--f-teal) 100%);
      border-radius: 12px;
      padding: 10px 10px 14px;
      color: #fff;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 6px;
      align-items: center;
      overflow: hidden;
    }
    .fior-score-info { display: flex; flex-direction: column; gap: 1px; }
    .fior-score-label {
      font-family: var(--f-mono);
      font-size: 6.5px;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      opacity: 0.85;
    }
    .fior-score-verdict {
      font-family: var(--f-display);
      font-size: 16px;
      font-weight: 700;
      margin: 0;
      line-height: 1;
    }
    .fior-score-meta {
      font-family: var(--f-body);
      font-size: 7px;
      opacity: 0.85;
      margin: 2px 0 0;
    }
    .fior-score-ring {
      width: 38px; height: 38px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.18);
      border: 1.5px solid rgba(255, 255, 255, 0.4);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      transform-origin: center;
    }
    .fior-score-value {
      font-family: var(--f-display);
      font-size: 14px;
      font-weight: 700;
      line-height: 1;
      color: #fff;
    }
    .fior-score-max {
      font-family: var(--f-mono);
      font-size: 6px;
      opacity: 0.8;
      margin-top: 1px;
    }
    .fior-score-progress {
      grid-column: 1 / -1;
      height: 2px;
      background: rgba(255, 255, 255, 0.25);
      border-radius: 999px;
      overflow: hidden;
      margin-top: 2px;
    }
    .fior-score-progress span {
      display: block;
      width: 76%;
      height: 100%;
      background: #fff;
      border-radius: 999px;
    }

    /* CTA — gradient + drop icon */
    .fior-cta {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      width: 100%;
      padding: 8px 12px;
      background: linear-gradient(135deg, var(--f-blue) 0%, var(--f-primary) 100%);
      color: #fff;
      border: 0;
      border-radius: 12px;
      font-family: var(--f-display);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.02em;
      cursor: pointer;
      box-shadow: 0 4px 12px -4px rgba(26, 112, 180, 0.35);
    }
    .fior-cta svg { width: 12px; height: 12px; display: block; }

    /* Section header */
    .fior-section-header {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      padding: 2px 2px 0;
    }
    .fior-section-title {
      font-family: var(--f-display);
      font-size: 10px;
      font-weight: 700;
      color: var(--f-ink);
    }
    .fior-section-link {
      font-family: var(--f-mono);
      font-size: 7px;
      color: var(--f-blue);
      letter-spacing: 0.05em;
    }

    /* Parameters grid 2x2 — stretches to fill remaining space */
    .fior-params-grid {
      flex: 1;
      min-height: 0;
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 5px;
    }
    .fior-param-card {
      background: #fff;
      border-radius: 9px;
      padding: 9px 9px 10px;
      box-shadow: 0 2px 8px -4px rgba(13, 30, 46, 0.08);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 6px;
      transform-origin: center;
    }
    .fior-param-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 4px;
    }
    .fior-param-label {
      font-family: var(--f-mono);
      font-size: 7px;
      color: #6B7C90;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }
    .fior-param-chip {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 2px 5px;
      border-radius: 999px;
      font-family: var(--f-display);
      font-size: 6.5px;
      font-weight: 700;
      letter-spacing: 0.02em;
      white-space: nowrap;
    }
    .fior-param-chip::before {
      content: '';
      width: 4px; height: 4px;
      border-radius: 50%;
      background: currentColor;
      flex-shrink: 0;
    }
    .fior-param-chip.is-good      { background: rgba(43, 143, 217, 0.14); color: var(--f-primary); }
    .fior-param-chip.is-excellent { background: rgba(26, 200, 99, 0.14);  color: #128046; }
    .fior-param-chip.is-medium    { background: rgba(255, 178, 0, 0.18);  color: #8A5F00; }
    .fior-param-value {
      font-family: var(--f-display);
      font-size: 13px;
      font-weight: 700;
      color: var(--f-ink);
      line-height: 1;
    }
    .fior-param-value span {
      font-family: var(--f-mono);
      font-size: 6.5px;
      color: #6B7C90;
      font-weight: 500;
      margin-left: 1px;
    }

    /* Alert banner */
    .fior-alert {
      display: flex;
      align-items: center;
      gap: 7px;
      background: #FFF6E0;
      border-radius: 9px;
      padding: 7px 9px;
    }
    .fior-alert-dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: var(--f-yellow);
      flex-shrink: 0;
    }
    .fior-alert-text {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 1px;
      min-width: 0;
    }
    .fior-alert-text strong {
      font-family: var(--f-display);
      font-size: 8px;
      font-weight: 700;
      color: #5C4200;
    }
    .fior-alert-text span {
      font-family: var(--f-body);
      font-size: 6.5px;
      color: #8A6C2D;
      line-height: 1.2;
    }
    .fior-alert svg {
      width: 10px; height: 10px;
      color: #8A6C2D;
      flex-shrink: 0;
    }

    /* Bottom nav — iOS-style tab bar */
    .fior-nav {
      margin-top: auto;
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      padding: 8px 6px 10px;
      background: #fff;
      border-top: 1px solid rgba(13, 30, 46, 0.06);
      border-radius: 12px;
      gap: 2px;
      position: relative;
    }
    .fior-nav::after {
      content: '';
      position: absolute;
      left: 50%; bottom: 3px;
      transform: translateX(-50%);
      width: 60px; height: 3px;
      border-radius: 999px;
      background: rgba(13, 30, 46, 0.35);
    }
    .fior-nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1px;
      padding-bottom: 6px;
      font-family: var(--f-mono);
      font-size: 6.5px;
      letter-spacing: 0.05em;
      color: #6B7C90;
    }
    .fior-nav-item svg {
      display: block;
      width: 14px; height: 14px;
      stroke-width: 1.6;
      fill: none;
    }
    .fior-nav-item.is-active { color: var(--f-blue); }
    .cs-hero-caption {
      width: min(260px, 100%);
      text-align: center;
      font-family: var(--f-mono);
      font-size: 0.62rem;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      color: var(--ink-soft, #666);
      opacity: 0.7;
    }

    @keyframes slideUp {
      from { opacity: 0; transform: translateY(30px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* ═══ SECTIONS ═══ */
    .cs-section {
      max-width: var(--cs-content-max); margin: 0 auto;
      padding: var(--cs-section-gap) var(--cs-gutter);
      position: relative;
    }
    .cs-section-label {
      position: absolute; left: 16px; top: 50%;
      translate: 0 -50%;
      font-family: var(--f-mono); font-size: 0.58rem;
      text-transform: uppercase; letter-spacing: 0.22em; color: var(--ink-dim);
      writing-mode: vertical-rl; transform: rotate(180deg);
      pointer-events: none;
    }

    /* overview Challenge/Solution/Impact — uses shared .overview from case-study.css (dark cards) */
    /* .overview-item p color comes from case-study.css default (var(--ink-on-dark)) */
    .case-study .overview-item p strong { color: var(--bg); font-weight: 500; }
    .case-study .overview-item p em { color: var(--bg); font-style: normal; font-weight: 700; letter-spacing: 0.02em; }

    /* Inline EPA source links inside Overview cards (dark bg) */
    .case-study .overview-item a.src-link {
      color: var(--accent);
      text-decoration: none;
      border-bottom: 1px dotted rgba(0, 232, 122, 0.4);
      padding-bottom: 1px;
      transition: border-color 0.25s, color 0.25s;
    }
    .case-study .overview-item a.src-link:hover {
      color: #ffffff;
      border-bottom-color: var(--accent);
    }

    /* ═══ PASS C · DEEP DIVE (pattern from case-03), INTRO, CALLOUT, HMW, DIRECTIONS, ASCII ═══ */

    /* Section title/intro — align with .deep-dive 3rem padding */
    .cs-section-title {
      font-family: var(--f-display); font-size: 2rem; font-weight: 700;
      margin-bottom: 0.5rem; padding-left: 3rem;
      letter-spacing: 0.03em;
    }
    .cs-section-intro {
      font-family: var(--f-body); font-size: 1rem; line-height: 1.8;
      color: var(--ink-mid); margin-bottom: var(--cs-inner-gap);
      padding-left: 3rem; padding-right: 3rem; font-weight: 300;
      max-width: 900px;
    }
    /* Modifier: flush-left header — used when section content (e.g. cards) starts at section's left edge */
    .cs-section.is-flush .cs-section-title,
    .cs-section.is-flush .cs-section-intro {
      padding-left: 0;
      padding-right: 0;
    }
    .cs-section-intro p { margin: 0 0 1rem; }
    .cs-section-intro p:last-child { margin-bottom: 0; }
    .cs-section-intro strong { color: var(--ink); font-weight: 500; }
    .cs-section-intro em { color: var(--ink); font-style: normal; font-weight: 700; }

    /* Pre-process evidence callout — same padding-left as deep-dive blocks */
    .cs-section .callout.evidence-callout {
      margin-left: 3rem;
      margin-right: 3rem;
      margin-bottom: var(--cs-section-gap);
    }

    /* Deep Dive — copied verbatim from case-03 pattern */
    .deep-dive {
      display: grid;
      grid-template-columns: 200px 1fr;
      gap: var(--cs-inner-gap);
      margin-bottom: var(--cs-inner-gap);
      align-items: start;
      padding-left: 3rem;
    }
    .deep-dive-phase {
      font-family: var(--f-mono);
      font-size: 0.65rem;
      color: var(--accent-on-light);
      letter-spacing: 0.22em;
      text-transform: uppercase;
    }
    .deep-dive-number {
      font-family: var(--f-display);
      font-size: 3rem;
      font-weight: 700;
      color: var(--accent-on-light);
      line-height: 1;
      margin-top: 0.5rem;
    }
    .deep-dive-title {
      font-family: var(--f-display);
      font-size: 1.5rem;
      font-weight: 600;
      margin-bottom: 0.5rem;
      letter-spacing: 0.03em;
      text-transform: uppercase;
      color: var(--ink);
    }
    .deep-dive-law {
      font-family: var(--f-mono);
      font-size: 0.65rem;
      color: var(--ink-mid);
      letter-spacing: 0.22em;
      text-transform: uppercase;
      margin-bottom: 1rem;
    }
    .deep-dive-body p {
      font-family: var(--f-body);
      font-size: 0.95rem;
      line-height: 1.8;
      margin: 0 0 var(--cs-element-gap);
      font-weight: 300;
      color: var(--ink-mid);
    }
    .deep-dive-body p strong { color: var(--ink); font-weight: 500; }
    .deep-dive-body p em { color: var(--ink); font-style: normal; font-weight: 700; }
    .deep-dive-body ul.arrow-list {
      list-style: none; margin: 0 0 var(--cs-element-gap); padding: 0;
    }
    .deep-dive-body ul.arrow-list li {
      font-family: var(--f-body);
      font-size: 0.95rem; line-height: 1.8; padding-left: 1.5rem;
      position: relative; margin-bottom: 0.5rem;
      color: var(--ink-mid); font-weight: 300;
    }
    .deep-dive-body ul.arrow-list li::before {
      content: '\2192'; position: absolute; left: 0;
      color: var(--accent-on-light); font-family: var(--f-mono);
    }
    .deep-dive-body ul.arrow-list li strong { color: var(--ink); font-weight: 500; }

    /* Callout — dark card with accent left border (pattern from case-01/03) */
    .callout {
      background: var(--dark); color: var(--bg);
      padding: var(--cs-inner-gap); margin: var(--cs-element-gap) 0;
      border-left: 3px solid var(--accent);
    }
    .callout-label {
      font-family: var(--f-mono); font-size: 0.7rem;
      text-transform: uppercase; letter-spacing: 0.18em;
      color: var(--accent); margin-bottom: 0.75rem; display: block;
    }
    .callout p {
      font-size: 0.95rem; line-height: 1.8;
      color: var(--bg); font-weight: 300;
      margin: 0 0 0.6rem;
    }
    .callout p:last-child { margin-bottom: 0; }
    .callout p strong { color: var(--accent); font-weight: 600; }
    .callout p em { color: var(--bg); font-style: italic; }
    .callout ul { margin: 0.4rem 0 0.6rem; padding-left: 1.1rem; }
    .callout li {
      font-size: 0.92rem; line-height: 1.7;
      color: var(--bg); font-weight: 300;
      margin-bottom: 0.45rem;
    }
    .callout li strong { color: var(--accent); font-weight: 600; }
    .callout a {
      color: var(--accent); text-decoration: none;
      border-bottom: 1px dotted rgba(0, 232, 122, 0.45);
      transition: border-color 0.2s, color 0.2s;
    }
    .callout a:hover { border-bottom-color: var(--accent); color: #ffffff; }

    /* How Might We — 8-item grid */
    .hmw-grid {
      list-style: none; padding: 0;
      display: grid; grid-template-columns: repeat(2, 1fr);
      gap: 0.75rem 1.5rem;
      margin: var(--cs-element-gap) 0;
    }
    .hmw-grid li {
      font-family: var(--f-mono);
      font-size: 0.82rem; line-height: 1.65;
      padding: 0.85rem 1rem;
      border-left: 2px solid rgba(8, 8, 8, 0.18);
      color: var(--ink-mid);
      transition: border-color 0.25s var(--ease), color 0.25s var(--ease), background 0.25s var(--ease);
    }
    .hmw-grid li:hover {
      border-left-color: var(--accent);
      color: var(--ink);
      background: rgba(0, 232, 122, 0.08);
    }
    .hmw-grid li strong {
      display: block;
      font-size: 0.62rem; letter-spacing: 0.22em;
      text-transform: uppercase;
      color: var(--accent);
      margin-bottom: 0.35rem;
      font-weight: 600;
    }

    /* Product directions — 4 options with one selected */
    .direction-list {
      list-style: none; padding: 0;
      margin: var(--cs-element-gap) 0;
      display: grid; gap: 0.6rem;
    }
    .direction-list li {
      display: grid;
      grid-template-columns: 48px 1fr auto;
      align-items: center; gap: 1rem;
      padding: 0.9rem 1.1rem;
      border: 1px solid rgba(8, 8, 8, 0.15);
      font-family: var(--f-mono);
      font-size: 0.88rem;
      color: var(--ink-mid);
      transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
    }
    .direction-list li:not(.is-selected):hover {
      border-color: var(--ink);
      color: var(--ink);
    }
    .direction-list .dir-num {
      font-size: 0.7rem; letter-spacing: 0.22em;
      color: rgba(8, 8, 8, 0.35);
      text-transform: uppercase;
    }
    .direction-list .dir-tag {
      font-size: 0.6rem; letter-spacing: 0.22em;
      text-transform: uppercase;
      color: rgba(8, 8, 8, 0.4);
      white-space: nowrap;
    }
    .direction-list li.is-selected {
      background: rgba(0, 232, 122, 0.08);
      border-color: var(--accent);
      color: var(--ink);
    }
    .direction-list li.is-selected .dir-num { color: var(--accent); }
    .direction-list li.is-selected .dir-tag {
      color: var(--accent);
      font-weight: 700;
    }
    .direction-list li strong { color: var(--ink); font-weight: 600; }

    /* ASCII wireframe sketch
       — background-attachment: local on the fade-gradient layers makes them
         stick to the visible edges as the user scrolls, acting as a native
         scroll affordance (Lea Verou pattern). Fade visible only when content
         overflows; disappears when reaching the end of scroll. */
    .wireframe-sketch {
      background:
        /* solid bg */
        linear-gradient(var(--dark), var(--dark)),
        /* shadow fade-right → means "more content to the right" */
        linear-gradient(to right, transparent, var(--dark) 60%) right / 48px 100% no-repeat,
        /* shadow fade-left → means "more content to the left" (after scrolling) */
        linear-gradient(to left,  transparent, var(--dark) 60%) left  / 48px 100% no-repeat;
      background-attachment: local, scroll, scroll;
      color: var(--bg);
      font-family: var(--f-mono);
      font-size: 0.72rem; line-height: 1.5;
      padding: 1.5rem;
      margin: var(--cs-element-gap) 0 0.4rem;
      white-space: pre; overflow-x: auto;
      border-left: 3px solid var(--accent);
      /* Touch scroll affordance — explicit pan-x avoids gesture conflicts with
         the vertical page scroll, so the user can drag horizontally with a finger.
         -webkit-overflow-scrolling for momentum on older iOS. */
      touch-action: pan-x;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-x: contain;
    }
    .wireframe-hint {
      display: none; /* desktop: not needed */
      font-family: var(--f-mono); font-size: 0.7rem;
      letter-spacing: 0.22em; text-transform: uppercase;
      color: var(--accent);
      margin: 0.55rem 0 0.9rem;
      /* Subtle pulse so the user notices the affordance.
         Pure opacity oscillation — no layout shift, no motion sickness. */
      animation: wireframe-hint-pulse 2.4s ease-in-out infinite;
    }
    @keyframes wireframe-hint-pulse {
      0%, 100% { opacity: 0.55; }
      50%      { opacity: 1;    }
    }
    @media (prefers-reduced-motion: reduce) {
      .wireframe-hint { animation: none; opacity: 1; }
    }
    .wireframe-caption {
      display: block;
      font-family: var(--f-mono);
      font-size: 0.66rem; letter-spacing: 0.22em;
      text-transform: uppercase;
      color: var(--ink-mid);
      margin-bottom: var(--cs-element-gap);
    }

    /* Pass C responsive */
    @media (max-width: 1024px) {
      .hmw-grid { grid-template-columns: 1fr; }
    }
    @media (max-width: 768px) {
      .direction-list li {
        grid-template-columns: 40px 1fr;
        row-gap: 0.3rem;
      }
      .direction-list li .dir-tag {
        grid-column: 1 / -1;
        padding-left: 40px;
      }
      .wireframe-sketch { font-size: 0.6rem; padding: 1rem; }
      .wireframe-hint   { display: block; }
    }
    @media (max-width: 480px) {
      .wireframe-sketch { font-size: 0.5rem; padding: 0.8rem; }
    }

    /* ═══ PASS D · TOKEN FLOW, VERDICT LADDER, DS SHOWCASE ═══ */

    /* Token flow — primitive → semantic → component cascade visual */
    .token-flow {
      display: grid;
      grid-template-columns: 1fr auto 1fr auto 1fr;
      gap: 1rem;
      align-items: stretch;
      margin: var(--cs-element-gap) 0;
      font-family: var(--f-mono);
    }
    .token-layer {
      background: var(--dark);
      color: var(--bg);
      padding: 1rem 1.1rem;
      border-left: 3px solid var(--accent);
      display: flex; flex-direction: column; gap: 0.4rem;
    }
    .token-layer-label {
      font-size: 0.58rem; letter-spacing: 0.22em;
      text-transform: uppercase;
      color: var(--accent); font-weight: 600;
    }
    .token-layer-name {
      font-size: 0.85rem;
      color: var(--bg); font-weight: 500;
    }
    .token-layer-value {
      font-size: 0.7rem;
      color: rgba(240, 237, 232, 0.55);
      line-height: 1.5;
    }
    .token-arrow {
      display: flex; align-items: center; justify-content: center;
      font-family: var(--f-mono);
      font-size: 1.2rem;
      color: var(--accent);
    }

    /* Verdict Ladder — 4-chip live component */
    .verdict-ladder {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 1rem;
      margin: var(--cs-element-gap) 0;
    }
    .verdict-chip {
      display: flex; flex-direction: column; gap: 0.5rem;
      padding: 1.25rem 1rem;
      border-radius: 8px;
      color: #ffffff;
      position: relative;
      overflow: hidden;
      min-height: 140px;
      justify-content: space-between;
    }
    .verdict-chip::before {
      content: '';
      position: absolute;
      top: 0; right: 0; width: 72px; height: 72px;
      background: rgba(255, 255, 255, 0.12);
      border-radius: 50%;
      transform: translate(28px, -28px);
      pointer-events: none;
    }
    .verdict-chip .v-dot {
      display: inline-block;
      width: 10px; height: 10px; border-radius: 50%;
      background: rgba(255, 255, 255, 0.9);
      margin-right: 0.5rem;
    }
    .verdict-chip .v-label {
      font-family: var(--f-mono); font-size: 0.6rem;
      letter-spacing: 0.2em; text-transform: uppercase;
      color: rgba(255, 255, 255, 0.7);
      display: flex; align-items: center;
    }
    .verdict-chip .v-state {
      font-family: var(--f-display);
      font-size: 1.4rem; font-weight: 700;
      letter-spacing: 0.02em;
      line-height: 1;
    }
    .verdict-chip .v-hex {
      font-family: var(--f-mono); font-size: 0.62rem;
      color: rgba(255, 255, 255, 0.7);
      letter-spacing: 0.12em;
    }
    .verdict-chip.v-excellent { background: #1AC863; }
    .verdict-chip.v-good      { background: #2B8FD9; }
    .verdict-chip.v-medium    { background: #FFB200; color: #1A1200; }
    .verdict-chip.v-medium .v-label,
    .verdict-chip.v-medium .v-hex { color: rgba(26, 18, 0, 0.65); }
    .verdict-chip.v-medium .v-dot { background: rgba(26, 18, 0, 0.7); }
    .verdict-chip.v-medium::before { background: rgba(26, 18, 0, 0.08); }
    .verdict-chip.v-bad       { background: #F43535; }

    /* Stat row — small metric badges under the ladder */
    .ds-stats {
      display: grid; grid-template-columns: repeat(3, 1fr);
      gap: 1rem;
      margin: var(--cs-element-gap) 0;
    }
    .ds-stat {
      padding: 1rem 1.1rem;
      border-left: 2px solid var(--accent);
      background: rgba(0, 232, 122, 0.04);
    }
    .ds-stat-value {
      font-family: var(--f-display);
      font-size: 1.6rem; font-weight: 700;
      color: var(--ink);
      letter-spacing: 0.02em;
      line-height: 1;
    }
    .ds-stat-label {
      font-family: var(--f-mono); font-size: 0.62rem;
      letter-spacing: 0.2em; text-transform: uppercase;
      color: var(--ink-mid);
      margin-top: 0.5rem;
    }

    /* DS showcase — dark full-bleed panel (matches case-03 .scale-panel pattern exactly) */
    .ds-showcase {
      background: var(--dark); color: var(--bg);
      margin: 0;
      /* Generous vertical padding — dark sections need breathing room around the colour-shift transition */
      padding: calc(var(--cs-section-gap) * 2) var(--cs-gutter);
    }
    .ds-showcase-inner { max-width: var(--cs-content-max); margin: 0 auto; }
    .ds-showcase-label {
      font-family: var(--f-mono); font-size: 0.65rem;
      color: var(--accent);
      letter-spacing: 0.22em; text-transform: uppercase;
      margin-bottom: 0.75rem;
    }
    .ds-showcase-title {
      font-family: var(--f-display);
      font-size: clamp(1.6rem, 2.6vw, 2.2rem);
      font-weight: 700; color: var(--bg);
      margin-bottom: 0.5rem;
      letter-spacing: 0.02em;
    }
    .ds-showcase-subtitle {
      font-family: var(--f-body); font-size: 0.95rem;
      line-height: 1.8; color: rgba(240, 237, 232, 0.6);
      margin-bottom: var(--cs-section-gap);
      max-width: 720px; font-weight: 300;
    }
    .ds-group {
      margin-bottom: var(--cs-section-gap);
    }
    .ds-group:last-child { margin-bottom: 0; }
    .ds-group-title {
      font-family: var(--f-mono);
      font-size: 0.65rem; letter-spacing: 0.22em;
      text-transform: uppercase;
      color: var(--accent);
      margin-bottom: 1.25rem;
    }

    /* 8 colour ramps — show primary swatch of each */
    .ds-ramp-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 1rem;
    }
    .ds-ramp-card {
      background: rgba(240, 237, 232, 0.03);
      border: 1px solid rgba(240, 237, 232, 0.08);
      overflow: hidden;
      display: flex; flex-direction: column;
    }
    .ds-ramp-swatch {
      height: 88px;
      display: flex; align-items: flex-end;
      padding: 0.5rem 0.75rem;
      font-family: var(--f-mono); font-size: 0.58rem;
      letter-spacing: 0.18em; text-transform: uppercase;
      color: rgba(255, 255, 255, 0.85);
    }
    .ds-ramp-info {
      padding: 0.75rem 0.9rem;
    }
    .ds-ramp-name {
      font-family: var(--f-mono);
      font-size: 0.7rem;
      color: var(--bg);
      letter-spacing: 0.1em;
      margin-bottom: 0.3rem;
    }
    .ds-ramp-use {
      font-family: var(--f-body); font-size: 0.75rem;
      line-height: 1.5; color: rgba(240, 237, 232, 0.55);
      font-weight: 300;
    }

    /* Typography scale samples */
    .ds-type-scale {
      display: flex; flex-direction: column; gap: 1.1rem;
    }
    .ds-type-row {
      display: grid;
      grid-template-columns: 150px 1fr auto;
      gap: 1.5rem; align-items: baseline;
      padding-bottom: 0.9rem;
      border-bottom: 1px solid rgba(240, 237, 232, 0.08);
    }
    .ds-type-row:last-child { border-bottom: none; padding-bottom: 0; }
    .ds-type-meta {
      font-family: var(--f-mono); font-size: 0.6rem;
      letter-spacing: 0.18em; text-transform: uppercase;
      color: rgba(240, 237, 232, 0.55);
    }
    .ds-type-sample {
      font-family: 'Nunito', 'Inter', sans-serif;
      color: var(--bg);
      line-height: 1.1;
    }
    .ds-type-spec {
      font-family: var(--f-mono); font-size: 0.6rem;
      letter-spacing: 0.14em;
      color: var(--accent);
      white-space: nowrap;
    }
    .ds-type-sample.t-display { font-size: 2.4rem; font-weight: 700; }
    .ds-type-sample.t-h1      { font-size: 2rem;   font-weight: 700; }
    .ds-type-sample.t-h2      { font-size: 1.5rem; font-weight: 600; }
    .ds-type-sample.t-h3      { font-size: 1.25rem; font-weight: 600; }
    .ds-type-sample.t-body    { font-size: 1rem;   font-weight: 400; }
    .ds-type-sample.t-label   { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }

    /* Spacing scale — vertical bars */
    .ds-spacing-scale {
      display: flex; align-items: flex-end;
      gap: 1rem;
      padding-top: 0.5rem;
    }
    .ds-spacing-unit {
      display: flex; flex-direction: column; align-items: center;
      gap: 0.6rem;
      min-width: 42px;
    }
    .ds-spacing-bar {
      background: var(--accent);
      width: 100%;
      min-width: 24px;
    }
    .ds-spacing-val {
      font-family: var(--f-mono); font-size: 0.62rem;
      letter-spacing: 0.1em;
      color: rgba(240, 237, 232, 0.65);
    }

    /* Pass D responsive */
    @media (max-width: 1024px) {
      .token-flow { grid-template-columns: 1fr; gap: 0.5rem; }
      .token-arrow { transform: rotate(90deg); padding: 0.2rem 0; }
      .verdict-ladder { grid-template-columns: repeat(2, 1fr); }
      .ds-ramp-grid { grid-template-columns: repeat(2, 1fr); }
      .ds-stats { grid-template-columns: 1fr; }
    }
    @media (max-width: 768px) {
      .verdict-ladder { grid-template-columns: 1fr; }
      .ds-ramp-grid { grid-template-columns: repeat(2, 1fr); }
      .ds-type-row { grid-template-columns: 1fr; gap: 0.4rem; }
      .ds-type-sample.t-display { font-size: 1.8rem; }
      .ds-type-sample.t-h1 { font-size: 1.5rem; }
      .ds-spacing-scale { flex-wrap: wrap; }
    }

    /* ═══ DELIVERABLES · PASS E — CASE-04-SPECIFIC OVERRIDES ═══
       Base .deliverable-*, .btn-launch, .spec-pill, .media-frame, .classified-*
       live in case-study.css (shared with case-03 and any future case study).
       Below: only Fior-specific extensions (phone-mock, flow-mock, fior-*). */

    /* Phone-mock (Deliverable 01) */
    .phone-mock {
      position: absolute; inset: 0;
      display: flex; align-items: center; justify-content: center;
      background: var(--ink);
      overflow: hidden;
    }
    .phone-mock::before {
      content: '';
      position: absolute; inset: 0;
      background-image:
        linear-gradient(rgba(0, 232, 122, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 232, 122, 0.06) 1px, transparent 1px);
      background-size: 32px 32px;
      pointer-events: none;
    }
    .phone-mock-device {
      position: relative;
      /* Responsive width — clamp keeps the device within the .media-frame box
         on every viewport, preventing the bottom of the phone from being
         clipped by .media-frame's overflow: hidden on narrow screens. */
      width: clamp(110px, 32vw, 150px);
      aspect-ratio: 9 / 19;
      background: var(--ink-soft);
      border: 1px solid var(--accent);
      border-radius: 14px;
      padding: 10px 8px;
      display: flex; flex-direction: column;
      gap: 6px;
      box-shadow: 0 0 0 6px rgba(0, 232, 122, 0.1);
    }
    .phone-mock-notch {
      width: 40px; height: 6px;
      background: var(--accent);
      opacity: 0.4;
      border-radius: 3px;
      margin: 0 auto 4px;
    }
    .phone-mock-line {
      height: 6px;
      background: rgba(0, 232, 122, 0.22);
      border-radius: 2px;
    }
    .phone-mock-line.wide { height: 24px; background: rgba(0, 232, 122, 0.08); }
    .phone-mock-line.short { width: 60%; }
    .phone-mock-chip {
      align-self: flex-start;
      padding: 3px 8px;
      background: var(--accent);
      color: var(--ink);
      font-family: var(--f-mono); font-size: 0.5rem;
      letter-spacing: 0.15em;
      border-radius: 2px;
    }

    /* Flow-mock (Deliverable 02) */
    .flow-mock {
      position: absolute; inset: 0;
      background: var(--ink);
      display: grid;
      grid-template-columns: repeat(9, 1fr);
      align-items: center;
      padding: 0 8%;
      gap: 8px;
    }
    .flow-mock::before {
      content: '';
      position: absolute; top: 50%; left: 8%; right: 8%;
      height: 1px;
      background: linear-gradient(90deg,
        transparent,
        rgba(0, 232, 122, 0.4) 10%,
        rgba(0, 232, 122, 0.4) 90%,
        transparent);
      transform: translateY(-50%);
      z-index: 1;
    }
    .flow-dot {
      position: relative;
      z-index: 2;
      width: 14px; height: 14px;
      background: var(--accent);
      border-radius: 50%;
      justify-self: center;
      box-shadow: 0 0 0 4px rgba(0, 232, 122, 0.18);
    }
    .flow-dot.sm {
      width: 8px; height: 8px;
      background: transparent;
      border: 1px solid var(--accent);
      box-shadow: none;
    }
    .flow-label {
      position: absolute;
      top: 12px; left: 16px;
      font-family: var(--f-mono); font-size: 0.58rem;
      letter-spacing: 0.18em; text-transform: uppercase;
      color: rgba(0, 232, 122, 0.55);
      z-index: 3;
    }
    .flow-step-label {
      position: absolute;
      bottom: 16px; right: 16px;
      font-family: var(--f-mono); font-size: 0.55rem;
      letter-spacing: 0.15em;
      color: rgba(240, 237, 232, 0.35);
      z-index: 3;
    }

    /* Pass E responsive — case-04-specific media-frame override for phone mockups.
       (.deliverable-block stack + padding reset lives in case-study.css shared.) */
    @media (max-width: 1024px) {
      /* Phone mockup is vertical (9/19); default 16/10 media-frame is too short
         on mobile and clips the device. Use a taller aspect-ratio when the
         frame hosts a .phone-mock so the phone fits completely. */
      .media-frame:has(.phone-mock) { aspect-ratio: 4 / 5; }
    }

    /* ═══ RESPONSIVE ═══ */
    @media (max-width: 1023px) {
      .cs-hero { grid-template-columns: 55fr 45fr; gap: 3rem; }
      .fior-device { width: min(220px, 100%); }
    }
    /* ═══ MOBILE RESET — mirrors case-03 pattern: remove rotated vertical label
       and drop all 3rem left-paddings so content breathes on narrow viewports.
       (.deliverable-block padding reset is in the shared case-study.css.) ═══ */
    @media (max-width: 1024px) {
      .cs-section-label { display: none; }
      .cs-section-title  { padding-left: 0; padding-right: 0; }
      .cs-section-intro  { padding-left: 0; padding-right: 0; }
      .cs-section .callout.evidence-callout { margin-left: 0; margin-right: 0; }
      .deep-dive        { padding-left: 0; }
    }
    @media (max-width: 768px) {
      .cs-hero-meta { grid-template-columns: repeat(2, auto); gap: 1rem 2rem; }
      .cs-hero { padding: 2rem 1.25rem var(--cs-section-gap); grid-template-columns: 1fr; gap: 2rem; }
      .cs-hero-visual { order: 2; align-items: center; }
      .fior-device { width: 240px; }
      .cs-section { padding: var(--cs-section-gap) 1.25rem; }
      /* Deep-dive steps collapse to single column so STEP + number stack above the title */
      .deep-dive { grid-template-columns: 1fr; gap: 0.75rem; }
      /* Grid items default to min-width: auto (= min-content), which makes a long
         ASCII <pre> child expand the column instead of scrolling — forcing 0 here
         lets overflow-x: auto on .wireframe-sketch actually kick in. */
      .deep-dive > div { min-width: 0; }
      .deep-dive-body  { min-width: 0; }
      .wireframe-sketch { max-width: 100%; }
      .deep-dive-number { font-size: 2.5rem; margin-top: 0.25rem; }
      .deep-dive-title  { font-size: 1.25rem; letter-spacing: 0.02em; }
    }
