@font-face {
  font-family: "IRANSansX";
  src: url("../fonts/iran/iransansxv.woff") format("woff");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
      --deep:#123c3c;
      --deep-2:#0b302f;
      --teal:#11998e;
      --teal-readable:#08796f;
      --teal-soft:#7fcfc4;
      --paper:#f7faf9;
      --paper-2:#edf4f1;
      --ink:#173f3d;
      --muted:#536f6a;
      --lime:#d7ff63;
      --gold:#d6b878;
      --line-dark:rgba(222,245,239,.18);
      --line-light:rgba(23,63,61,.14);
      --shadow:0 24px 60px rgba(13,48,47,.13);
      --wrap:min(92vw,1440px);
      --stage-top:0px;
      --stage-height:100dvh;
      --mesh-opacity:1;
      --type-micro:12px;
      --type-meta:14px;
      --type-body:16px;
      --type-control:14px;
      --type-card-title:20px;
      --type-display:clamp(36px,3.75vw,60px);
    }

    html { scroll-behavior:auto; }
    *,*::before,*::after { box-sizing:border-box; }
    body {
      margin:0;
      min-width:320px;
      overflow-x:clip;
      color:var(--ink);
      background:var(--deep);
      font-family:"IRANSansX",Tahoma,Arial,sans-serif;
      -webkit-font-smoothing:antialiased;
    }
    a { color:inherit; text-decoration:none; }
    button,input { font:inherit; }
    ::selection { color:#fff; background:var(--teal); }

    #mesh-canvas {
      position:fixed;
      top:0;
      right:0;
      bottom:auto;
      left:0;
      z-index:2;
      width:100%;
      height:100dvh;
      display:block;
      pointer-events:none;
      opacity:0;
    }
    body.mesh-ready #mesh-canvas { opacity:var(--mesh-opacity); }
    .mesh-fallback {
      position:fixed;
      left:8vw;
      top:calc(var(--stage-top) + var(--stage-height) / 2);
      z-index:2;
      width:min(36vw,510px);
      aspect-ratio:1;
      display:none;
      border:1px solid rgba(17,153,142,.4);
      border-radius:50%;
      transform:translateY(-50%);
    }
    .mesh-fallback::before,.mesh-fallback::after {
      position:absolute;
      inset:14%;
      content:"";
      border:1px solid rgba(184,145,82,.38);
      border-radius:50%;
    }
    .mesh-fallback::after { inset:29%; border-color:rgba(17,153,142,.28); }

    .site-header {
      position:fixed;
      top:8px;
      right:50%;
      z-index:100;
      width:min(94vw,1540px);
      min-height:64px;
      padding:8px 18px 8px 22px;
      display:flex;
      direction:rtl;
      align-items:center;
      gap:20px;
      color:#244848;
      background:rgba(255,255,255,.95);
      border:1px solid #eaecf0;
      border-radius:54px;
      box-shadow:inset 0 0 12px 2px rgba(255,255,255,.1),0 8px 26px rgba(0,0,0,.08);
      transform:translateX(50%);
      backdrop-filter:blur(18px);
    }
    .brand {
      display:flex;
      align-items:center;
      gap:9px;
      flex:0 0 auto;
      font-size:22px;
      font-weight:900;
      letter-spacing:.08em;
    }
    .brand-mark {
      width:13px;
      height:13px;
      display:inline-block;
      border:3px solid var(--teal);
      border-radius:50%;
      box-shadow:inset 0 0 0 2px #fff,0 0 0 1px rgba(17,153,142,.18);
    }
    .main-nav { display:flex; align-items:center; gap:18px; font-size:var(--type-control); font-weight:700; }
    .main-nav a { opacity:.78; transition:opacity .2s,color .2s; }
    .main-nav a:hover { color:var(--teal); opacity:1; }
    .header-search {
      height:40px;
      min-width:260px;
      flex:1 1 420px;
      max-width:510px;
      margin-inline:auto;
      padding:0 17px;
      color:#55736e;
      background:#fbfdfc;
      border:1px solid #b5cbc7;
      border-radius:10px;
      outline:none;
      font-size:var(--type-control);
    }
    .header-search:focus { border-color:var(--teal); box-shadow:0 0 0 3px rgba(17,153,142,.1); }
    .header-actions { display:flex; align-items:center; gap:14px; flex:0 0 auto; font-size:var(--type-control); font-weight:800; }
    .join-button { padding:10px 17px; color:#fff; background:var(--teal-readable); border-radius:999px; white-space:nowrap; }
    .menu-button { display:none; border:0; border-radius:11px; color:var(--deep); background:var(--paper-2); }

    .chapter-progress {
      position:fixed;
      top:calc(var(--stage-top) + var(--stage-height) / 2);
      right:auto;
      left:20px;
      z-index:30;
      display:grid;
      gap:11px;
      direction:ltr;
      transform:translateY(-50%);
    }
    .chapter-progress button {
      width:44px;
      padding:0;
      display:flex;
      align-items:center;
      gap:7px;
      color:#86aaa4;
      background:transparent;
      border:0;
      cursor:pointer;
      font-size:var(--type-micro);
      font-weight:800;
    }
    .chapter-progress i { width:14px; height:1px; background:currentColor; transition:width .3s,color .3s; }
    .chapter-progress button.active { color:var(--lime); }
    .chapter-progress button.active i { width:29px; }
    .chapter--light + .chapter-progress button { color:var(--muted); }

    main { position:relative; }
    .chapter {
      min-height:150svh;
      position:relative;
      color:var(--chapter-ink);
      --chapter-bg:var(--deep);
      --chapter-ink:#f4f9f7;
      --chapter-muted:#b4d0ca;
      --chapter-line:var(--line-dark);
    }
    .chapter--light {
      --chapter-bg:var(--paper);
      --chapter-ink:var(--ink);
      --chapter-muted:var(--muted);
      --chapter-line:var(--line-light);
    }
    .chapter::before {
      position:absolute;
      inset:0;
      z-index:0;
      content:"";
      background:var(--chapter-bg);
    }
    .hero-chapter {
      min-height:100svh;
      isolation:isolate;
      --chapter-bg:#071f1f;
      --chapter-muted:#d2e1dd;
    }
    .hero-chapter::before {
      background:
        linear-gradient(90deg,rgba(4,24,24,.24),rgba(4,24,24,.5) 48%,rgba(4,24,24,.86)),
        linear-gradient(0deg,rgba(5,29,28,.76),transparent 48%),
        radial-gradient(ellipse at 20% 34%,rgba(183,145,82,.22),transparent 26%),
        repeating-linear-gradient(112deg,transparent 0 12vw,rgba(159,207,198,.035) 12.1vw 12.25vw);
    }
    .hero-chapter::after {
      position:absolute;
      inset:0;
      z-index:1;
      content:"";
      pointer-events:none;
      background:radial-gradient(circle at 19% 25%,rgba(215,255,99,.1),transparent 23%);
    }
    .hero-chapter .chapter__frame { z-index:3; }
    .hero-chapter .copy {
      padding:clamp(24px,3vw,48px);
      border:1px solid rgba(255,255,255,.12);
      border-radius:24px;
      background:rgba(5,34,33,.34);
      box-shadow:0 24px 70px rgba(0,0,0,.22);
      backdrop-filter:blur(12px);
    }
    .chapter__frame {
      position:sticky;
      top:var(--stage-top);
      z-index:3;
      width:var(--wrap);
      height:var(--stage-height);
      margin:auto;
      padding:clamp(34px,6vh,68px) 18px 36px;
      display:grid;
      grid-template-columns:repeat(12,minmax(0,1fr));
      grid-template-rows:1fr auto;
      column-gap:24px;
      align-items:center;
      direction:ltr;
    }
    .copy {
      z-index:4;
      max-width:560px;
      direction:rtl;
      text-align:right;
      opacity:.22;
      transform:translateY(22px);
      transition:opacity .5s ease,transform .65s cubic-bezier(.2,.7,.2,1);
    }
    .chapter.is-active .copy { opacity:1; transform:none; }
    .side-right { grid-column:8/13; justify-self:end; }
    .side-left { grid-column:1/6; justify-self:start; }
    .side-center { grid-column:4/10; max-width:750px; justify-self:center; text-align:center; }
    .kicker {
      margin:0 0 15px;
      display:flex;
      align-items:center;
      gap:10px;
      color:var(--teal-soft);
      font-size:var(--type-micro);
      font-weight:900;
      letter-spacing:.16em;
    }
    .chapter--light .kicker { color:var(--teal-readable); }
    .kicker::before { width:28px; height:1px; content:""; background:currentColor; }
    .chapter h1,.chapter h2 { margin:0; color:var(--chapter-ink); font-size:var(--type-display); line-height:1.13; font-weight:900; letter-spacing:-.045em; }
    .chapter h1 em,.chapter h2 em { color:var(--lime); font-style:normal; }
    .chapter--light h2 em { color:var(--teal); }
    .lede { max-width:500px; margin:18px 0 0; color:var(--chapter-muted); font-size:var(--type-body); line-height:1.85; }
    .side-center .lede { margin-inline:auto; }
    .actions { margin-top:24px; display:flex; gap:10px; flex-wrap:wrap; }
    .side-center .actions { justify-content:center; }
    .primary,.secondary {
      min-height:43px;
      padding:0 19px;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      border-radius:999px;
      font-size:var(--type-control);
      font-weight:900;
    }
    .primary { color:var(--deep); background:var(--lime); box-shadow:0 14px 38px rgba(215,255,99,.16); }
    .chapter--light .primary { color:#fff; background:var(--teal-readable); box-shadow:0 14px 38px rgba(17,153,142,.2); }
    .secondary { color:var(--chapter-ink); border:1px solid var(--chapter-line); background:rgba(255,255,255,.04); }
    .chapter--light .secondary { background:#fff; }
    .chapter-label {
      grid-column:1/13;
      align-self:end;
      display:flex;
      justify-content:space-between;
      color:var(--chapter-muted);
      font-size:var(--type-micro);
      font-weight:800;
      letter-spacing:.13em;
      direction:ltr;
      padding-top:12px;
    }
    .chapter-label b { color:var(--teal-soft); }
    .chapter--light .chapter-label b { color:var(--teal-readable); }

    .mini-search {
      max-width:480px;
      margin-top:30px;
      padding:7px;
      display:flex;
      gap:8px;
      color:var(--ink);
      background:#fff;
      border:1px solid rgba(255,255,255,.55);
      border-radius:17px;
      box-shadow:var(--shadow);
    }
    .mini-search input { flex:1; min-width:0; padding:10px 12px; color:var(--ink); background:transparent; border:0; outline:0; font-size:var(--type-control); }
    .mini-search input::placeholder { color:#78928e; }
    .mini-search button { padding:10px 16px; color:#fff; background:var(--teal-readable); border:0; border-radius:12px; font-size:var(--type-control); font-weight:800; white-space:nowrap; cursor:pointer; }

    .metric-row,.feature-grid,.article-list,.club-strip {
      margin-top:30px;
      display:grid;
      gap:8px;
    }
    .metric-row { grid-template-columns:repeat(3,1fr); }
    .metric {
      padding:17px 13px;
      border-top:1px solid var(--chapter-line);
    }
    .metric strong { display:block; color:var(--chapter-ink); font-size:25px; letter-spacing:-.04em; }
    .metric span { display:block; margin-top:6px; color:var(--chapter-muted); font-size:var(--type-meta); line-height:1.65; }
    .feature-grid { grid-template-columns:repeat(2,1fr); }
    .feature {
      min-height:105px;
      padding:17px;
      display:block;
      color:var(--chapter-ink);
      border:1px solid var(--chapter-line);
      border-radius:14px;
      background:rgba(255,255,255,.035);
      backdrop-filter:blur(8px);
    }
    .chapter--light .feature { background:rgba(255,255,255,.78); }
    .feature b { display:block; color:var(--teal-soft); font-size:var(--type-micro); }
    .chapter--light .feature b { color:var(--teal-readable); }
    .feature strong { display:block; margin-top:18px; font-size:16px; }
    .feature span { display:block; margin-top:6px; color:var(--chapter-muted); font-size:var(--type-meta); line-height:1.65; }

    .club-strip { grid-template-columns:repeat(3,minmax(0,1fr)); gap:11px; }
    .club-chip {
      min-width:0;
      padding:0;
      display:block;
      overflow:hidden;
      border:1px solid var(--chapter-line);
      border-radius:18px;
      background:rgba(255,255,255,.82);
      box-shadow:0 14px 34px rgba(13,48,47,.08);
      transition:transform .25s ease,box-shadow .25s ease;
    }
    .club-chip:hover { transform:translateY(-4px); box-shadow:0 19px 40px rgba(13,48,47,.13); }
    .entity-card__media {
      position:relative;
      height:116px;
      overflow:hidden;
      display:grid;
      place-items:center;
      color:rgba(255,255,255,.84);
      background:
        radial-gradient(circle at 22% 18%,rgba(215,255,99,.28),transparent 34%),
        linear-gradient(135deg,#0f6c66,#0d3433);
    }
    .entity-card__media::after {
      position:absolute;
      inset:auto 0 0;
      height:48%;
      content:"";
      background:linear-gradient(transparent,rgba(7,36,35,.58));
    }
    .entity-card__media img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
    .entity-card__fallback { font-size:34px; font-weight:900; opacity:.8; }
    .entity-card__badge {
      position:absolute;
      right:10px;
      bottom:9px;
      z-index:2;
      padding:5px 8px;
      color:#fff;
      background:rgba(10,54,52,.74);
      border:1px solid rgba(255,255,255,.25);
      border-radius:999px;
      backdrop-filter:blur(8px);
      font-size:var(--type-micro);
      font-weight:800;
    }
    .club-chip__body { padding:12px 13px 13px; }
    .club-chip strong { display:block; overflow:hidden; font-size:16px; text-overflow:ellipsis; white-space:nowrap; }
    .club-chip span { display:block; min-height:28px; margin-top:6px; color:var(--chapter-muted); font-size:var(--type-meta); line-height:1.6; }
    .club-chip b { display:block; margin-top:8px; color:var(--lime); font-size:13px; }
    .chapter--light .club-chip b { color:var(--teal-readable); }

    .club-panel-chapter {
      min-height:570svh;
      overflow:visible;
      --chapter-bg:#082927;
    }
    .club-panel-frame {
      position:sticky;
      top:var(--stage-top);
      z-index:4;
      height:var(--stage-height);
      overflow:hidden;
      isolation:isolate;
      color:#f4f9f7;
      background:
        radial-gradient(circle at 78% 52%,rgba(17,153,142,.2),transparent 32%),
        radial-gradient(circle at 10% 15%,rgba(215,255,99,.07),transparent 28%);
    }
    .club-panel-frame::before {
      position:absolute;
      inset:0;
      content:"";
      pointer-events:none;
      opacity:.3;
      background-image:linear-gradient(rgba(167,217,209,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(167,217,209,.08) 1px,transparent 1px);
      background-size:72px 72px;
      mask-image:linear-gradient(90deg,transparent,#000 36%,#000);
    }
    .club-panel-copy {
      position:absolute;
      top:50%;
      left:clamp(42px,7vw,130px);
      z-index:20;
      width:min(34vw,470px);
      direction:rtl;
      text-align:right;
      transform:translateY(-50%);
    }
    .club-panel-copy h2 { font-size:var(--type-display); }
    .club-panel-copy .lede { max-width:390px; }
    .club-panel-copy__count {
      margin-top:28px;
      display:flex;
      align-items:center;
      gap:13px;
      direction:ltr;
      color:#aac9c3;
      font-size:var(--type-micro);
      font-weight:900;
      letter-spacing:.12em;
    }
    .club-panel-copy__count b { color:var(--lime); font-size:26px; letter-spacing:-.04em; }
    .club-panel-meter {
      width:110px;
      height:2px;
      overflow:hidden;
      background:rgba(255,255,255,.16);
      border-radius:999px;
    }
    .club-panel-meter i { width:0; height:100%; display:block; background:var(--lime); border-radius:inherit; }
    .club-panel-stage {
      position:absolute;
      inset:0;
      z-index:10;
      width:100%;
      height:100%;
      pointer-events:none;
    }
    .club-panel-card {
      position:absolute;
      width:1px;
      height:1px;
      overflow:hidden;
      clip:rect(0 0 0 0);
      clip-path:inset(50%);
      white-space:nowrap;
    }
    .club-panel-index {
      position:absolute;
      right:clamp(24px,4vw,70px);
      bottom:28px;
      z-index:30;
      color:#84aaa4;
      font-size:var(--type-micro);
      font-weight:900;
      letter-spacing:.14em;
    }

    .trainer-grid { gap:11px; }
    .trainer-card {
      min-height:0;
      padding:0;
      overflow:hidden;
      border-radius:18px;
      background:rgba(255,255,255,.055);
      transition:transform .25s ease,background .25s ease;
    }
    .trainer-card:hover { transform:translateY(-4px); background:rgba(255,255,255,.085); }
    .trainer-card .entity-card__media { height:132px; }
    .trainer-card__body { padding:12px 14px 14px; }
    .trainer-card b { font-size:var(--type-micro); }
    .trainer-card strong { margin-top:7px; font-size:16px; }
    .trainer-card span { min-height:31px; margin-top:5px; font-size:var(--type-meta); line-height:1.65; }

    .article-list { gap:0; border-top:1px solid var(--chapter-line); }
    .article {
      padding:10px 0;
      display:grid;
      grid-template-columns:28px minmax(0,1fr) 72px;
      gap:12px;
      align-items:center;
      border-bottom:1px solid var(--chapter-line);
    }
    .article b { color:var(--gold); font-size:var(--type-micro); }
    .article strong { font-size:16px; line-height:1.7; }
    .article-meta { display:block; margin-top:3px; color:var(--chapter-muted); font-size:var(--type-meta); }
    .article-thumb {
      position:relative;
      width:72px;
      height:50px;
      overflow:hidden;
      display:grid;
      place-items:center;
      color:var(--teal-soft);
      background:rgba(255,255,255,.06);
      border-radius:11px;
      font-size:16px;
      font-weight:900;
    }
    .article-thumb img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }

    .media-chapter {
      min-height:460svh;
      overflow:visible;
      --chapter-bg:var(--deep-2);
    }
    .media-story__frame {
      position:sticky;
      top:var(--stage-top);
      z-index:4;
      height:var(--stage-height);
      overflow:hidden;
      isolation:isolate;
      color:#f4f9f7;
      background:
        radial-gradient(circle at 12% 68%,rgba(184,145,82,.19),transparent 32%),
        radial-gradient(circle at 86% 28%,rgba(17,153,142,.16),transparent 35%),
        linear-gradient(115deg,#092a29,#102f2e 58%,#081f1f);
    }
    .media-story__frame::before {
      position:absolute;
      inset:0;
      z-index:-1;
      content:"";
      opacity:.2;
      background-image:linear-gradient(rgba(255,255,255,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.05) 1px,transparent 1px);
      background-size:72px 72px;
      mask-image:linear-gradient(90deg,transparent,#000 34%,#000 66%,transparent);
    }
    .media-story__intro {
      position:absolute;
      top:50%;
      right:max(24px,5vw);
      z-index:12;
      width:min(31vw,430px);
      padding:clamp(20px,2.2vw,30px);
      direction:rtl;
      text-align:right;
      background:rgba(4,31,30,.74);
      border:1px solid rgba(255,255,255,.12);
      border-radius:22px;
      box-shadow:0 20px 60px rgba(0,0,0,.22);
      -webkit-backdrop-filter:blur(14px);
      backdrop-filter:blur(14px);
      transform:translateY(-50%);
    }
    .media-story__intro .kicker { margin-bottom:13px; }
    .media-story__intro h2 { font-size:var(--type-display); line-height:1.16; }
    .media-story__intro .lede { margin-top:14px; font-size:var(--type-body); line-height:1.8; }
    .media-stage {
      position:absolute;
      inset:0;
      overflow:hidden;
    }
    .media-stage__window {
      position:absolute;
      top:50%;
      left:46%;
      z-index:11;
      height:min(80vh,800px);
      aspect-ratio:2/3;
      border:1px dashed rgba(247,250,249,.4);
      border-radius:8px;
      pointer-events:none;
      transform:translate(-50%,-50%);
    }
    .media-stage__window .corner { position:absolute; width:18px; height:18px; }
    .media-stage__window .corner::before,.media-stage__window .corner::after { position:absolute; content:""; background:var(--lime); }
    .media-stage__window .corner::before { width:2px; height:13px; }
    .media-stage__window .corner::after { width:13px; height:2px; }
    .corner--tl { top:-1px; left:-1px; }
    .corner--tl::before,.corner--tl::after { top:0; left:0; }
    .corner--tr { top:-1px; right:-1px; }
    .corner--tr::before,.corner--tr::after { top:0; right:0; }
    .corner--bl { bottom:-1px; left:-1px; }
    .corner--bl::before,.corner--bl::after { bottom:0; left:0; }
    .corner--br { bottom:-1px; right:-1px; }
    .corner--br::before,.corner--br::after { bottom:0; right:0; }
    .media-card {
      position:absolute;
      top:50%;
      left:46%;
      z-index:2;
      height:min(80vh,800px);
      aspect-ratio:2/3;
      overflow:hidden;
      color:#fff;
      background:#0a2524;
      border:1px solid rgba(247,250,249,.1);
      border-radius:8px;
      box-shadow:0 20px 50px rgba(0,0,0,.28);
      opacity:0;
      transform:translate(-50%,-50%) scale(.68);
      transform-origin:center;
      will-change:transform,opacity;
    }
    .media-card:first-child { opacity:1; transform:translate(-50%,-50%) scale(1); }
    .media-card__visual,.media-card__visual img { width:100%; height:100%; }
    .media-card__visual { position:relative; overflow:hidden; background:linear-gradient(145deg,#145f5a,#071f1f); }
    .media-card__visual img { display:block; object-fit:cover; object-position:center 15%; }
    .media-card__visual::after { position:absolute; inset:45% 0 0; content:""; background:linear-gradient(transparent,rgba(4,23,22,.88)); pointer-events:none; }
    .media-card__caption {
      position:absolute;
      right:26px;
      bottom:24px;
      left:26px;
      z-index:3;
      display:flex;
      align-items:flex-end;
      justify-content:space-between;
      gap:16px;
      direction:rtl;
    }
    .media-card__info { display:flex; flex-direction:column; gap:6px; }
    .media-card__role,
    .media-card__caption strong,
    .media-card__meta,
    .media-card__type {
      opacity:0;
      transform:translateY(16px);
    }
    .media-card__role { display:block; color:var(--lime); font-size:var(--type-meta); font-weight:800; letter-spacing:.06em; }
    .media-card__caption strong { display:block; font-size:var(--type-card-title); line-height:1.5; }
    .media-card__meta { display:block; color:#d4e5e1; font-size:var(--type-meta); line-height:1.7; }
    .media-card__type { flex:0 0 auto; padding:8px 11px; color:var(--deep); background:var(--lime); border-radius:999px; font-size:var(--type-micro); font-weight:900; }
    .media-card.is-focused .media-card__role,
    .media-card.is-focused .media-card__caption strong,
    .media-card.is-focused .media-card__meta,
    .media-card.is-focused .media-card__type {
      animation:captionRise .6s cubic-bezier(.2,.7,.2,1) both;
    }
    .media-card.is-focused .media-card__role { animation-delay:.04s; }
    .media-card.is-focused .media-card__type { animation-delay:.1s; }
    .media-card.is-focused .media-card__caption strong { animation-delay:.18s; }
    .media-card.is-focused .media-card__meta { animation-delay:.3s; }
    @keyframes captionRise {
      from { opacity:0; transform:translateY(16px); }
      to { opacity:1; transform:translateY(0); }
    }
    .media-story__meter {
      position:absolute;
      bottom:24px;
      left:46%;
      z-index:12;
      width:min(34vw,440px);
      height:2px;
      overflow:hidden;
      background:rgba(255,255,255,.18);
      border-radius:999px;
      transform:translateX(-50%);
    }
    .media-story__meter > i { width:0; height:100%; display:block; background:var(--lime); border-radius:inherit; }
    .media-story__hint {
      position:absolute;
      bottom:-26px;
      left:50%;
      z-index:12;
      display:flex;
      align-items:center;
      gap:8px;
      color:#9fc4bd;
      font-size:var(--type-micro);
      font-weight:800;
      letter-spacing:.12em;
      transform:translateX(-50%);
    }
    .media-story__hint i { font-style:normal; }

    .schools-chapter {
      min-height:380svh;
      overflow:visible;
      --chapter-bg:var(--deep-2);
    }
    .schools-story__frame {
      position:sticky;
      top:var(--stage-top);
      z-index:4;
      height:var(--stage-height);
      overflow:hidden;
      color:#f4f9f7;
      background:radial-gradient(circle at 50% 50%,transparent 32%,rgba(6,26,26,.5) 100%);
    }
    .schools-story__intro {
      position:absolute;
      top:clamp(44px,7vh,88px);
      right:clamp(30px,5vw,96px);
      left:clamp(30px,5vw,96px);
      z-index:5;
      display:grid;
      grid-template-columns:minmax(260px,1fr) minmax(360px,38vw);
      grid-template-rows:auto auto;
      column-gap:clamp(140px,20vw,390px);
      align-items:end;
      pointer-events:none;
      opacity:var(--schools-intro-opacity,1);
      transform:translateY(var(--schools-intro-shift,0));
      transition:opacity .12s linear;
    }
    .schools-story__intro .kicker,
    .schools-story__intro h2 { grid-column:2; text-align:right; }
    .schools-story__intro .kicker { justify-content:flex-start; }
    .schools-story__intro h2 { margin:0; }
    .schools-story__intro .lede {
      grid-column:1;
      grid-row:1 / 3;
      max-width:390px;
      margin:0;
      align-self:end;
      text-align:right;
    }
    .schools-list {
      position:absolute;
      inset:0;
      z-index:4;
      width:100%;
      height:100%;
      overflow:hidden;
      opacity:var(--schools-list-opacity,0);
      -webkit-mask-image:linear-gradient(to bottom,transparent,#000 9%,#000 91%,transparent);
      mask-image:linear-gradient(to bottom,transparent,#000 9%,#000 91%,transparent);
    }
    .schools-list__track {
      display:flex;
      flex-direction:column;
      align-items:stretch;
      gap:0;
      direction:ltr;
      will-change:transform;
    }
    .school-item {
      position:relative;
      box-sizing:border-box;
      width:calc(100% - clamp(56px,6vw,120px));
      min-height:clamp(210px,30vh,330px);
      margin:0 auto;
      padding:clamp(24px,3.2vh,38px) 0;
      display:grid;
      grid-template-columns:minmax(220px,1fr) clamp(300px,27vw,480px) minmax(240px,1fr);
      grid-template-rows:auto 1fr;
      column-gap:clamp(100px,15vw,300px);
      align-items:start;
      border:0;
      border-top:1px solid rgba(196,220,214,.24);
      border-radius:0;
      background:none;
      direction:ltr;
      transition:border-color .25s ease,opacity .25s ease;
    }
    .school-item__rank {
      grid-column:1;
      grid-row:1;
      z-index:2;
      margin:14px 0 0 14px;
      color:var(--gold);
      font-size:12px;
      font-weight:900;
      letter-spacing:.13em;
    }
    .school-item__body {
      grid-column:3;
      grid-row:1 / 3;
      min-width:0;
      direction:rtl;
      text-align:right;
    }
    .school-item__body strong { display:block; font-size:clamp(20px,1.7vw,31px); line-height:1.45; transition:color .3s ease; }
    .school-item__body span { display:block; margin-top:10px; color:#c1d8d3; font-size:var(--type-meta); line-height:1.65; }
    .school-item__badge {
      grid-column:1;
      grid-row:2;
      z-index:2;
      align-self:end;
      width:max-content;
      min-height:30px;
      margin:0 0 14px 14px;
      padding:6px 12px;
      display:inline-flex;
      align-items:center;
      gap:7px;
      border:1px solid rgba(215,255,99,.18);
      border-radius:999px;
      background:rgba(215,255,99,.08);
      color:var(--lime);
      font-size:var(--type-micro);
      font-weight:800;
      opacity:.58;
      transform:translateY(5px) scale(.96);
      transition:color .3s ease,background .3s ease,border-color .3s ease,box-shadow .3s ease,opacity .3s ease,transform .3s ease;
    }
    .school-item__badge::before {
      width:16px;
      height:16px;
      display:grid;
      place-items:center;
      content:"✓";
      color:var(--deep-2);
      background:var(--lime);
      border-radius:50%;
      font-size:var(--type-micro);
      font-weight:900;
    }
    .school-item.is-active .school-item__badge,
    .school-item:hover .school-item__badge {
      color:var(--deep-2);
      background:var(--lime);
      border-color:var(--lime);
      box-shadow:0 8px 24px rgba(215,255,99,.18);
      opacity:1;
      transform:translateY(0) scale(1);
    }
    .school-item.is-active .school-item__badge::before,
    .school-item:hover .school-item__badge::before {
      color:var(--lime);
      background:var(--deep-2);
    }
    .school-item__visual {
      position:relative;
      grid-column:1;
      grid-row:1 / 3;
      width:min(390px,28vw);
      aspect-ratio:4/3;
      margin:0 0 0 clamp(36px,3vw,58px);
      align-self:center;
      justify-self:start;
      overflow:hidden;
      background:#071f1f;
      border:1px solid rgba(196,220,214,.18);
      border-radius:3px;
    }
    .school-item__visual::after {
      position:absolute;
      inset:0;
      content:"";
      background:linear-gradient(180deg,rgba(3,18,18,.06) 35%,rgba(3,18,18,.78));
      pointer-events:none;
    }
    .school-item__visual img {
      width:100%;
      height:100%;
      display:block;
      object-fit:cover;
      filter:saturate(.78) brightness(.68);
      transform:scale(1.035);
      transition:filter .45s ease,transform .75s cubic-bezier(.2,.7,.2,1);
    }
    .school-item.is-active .school-item__visual img {
      filter:saturate(1) brightness(.96);
      transform:scale(1);
    }
    .school-item.is-active { border-color:rgba(215,255,99,.64); }
    .school-item.is-active .school-item__body strong { color:var(--lime); }

    .pools-chapter {
      min-height:620svh;
      overflow:visible;
      --chapter-bg:#061f20;
    }
    .pools-story__frame {
      position:sticky;
      top:var(--stage-top);
      z-index:4;
      height:var(--stage-height);
      overflow:hidden;
      isolation:isolate;
      color:#f4f9f7;
      background:
        radial-gradient(circle at 50% 30%,rgba(17,153,142,.16),transparent 34%),
        linear-gradient(180deg,#082b2b,#061f20);
    }
    .pools-story__frame::before {
      position:absolute;
      inset:0;
      z-index:-1;
      content:"";
      opacity:.22;
      background-image:linear-gradient(rgba(167,217,209,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(167,217,209,.08) 1px,transparent 1px);
      background-size:72px 72px;
      mask-image:linear-gradient(90deg,transparent,#000 20%,#000 80%,transparent);
    }
    .pools-story__intro {
      position:absolute;
      top:clamp(30px,5.2vh,64px);
      right:clamp(28px,5vw,90px);
      left:clamp(28px,5vw,90px);
      z-index:7;
      display:grid;
      grid-template-columns:minmax(260px,1fr) minmax(380px,46vw);
      gap:clamp(60px,11vw,210px);
      align-items:end;
      direction:ltr;
      pointer-events:none;
      opacity:var(--pools-intro-opacity,1);
      transform:translateY(var(--pools-intro-shift,0));
    }
    .pools-story__intro-copy { direction:rtl; text-align:right; }
    .pools-story__intro-copy .kicker { margin-bottom:9px; }
    .pools-story__intro-copy h2 { font-size:var(--type-display); }
    .pools-story__intro .lede {
      max-width:430px;
      margin:0;
      direction:rtl;
      text-align:right;
      font-size:var(--type-body);
      line-height:1.9;
    }
    .pools-story__viewport {
      position:absolute;
      inset:clamp(145px,22vh,210px) 0 clamp(45px,7vh,74px);
      z-index:5;
      overflow:hidden;
      -webkit-mask-image:linear-gradient(90deg,transparent,#000 5%,#000 95%,transparent);
      mask-image:linear-gradient(90deg,transparent,#000 5%,#000 95%,transparent);
    }
    .pools-story__track {
      position:absolute;
      top:0;
      left:0;
      height:100%;
      width:max-content;
      display:flex;
      flex-direction:row-reverse;
      align-items:stretch;
      gap:clamp(14px,1.5vw,26px);
      direction:ltr;
      will-change:transform;
    }
    .pool-card {
      position:relative;
      flex:0 0 auto;
      width:auto;
      height:100%;
      aspect-ratio:var(--pool-ratio,3/2);
      overflow:hidden;
      color:#fff;
      background:#0a302f;
      border:1px solid rgba(188,224,216,.22);
      border-radius:4px;
      box-shadow:0 28px 70px rgba(0,0,0,.3);
      opacity:.42;
      transform:scale(.94);
      transform-origin:center;
      transition:opacity .22s linear,transform .28s ease,border-color .28s ease;
    }
    .pool-card.is-active { opacity:1; transform:scale(1); border-color:rgba(215,255,99,.68); }
    .pool-card img {
      width:100%;
      height:100%;
      display:block;
      object-fit:cover;
      filter:saturate(.78) brightness(.7);
      transform:scale(1.025);
      transition:filter .35s ease,transform .65s cubic-bezier(.2,.7,.2,1);
    }
    .pool-card.is-active img { filter:saturate(1) brightness(.9); transform:scale(1); }
    .pool-card::after {
      position:absolute;
      inset:36% 0 0;
      content:"";
      background:linear-gradient(transparent,rgba(3,21,21,.92));
      pointer-events:none;
    }
    .pool-card__number {
      position:absolute;
      top:20px;
      left:22px;
      z-index:2;
      color:var(--lime);
      font-size:var(--type-micro);
      font-weight:900;
      letter-spacing:.14em;
    }
    .pool-card__content {
      position:absolute;
      right:clamp(18px,2.5vw,34px);
      bottom:clamp(17px,2.6vh,30px);
      left:clamp(18px,2.5vw,34px);
      z-index:2;
      direction:rtl;
      text-align:right;
      transition:opacity .16s linear;
    }
    .pool-card__content strong { display:block; font-size:clamp(20px,2vw,31px); line-height:1.45; }
    .pool-card__content span { display:block; margin-top:7px; color:#d4e5e1; font-size:var(--type-meta); line-height:1.7; }
    .pool-card__content b { display:block; margin-top:10px; color:var(--lime); font-size:13px; }
    .pools-story__progress {
      position:absolute;
      right:clamp(26px,5vw,90px);
      bottom:22px;
      left:clamp(26px,5vw,90px);
      z-index:8;
      display:flex;
      align-items:center;
      gap:14px;
      direction:ltr;
      color:#91b8b1;
      font-size:var(--type-micro);
      font-weight:900;
      letter-spacing:.12em;
    }
    .pools-story__progress strong { color:var(--lime); font-size:19px; }
    .pools-story__meter { width:min(230px,28vw); height:2px; overflow:hidden; background:rgba(255,255,255,.17); border-radius:999px; }
    .pools-story__meter i { width:0; height:100%; display:block; background:var(--lime); border-radius:inherit; }

    .ecosystem-legend {
      margin-top:30px;
      display:flex;
      flex-wrap:wrap;
      gap:8px;
    }
    .ecosystem-legend a {
      padding:9px 13px;
      display:inline-flex;
      align-items:center;
      gap:7px;
      color:var(--chapter-ink);
      border:1px solid var(--chapter-line);
      border-radius:999px;
      font-size:var(--type-meta);
    }
    .ecosystem-legend a b { color:var(--teal-soft); font-size:var(--type-micro); }
    .chapter--light .ecosystem-legend a b { color:var(--teal-readable); }

    .scroll-cue {
      position:absolute;
      bottom:50px;
      left:50%;
      z-index:4;
      display:flex;
      align-items:center;
      gap:10px;
      color:var(--chapter-muted);
      font-size:var(--type-micro);
      font-weight:800;
      transform:translateX(-50%);
    }
    .scroll-cue i { width:32px; height:32px; display:grid; place-items:center; border:1px solid var(--chapter-line); border-radius:50%; font-style:normal; }

    .site-footer {
      position:relative;
      z-index:5;
      padding:70px 0 30px;
      color:#dce9e6;
      background:#244848;
      border-radius:32px 32px 0 0;
    }
    .footer-grid {
      width:var(--wrap);
      margin:auto;
      display:grid;
      grid-template-columns:1.7fr repeat(4,1fr);
      gap:42px;
    }
    .footer-brand strong { display:block; color:#fff; font-size:25px; letter-spacing:.08em; }
    .footer-brand p { max-width:360px; margin:18px 0 0; color:#d2e1dd; font-size:var(--type-meta); line-height:1.9; }
    .footer-col h3 { margin:0 0 18px; color:#fff; font-size:16px; }
    .footer-col a,.footer-col p { display:block; margin:9px 0; color:#e4efec; font-size:var(--type-meta); line-height:1.75; }
    .footer-bottom {
      width:var(--wrap);
      margin:52px auto 0;
      padding-top:22px;
      display:flex;
      justify-content:space-between;
      gap:22px;
      color:#b8cbc7;
      border-top:1px solid rgba(255,255,255,.14);
      font-size:var(--type-micro);
    }

    @media (max-width:1050px) {
      .main-nav { display:none; }
      .header-search { min-width:220px; }
      .chapter-progress { left:10px; }
      .chapter__frame { column-gap:14px; }
      .side-right { grid-column:7/13; }
      .side-left { grid-column:1/7; }
      .footer-grid { grid-template-columns:repeat(2,1fr); }
      .footer-brand { grid-column:1/3; }
    }
    @media (max-width:720px) {
      :root { --type-display:clamp(30px,8vw,36px); --type-body:15px; --type-meta:13px; }
      .site-header { width:calc(100% - 22px); min-height:58px; padding:8px 12px; border-radius:18px; }
      .brand { margin-left:auto; font-size:19px; }
      .header-search,.header-actions .login { display:none; }
      .header-actions { gap:8px; }
      .join-button { padding:9px 12px; font-size:12px; }
      .menu-button { display:block; }
      #mesh-canvas { z-index:1; }
      .chapter-progress { display:none; }
      .chapter {
        min-height:155svh;
        --chapter-muted:#d5e4e0;
      }
      .schools-chapter { min-height:520svh; }
      .pools-chapter { min-height:620svh; }
      .club-panel-chapter { min-height:620svh; }
      .hero-chapter { min-height:100svh; }
      .chapter--light { --chapter-muted:#536f6a; }
      .chapter__frame {
        width:100%;
        padding:24px 20px 24px;
        grid-template-columns:1fr;
        grid-template-rows:1fr auto;
        align-items:start;
        overflow:hidden;
      }
      .copy,.side-right,.side-left,.side-center {
        grid-column:1;
        width:100%;
        max-width:none;
        justify-self:stretch;
        text-align:right;
      }
      .copy {
        padding-top:14svh;
        opacity:1;
        transform:none;
        transition:none;
      }
      .hero-chapter .copy {
        margin-top:27svh;
        padding:20px;
        background:rgba(5,34,33,.44);
      }
      .hero-chapter::before { background-position:58% center; }
      .kicker { margin-bottom:11px; font-size:var(--type-micro); letter-spacing:.08em; }
      .chapter h1,.chapter h2 {
        max-width:100%;
        font-size:var(--type-display);
        line-height:1.17;
        letter-spacing:-.035em;
      }
      .lede {
        max-width:100%;
        margin-top:14px;
        font-size:var(--type-body);
        line-height:1.8;
        font-weight:500;
      }
      .actions { margin-top:18px; gap:8px; }
      .primary,.secondary { min-height:46px; padding:0 16px; flex:1 1 140px; font-size:var(--type-control); }
      .mini-search,.metric-row,.feature-grid,.club-strip,.article-list,.ecosystem-legend { width:100%; max-width:none; margin-top:16px; }
      .mini-search { padding:5px; gap:5px; border-radius:14px; }
      .mini-search input { padding:9px 10px; font-size:16px; }
      .mini-search button { padding:9px 11px; font-size:var(--type-control); }
      .metric-row { grid-template-columns:repeat(3,1fr); }
      .metric { padding:11px 5px; }
      .metric strong { font-size:22px; }
      .metric span { font-size:12px; line-height:1.55; }
      .feature-grid { gap:7px; }
      .feature { min-height:0; padding:11px 12px; }
      .feature b { font-size:var(--type-micro); }
      .feature strong { margin-top:7px; font-size:15px; }
      .feature span { margin-top:4px; font-size:var(--type-meta); line-height:1.55; }
      .club-strip {
        display:flex;
        gap:7px;
        overflow-x:auto;
        overscroll-behavior-inline:contain;
        scroll-snap-type:x mandatory;
        scrollbar-width:none;
        padding-bottom:3px;
      }
      .club-strip::-webkit-scrollbar { display:none; }
      .club-chip { flex:0 0 82%; padding:0; scroll-snap-align:start; }
      .entity-card__media { height:122px; }
      .club-chip__body { padding:10px 12px 11px; }
      .club-chip strong { font-size:15px; }
      .club-chip span { font-size:var(--type-meta); }
      .club-chip b { margin-top:5px; font-size:var(--type-micro); }
      .club-panel-copy {
        top:36px;
        right:20px;
        left:20px;
        width:auto;
        min-height:0;
        padding:0 4px;
        text-align:center;
        transform:none;
        background:none;
      }
      .club-panel-copy .kicker { justify-content:center; }
      .club-panel-copy h2 { font-size:var(--type-display); }
      .club-panel-copy .lede { max-width:350px; margin:12px auto 0; font-size:var(--type-body); line-height:1.75; }
      .club-panel-copy .primary { min-height:42px; margin-top:14px; padding:0 15px; font-size:13px; }
      .club-panel-copy__count { margin-top:14px; justify-content:center; }
      .club-panel-copy__count b { font-size:20px; }
      .club-panel-stage { inset:0; width:100%; height:100%; }
      .club-panel-index { right:20px; bottom:16px; font-size:var(--type-micro); }
      .trainer-grid { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; }
      .trainer-grid::-webkit-scrollbar { display:none; }
      .trainer-card { flex:0 0 82%; scroll-snap-align:start; }
      .trainer-card .entity-card__media { height:135px; }
      .article { padding:9px 0; grid-template-columns:25px minmax(0,1fr) 60px; gap:8px; }
      .article strong { font-size:14px; }
      .article-meta { font-size:var(--type-micro); }
      .article-thumb { width:60px; height:44px; }
      .schools-story__intro {
        top:54px;
        right:24px;
        left:24px;
        display:block;
      }
      .schools-story__intro .kicker,.schools-story__intro h2,.schools-story__intro .lede { text-align:center; }
      .schools-story__intro .kicker { justify-content:center; }
      .schools-story__intro .lede { max-width:360px; margin:12px auto 0; }
      .schools-list { width:100%; }
      .school-item {
        width:88vw;
        min-height:430px;
        padding:22px 0;
        grid-template-columns:1fr auto;
        grid-template-rows:auto auto 1fr;
        column-gap:18px;
      }
      .school-item__rank { grid-column:1; grid-row:1; margin:0; }
      .school-item__body { grid-column:1 / 3; grid-row:2; margin-top:18px; text-align:right; }
      .school-item__badge { grid-column:2; grid-row:1; margin:0; }
      .school-item__visual { grid-column:1 / 3; grid-row:3; width:100%; margin:18px 0 0; }
      .school-item__body strong { font-size:18px; }
      .school-item__body span { font-size:var(--type-meta); }
      .school-item__badge { min-height:34px; padding:7px 12px; font-size:var(--type-micro); }
      .pools-story__intro {
        top:28px;
        right:20px;
        left:20px;
        display:block;
        text-align:center;
      }
      .pools-story__intro-copy,.pools-story__intro .lede { text-align:center; }
      .pools-story__intro-copy .kicker { justify-content:center; }
      .pools-story__intro-copy h2 { font-size:var(--type-display); }
      .pools-story__intro .lede { max-width:350px; margin:10px auto 0; font-size:14px; line-height:1.7; }
      .pools-story__viewport {
        inset:clamp(118px,15.5vh,145px) 0 58px;
        -webkit-mask-image:linear-gradient(90deg,transparent,#000 3%,#000 97%,transparent);
        mask-image:linear-gradient(90deg,transparent,#000 3%,#000 97%,transparent);
      }
      .pools-story__track { gap:12px; }
      .pool-card {
        height:64vw;
        align-self:center;
        border-radius:15px;
      }
      .pool-card__number { top:14px; left:15px; font-size:var(--type-micro); }
      .pool-card__content { right:16px; bottom:15px; left:16px; }
      .pool-card__content strong { font-size:20px; }
      .pool-card__content span { font-size:var(--type-meta); }
      .pools-story__progress { right:20px; bottom:17px; left:20px; justify-content:center; }
      .pools-story__meter { width:42vw; }
      .ecosystem-legend { gap:6px; }
      .ecosystem-legend a { padding:8px 10px; font-size:var(--type-meta); }
      .chapter-label { grid-column:1; font-size:var(--type-micro); letter-spacing:.06em; }
      .scroll-cue { display:none; }
      .media-story__intro {
        top:22px;
        right:20px;
        left:20px;
        width:auto;
        padding:14px 16px;
        background:rgba(4,31,30,.8);
        border-radius:16px;
        transform:none;
      }
      .media-story__intro h2 { max-width:350px; font-size:var(--type-display); }
      .media-story__intro .lede { max-width:350px; margin-top:8px; font-size:14px; line-height:1.65; }
      .media-stage__window,.media-card {
        top:var(--media-card-mobile-center,66%);
        left:50%;
        width:var(--media-card-mobile-width,min(84vw,380px));
        max-width:none;
        height:auto;
        aspect-ratio:2/3;
        border-radius:19px;
      }
      .media-card__visual img { object-position:center 10%; }
      .media-card__caption { right:16px; bottom:15px; left:16px; }
      .media-card__caption strong { font-size:18px; }
      .media-card__role,.media-card__meta { font-size:var(--type-micro); }
      .media-story__meter { bottom:14px; left:50%; width:62vw; }
      .media-story__hint { bottom:9px; }
      .footer-grid { grid-template-columns:1fr 1fr; gap:30px 20px; }
      .footer-brand { grid-column:1/3; }
      .footer-bottom { display:block; line-height:2; }
      .footer-bottom span { display:block; margin-top:8px; }
    }
    @media (min-width:721px) and (max-width:950px) and (max-height:600px) {
      :root { --type-display:clamp(30px,4.4vw,38px); --type-body:14px; --type-meta:12px; }
      .chapter { min-height:180svh; }
      .chapter__frame {
        top:var(--stage-top);
        height:var(--stage-height);
        padding:12px 20px 12px;
        column-gap:14px;
        align-items:start;
      }
      .copy { padding-top:0; align-self:start; }
      .kicker { margin-bottom:9px; font-size:var(--type-micro); }
      .chapter h1,.chapter h2 { font-size:var(--type-display); line-height:1.12; }
      .lede { margin-top:10px; font-size:var(--type-body); line-height:1.6; }
      .actions,.mini-search,.metric-row,.feature-grid,.club-strip,.article-list,.ecosystem-legend { margin-top:11px; }
      .primary,.secondary { min-height:40px; padding:0 14px; font-size:13px; }
      .feature { min-height:66px; padding:9px 10px; }
      .feature strong { margin-top:5px; font-size:14px; }
      .feature span { margin-top:2px; font-size:var(--type-meta); }
      .metric { padding:9px 5px; }
      .metric strong { font-size:20px; }
      .metric span { font-size:var(--type-meta); }
      .article { padding:8px 0; }
      .scroll-cue { display:none; }
      .media-story__intro { right:24px; width:27vw; }
      .media-story__intro h2 { font-size:var(--type-display); }
      .media-story__intro .lede { font-size:var(--type-meta); }
      .media-stage__window,.media-card { left:47%; height:72vh; }
      .media-story__meter { bottom:8px; left:47%; }
    }
    @media (prefers-reduced-motion:reduce) {
      html { scroll-behavior:auto; }
      .copy { transition:none; }
    }
  

/* Preserve the supplied reference's stage, type, glass surfaces and pinned frames. */
:root{--deep:#12362d;--deep-2:#0b2b23;--teal: #23b6ff;--teal-readable: #1c9ad9;--teal-soft: #4fc4fe;--lime: #23b6ff;--gold:#bfcca9;--paper:#f7faf8;--paper-2:#edf4ef;--ink:#173e2b;--muted:#536f5c;--line-dark:rgba(223,245,225,.18);--line-light:rgba(23,63,40,.14);--stage-top:82px;--stage-height:calc(100dvh - 82px);--accent-text:var(--lime);color-scheme:dark}
:root[data-theme=light]{--deep:#f4f8f5;--deep-2:#e8f0ea;--paper:#e9f2ec;--paper-2:#dfeae2;--accent-text:#2d8f00;color-scheme:light}
:root[data-theme=light] .chapter{--chapter-ink:#173e2b;--chapter-muted:#536f5c;--chapter-line:rgba(23,63,40,.14)}
:root[data-theme=light] .chapter h1 em,:root[data-theme=light] .chapter h2 em,:root[data-theme=light] .kicker{color:#2d8f00}
:root[data-theme=light] .hero-chapter .copy{background:rgba(255,255,255,.52);border-color:rgba(23,63,40,.14);box-shadow:0 24px 70px rgba(23,63,40,.1)}
a:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid var(--lime);outline-offset:5px}
.skip{position:fixed;top:-100px;right:20px;z-index:1000;background:var(--lime);color:#163621;padding:14px}.skip:focus{top:85px}
.icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.brand-mark{background:transparent;color:transparent;border-color:var(--teal);box-shadow:inset 0 0 0 2px white;font-size:0}
.header-search{position:relative;height:40px;padding:0;background:transparent;border:0;min-width:150px;max-width:360px}.header-search input{padding:0 38px 0 14px;width:100%;height:40px;border:1px solid #b5cbc0;border-radius:10px;background:#fbfdfc;color:#24482f;font-size:14px}.header-search .icon{position:absolute;right:11px;top:10px;color:#557363}
.header-actions{gap:10px}.join-button{background:var(--lime);color:#173e2b}.theme-button{display:grid;place-items:center;width:38px;height:38px;border:1px solid #24484826;border-radius:50%;color:#24482f;background:transparent;cursor:pointer}.theme-button .moon{display:none}[data-theme=light] .theme-button .sun{display:none}[data-theme=light] .theme-button .moon{display:block}.menu-button{place-items:center}.mobile-nav{display:none}
#ecu-canvas{position:fixed;left:0;right:0;top:var(--stage-top);height:var(--stage-height);width:100%;z-index:2;pointer-events:none;opacity:0;transition:opacity .7s}body.model-ready #ecu-canvas{opacity:1}
.hero-chapter{isolation:auto;--chapter-bg:var(--deep);--chapter-muted:#c1d6cb}.hero-chapter:before{background:radial-gradient(ellipse at 20% 38%,rgba(126,240,2,.10),transparent 35%),linear-gradient(90deg,rgba(0,15,11,.10),rgba(0,15,11,.12) 48%,rgba(0,15,11,.32)),repeating-linear-gradient(112deg,transparent 0 12vw,rgba(159,207,173,.035) 12.1vw 12.25vw),var(--deep)}[data-theme=light] .hero-chapter:before{background:radial-gradient(ellipse at 20% 38%,rgba(126,240,2,.12),transparent 35%),repeating-linear-gradient(112deg,transparent 0 12vw,rgba(23,63,40,.025) 12.1vw 12.25vw),var(--deep)}
.hero-chapter .copy{background:rgba(5,34,22,.34)}.chapter__frame{height:var(--stage-height);top:var(--stage-top);min-height:0;padding:clamp(30px,5vh,60px) 18px 32px}.chapter h1,.chapter h2{line-height:1.38;letter-spacing:-.035em}.chapter h1 em,.chapter h2 em{color:var(--accent-text)}.chapter--light h2 em{color:#2d8f00}.primary{color:#173e2b;background:var(--lime);border:0;cursor:pointer;min-height:45px}.chapter--light .primary{background:var(--lime);color:#173e2b}.primary:hover,.secondary:hover{transform:translateY(-2px)}.primary,.secondary{gap:10px;transition:transform .2s}.chapter-label{border-top:1px solid var(--chapter-line);padding-top:14px;font-size:12px;letter-spacing:.07em}.chapter-label b{color:var(--accent-text)}
.object{position:relative;grid-row:1;grid-column:1/8;height:60%;min-height:280px;pointer-events:none}.object--right{grid-column:6/13}.object-note{position:absolute;left:8%;bottom:0;display:flex;align-items:center;gap:12px;font-size:12px;letter-spacing:.12em;color:var(--chapter-muted)}.object-note:before{content:'';width:30px;height:1px;background:var(--lime)}.hero-index{position:absolute;left:8%;top:0;color:rgba(160,235,105,.06);font-size:120px;font-weight:900;letter-spacing:.12em;z-index:-1}.hero-chapter .object{grid-column:1/7;height:75%}.hero-chapter .side-right{grid-column:7/13}.scroll-cue{bottom:35px}.chapter-progress{top:calc(var(--stage-top) + var(--stage-height)/2)}.chapter-progress button{height:28px}.chapter-progress button.active{color:var(--accent-text)}body.on-light .chapter-progress button.active{color:#2d8f00}
.model-controls{position:fixed;top:calc(var(--stage-top) + var(--stage-height)*.83);left:var(--model-x,25%);transform:translateX(-50%);z-index:25;display:flex;align-items:center;gap:8px;opacity:0;pointer-events:none;transition:opacity .4s;color:var(--chapter-muted,#b4d0ca)}.model-ready .model-controls{opacity:1;pointer-events:auto}.model-controls button{width:38px;height:38px;display:grid;place-items:center;color:#b4d0ca;background:rgba(10,43,28,.5);border:1px solid rgba(222,245,225,.2);border-radius:50%;backdrop-filter:blur(12px);cursor:pointer}.model-controls button[aria-pressed=true]{color:#173e2b;background:var(--lime);border-color:var(--lime)}.model-controls button:disabled{opacity:.4;cursor:wait}.model-status{max-width:150px;font-size:12px;line-height:1.8;direction:rtl;color:#b4d0ca;user-select:none}body.on-light .model-controls button,[data-theme=light] .model-controls button{color:#2d8f00;border-color:rgba(23,63,40,.2);background:rgba(255,255,255,.62)}body.on-light .model-status,[data-theme=light] .model-status{color:#536f5c}.model-controls[data-active='1']{top:calc(var(--stage-top) + var(--stage-height)*.62)}.model-controls[data-active='3']{top:calc(var(--stage-top) + var(--stage-height)*.91)}.model-controls--center{top:calc(var(--stage-top) + var(--stage-height)*.93)}.model-dragging{cursor:grabbing;user-select:none}.webgl-unavailable .model-controls{opacity:1}.webgl-unavailable .model-controls button{display:none}
.course-chapter{min-height:570svh;--chapter-bg:var(--deep-2)}.course-frame{position:sticky;top:var(--stage-top);height:var(--stage-height);width:var(--wrap);margin:auto;padding:40px 18px 32px;display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:24px;align-items:center;direction:ltr;z-index:3;isolation:auto}.course-frame:before{content:'';position:absolute;inset:0;opacity:.3;pointer-events:none;background-image:linear-gradient(rgba(167,217,176,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(167,217,176,.08) 1px,transparent 1px);background-size:72px 72px;mask-image:linear-gradient(90deg,transparent,#000 36%,#000)}.course-copy{grid-column:1/6;width:100%;max-width:470px;direction:rtl;position:relative;z-index:4;opacity:.22;transform:translateY(22px);transition:opacity .5s,transform .65s}.is-active .course-copy{opacity:1;transform:none}.course-copy .primary{margin-top:24px}.course-copy .kicker{justify-content:flex-start}.course-count{display:flex;align-items:center;gap:13px;direction:ltr;color:var(--chapter-muted);font-size:12px;letter-spacing:.12em;font-weight:800;margin-top:28px}.course-count b{color:var(--accent-text);font-size:28px;letter-spacing:-.04em}.course-meter{height:2px;width:110px;background:var(--chapter-line)}.course-meter i{height:100%;display:block;background:var(--lime);width:0}.course-stage{position:relative;grid-column:7/13;height:100%;direction:rtl;pointer-events:none}.course-card{position:absolute;bottom:90px;left:4%;right:4%;pointer-events:auto;border:1px solid var(--chapter-line);border-radius:18px;background:rgba(8,40,29,.8);box-shadow:0 20px 60px rgba(0,0,0,.16);backdrop-filter:blur(18px);will-change:transform}.course-media{position:relative;padding:13px 22px 0;display:flex;justify-content:space-between;gap:15px;align-items:center;color:var(--chapter-muted)}.course-media .code{direction:ltr;font-size:12px;letter-spacing:.1em}.course-level{font-size:12px;border:1px solid var(--chapter-line);border-radius:20px;padding:4px 9px}.course-body{padding:12px 22px 18px}.course-body h3{margin:0;font-size:22px;font-weight:800;color:var(--chapter-ink)}.course-body p{margin:8px 0 10px;line-height:1.8;font-size:14px;color:var(--chapter-muted)}.course-body button{padding:0;border:0;background:transparent;color:var(--accent-text);font-size:14px;font-weight:800;cursor:pointer}.course-select{position:absolute;left:0;right:0;bottom:35px;display:flex;justify-content:center;gap:8px;direction:ltr;pointer-events:auto}.course-select button{height:34px;width:34px;border:1px solid var(--chapter-line);color:var(--chapter-muted);background:transparent;border-radius:50%;font:inherit;font-size:12px;cursor:pointer}.course-select button[aria-pressed=true]{color:#173e2b;background:var(--lime);border-color:var(--lime)}.course-foot{position:absolute;left:18px;right:18px;bottom:12px;display:flex;justify-content:space-between;gap:15px;font-size:12px;letter-spacing:.08em;direction:ltr;color:var(--chapter-muted)}[data-theme=light] .course-card{background:rgba(255,255,255,.8)}
.tools-chapter{min-height:220svh}.tools-frame{position:sticky;top:var(--stage-top);height:var(--stage-height);width:var(--wrap);margin:auto;padding:38px 18px 25px;z-index:3;display:flex;align-items:center;flex-direction:column}.tools-intro{text-align:center;max-width:850px}.tools-intro .kicker{justify-content:center}.tools-intro h2{font-size:clamp(34px,3.3vw,52px)}.tools-intro .lede{max-width:640px;margin-inline:auto}.tools-stage{width:min(86%,1100px);position:relative;flex:1;margin-top:24px;min-height:180px;pointer-events:none}.tool-label{position:absolute;border-top:1px solid var(--chapter-line);padding-top:12px;font-size:16px;font-weight:800;max-width:200px;direction:rtl}.tool-label small{display:block;font-size:14px;line-height:1.8;font-weight:400;color:var(--chapter-muted);margin-top:7px}.tool-label--left{left:0;top:45%}.tool-label--right{right:0;top:25%}.stage-corner{display:none}.tools-caption{width:100%;display:flex;justify-content:space-between;direction:ltr;font-size:12px;letter-spacing:.1em;color:var(--chapter-muted);border-top:1px solid var(--chapter-line);padding-top:13px}
.feature{cursor:pointer}.chapter--light .feature{background:rgba(255,255,255,.65)}.diagnostic-list{margin-top:25px;border-top:1px solid var(--chapter-line)}.diagnostic-list div{display:flex;align-items:center;gap:16px;border-bottom:1px solid var(--chapter-line);padding:14px 0;font-size:16px}.diagnostic-list b{color:var(--accent-text);font-size:12px}.diagnostic-list span{flex:1}.diagnostic-list small{font-size:12px;color:var(--chapter-muted);direction:ltr}
.workshop{min-height:350svh}.workshop-frame{position:sticky;top:var(--stage-top);height:var(--stage-height);width:var(--wrap);margin:auto;padding:38px 18px 32px;display:flex;flex-direction:column;z-index:3}.workshop-intro{display:flex;justify-content:space-between;gap:50px;align-items:end;direction:rtl}.workshop-intro h2{max-width:620px}.workshop-intro .lede{max-width:340px}.bench{flex:1;position:relative;margin-top:25px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--chapter-line);direction:ltr;pointer-events:none}.bench-label{position:absolute;left:0;top:0;color:#2d8f00;font-size:12px;letter-spacing:.1em}.bench-item{position:relative;font-size:12px;letter-spacing:.1em;max-width:180px;color:var(--chapter-muted);transform:translateY(calc(var(--bench-progress,0)*-40px));transition:opacity .3s}.bench-item:first-of-type{align-self:start;margin-top:50px}.bench-item:last-of-type{align-self:end;margin-bottom:50px}.workshop-bottom{margin-top:24px;display:flex;align-items:center;justify-content:space-between;gap:30px;direction:rtl}.workshop-bottom p{font-size:14px;line-height:1.8;color:var(--chapter-muted);max-width:580px}
.article{width:100%;text-align:right;border:0;border-bottom:1px solid var(--chapter-line);background:transparent;color:var(--chapter-ink);cursor:pointer;grid-template-columns:28px 1fr 24px;padding:16px 0}.article b{color:var(--accent-text)}.article-meta{font-size:14px}.article:hover strong{color:var(--accent-text)}.footer-brand .brand{width:fit-content;direction:ltr}.site-footer{background:var(--deep-2);color:#f4f9f5}.footer-grid{grid-template-columns:2fr 1fr 1fr}.footer-bottom{display:flex;justify-content:space-between;gap:20px;font-size:12px;color:#b4d0bc}.site-footer a{color:inherit}[data-theme=light] .site-footer{color:#173e2b}[data-theme=light] .site-footer p,[data-theme=light] .site-footer .footer-bottom{color:#536f5c}
dialog{width:min(620px,calc(100vw - 32px));max-height:85vh;padding:30px;border:1px solid var(--line-dark);border-radius:24px;background:#103329;color:#f4f9f5;box-shadow:0 35px 100px #0005;overflow:auto}dialog::backdrop{background:#061d18b3;backdrop-filter:blur(8px)}[data-theme=light] dialog{background:#f7faf8;color:#173e2b;border-color:var(--line-light)}.dialog-head{display:flex;align-items:start;justify-content:space-between;gap:20px}.dialog-close{width:36px;height:36px;flex-shrink:0;background:transparent;color:inherit;border:1px solid var(--chapter-line,#6b8a7144);border-radius:50%;font-size:25px;cursor:pointer}.dialog-kicker{direction:ltr;font-size:12px;letter-spacing:.1em;color:var(--accent-text);margin:0 0 10px}.dialog-title{font-size:28px;line-height:1.6}.dialog-body{margin-top:18px;font-size:16px;line-height:2;color:#b4d0bc}.dialog-body h3{color:#f4f9f5;font-size:16px;margin:24px 0 8px}.dialog-body ul{padding-right:24px}.dialog-body li{padding-bottom:6px}[data-theme=light] .dialog-body{color:#536f5c}[data-theme=light] .dialog-body h3{color:#173e2b}.search-results{display:grid;gap:10px;margin-top:18px}.search-result{display:flex;justify-content:space-between;gap:15px;align-items:center;padding:15px 16px;border:1px solid #6b8a7144;border-radius:12px;text-align:right;background:transparent;color:inherit;font-size:16px;cursor:pointer}.search-result small{font-size:12px;color:var(--accent-text);white-space:nowrap}
@media(min-width:721px) and (max-width:1100px){.main-nav{gap:12px}.site-header{gap:15px}.header-search{max-width:250px}.side-right{grid-column:7/13}.side-left{grid-column:1/7}.object{grid-column:1/7}.object--right{grid-column:7/13}.course-copy{grid-column:1/6}.course-stage{grid-column:6/13}.course-card{bottom:95px;left:6%;right:3%}.course-body p{font-size:14px}.hero-chapter .copy{padding:25px}.hero-chapter h1{font-size:clamp(34px,4vw,54px)}}
@media(max-width:720px){html{scroll-padding-top:80px}.site-header{top:8px;gap:10px;width:calc(100% - 22px);min-height:58px;padding:7px 12px;border-radius:18px}.brand{font-size:18px}.header-search,.main-nav{display:none}.header-actions{margin-right:auto;gap:6px}.join-button{padding:9px 12px;font-size:12px}.theme-button{width:34px;height:34px}.menu-button{display:grid}.mobile-nav.open{position:fixed;display:flex;flex-direction:column;top:75px;right:12px;left:12px;padding:12px;z-index:99;border:1px solid var(--line-dark);border-radius:16px;background:#103329;box-shadow:var(--shadow);color:#f4f9f5}.mobile-nav a{padding:13px;border-bottom:1px solid var(--line-dark);font-size:16px}.mobile-nav a:last-child{border:0}[data-theme=light] .mobile-nav.open{background:#f7faf8;color:#173e2b}.chapter{min-height:180svh}.hero-chapter{min-height:135svh}.chapter__frame{position:sticky;top:var(--stage-top);height:var(--stage-height);width:100%;min-height:0;padding:18px 22px 20px;display:grid;grid-template-columns:1fr;grid-template-rows:1fr auto;align-items:start;direction:rtl;gap:0}.copy,.side-right,.side-left,.hero-chapter .side-right{grid-column:1;grid-row:1;max-width:none;width:100%;position:relative;top:auto;right:auto;bottom:auto;left:auto;padding:0;text-align:right;justify-self:stretch;transform:translateY(18px)}.is-active .copy{transform:none}.chapter h1,.chapter h2,.hero-chapter h1{font-size:clamp(28px,7.4vw,36px);line-height:1.38;letter-spacing:-.035em}.hero-chapter .copy{padding:18px 20px;border-radius:20px;background:rgba(5,34,22,.34)}.kicker,.hero-chapter .kicker{font-size:12px;letter-spacing:.06em;margin-bottom:9px}.lede{font-size:14px;line-height:1.8;margin-top:12px;max-width:none}.actions{margin-top:17px;gap:7px}.primary,.secondary{min-height:40px;font-size:12px;padding:0 14px}.object,.hero-chapter .object,.object--right{grid-column:1;grid-row:1;position:absolute;left:0;right:0;top:45%;height:50%;width:100%;min-height:0;margin:0;pointer-events:none}.object-note{display:none}.hero-index{font-size:80px;top:20%;left:8%}.chapter-label{grid-column:1;grid-row:2;align-self:end;font-size:12px;line-height:1.8;letter-spacing:0;gap:10px;padding-top:10px;z-index:4}.chapter-label span:last-child{max-width:52%;text-align:right}.scroll-cue{display:none}.chapter-progress{display:none}.model-controls{top:calc(var(--stage-top) + var(--stage-height)*.90);left:50%;gap:6px}.model-controls button{width:32px;height:32px}.model-status{font-size:12px;max-width:155px}.model-controls[data-active='1']{top:calc(var(--stage-top) + var(--stage-height)*.53)}.model-controls[data-active='3']{top:calc(var(--stage-top) + var(--stage-height)*.92)}.model-controls--center{top:calc(var(--stage-top) + var(--stage-height)*.92)}.model-controls[data-active='5']{display:none}
.course-chapter{min-height:500svh}.course-frame{height:var(--stage-height);top:var(--stage-top);width:100%;min-height:0;padding:18px 22px 22px;display:block}.course-copy{position:relative;width:100%;max-width:none;grid-column:auto}.course-copy h2{font-size:30px}.course-copy .lede{font-size:14px;line-height:1.8;margin-top:10px}.course-copy .primary{margin-top:14px}.course-count{position:absolute;top:0;left:0;margin:0;gap:8px}.course-count b{font-size:18px}.course-count span{font-size:12px}.course-meter{display:none}.course-copy .kicker{padding-left:65px;font-size:12px;justify-content:flex-start}.course-stage{position:absolute;left:22px;right:22px;top:0;bottom:0;height:auto;grid-column:auto}.course-card{bottom:76px;left:0;right:0;border-radius:16px}.course-media{padding:11px 16px 0}.course-body{padding:7px 16px 12px}.course-body h3{font-size:18px}.course-body p{font-size:14px;line-height:1.65;margin:4px 0 5px}.course-body button{font-size:12px}.course-level,.course-media .code{font-size:12px}.course-select{bottom:28px;gap:8px}.course-select button{width:32px;height:32px}.course-foot{left:22px;right:22px;bottom:9px;font-size:12px;letter-spacing:0}.course-foot span:first-child{display:none}
.tools-chapter{min-height:220svh}.tools-frame{width:100%;height:var(--stage-height);top:var(--stage-top);min-height:0;padding:18px 22px 20px}.tools-intro{width:100%;text-align:right}.tools-intro .kicker{justify-content:flex-start}.tools-intro h2{font-size:30px}.tools-intro .lede{font-size:14px}.tools-stage{width:100%;margin-top:12px;min-height:200px}.tool-label{font-size:12px;max-width:125px;padding-top:8px}.tool-label small{font-size:12px;line-height:1.6}.tool-label--left{left:0;top:8%}.tool-label--right{right:0;top:8%}.tools-caption{font-size:12px;letter-spacing:0;gap:12px}.tools-caption span:first-child{max-width:60%}.feature-grid{margin-top:14px;gap:7px}.feature{min-height:78px;padding:10px 12px}.feature b{font-size:12px}.feature strong{margin-top:5px;font-size:14px}.feature span{font-size:12px;line-height:1.6;margin-top:3px}.diagnostic-list{margin-top:15px}.diagnostic-list div{font-size:14px;gap:12px;padding:10px 0}.diagnostic-list small{font-size:12px}.diagnostics .actions{margin-top:15px}.workshop{min-height:350svh}.workshop-frame{width:100%;height:var(--stage-height);top:var(--stage-top);min-height:0;padding:18px 22px 20px}.workshop-intro{display:block}.workshop-intro h2{font-size:30px}.workshop-intro .lede{max-width:none;font-size:14px}.bench{margin-top:14px}.bench-label{font-size:12px;letter-spacing:0}.bench-item{max-width:120px;font-size:12px;letter-spacing:0}.bench-item:first-of-type{margin-top:40px}.bench-item:last-of-type{margin-bottom:30px}.workshop-bottom{margin-top:12px;gap:12px;display:block}.workshop-bottom p{font-size:12px;line-height:1.6;margin:0 0 10px}.workshop-bottom .primary{min-height:36px;font-size:12px}.article-list{margin-top:14px}.article{padding:9px 0;grid-template-columns:22px 1fr 18px;gap:8px}.article strong{font-size:14px;line-height:1.65}.article-meta{font-size:12px;line-height:1.6}.metric-row{margin-top:15px;gap:8px}.metric{padding:12px 0}.metric strong{font-size:19px}.metric span{font-size:12px;line-height:1.7;margin-top:5px}.site-footer{padding:40px 24px 24px}.footer-grid{grid-template-columns:1fr 1fr;gap:25px}.footer-brand{grid-column:1/-1}.footer-bottom{display:flex;flex-direction:column;font-size:12px;gap:8px}dialog{padding:24px}.dialog-title{font-size:24px}
}
@media(max-height:700px) and (min-width:721px){.chapter h1,.chapter h2{font-size:36px}.lede{font-size:14px;line-height:1.75}.hero-chapter .copy{padding:24px}.chapter__frame{padding-top:20px;padding-bottom:22px}.tools-intro h2{font-size:34px}.tools-intro .lede{font-size:14px}.course-body p{display:none}.course-card{bottom:65px}.course-select{bottom:18px}.course-foot{bottom:0}.workshop-intro h2{font-size:34px}.workshop-bottom p{font-size:12px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{transition:none!important;animation:none!important}.copy,.course-copy{transform:none}.course-card{will-change:auto}}

.hero-chapter{min-height:240svh}.model-controls[data-active='1']{top:calc(var(--stage-top) + var(--stage-height)*.63)}@media(max-width:720px){.hero-chapter{min-height:240svh}.hero-chapter .copy{margin-top:0}.model-controls[data-active='1']{top:calc(var(--stage-top) + var(--stage-height)*.71)}}

.header-actions .login-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 10px;
  opacity: .78;
  transition:
    opacity .2s ease,
    border-color .2s ease,
    color .2s ease;
}

.header-actions .login-link:hover {
  color: var(--teal-readable);
  border-color: var(--teal);
  opacity: 1;
}

.brand {
  letter-spacing: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(114, 240, 0, .48);
  border-radius: 8px;
  color: #173e2b;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(114, 240, 0, .08);
  font-family: Arial, sans-serif;
  font-size: 9px;
  font-weight: 900;
}

.site-footer .brand-mark {
  color: #173e2b;
}

@media (max-width: 720px) {
  .header-actions .login-link {
    display: none;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }
}


/* ============================================================
   CarTroubleshoot homepage header — true dark theme
   ============================================================ */

:root[data-theme="dark"] .site-header {
  color: #edf5ef;
  background:
    linear-gradient(
      180deg,
      rgba(16, 24, 21, 0.68),
      rgba(8, 15, 13, 0.58)
    );
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 10px 30px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(18px) saturate(128%);
  backdrop-filter: blur(18px) saturate(128%);
}

:root[data-theme="dark"] .site-header .brand {
  color: #f4f8f5;
}

:root[data-theme="dark"] .site-header .main-nav a {
  color: #d4e1d8;
}

:root[data-theme="dark"] .site-header .main-nav a:hover {
  color: var(--lime);
}

:root[data-theme="dark"] .site-header .header-search input {
  color: #eef6f0;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.13);
}

:root[data-theme="dark"] .site-header .header-search input::placeholder {
  color: #82958a;
}

:root[data-theme="dark"] .site-header .header-search .icon {
  color: #a7b8ae;
}

:root[data-theme="dark"] .site-header .theme-button {
  color: #dce8e0;
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .site-header .theme-button:hover {
  color: var(--lime);
  background: rgba(114, 240, 0, 0.08);
  border-color: rgba(114, 240, 0, 0.32);
}

:root[data-theme="dark"] .site-header .login-link {
  color: #dce8e0;
  border-color: rgba(255, 255, 255, 0.14);
}

:root[data-theme="dark"] .site-header .login-link:hover {
  color: var(--lime);
  border-color: rgba(114, 240, 0, 0.36);
  background: rgba(114, 240, 0, 0.055);
}

:root[data-theme="dark"] .site-header .join-button {
  color: #15210f;
  background: var(--lime);
  box-shadow: 0 8px 18px rgba(114, 240, 0, 0.12);
}

:root[data-theme="dark"] .site-header .join-button:hover {
  background: #84ff1d;
}

:root[data-theme="dark"] .site-header .menu-button {
  color: #eaf3ed;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

:root[data-theme="dark"] .site-header .brand-mark {
  color: #15210f;
  background: var(--lime);
  border-color: rgba(114, 240, 0, 0.55);
  box-shadow: 0 0 0 4px rgba(114, 240, 0, 0.07);
}

/* Light mode intentionally keeps the supplied bright header. */
:root[data-theme="light"] .site-header {
  color: #244848;
  background: rgba(255, 255, 255, 0.95);
  border-color: #eaecf0;
  box-shadow:
    inset 0 0 12px 2px rgba(255, 255, 255, 0.1),
    0 8px 26px rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] .site-header .main-nav a {
  color: #244848;
}

:root[data-theme="light"] .site-header .header-search input {
  color: #24482f;
  background: #fbfdfc;
  border-color: #b5cbc0;
}

:root[data-theme="light"] .site-header .header-search input::placeholder {
  color: #75867d;
}

:root[data-theme="light"] .site-header .header-search .icon {
  color: #557363;
}


/* Dark glass refinement: keep the header translucent instead of solid black. */
:root[data-theme="dark"] .site-header .header-search input {
  background: rgba(255, 255, 255, 0.035);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

:root[data-theme="dark"] .site-header .theme-button,
:root[data-theme="dark"] .site-header .login-link {
  background: rgba(255, 255, 255, 0.028);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

:root[data-theme="dark"] .site-header::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 88% 0%,
      rgba(114, 240, 0, 0.055),
      transparent 28%
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.018),
      transparent 36%,
      rgba(255, 255, 255, 0.012)
    );
}


/* ============================================================
   Homepage dark theme — remove remaining light/white chapters
   ============================================================ */

:root[data-theme="dark"] {
  --paper: #101712;
  --paper-2: #151e18;
  --ink: #f1f6f2;
  --muted: #9caca1;
  --line-light: rgba(218, 236, 223, 0.12);
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.22);
}

/*
 * Sections that are intentionally light in the source design stay light only
 * in Light mode. In Dark mode they use a soft green-charcoal surface rather
 * than white.
 */
:root[data-theme="dark"] .chapter--light {
  --chapter-bg: #101712;
  --chapter-ink: #f1f6f2;
  --chapter-muted: #9caca1;
  --chapter-line: rgba(218, 236, 223, 0.12);
}

/* Add a little depth instead of a completely flat black panel. */
:root[data-theme="dark"] .chapter--light::before {
  background:
    radial-gradient(
      circle at 18% 24%,
      rgba(114, 240, 0, 0.045),
      transparent 28%
    ),
    radial-gradient(
      circle at 82% 72%,
      rgba(47, 109, 72, 0.075),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      #111914,
      #0d1510
    );
}

/* Accents on formerly-light chapters use the site's main green. */
:root[data-theme="dark"] .chapter--light .kicker,
:root[data-theme="dark"] .chapter--light h2 em,
:root[data-theme="dark"] .chapter--light .chapter-label b,
:root[data-theme="dark"] .chapter--light .feature b,
:root[data-theme="dark"] .chapter--light .bench-label,
:root[data-theme="dark"] .chapter--light .article b {
  color: var(--lime);
}

/* Buttons must no longer introduce white blocks in dark mode. */
:root[data-theme="dark"] .chapter--light .primary {
  color: #15210f;
  background: var(--lime);
  box-shadow: 0 12px 30px rgba(114, 240, 0, 0.11);
}

:root[data-theme="dark"] .chapter--light .secondary {
  color: var(--chapter-ink);
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--chapter-line);
}

/* Feature cards in chapter 04. */
:root[data-theme="dark"] .chapter--light .feature {
  color: var(--chapter-ink);
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.045),
      rgba(255, 255, 255, 0.018)
    );
  border-color: var(--chapter-line);
  box-shadow: none;
}

/* Any reusable chips/cards that land inside a light chapter. */
:root[data-theme="dark"] .chapter--light .club-chip {
  color: var(--chapter-ink);
  background: rgba(16, 25, 20, 0.88);
  border-color: var(--chapter-line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

:root[data-theme="dark"] .chapter--light .club-chip span {
  color: var(--chapter-muted);
}

/* Search boxes should remain glassy/dark if reused in a light chapter. */
:root[data-theme="dark"] .chapter--light .mini-search,
:root[data-theme="dark"] .mini-search {
  color: #f1f6f2;
  background: rgba(17, 26, 21, 0.86);
  border-color: rgba(218, 236, 223, 0.13);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

:root[data-theme="dark"] .mini-search input {
  color: #f1f6f2;
}

:root[data-theme="dark"] .mini-search input::placeholder {
  color: #829389;
}

/*
 * The source marks these chapters as "on-light" while scrolling so the
 * floating model controls remain readable. Override that helper state when
 * the user's actual theme is dark.
 */
:root[data-theme="dark"] body.on-light .model-controls button,
:root[data-theme="dark"] .model-controls button {
  color: #c6d4cb;
  border-color: rgba(218, 236, 223, 0.14);
  background: rgba(11, 20, 15, 0.62);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

:root[data-theme="dark"] body.on-light .model-controls button[aria-pressed="true"],
:root[data-theme="dark"] .model-controls button[aria-pressed="true"] {
  color: #15210f;
  background: var(--lime);
  border-color: var(--lime);
}

:root[data-theme="dark"] body.on-light .model-status,
:root[data-theme="dark"] .model-status {
  color: #9caca1;
}

/* Course cards stay dark even if a parent scene temporarily has on-light. */
:root[data-theme="dark"] .course-card {
  color: #f1f6f2;
  background:
    linear-gradient(
      145deg,
      rgba(18, 31, 23, 0.92),
      rgba(11, 22, 16, 0.88)
    );
  border-color: rgba(218, 236, 223, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

/* Mobile menu/dialogs should follow the selected theme too. */
:root[data-theme="dark"] .mobile-nav.open {
  color: #f1f6f2;
  background: rgba(13, 22, 16, 0.96);
  border-color: rgba(218, 236, 223, 0.12);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

:root[data-theme="dark"] dialog {
  color: #f1f6f2;
  background:
    linear-gradient(
      160deg,
      rgba(17, 29, 21, 0.98),
      rgba(9, 18, 13, 0.98)
    );
  border-color: rgba(218, 236, 223, 0.12);
}

:root[data-theme="dark"] .dialog-body {
  color: #a7b7ad;
}

:root[data-theme="dark"] .dialog-body h3 {
  color: #f1f6f2;
}


/* Light theme footer headings: keep section titles readable on the pale footer. */
:root[data-theme="light"] .site-footer .footer-col h3 {
  color: #173e2b;
}

:root[data-theme="light"] .site-footer .footer-col a,
:root[data-theme="light"] .site-footer .footer-col p {
  color: #315f43;
}

:root[data-theme="light"] .site-footer .footer-brand strong {
  color: #173e2b;
}


/* ============================================================
   Mobile homepage header — keep every control inside the pill
   ============================================================ */

@media (max-width: 720px) {
  .site-header {
    top: 8px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    min-height: 56px;
    margin: 0;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    border-radius: 16px;
    transform: none;
    overflow: hidden;
  }

  .site-header .brand {
    min-width: 0;
    margin: 0;
    gap: 6px;
    flex: 0 1 auto;
    overflow: hidden;
    font-size: 15.5px;
    line-height: 1;
    white-space: nowrap;
  }

  .site-header .brand-mark {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
  }

  .site-header .header-actions {
    min-width: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
    gap: 4px;
  }

  .site-header .header-actions .theme-button {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  .site-header .header-actions .menu-button {
    flex: 0 0 auto;
  }

  .site-header .header-actions .join-button {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    line-height: 1;
  }

  .site-header .header-actions .menu-button {
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.10);
  }

  :root[data-theme="light"] .site-header .header-actions .menu-button {
    border-color: rgba(23, 62, 43, 0.12);
  }

  .mobile-nav.open {
    top: 72px;
    right: 8px;
    left: 8px;
  }
}

@media (max-width: 360px) {
  .site-header {
    gap: 4px;
    padding-right: 6px;
    padding-left: 6px;
  }

  .site-header .brand {
    font-size: 14px;
  }

  .site-header .brand-mark {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
  }

  .site-header .header-actions {
    gap: 3px;
  }

  .site-header .header-actions .theme-button {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .site-header .header-actions .menu-button {
    flex-basis: auto;
  }

  .site-header .header-actions .join-button {
    min-height: 30px;
    padding-right: 8px;
    padding-left: 8px;
    font-size: 11px;
  }
}


/* ============================================================
   Workshop chapter — continuous scroll feedback
   ============================================================ */

.workshop .bench {
  --bench-progress: 0;
  --bench-housing-opacity: 0.32;
  --bench-housing-y: 16px;
  --bench-board-opacity: 0.28;
  --bench-board-y: 18px;
  --bench-final-opacity: 0.38;
  --bench-final-y: 12px;
  overflow: visible;
}

.workshop .bench::before {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--chapter-line);
  pointer-events: none;
}

.workshop .bench::after {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  content: "";
  background:
    linear-gradient(
      90deg,
      var(--lime),
      var(--lime)
    );
  box-shadow: 0 0 16px rgba(114, 240, 0, 0.22);
  transform: scaleX(var(--bench-progress));
  transform-origin: left center;
  pointer-events: none;
  will-change: transform;
}

.workshop .bench-item {
  transition:
    opacity 0.18s linear,
    transform 0.2s ease,
    color 0.2s ease;
}

.workshop .bench-item:first-of-type {
  opacity: var(--bench-housing-opacity);
  transform: translateY(var(--bench-housing-y));
}

.workshop .bench-item:last-of-type {
  opacity: var(--bench-board-opacity);
  transform: translateY(var(--bench-board-y));
}

.workshop[data-bench-step="1"] .bench-item:first-of-type,
.workshop[data-bench-step="2"] .bench-item:first-of-type,
.workshop[data-bench-step="3"] .bench-item:first-of-type,
.workshop[data-bench-step="4"] .bench-item:first-of-type {
  color: var(--accent-text);
}

.workshop[data-bench-step="2"] .bench-item:last-of-type,
.workshop[data-bench-step="3"] .bench-item:last-of-type,
.workshop[data-bench-step="4"] .bench-item:last-of-type {
  color: var(--accent-text);
}

.workshop .workshop-bottom {
  opacity: var(--bench-final-opacity);
  transform: translateY(var(--bench-final-y));
  transition:
    opacity 0.18s linear,
    transform 0.22s ease;
}

.workshop[data-bench-step="1"] .bench-label::after,
.workshop[data-bench-step="2"] .bench-label::after,
.workshop[data-bench-step="3"] .bench-label::after,
.workshop[data-bench-step="4"] .bench-label::after {
  display: inline-block;
  margin-inline-start: 10px;
  color: var(--accent-text);
  content: "01 / HOUSING";
}

.workshop[data-bench-step="2"] .bench-label::after {
  content: "02 / CIRCUIT BOARD";
}

.workshop[data-bench-step="3"] .bench-label::after {
  content: "03 / CONNECTORS";
}

.workshop[data-bench-step="4"] .bench-label::after {
  content: "04 / VERIFY";
}

:root[data-theme="dark"] .workshop .bench::after {
  box-shadow: 0 0 18px rgba(114, 240, 0, 0.16);
}

@media (prefers-reduced-motion: reduce) {
  .workshop .bench-item,
  .workshop .workshop-bottom {
    transition: none;
  }
}

/* Component story: ECU → remapping → wiring → engine → suspension. */
.component-chapter {
  min-height: 255svh;
  --chapter-bg: #070b10;
  --chapter-ink: #f2f6f7;
  --chapter-muted: #9baeb2;
  --chapter-line: rgba(168, 208, 214, 0.16);
  isolation: isolate;
}

.component-chapter.ecu-chapter {
  min-height: 430svh;
}

.component-chapter::before {
  background:
    radial-gradient(circle at 18% 42%, rgba(18, 118, 128, 0.22), transparent 36%),
    radial-gradient(circle at 82% 64%, rgba(204, 102, 45, 0.13), transparent 34%),
    linear-gradient(135deg, #05080c 0%, #0a1418 48%, #10100e 100%);
}

/* A short optical bridge hides the physical edge between adjacent sticky
   chapters while their 3D assemblies cross-dissolve. */
body::after {
  content: '';
  position: fixed;
  z-index: 8;
  pointer-events: none;
  top: var(--stage-top);
  right: 0;
  bottom: 0;
  left: 0;
  opacity: calc(var(--handoff, 0) * 0.72);
  background:
    radial-gradient(ellipse at 50% 52%, rgba(8, 18, 20, 0.60), rgba(3, 7, 10, 0.94)),
    linear-gradient(135deg, #05090c, #0b1113);
  backdrop-filter: blur(calc(var(--handoff, 0) * 4px));
  transition: opacity 80ms linear;
}

.remap-chapter::before,
.engine-chapter::before {
  background:
    radial-gradient(circle at 76% 43%, rgba(19, 129, 145, 0.23), transparent 34%),
    radial-gradient(circle at 15% 72%, rgba(219, 112, 48, 0.13), transparent 33%),
    linear-gradient(145deg, #05090d, #0b1518 54%, #12100d);
}

.component-frame {
  position: sticky;
  overflow: clip;
}

.section-anchor {
  position: absolute;
  top: 0;
}

.component-copy {
  max-width: 460px;
  padding: clamp(22px, 3vw, 42px);
  border: 1px solid rgba(184, 222, 225, 0.12);
  background: linear-gradient(145deg, rgba(8, 15, 20, 0.94), rgba(13, 19, 18, 0.86));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(20px);
}

.component-copy .lede {
  color: #aabbbf;
}

.layer-rail,
.engine-specs,
.map-legend {
  display: grid;
  gap: 9px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--chapter-line);
}

.layer-rail span,
.engine-specs span,
.map-legend span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #bac9cc;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.layer-rail span::before,
.engine-specs span::before {
  content: '';
  width: 17px;
  height: 1px;
  background: linear-gradient(90deg, #3fd5dc, #dc713d);
}

.map-legend {
  grid-template-columns: repeat(3, 1fr);
}

.map-legend span {
  display: grid;
  gap: 6px;
  line-height: 1.6;
}

.map-legend i {
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #25c7d3, #ed8448);
}

/* Generated vehicle X-ray scan study. */
.vehicle-scan {
  position: relative;
  z-index: 9;
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.5fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: center;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(70px, 9vw, 132px) 0;
  direction: rtl;
  color: #edf7f7;
}

.vehicle-scan::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 6% -8%;
  background:
    radial-gradient(circle at 74% 48%, rgba(44, 201, 205, 0.13), transparent 36%),
    radial-gradient(circle at 18% 65%, rgba(9, 30, 53, 0.08), transparent 30%);
  filter: blur(22px);
}

.vehicle-scan__copy h2 {
  margin: 14px 0 20px;
  font-size: clamp(38px, 4.8vw, 68px);
  line-height: 1.34;
}

.vehicle-scan__copy h2 em { color: var(--accent-text); }

.vehicle-scan__copy > p:last-of-type {
  max-width: 420px;
  color: #9eb2b5;
  font-size: 15px;
  line-height: 2;
}

.vehicle-scan__legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(129, 196, 199, 0.18);
  direction: ltr;
}

.vehicle-scan__legend span {
  color: #8ea4a7;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.vehicle-scan__legend span::before {
  content: '';
  display: inline-block;
  width: 13px;
  height: 1px;
  margin-right: 8px;
  vertical-align: middle;
  background: linear-gradient(90deg, #6ff000, #50d6da);
}

.vehicle-scan__visual {
  position: relative;
  perspective: 1100px;
  isolation: isolate;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(9, 30, 53, 0.24);
  background: #03080a;
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.46), 0 0 45px rgba(9, 30, 53, 0.06), inset 0 0 40px rgba(9, 30, 53, 0.05);
}

.vehicle-scan__visual::after {
  content: '';
  position: absolute;
  z-index: 6;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.04), transparent 25%, transparent 70%, rgba(111,240,0,0.055)),
    repeating-linear-gradient(0deg, rgba(111,240,0,0.018) 0 1px, transparent 1px 5px);
}

.vehicle-scan__visual img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 760 / 428;
  object-fit: cover;
}

.vehicle-scan__twin {
  position: relative;
  z-index: 0;
  transform: scale(1.012);
  animation: twin-breathe 9s ease-in-out infinite;
}

.vehicle-scan__beam {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: -12%;
  width: 9%;
  pointer-events: none;
  border-right: 1px solid rgba(180, 255, 114, 0.96);
  background: linear-gradient(90deg, transparent, rgba(9, 30, 53, 0.16) 72%, rgba(211, 255, 177, 0.32));
  filter: drop-shadow(0 0 9px rgba(9, 30, 53, 0.88));
  animation: twin-scan 9s cubic-bezier(.55, 0, .32, 1) infinite;
}

.vehicle-scan__signal {
  position: absolute;
  z-index: 3;
  left: 32%;
  top: 42%;
  width: 38%;
  height: 26%;
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(173, 255, 92, 0.22), transparent 58%),
    repeating-linear-gradient(166deg, transparent 0 8px, rgba(9, 30, 53, 0.18) 9px 10px, transparent 11px 19px);
  mix-blend-mode: screen;
  filter: blur(1px) drop-shadow(0 0 12px rgba(111,240,0,.45));
  transform: rotate(-7deg) scaleX(.82);
  animation: twin-signal 3.4s ease-in-out infinite;
}

.vehicle-scan__flaps {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  pointer-events: none;
  transform-style: preserve-3d;
}

.vehicle-scan__flaps i {
  position: relative;
  display: block;
  min-width: 0;
  border-right: 1px solid rgba(162, 255, 82, 0.22);
  background:
    linear-gradient(180deg, rgba(21, 46, 25, 0.82), rgba(5, 15, 8, 0.92)),
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(9, 30, 53, 0.08) 14px 15px);
  box-shadow: inset 0 -20px 35px rgba(9, 30, 53, 0.06);
  transform-origin: 50% 0;
  backface-visibility: hidden;
  animation: twin-flap-drop 9s cubic-bezier(.72, 0, .2, 1) infinite;
  animation-delay: calc(var(--flap) * 105ms);
}

.vehicle-scan__flaps i::after {
  content: '';
  position: absolute;
  right: 12%;
  bottom: 9px;
  left: 12%;
  height: 2px;
  background: #6ff000;
  box-shadow: 0 0 10px rgba(9, 30, 53, 0.9);
}

.vehicle-scan__visual figcaption {
  position: absolute;
  z-index: 8;
  right: 18px;
  bottom: 14px;
  left: 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: rgba(215, 239, 239, 0.68);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  direction: ltr;
}

@keyframes twin-breathe {
  0%, 100% { transform: scale(1.012); filter: saturate(.92) brightness(.9); }
  50% { transform: scale(1.035); filter: saturate(1.1) brightness(1.04); }
}

@keyframes twin-scan {
  0%, 12% { transform: translateX(0); opacity: 0; }
  18% { opacity: 1; }
  62% { transform: translateX(1240%); opacity: 1; }
  68%, 100% { transform: translateX(1240%); opacity: 0; }
}

@keyframes twin-signal {
  0%, 100% { opacity: .38; transform: rotate(-7deg) scaleX(.82) translateX(-3%); }
  50% { opacity: .9; transform: rotate(-7deg) scaleX(1.08) translateX(3%); }
}

@keyframes twin-flap-drop {
  0%, 15% {
    opacity: .88;
    transform: translateY(0) rotateX(0deg);
  }
  38%, 76% {
    opacity: .08;
    transform: translateY(112%) rotateX(-86deg);
  }
  96%, 100% {
    opacity: .88;
    transform: translateY(0) rotateX(0deg);
  }
}

.vehicle-scan__studies {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 34px);
  margin-top: 10px;
}

.vehicle-scan__study {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(175px, 0.62fr);
  overflow: hidden;
  border: 1px solid rgba(105, 190, 194, 0.20);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(8, 18, 22, 0.72), rgba(6, 11, 14, 0.38));
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.18);
}

.vehicle-scan__study figure {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-right: 1px solid rgba(105, 190, 194, 0.18);
}

.vehicle-scan__study img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 178px;
  object-fit: cover;
}

.vehicle-scan__study figure span {
  position: absolute;
  right: 13px;
  bottom: 11px;
  padding: 5px 7px;
  color: #cde1e1;
  background: rgba(2, 8, 10, 0.68);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  direction: ltr;
}

.vehicle-scan__study > div {
  align-self: center;
  padding: 20px;
}

.vehicle-scan__study h3 {
  margin: 0;
  color: #ecf5f5;
  font-size: 18px;
}

.vehicle-scan__study p {
  margin: 9px 0 0;
  color: #8fa5a8;
  font-size: 12px;
  line-height: 1.9;
}

@media (max-width: 820px) {
  .vehicle-scan {
    grid-template-columns: 1fr;
    width: min(100% - 30px, 760px);
    padding: 72px 0;
  }

  .vehicle-scan__copy h2 { font-size: clamp(34px, 9vw, 48px); }
  .vehicle-scan__copy > p:last-of-type { max-width: 620px; }
  .vehicle-scan__studies { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .vehicle-scan__study { grid-template-columns: 1fr; }
  .vehicle-scan__study figure { border-right: 0; }
}

.ecu-callouts {
  position: absolute;
  direction: rtl;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}

.ecu-callouts > span {
  position: absolute;
  --label-width: 148px;
  left: var(--label-x, 440px);
  top: var(--label-y, 260px);
  width: var(--label-width);
  min-width: 0;
  padding: 8px 10px;
  color: #e8f7f7;
  border: 1px solid rgba(92, 208, 214, 0.36);
  background: rgba(4, 10, 14, 0.78);
  font-size: 12px;
  line-height: 1.5;
  opacity: clamp(0, calc((var(--ecu-progress, 0) - var(--delay)) * 9), 1);
  transform: translateY(calc((1 - clamp(0, calc((var(--ecu-progress, 0) - var(--delay)) * 9), 1)) * 12px));
}

.ecu-callouts > span::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: var(--leader-length, 80px);
  height: 1px;
  background: linear-gradient(90deg, #dd7641, #4bd2d8);
  transform: rotate(var(--leader-angle, 180deg));
  transform-origin: 0 50%;
}

.ecu-callouts > span::after {
  content: '';
  position: absolute;
  top: var(--target-local-y, 50%);
  left: var(--target-local-x, -80px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #55dce0;
  box-shadow: 0 0 0 4px rgba(85, 220, 224, 0.14);
}

.ecu-callouts i {
  display: none;
}

:root[data-theme='light'] .component-chapter {
  --chapter-bg: #edf5ef;
  --chapter-ink: #173e2b;
  --chapter-muted: #536f5c;
  --chapter-line: rgba(23, 63, 40, 0.14);
}

/* Keep the shared site navigation full-bleed on the homepage. */
body.home-automotive-page .site-header {
  position: sticky;
  top: 0;
  right: auto;
  left: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  transform: none;
  border-radius: 0;
}

/* Final light-theme overrides for the full-screen hero scan layers. These
   come after the scan presentation rules so they win the cascade. */
:root[data-theme="light"] .hero-scan::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 22%, transparent 72%, rgba(220, 232, 224, 0.16)),
    linear-gradient(90deg, rgba(45, 143, 0, 0.018), transparent 13%, transparent 87%, rgba(45, 143, 0, 0.014)),
    repeating-linear-gradient(0deg, rgba(23, 63, 40, 0.018) 0 1px, transparent 1px 5px) !important;
  box-shadow: inset 0 0 58px rgba(23, 63, 40, 0.04) !important;
}

:root[data-theme="light"] .hero-scan {
  background:
    radial-gradient(circle at 50% 45%, rgba(180, 220, 190, 0.28), transparent 54%),
    linear-gradient(135deg, #f4f8f5, #e8f1eb 46%, #f7faf8) !important;
}

:root[data-theme="light"] .hero-scan__conceal {
  background:
    radial-gradient(circle at 0 58%, rgba(114, 240, 0, 0.06), transparent 28%),
    linear-gradient(90deg, rgba(245, 249, 246, 0.08), rgba(239, 247, 241, 0.18) 48%, rgba(232, 241, 235, 0.28)),
    repeating-linear-gradient(0deg, transparent 0 17px, rgba(45, 143, 0, 0.018) 18px 19px) !important;
  box-shadow: -9px 0 26px rgba(45, 143, 0, 0.06) !important;
}

/* Light-mode surfaces for the opening and component chapters (01–06). */
:root[data-theme='light'] .hero-chapter {
  --chapter-bg: #f4f8f5;
  --chapter-muted: #536f5c;
}

:root[data-theme='light'] .hero-chapter::before {
  background:
    radial-gradient(ellipse at 20% 38%, rgba(114, 240, 0, 0.10), transparent 35%),
    repeating-linear-gradient(112deg, transparent 0 12vw, rgba(23, 63, 40, 0.025) 12.1vw 12.25vw),
    #f4f8f5;
}

:root[data-theme='light'] .component-chapter::before {
  background:
    radial-gradient(circle at 18% 42%, rgba(45, 143, 0, 0.08), transparent 36%),
    radial-gradient(circle at 82% 64%, rgba(190, 130, 70, 0.07), transparent 34%),
    linear-gradient(135deg, #edf5ef 0%, #f5f9f5 48%, #e8f1eb 100%);
}

:root[data-theme='light'] .remap-chapter::before,
:root[data-theme='light'] .engine-chapter::before {
  background:
    radial-gradient(circle at 76% 43%, rgba(45, 143, 0, 0.09), transparent 34%),
    radial-gradient(circle at 15% 72%, rgba(190, 130, 70, 0.07), transparent 33%),
    linear-gradient(145deg, #edf5ef, #f5f9f5 54%, #e8f1eb);
}

:root[data-theme='light'] .component-copy {
  border-color: rgba(23, 63, 40, 0.14);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(239, 247, 241, 0.86));
  box-shadow: 0 24px 80px rgba(23, 63, 40, 0.10);
}

:root[data-theme='light'] .component-copy .lede,
:root[data-theme='light'] .layer-rail span,
:root[data-theme='light'] .engine-specs span,
:root[data-theme='light'] .map-legend span {
  color: #536f5c;
}

:root[data-theme='light'] body::after {
  background:
    radial-gradient(ellipse at 50% 52%, rgba(232, 242, 235, 0.72), rgba(245, 249, 246, 0.94)),
    linear-gradient(135deg, #edf5ef, #f7faf8);
}

@media (max-width: 720px) {
  .component-chapter {
    min-height: 220svh;
  }

  .component-chapter.ecu-chapter {
    min-height: 360svh;
  }

  .component-copy {
    max-width: none;
    padding: 16px 17px;
    border-radius: 14px;
    background: rgba(5, 11, 15, 0.72);
  }

  .component-copy .lede {
    max-width: 94%;
  }

  .layer-rail,
  .engine-specs,
  .map-legend {
    margin-top: 12px;
    padding-top: 10px;
  }

  .layer-rail,
  .engine-specs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ecu-callouts {
    inset: 0;
  }

  .ecu-callouts > span {
    --label-width: 104px;
    min-width: 100px;
    padding: 5px 7px;
    font-size: 10px;
  }

  .ecu-callouts > span:nth-child(even) {
    display: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  body::after { display: none; }

  .ecu-callouts > span {
    transform: none;
  }
}


/* Light theme: selected 3D model controls must visibly switch state. */
:root[data-theme="light"] .model-controls button[aria-pressed="true"],
:root[data-theme="light"] body.on-light .model-controls button[aria-pressed="true"] {
  color: #173e2b;
  background: var(--lime);
  border-color: var(--lime);
  box-shadow:
    0 7px 18px rgba(114, 240, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

:root[data-theme="light"] .model-controls button[aria-pressed="true"]:hover,
:root[data-theme="light"] body.on-light .model-controls button[aria-pressed="true"]:hover {
  color: #173e2b;
  background: #7cf515;
  border-color: #7cf515;
}


/* Light theme: large chapter/index numbers need visible but subtle contrast. */
:root[data-theme="light"] .hero-index {
  color: rgba(45, 143, 0, 0.17);
  -webkit-text-stroke: 1px rgba(45, 143, 0, 0.045);
  text-shadow: 0 0 28px rgba(114, 240, 0, 0.035);
}

/* Keep other numeric navigation accents readable on pale sections too. */
:root[data-theme="light"] body.on-light .chapter-progress button {
  color: rgba(39, 78, 57, 0.58);
}

:root[data-theme="light"] body.on-light .chapter-progress button.active {
  color: #2d8f00;
}

:root[data-theme="light"] .chapter--light .chapter-label b,
:root[data-theme="light"] .course-count b {
  color: #2d8f00;
}


/* ============================================================
   CarTroubleshoot neutral black base palette
   Green stays an accent only; backgrounds are no longer green-tinted.
   ============================================================ */

:root {
  --deep: #080a0d;
  --deep-2: #0d1014;
  --paper: #f7f8f9;
  --paper-2: #eceff1;
  --ink: #15191f;
  --muted: #68707a;
  --line-dark: rgba(232, 237, 242, 0.13);
  --line-light: rgba(21, 25, 31, 0.12);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
}

/* Dark mode: true black / graphite surfaces. */
:root[data-theme="dark"] {
  --deep: #050608;
  --deep-2: #0a0c0f;
  --paper: #101318;
  --paper-2: #15191f;
  --ink: #f2f4f6;
  --muted: #9ca3ad;
  --line-dark: rgba(255, 255, 255, 0.11);
  --line-light: rgba(255, 255, 255, 0.09);
}

/* Light mode stays neutral instead of pale green. */
:root[data-theme="light"] {
  --deep: #f3f4f5;
  --deep-2: #e9ebed;
  --paper: #f8f9fa;
  --paper-2: #eef0f2;
  --ink: #161a20;
  --muted: #68707a;
  --line-dark: rgba(22, 26, 32, 0.12);
  --line-light: rgba(22, 26, 32, 0.11);
}

/* Main chapter surfaces. */
:root[data-theme="dark"] .chapter,
:root[data-theme="dark"] .chapter--light {
  --chapter-bg: #080a0d;
  --chapter-ink: #f2f4f6;
  --chapter-muted: #9ca3ad;
  --chapter-line: rgba(255, 255, 255, 0.10);
}

:root[data-theme="light"] .chapter,
:root[data-theme="light"] .chapter--light {
  --chapter-bg: #f7f8f9;
  --chapter-ink: #161a20;
  --chapter-muted: #68707a;
  --chapter-line: rgba(22, 26, 32, 0.11);
}

/* Remove the previous green cast from light chapter backdrops. */
:root[data-theme="light"] .chapter--light::before {
  background:
    radial-gradient(
      circle at 82% 22%,
      rgba(114, 240, 0, 0.035),
      transparent 28%
    ),
    linear-gradient(
      180deg,
      #f9fafb,
      #f3f4f5
    );
}

/* Dark chapters get graphite depth, with only a very subtle green accent. */
:root[data-theme="dark"] .chapter::before,
:root[data-theme="dark"] .chapter--light::before {
  background:
    radial-gradient(
      circle at 18% 26%,
      rgba(114, 240, 0, 0.035),
      transparent 26%
    ),
    radial-gradient(
      circle at 82% 72%,
      rgba(255, 255, 255, 0.018),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      #0b0d10,
      #060709
    );
}

/* Hero background: black rather than green-black. */
:root[data-theme="dark"] .hero-chapter::before {
  background:
    radial-gradient(
      ellipse at 20% 38%,
      rgba(114, 240, 0, 0.07),
      transparent 34%
    ),
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.18),
      rgba(0, 0, 0, 0.34) 48%,
      rgba(0, 0, 0, 0.64)
    ),
    repeating-linear-gradient(
      112deg,
      transparent 0 12vw,
      rgba(255, 255, 255, 0.018) 12.1vw 12.25vw
    ),
    #07090b;
}

:root[data-theme="light"] .hero-chapter::before {
  background:
    radial-gradient(
      ellipse at 20% 38%,
      rgba(114, 240, 0, 0.06),
      transparent 34%
    ),
    repeating-linear-gradient(
      112deg,
      transparent 0 12vw,
      rgba(22, 26, 32, 0.018) 12.1vw 12.25vw
    ),
    #f4f5f6;
}

:root[data-theme="light"] .hero-scan::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 22%, transparent 72%, rgba(220, 232, 224, 0.34)),
    linear-gradient(90deg, rgba(45, 143, 0, 0.025), transparent 13%, transparent 87%, rgba(45, 143, 0, 0.02)),
    repeating-linear-gradient(0deg, rgba(23, 63, 40, 0.025) 0 1px, transparent 1px 5px);
  box-shadow: inset 0 0 58px rgba(23, 63, 40, 0.08);
}

/* Course chapter and cards should no longer carry a green tint. */
:root[data-theme="dark"] .course-chapter {
  --chapter-bg: #090b0e;
}

:root[data-theme="dark"] .course-card {
  background: rgba(15, 18, 22, 0.84);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.30);
}

:root[data-theme="light"] .course-card {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(22, 26, 32, 0.10);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.08);
}

/* Floating controls: neutral black glass; green only when active. */
:root[data-theme="dark"] .model-controls button,
:root[data-theme="dark"] body.on-light .model-controls button {
  color: #c6ccd4;
  background: rgba(12, 14, 18, 0.64);
  border-color: rgba(255, 255, 255, 0.12);
}

:root[data-theme="light"] .model-controls button,
:root[data-theme="light"] body.on-light .model-controls button {
  color: #414850;
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(22, 26, 32, 0.14);
}

/* Footer: graphite in dark, neutral gray in light. */
:root[data-theme="dark"] .site-footer {
  color: #f2f4f6;
  background: #090b0e;
}

:root[data-theme="dark"] .site-footer p,
:root[data-theme="dark"] .site-footer .footer-bottom {
  color: #9ca3ad;
}

:root[data-theme="light"] .site-footer {
  color: #171b20;
  background: #eceff1;
}

:root[data-theme="light"] .site-footer p,
:root[data-theme="light"] .site-footer .footer-bottom,
:root[data-theme="light"] .site-footer .footer-col a,
:root[data-theme="light"] .site-footer .footer-col p {
  color: #5f6872;
}

:root[data-theme="light"] .site-footer .footer-col h3,
:root[data-theme="light"] .site-footer .footer-brand strong {
  color: #171b20;
}

/* Header glass uses graphite instead of green-black. */
:root[data-theme="dark"] .site-header {
  background:
    linear-gradient(
      180deg,
      rgba(20, 22, 26, 0.72),
      rgba(8, 10, 13, 0.62)
    );
  border-color: rgba(255, 255, 255, 0.10);
}

:root[data-theme="dark"] .site-header::before {
  background:
    radial-gradient(
      circle at 88% 0%,
      rgba(114, 240, 0, 0.04),
      transparent 28%
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.018),
      transparent 36%,
      rgba(255, 255, 255, 0.012)
    );
}

/* Mobile menu follows the same neutral palette. */
:root[data-theme="dark"] .mobile-nav.open {
  color: #f2f4f6;
  background: rgba(10, 12, 15, 0.96);
  border-color: rgba(255, 255, 255, 0.10);
}

:root[data-theme="light"] .mobile-nav.open {
  color: #171b20;
  background: rgba(248, 249, 250, 0.97);
  border-color: rgba(22, 26, 32, 0.10);
}

/* Dialogs and supporting surfaces. */
:root[data-theme="dark"] dialog {
  color: #f2f4f6;
  background:
    linear-gradient(
      160deg,
      rgba(18, 21, 25, 0.98),
      rgba(7, 9, 11, 0.98)
    );
  border-color: rgba(255, 255, 255, 0.10);
}

:root[data-theme="light"] dialog {
  color: #171b20;
  background: #f8f9fa;
  border-color: rgba(22, 26, 32, 0.10);
}

/* Keep brand green only as the accent color. */
:root[data-theme="dark"] .kicker,
:root[data-theme="dark"] .chapter h1 em,
:root[data-theme="dark"] .chapter h2 em,
:root[data-theme="dark"] .chapter-label b,
:root[data-theme="light"] .kicker,
:root[data-theme="light"] .chapter h1 em,
:root[data-theme="light"] .chapter h2 em,
:root[data-theme="light"] .chapter-label b {
  color: var(--accent-text);
}


/* ============================================================
   Workshop / ECU exploded-view labels — dark mode readability
   ============================================================ */

:root[data-theme="dark"] .workshop .bench-label {
  color: #89f72a;
  opacity: 1;
  text-shadow: 0 0 16px rgba(114, 240, 0, 0.10);
}

:root[data-theme="dark"] .workshop .bench-item {
  color: #b9c2cb;
}

/*
 * Keep inactive scroll-step labels readable on graphite while still
 * preserving a visible emphasis difference for the active step.
 */
:root[data-theme="dark"] .workshop .bench-item:first-of-type {
  opacity: calc(0.64 + (var(--bench-housing-opacity) * 0.36));
}

:root[data-theme="dark"] .workshop .bench-item:last-of-type {
  opacity: calc(0.64 + (var(--bench-board-opacity) * 0.36));
}

:root[data-theme="dark"] .workshop[data-bench-step="1"] .bench-item:first-of-type,
:root[data-theme="dark"] .workshop[data-bench-step="2"] .bench-item:first-of-type,
:root[data-theme="dark"] .workshop[data-bench-step="3"] .bench-item:first-of-type,
:root[data-theme="dark"] .workshop[data-bench-step="4"] .bench-item:first-of-type,
:root[data-theme="dark"] .workshop[data-bench-step="2"] .bench-item:last-of-type,
:root[data-theme="dark"] .workshop[data-bench-step="3"] .bench-item:last-of-type,
:root[data-theme="dark"] .workshop[data-bench-step="4"] .bench-item:last-of-type {
  color: #23b6ff;
  text-shadow: 0 0 14px rgba(114, 240, 0, 0.08);
}

:root[data-theme="dark"] .workshop .bench-label::after {
  color: #23b6ff;
}

/* Light mode remains clean and readable as well. */
:root[data-theme="light"] .workshop .bench-label {
  color: #2d8f00;
}

:root[data-theme="light"] .workshop .bench-item {
  color: #53606b;
}


/* ============================================================
   Homepage navigation active state
   ============================================================ */

.main-nav a.is-active,
.main-nav a[aria-current="page"] {
  position: relative;
  color: var(--lime);
  opacity: 1;
}

.main-nav a.is-active::after,
.main-nav a[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: -9px;
  left: 0;
  height: 2px;
  content: "";
  border-radius: 99px;
  background: var(--lime);
  box-shadow: 0 0 10px rgba(114, 240, 0, 0.22);
}

:root[data-theme="light"] .main-nav a.is-active,
:root[data-theme="light"] .main-nav a[aria-current="page"] {
  color: #2d8f00;
}

.mobile-nav a.is-active,
.mobile-nav a[aria-current="page"] {
  color: var(--lime);
  background: rgba(114, 240, 0, 0.08);
}

:root[data-theme="light"] .mobile-nav a.is-active,
:root[data-theme="light"] .mobile-nav a[aria-current="page"] {
  color: #2d8f00;
  background: rgba(114, 240, 0, 0.09);
}


/* ============================================================
   Mobile chapter footer / 3D controls
   Keep the bottom metadata and model controls in separate rows.
   ============================================================ */

@media (max-width: 720px) {
  .chapter__frame {
    position: sticky;
    padding-bottom: 76px;
  }

  /*
   * The long English descriptor is decorative on mobile and was colliding
   * with the Persian step label and the fixed 3D controls.
   */
  .chapter-label {
    position: absolute;
    right: 18px;
    bottom: 14px;
    left: 18px;
    z-index: 8;
    width: auto;
    min-height: 34px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 0;
    padding-top: 9px;
    border-top: 1px solid var(--chapter-line);
    font-size: 11.5px;
    line-height: 1.55;
    letter-spacing: 0;
    direction: rtl;
  }

  .chapter-label span:first-child {
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-align: right;
  }

  .chapter-label span:last-child {
    display: none;
  }

  /*
   * Controls use their own fixed row above the chapter label.
   * Reset all chapter-specific desktop/mobile top positions first.
   */
  .model-controls,
  .model-controls[data-active="1"],
  .model-controls[data-active="3"],
  .model-controls--center {
    top: auto !important;
    right: auto;
    bottom: calc(60px + env(safe-area-inset-bottom));
    left: 50%;
    width: max-content;
    max-width: calc(100vw - 32px);
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transform: translateX(-50%);
  }

  .model-controls[data-active="5"] {
    display: none;
  }

  .model-controls button {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
  }

  /*
   * Status is a separate centered row above the two controls instead of
   * sitting inline with the chapter footer text.
   */
  .model-status {
    grid-column: 1 / -1;
    grid-row: 1;
    width: min(270px, calc(100vw - 64px));
    max-width: none;
    margin: 0 auto 1px;
    overflow: hidden;
    color: var(--chapter-muted, #b4d0ca);
    font-size: 11px;
    line-height: 1.55;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: rtl;
  }

  .model-controls button:first-of-type {
    grid-column: 1;
    grid-row: 2;
  }

  .model-controls button:nth-of-type(2) {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 380px) {
  .chapter__frame {
    padding-bottom: 72px;
  }

  .chapter-label {
    right: 14px;
    bottom: 11px;
    left: 14px;
    font-size: 11px;
  }

  .model-controls,
  .model-controls[data-active="1"],
  .model-controls[data-active="3"],
  .model-controls--center {
    bottom: calc(55px + env(safe-area-inset-bottom));
  }

  .model-status {
    width: min(235px, calc(100vw - 52px));
    font-size: 10.5px;
  }

  .model-controls button {
    width: 32px;
    height: 32px;
  }
}


/* ============================================================
   Course chapter layout refinement
   Keep the 3D model, its controls, course card, selector and footer
   in clearly separated visual zones on desktop and mobile.
   ============================================================ */

.course-frame {
  overflow: hidden;
}

.course-stage {
  overflow: visible;
}

/* The existing section frames stay intact; these labels travel with the 3D story. */
.component-readout {
  position: fixed;
  top: var(--readout-y, 70vh);
  left: var(--readout-x, 27.5vw);
  z-index: 5;
  width: var(--readout-width, 360px);
  max-width: calc(100vw - 40px);
  color: var(--ink);
  direction: rtl;
  text-align: right;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%);
}

:root[data-theme="dark"] .component-readout {
  color: #f2f4f6;
}

.component-readout__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
}

.component-readout__index {
  letter-spacing: 0.12em;
}

.component-readout h3 {
  margin: 7px 0 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.6;
}

.component-readout p {
  margin: 5px 0 0;
  color: #68707a;
  font-size: 14px;
  line-height: 1.8;
}

:root[data-theme="dark"] .component-readout p {
  color: #a7aeb8;
}

.component-readout__meter {
  display: block;
  height: 1px;
  margin-top: 12px;
  overflow: hidden;
  background: rgba(128, 139, 152, 0.24);
}

.component-readout__meter i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent-text);
  transform: scaleX(var(--part-progress, 0));
  transform-origin: right;
}

.model-ready .object-note {
  visibility: hidden;
}

.model-controls button[hidden] {
  display: none;
}

body.webgl-unavailable .component-readout,
body.model-load-error .component-readout {
  display: none;
}

body.model-load-error .model-controls {
  opacity: 1;
}

body.webgl-unavailable .copy,
body.webgl-unavailable .course-copy {
  opacity: 1;
  transform: none;
}

@media (min-width: 721px) {
  body .model-controls,
  body .model-controls[data-active="1"],
  body .model-controls[data-active="3"],
  body .model-controls--center {
    top: var(--controls-top, calc(var(--stage-top) + var(--stage-height) * 0.85));
  }

  .component-readout[data-chapter="1"] p,
  .component-readout[data-chapter="5"] p,
  .component-readout[data-chapter="2"] p,
  .component-readout[data-chapter="2"] .component-readout__meter {
    display: none;
  }
}

/* Desktop: give the card its own lower zone instead of letting it crowd
   the 3D controls and the chapter footer. */
@media (min-width: 1101px) {
  .course-frame {
    padding-bottom: 42px;
  }

  .course-stage {
    grid-column: 7 / 13;
  }

  .course-card {
    right: 6%;
    bottom: 112px;
    left: 6%;
    max-width: 540px;
    margin-inline: auto;
    border-radius: 15px;
    transform-origin: center bottom;
  }

  .course-select {
    bottom: 56px;
  }

  .course-foot {
    bottom: 15px;
    align-items: center;
  }

  /*
   * In chapter 02 the controls belong to the 3D object, not to the course
   * card. Keep them clearly above the card.
   */
  .model-controls[data-active="1"] {
    top: calc(var(--stage-top) + var(--stage-height) * 0.57);
  }
}

/* Medium desktop/tablet landscape. */
@media (min-width: 721px) and (max-width: 1100px) {
  .course-card {
    right: 5%;
    bottom: 108px;
    left: 5%;
    max-width: 510px;
    margin-inline: auto;
    border-radius: 15px;
    transform-origin: center bottom;
  }

  .course-select {
    bottom: 53px;
  }

  .course-foot {
    bottom: 14px;
  }

  .model-controls[data-active="1"] {
    top: calc(var(--stage-top) + var(--stage-height) * 0.57);
  }
}

/* Mobile: split the sticky chapter into four clean vertical zones:
   copy -> 3D model/controls -> course card -> selector/footer. */
@media (max-width: 720px) {
  .course-frame {
    padding:
      16px
      18px
      calc(18px + env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .course-copy {
    z-index: 10;
  }

  .course-copy h2 {
    max-width: 92%;
    font-size: clamp(29px, 8vw, 35px);
    line-height: 1.4;
  }

  .course-copy .lede {
    max-width: 95%;
    margin-top: 8px;
    font-size: 13.5px;
    line-height: 1.8;
  }

  .course-copy .primary {
    min-height: 42px;
    margin-top: 13px;
    padding-inline: 16px;
  }

  .course-count {
    top: 1px;
    left: 4px;
  }

  .course-copy .kicker {
    padding-left: 72px;
  }

  /*
   * The model controls used to inherit the generic mobile "bottom bar"
   * position and land directly on top of the course card.
   * For chapter 02 they now stay immediately under the 3D model.
   */
  .model-controls[data-active="1"],
  .model-controls[data-active="1"].model-controls--center {
    top: calc(var(--stage-top) + var(--stage-height) * 0.61) !important;
    right: auto;
    bottom: auto !important;
    left: 50%;
    width: max-content;
    max-width: calc(100vw - 40px);
    grid-template-columns: auto auto;
    gap: 7px;
    transform: translateX(-50%);
  }

  /* The text status adds unnecessary vertical clutter in this chapter;
     the selected course card already explains the current component. */
  .model-controls[data-active="1"] .model-status {
    display: none;
  }

  .model-controls[data-active="1"] button {
    grid-row: 1;
  }

  .course-stage {
    top: 0;
    right: 18px;
    bottom: 0;
    left: 18px;
  }

  .course-card {
    right: 0;
    bottom: 92px;
    left: 0;
    max-height: 205px;
    overflow: hidden;
    border-radius: 14px;
    transform-origin: center bottom;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
  }

  .course-media {
    padding: 10px 14px 0;
  }

  .course-media .code,
  .course-level {
    font-size: 11px;
  }

  .course-body {
    padding: 7px 14px 12px;
  }

  .course-body h3 {
    font-size: 17px;
    line-height: 1.55;
  }

  .course-body p {
    display: -webkit-box;
    margin: 4px 0 6px;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .course-body button {
    font-size: 12px;
  }

  .course-select {
    right: 0;
    bottom: 42px;
    left: 0;
    gap: 6px;
  }

  .course-select button {
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 11px;
  }

  .course-foot {
    right: 18px;
    bottom: 8px;
    left: 18px;
    min-height: 22px;
    align-items: center;
    justify-content: flex-start;
    font-size: 11px;
    line-height: 1.4;
  }

  .course-foot span:first-child {
    display: none;
  }

  .course-foot span:last-child {
    width: 100%;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 390px) {
  .course-frame {
    padding-right: 14px;
    padding-left: 14px;
  }

  .course-copy h2 {
    font-size: 28px;
  }

  .course-copy .lede {
    font-size: 13px;
  }

  .model-controls[data-active="1"],
  .model-controls[data-active="1"].model-controls--center {
    top: calc(var(--stage-top) + var(--stage-height) * 0.595) !important;
  }

  .course-stage {
    right: 14px;
    left: 14px;
  }

  .course-card {
    bottom: 88px;
    max-height: 198px;
  }

  .course-select {
    bottom: 40px;
    gap: 5px;
  }

  .course-select button {
    width: 28px;
    height: 28px;
  }

  .course-foot {
    right: 14px;
    bottom: 7px;
    left: 14px;
  }
}

/* Responsive caption/control positions are measured by the scene, not guessed. */
@media (max-width: 720px) {
  .component-readout {
    width: calc(100vw - 44px);
    max-width: none;
    text-align: center;
  }

  .component-readout__meta {
    justify-content: center;
    gap: 12px;
    font-size: 12px;
  }

  .component-readout h3 {
    display: inline;
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
  }

  .component-readout p,
  .component-readout__meter,
  .component-readout__phase {
    display: none;
  }

  .component-readout__meta {
    display: inline-flex;
    margin-inline-end: 8px;
  }

  body .model-controls,
  body .model-controls[data-active="1"],
  body .model-controls[data-active="3"],
  body .model-controls--center,
  body .model-controls[data-active="1"].model-controls--center {
    top: var(--controls-top) !important;
    right: auto;
    bottom: auto !important;
    left: var(--model-x, 50%);
    display: flex;
    width: max-content;
    max-width: calc(100vw - 36px);
    gap: 8px;
    transform: translateX(-50%);
  }

  body .model-controls .model-status {
    display: none;
  }

  .tools-stage .tool-label {
    top: 16%;
  }
}

@media (max-width: 720px) and (max-height: 740px) {
  /* Keep a useful model zone on compact phones; the course card retains details. */
  .course-copy .lede {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #ecu-canvas,
  .component-readout,
  .model-controls {
    transition: none;
  }
}

/* Opening sequence: digital-twin scan -> descending shutters -> live 3D car. */
.hero-scan {
  position: absolute;
  z-index: 40;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  aspect-ratio: auto;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(23,48,32,.72), transparent 54%),
    linear-gradient(135deg, #040706, #09110d 46%, #030506);
  box-shadow: none;
  opacity: var(--hero-scan-opacity, 1);
  transform: translateX(-50%);
  pointer-events: none;
}

.hero-chapter .chapter__frame {
  z-index: 35;
}

.hero-scan::after {
  content: '';
  position: absolute;
  z-index: 5;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(3,8,6,.14), transparent 22%, transparent 72%, rgba(3,8,6,.52)),
    linear-gradient(90deg, rgba(111,240,0,.055), transparent 13%, transparent 87%, rgba(111,240,0,.04)),
    repeating-linear-gradient(0deg, rgba(111,240,0,.025) 0 1px, transparent 1px 5px);
  box-shadow: inset 0 0 58px rgba(0,0,0,.34);
  pointer-events: none;
}

.hero-scan img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: saturate(1.06) brightness(.93);
  transform: scale(var(--hero-scan-scale, 1.025));
}

.hero-scan__signal {
  position: absolute;
  z-index: 2;
  left: 28%;
  top: 37%;
  width: 44%;
  height: 34%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse, rgba(175,255,98,.24), transparent 62%),
    repeating-linear-gradient(166deg, transparent 0 8px, rgba(111,240,0,.18) 9px 10px, transparent 11px 19px);
  mix-blend-mode: screen;
  filter: blur(1px) drop-shadow(0 0 16px rgba(111,240,0,.5));
  opacity: var(--hero-signal-opacity, .28);
  transform: rotate(-7deg) scaleX(var(--hero-signal-scale, .72));
}

.hero-scan__conceal {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--hero-reveal-x, 44%);
  background:
    radial-gradient(circle at 0 58%, rgba(111,240,0,.10), transparent 28%),
    linear-gradient(90deg, rgba(3,8,6,.42), rgba(3,8,6,.72) 48%, rgba(2,5,4,.84)),
    repeating-linear-gradient(0deg, transparent 0 17px, rgba(111,240,0,.032) 18px 19px);
  -webkit-mask-image: linear-gradient(90deg, transparent, rgba(0,0,0,.78) 8%, #000 19%);
  mask-image: linear-gradient(90deg, transparent, rgba(0,0,0,.78) 8%, #000 19%);
  box-shadow: -9px 0 26px rgba(111,240,0,.11);
  pointer-events: none;
}

.hero-scan__beam {
  position: absolute;
  z-index: 6;
  top: 0;
  bottom: 0;
  left: 0;
  width: 8%;
  border-right: 1px solid rgba(203,255,158,.98);
  background: linear-gradient(90deg, transparent, rgba(111,240,0,.14) 68%, rgba(212,255,177,.34));
  filter: drop-shadow(0 0 11px rgba(111,240,0,.95));
  opacity: var(--hero-beam-opacity, 1);
  transform: translateX(var(--hero-scan-x, -120%));
}

.hero-scan__flaps {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  perspective: 1200px;
  transform-style: preserve-3d;
}

.hero-scan__flaps i {
  position: relative;
  display: block;
  min-width: 0;
  border-right: 1px solid rgba(165,255,91,.22);
  background:
    linear-gradient(180deg, rgba(23,54,28,.44), rgba(4,15,8,.62)),
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(111,240,0,.07) 14px 15px);
  box-shadow: inset 0 -20px 38px rgba(111,240,0,.08);
  transform-origin: 50% 0;
  backface-visibility: hidden;
  opacity: var(--hero-flap-opacity, .82);
  transform: translateY(var(--hero-flap-y, 0%)) rotateX(var(--hero-flap-angle, 0deg));
}

.hero-scan__flaps i::after {
  content: '';
  position: absolute;
  right: 12%;
  bottom: 10px;
  left: 12%;
  height: 2px;
  background: #6ff000;
  box-shadow: 0 0 11px rgba(111,240,0,.95);
}

.hero-scan figcaption {
  position: absolute;
  z-index: 7;
  right: clamp(24px, 5vw, 78px);
  bottom: 24px;
  left: clamp(24px, 5vw, 78px);
  display: flex;
  justify-content: space-between;
  color: rgba(225,245,227,.76);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  direction: ltr;
}

body[data-active-chapter="0"] #ecu-canvas {
  opacity: var(--hero-model, 0);
}

body[data-active-chapter="0"]:not(.hero-model-ready) .model-controls {
  opacity: 0;
  pointer-events: none;
}

body:not(.hero-model-ready) .model-controls {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.hero-chapter.is-active .copy,
.hero-chapter.is-active .chapter-label,
.hero-chapter.is-active .scroll-cue,
.hero-chapter.is-active .object {
  opacity: var(--hero-copy, 0);
}

.hero-chapter.is-active .copy {
  transform: translateY(calc((1 - var(--hero-copy, 0)) * 22px));
}

.vehicle-scan__copy {
  grid-column: 1 / -1;
  max-width: none;
  padding: clamp(24px, 3.4vw, 46px);
  border: 1px solid rgba(118, 190, 185, 0.17);
  border-radius: 12px;
  background:
    radial-gradient(circle at 88% 18%, rgba(9, 30, 53, 0.09), transparent 30%),
    linear-gradient(145deg, rgba(7, 17, 15, 0.92), rgba(8, 24, 19, 0.72));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
}

@media (min-width: 821px) {
  .vehicle-scan__copy {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
    grid-template-rows: auto auto auto;
    column-gap: clamp(42px, 6vw, 86px);
    align-items: start;
  }

  .vehicle-scan__copy .kicker {
    grid-column: 1 / -1;
  }

  .vehicle-scan__copy h2 {
    grid-column: 1;
    grid-row: 2 / 4;
    align-self: center;
    margin-bottom: 0;
  }

  .vehicle-scan__copy > p:last-of-type {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
    margin-top: 20px;
  }

  .vehicle-scan__legend {
    grid-column: 2;
    grid-row: 3;
  }
}

/* The journal and final choice share one responsive content frame. */
.balanced-chapter .copy {
  grid-column: 7 / 13;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  max-width: 560px;
  max-height: calc(var(--stage-height) - 110px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--chapter-line) transparent;
  padding: clamp(20px, 2vw, 30px);
  border: 1px solid var(--chapter-line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(7, 17, 13, 0.94), rgba(13, 25, 18, 0.86));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(18px);
}

.balanced-chapter .object {
  grid-column: 1 / 7;
  min-width: 0;
}

.balanced-chapter .article-list,
.balanced-chapter .metric-row {
  margin-top: 20px;
}

.balanced-chapter .article {
  grid-template-columns: 24px minmax(0, 1fr) 20px;
  gap: 10px;
  padding-block: 12px;
}

.balanced-chapter .metric-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.balanced-chapter .metric {
  min-width: 0;
  padding: 14px 4px;
}

.balanced-chapter .metric strong {
  font-size: clamp(18px, 1.6vw, 23px);
}

.balanced-chapter .metric span {
  font-size: 13px;
}

.balanced-chapter .actions {
  gap: 10px;
}

.balanced-chapter .actions a {
  min-width: 0;
  min-height: 44px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 9px;
}

:root[data-theme="light"] .balanced-chapter .copy {
  color: var(--ink);
  border-color: rgba(39, 95, 58, 0.14);
  background: linear-gradient(145deg, rgba(250, 253, 251, 0.96), rgba(233, 243, 236, 0.9));
  box-shadow: 0 12px 32px rgba(24, 64, 38, 0.06);
}

:root[data-theme="light"] .balanced-chapter .copy h2 {
  color: var(--ink);
}

:root[data-theme="light"] .balanced-chapter .copy .lede,
:root[data-theme="light"] .balanced-chapter .layer-rail span {
  color: var(--muted);
}

@media (max-width: 900px) {
  .balanced-chapter .chapter__frame {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    padding: 18px 18px 64px;
  }

  .balanced-chapter .copy {
    grid-column: 1;
    max-width: none;
    max-height: calc(var(--stage-height) - 82px);
    padding: 18px;
    align-self: start;
  }

  .balanced-chapter h2 {
    font-size: clamp(30px, 4.5vw, 36px);
    line-height: 1.38;
  }

  .balanced-chapter .lede {
    max-width: none;
    font-size: 14px;
    line-height: 1.85;
  }

  .balanced-chapter .layer-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
    padding-top: 12px;
  }

  .balanced-chapter .layer-rail span {
    font-size: 13px;
    letter-spacing: 0;
  }

  .balanced-chapter .object {
    display: none;
  }

  .balanced-chapter .chapter-label {
    grid-column: auto;
    grid-row: auto;
    position: absolute;
    inset: auto 18px 14px;
    width: auto;
    min-height: 34px;
    align-items: flex-end;
    direction: rtl;
  }

  .balanced-chapter .chapter-label span:last-child {
    display: none;
  }
}

@media (min-width: 721px) and (max-width: 900px) {
  body[data-active-chapter="0"] .chapter-progress,
  body[data-active-chapter="6"] .chapter-progress,
  body[data-active-chapter="7"] .chapter-progress {
    display: none;
  }
}

@media (max-width: 420px) {
  .balanced-chapter .copy {
    padding: 16px;
  }

  .balanced-chapter .actions {
    grid-template-columns: 1fr;
  }
}

/* Landscape phones keep two usable columns; long copy scrolls inside its
   card so the model and section label retain their own viewport space. */
@media (min-width: 721px) and (max-width: 900px) and (max-height: 560px) {
  .balanced-chapter .chapter__frame {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }

  .balanced-chapter .copy {
    grid-column: 2;
  }
}

body.webgl-unavailable .balanced-chapter .copy {
  max-height: none;
  overflow: visible;
}

@media (min-width: 721px) and (max-width: 900px) {
  body.webgl-unavailable .balanced-chapter .chapter__frame {
    position: relative;
    top: auto;
    height: auto;
    min-height: var(--stage-height);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    gap: 20px;
    padding: 24px 18px;
  }

  body.webgl-unavailable .balanced-chapter .copy {
    grid-column: 1;
  }

  body.webgl-unavailable .balanced-chapter .component-frame::after {
    position: relative;
    inset: auto;
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    height: 300px;
    transform: none;
  }

  body.webgl-unavailable .balanced-chapter .chapter-label {
    position: static;
    grid-column: 1;
    grid-row: 3;
  }
}

.component-readout[data-chapter="2"],
.component-readout[data-chapter="6"],
.component-readout[data-chapter="7"],
.model-controls[data-active="6"],
.model-controls[data-active="7"] {
  visibility: hidden;
  opacity: 0 !important;
  pointer-events: none;
}

@media (min-width: 821px) and (max-width: 1100px) {
  .vehicle-scan__copy h2 {
    font-size: clamp(42px, 5.2vw, 56px);
  }
}

/* WebGL can be disabled by browser policy, GPU drivers or power-saving
   settings. Keep the complete learning path usable with static visuals. */

body.webgl-unavailable::after,
body.webgl-unavailable #ecu-canvas,
body.webgl-unavailable .component-readout,
body.webgl-unavailable .model-controls {
  display: none;
}

body.webgl-unavailable .chapter,
body.webgl-unavailable .hero-chapter,
body.webgl-unavailable .component-chapter,
body.webgl-unavailable .component-chapter.ecu-chapter {
  min-height: max(720px, 100svh);
}

body.webgl-unavailable .copy,
body.webgl-unavailable .course-copy,
body.webgl-unavailable .hero-chapter.is-active .copy,
body.webgl-unavailable .hero-chapter.is-active .chapter-label,
body.webgl-unavailable .hero-chapter.is-active .scroll-cue,
body.webgl-unavailable .hero-chapter.is-active .object {
  opacity: 1;
  transform: none;
}

body.webgl-unavailable .chapter__frame {
  opacity: 1 !important;
  transform: none !important;
}

body.webgl-unavailable .hero-chapter .copy {
  position: relative;
  z-index: 3;
}

body.webgl-unavailable .hero-scan {
  z-index: 1;
  opacity: 0.52;
}

body.webgl-unavailable .hero-scan img {
  object-position: left center;
  transform: scale(1.025);
}

body.webgl-unavailable .hero-scan__conceal,
body.webgl-unavailable .hero-scan__beam,
body.webgl-unavailable .hero-scan__flaps {
  display: none;
}

body.webgl-unavailable .component-frame::after {
  content: '';
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 5%;
  width: 46%;
  height: 58%;
  border: 1px solid rgba(168, 208, 214, 0.18);
  border-radius: 12px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  box-shadow: inset 0 0 70px rgba(4, 12, 14, 0.48);
  transform: translateY(-50%);
  pointer-events: none;
}

body.webgl-unavailable .component-copy,
body.webgl-unavailable .component-frame .chapter-label {
  position: relative;
  z-index: 2;
}

body.webgl-unavailable .ecu-chapter .component-frame::after {
  background-image:
    linear-gradient(rgba(4, 10, 12, 0.14), rgba(4, 10, 12, 0.42)),
    url('../home-automotive/assets/ecu-xray-scan.webp');
  background-size: cover;
}

body.webgl-unavailable .remap-chapter .component-frame::after {
  right: 5%;
  left: auto;
  background-image:
    linear-gradient(rgba(4, 10, 12, 0.04), rgba(4, 10, 12, 0.22)),
    url('../img/home/course-diagnostics.webp');
  background-size: cover;
}

body.webgl-unavailable .wiring-chapter .component-frame::after {
  background-image:
    linear-gradient(rgba(3, 8, 6, 0.04), rgba(3, 8, 6, 0.24)),
    url('../img/home/course-electrical.webp');
  background-size: cover;
}

body.webgl-unavailable .engine-chapter .component-frame::after {
  right: 5%;
  left: auto;
  background-image:
    linear-gradient(rgba(4, 10, 12, 0.02), rgba(4, 10, 12, 0.18)),
    url('../img/home/course-engine.webp');
  background-size: cover;
}

.vehicle-scan,
.motion-showcase,
.motion-videos,
.site-footer,
.model-credits {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}

body.webgl-unavailable .suspension-chapter .component-frame::after {
  background-image:
    radial-gradient(circle at 68% 30%, rgba(114, 240, 0, 0.12), transparent 32%),
    url('../home-automotive/assets/suspension-fallback-v1.webp'),
    linear-gradient(145deg, #05090b, #0b1715 58%, #0d110d);
  background-position: center, center, center;
  background-size: auto, contain, auto;
}

@media (max-width: 720px) {
  body.webgl-unavailable .hero-scan {
    opacity: 0.7;
  }

  body.webgl-unavailable .component-frame {
    grid-template-rows: auto minmax(210px, 1fr) auto;
  }

  body.webgl-unavailable .component-copy {
    grid-row: 1;
  }

  body.webgl-unavailable .component-frame::after,
  body.webgl-unavailable .remap-chapter .component-frame::after,
  body.webgl-unavailable .engine-chapter .component-frame::after {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    grid-row: 2;
    width: 100%;
    height: min(38vh, 310px);
    margin-top: 18px;
    transform: none;
  }

  body.webgl-unavailable .component-frame .chapter-label {
    grid-row: 3;
  }
}


/* ============================================================
   Homepage navigator + 3D motion studies — blue brand pass
   ============================================================ */

body.home-automotive-page .chapter-progress button {
  color: #7893a9;
}

body.home-automotive-page .chapter-progress button.active,
body.home-automotive-page.on-light .chapter-progress button.active {
  color: #23b6ff;
}

body.home-automotive-page .chapter-progress button.active i {
  background: linear-gradient(90deg, #23b6ff, #14e0a5);
  box-shadow: 0 0 9px rgb(35 182 255 / 0.38);
}

.motion-showcase,
:root[data-theme="dark"] .motion-showcase {
  background: #050a10;
  color: #f3f7fb;
}

.motion-showcase .kicker,
.motion-stage__number {
  color: #23b6ff;
}

.motion-showcase__intro h2 em,
:root[data-theme="dark"] .motion-showcase__intro h2 em {
  color: #23b6ff;
  background: linear-gradient(135deg, #23b6ff, #14e0a5);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.motion-showcase__lead p {
  color: #a7b7c8;
}

.motion-stage {
  border-color: #29435d;
  background: #0a233d;
  color: #f3f7fb;
}

.motion-stage__badge,
.motion-stage__annotation p,
.motion-stage__hint,
.motion-stage__transport output {
  color: #a7b7c8;
}

.motion-stage__transport {
  border-top-color: #29435d;
}

.motion-stage__transport button {
  border-color: #3a5873;
  background: #102a43;
  color: #f3f7fb;
}

.motion-stage__transport button:hover:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(135deg, #23b6ff, #14e0a5);
  color: #031820;
}

#motion-timeline {
  accent-color: #23b6ff;
}

.motion-stage__loader {
  border-color: #29435d;
  border-top-color: #23b6ff;
}

.motion-shots {
  border-bottom-color: rgb(41 67 93 / 0.72);
}

.motion-shots button,
.motion-shots button + button {
  border-right-color: rgb(41 67 93 / 0.72);
  color: #f3f7fb;
}

.motion-shots button.is-selected {
  border-bottom-color: #23b6ff;
  background: rgb(35 182 255 / 0.08);
  box-shadow: inset 0 -2px 0 #14e0a5;
}

.motion-shots button > span,
:root[data-theme="dark"] .motion-shots button > span {
  color: #7dd5ff;
}

.motion-showcase :focus-visible {
  outline-color: #23b6ff;
}

@media (max-width: 800px) {
  .motion-shots button.is-selected {
    border-right-color: #23b6ff;
    border-bottom-color: rgb(41 67 93 / 0.72);
    box-shadow: inset -2px 0 0 #14e0a5;
  }
}

@media (max-width: 720px) {
  .hero-scan {
    top: 0;
    bottom: auto;
    width: 100vw;
    aspect-ratio: 16 / 9;
    border-radius: 0;
    transform: translateX(-50%);
  }

  .hero-scan img {
    object-fit: contain;
    object-position: 50% center;
  }

  .hero-chapter.is-active .copy {
    position: absolute;
    z-index: 42;
    top: min(31vw, 245px);
    right: 0;
    left: 0;
    width: auto;
    margin: 0;
    padding: clamp(28px, 8vw, 42px) 22px 24px;
    border: 0;
    border-radius: 0;
    background:
      linear-gradient(180deg, rgba(5,10,8,0), rgba(7,15,11,.78) 25%, rgba(8,17,13,.42) 76%, transparent);
    box-shadow: none;
    opacity: clamp(.82, calc(.82 + var(--hero-copy, 0) * .18), 1);
    transform: translateY(calc((1 - var(--hero-copy, 0)) * 8px));
  }

  .hero-chapter .copy .lede {
    max-width: 34rem;
  }

  .hero-scan figcaption {
    right: 14px;
    bottom: 13px;
    left: 14px;
    font-size: 8px;
    letter-spacing: .09em;
  }

  .hero-scan__flaps { grid-template-columns: repeat(4, 1fr); }
  .hero-scan__flaps i:last-child { display: none; }
  .hero-scan figcaption span:last-child { display: none; }
}

/* One continuous gradient language across the dark site. */
:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 14% 8%, rgba(111,240,0,.075), transparent 29%),
    radial-gradient(circle at 88% 42%, rgba(29,76,55,.18), transparent 34%),
    linear-gradient(145deg, #050807 0%, #0b1310 42%, #06090a 72%, #10150c 100%);
  background-attachment: fixed;
}

:root[data-theme="dark"] .chapter::before,
:root[data-theme="dark"] .chapter--light::before {
  background:
    radial-gradient(circle at 16% 25%, rgba(111,240,0,.052), transparent 27%),
    radial-gradient(circle at 84% 74%, rgba(45,103,75,.12), transparent 34%),
    linear-gradient(145deg, rgba(5,8,7,.98), rgba(12,20,16,.97) 48%, rgba(6,9,10,.98));
}

:root[data-theme="dark"] .hero-chapter::before {
  background:
    radial-gradient(ellipse at 50% 44%, rgba(111,240,0,.075), transparent 43%),
    repeating-linear-gradient(112deg, transparent 0 12vw, rgba(255,255,255,.016) 12.1vw 12.25vw),
    linear-gradient(145deg, #040706, #0b1510 48%, #050709);
}

:root[data-theme="dark"] .motion-showcase {
  background: linear-gradient(145deg, #0b1210, #111b16 48%, #080c0d);
}

:root[data-theme="dark"] .motion-videos {
  background: linear-gradient(145deg, #080d0c, #0f1713 52%, #07090b);
}

@media (prefers-reduced-motion: reduce) {
  .hero-scan__flaps { display: none; }
}

/* Featured courses sit between chapters 08 and 09 without joining the sticky
   chapter system, so the surrounding scene composition remains unchanged. */
.home-featured-courses {
  position: relative;
  z-index: 6;
  padding: clamp(64px, 8vw, 112px) max(22px, calc((100vw - 1320px) / 2));
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(9, 30, 53, .08), transparent 31%),
    linear-gradient(145deg, #0b1210, #111b16 48%, #080c0d);
  color: #edf3ef;
}

.home-featured-courses__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 34px;
}

.home-featured-courses__heading .kicker { margin: 0 0 12px; color: var(--accent-text); }
.home-featured-courses__heading h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.3;
  letter-spacing: -.035em;
}
.home-featured-courses__heading h2 em { color: var(--accent-text); font-style: normal; }
.home-featured-courses__heading p:last-child { margin: 12px 0 0; color: #aebfb6; line-height: 1.9; }
.home-featured-courses__heading > a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border: 1px solid rgba(220, 240, 227, .22);
  border-radius: 999px;
  color: #edf3ef;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.home-featured-courses__heading > a:hover {
  transform: translateY(-2px);
  border-color: var(--lime);
  color: var(--lime);
}

.home-featured-courses__slider-shell {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 14px;
}

.home-featured-courses__viewport {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  direction: rtl;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}
.home-featured-courses__viewport::-webkit-scrollbar { display: none; }
.home-featured-courses__viewport:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 6px;
}

.home-featured-courses__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 54px) / 4);
  gap: 18px;
  min-width: 100%;
  direction: rtl;
}

.home-featured-courses__control {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(220, 240, 227, .2);
  border-radius: 50%;
  background: rgba(20, 31, 26, .88);
  color: #edf3ef;
  cursor: pointer;
  font-size: 22px;
  transition: border-color .2s ease, background .2s ease, color .2s ease, opacity .2s ease, transform .2s ease;
}
.home-featured-courses__control:hover:not(:disabled) {
  transform: scale(1.05);
  border-color: var(--lime);
  color: var(--lime);
}
.home-featured-courses__control:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}
.home-featured-courses__control:disabled {
  opacity: .3;
  cursor: default;
}

.home-featured-courses__status {
  min-height: 20px;
  margin: 14px 60px 0;
  color: #aebfb6;
  font-size: 11px;
  text-align: center;
}

.home-featured-course-card {
  min-width: 0;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  border: 1px solid rgba(220, 240, 227, .14);
  border-radius: 18px;
  background: rgba(20, 31, 26, .82);
  box-shadow: 0 22px 55px rgba(0, 0, 0, .18);
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.home-featured-course-card:hover {
  transform: translateY(-5px);
  border-color: rgba(126, 240, 2, .48);
  box-shadow: 0 28px 65px rgba(0, 0, 0, .26);
}

.home-featured-course-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #132019;
}
.home-featured-course-card__media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(4, 8, 6, .04), rgba(4, 8, 6, .42));
  pointer-events: none;
}
.home-featured-course-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s cubic-bezier(.16, 1, .3, 1);
}
.home-featured-course-card:hover .home-featured-course-card__media img { transform: scale(1.035); }
.home-featured-course-card__media span,
.home-featured-course-card__media b {
  position: absolute;
  z-index: 1;
  top: 12px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1;
}
.home-featured-course-card__media span { right: 12px; background: rgba(5, 12, 8, .78); color: #fff; }
.home-featured-course-card__media b { left: 12px; background: var(--lime); color: #173e2b; }

.home-featured-course-card__body { display: flex; min-height: 218px; flex-direction: column; padding: 17px; }
.home-featured-course-card__body > small { color: var(--accent-text); font-size: 11px; font-weight: 800; }
.home-featured-course-card__body h3 { margin: 8px 0 0; font-size: 17px; line-height: 1.7; }
.home-featured-course-card__body h3 a { color: #f2f7f3; }
.home-featured-course-card__body > p {
  display: -webkit-box;
  min-height: calc(1.85em * 3);
  margin: 8px 0 18px;
  overflow: hidden;
  color: #aebfb6;
  font-size: 13px;
  line-height: 1.85;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.home-featured-course-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid rgba(220, 240, 227, .12);
  font-size: 12px;
}
.home-featured-course-card__meta span { overflow: hidden; color: #aebfb6; text-overflow: ellipsis; white-space: nowrap; }
.home-featured-course-card__meta strong { color: var(--lime); white-space: nowrap; }

:root[data-theme="light"] .home-featured-courses {
  background:
    radial-gradient(circle at 12% 8%, rgba(82, 179, 0, .09), transparent 31%),
    linear-gradient(145deg, #f3f6f3, #e8efeb 52%, #f7f9f7);
  color: #173e2b;
}
:root[data-theme="light"] .home-featured-courses__heading h2 { color: #173e2b; }
:root[data-theme="light"] .home-featured-courses__heading p:last-child { color: #536f5c; }
:root[data-theme="light"] .home-featured-courses__heading > a { border-color: rgba(23, 62, 43, .2); color: #173e2b; }
:root[data-theme="light"] .home-featured-courses__control { border-color: rgba(23, 62, 43, .17); background: rgba(255, 255, 255, .92); color: #173e2b; }
:root[data-theme="light"] .home-featured-courses__status { color: #536f5c; }
:root[data-theme="light"] .home-featured-course-card { border-color: rgba(23, 62, 43, .13); background: rgba(255, 255, 255, .9); box-shadow: 0 18px 45px rgba(31, 67, 46, .09); }
:root[data-theme="light"] .home-featured-course-card__body h3 a { color: #173e2b; }
:root[data-theme="light"] .home-featured-course-card__body > p,
:root[data-theme="light"] .home-featured-course-card__meta span { color: #536f5c; }
:root[data-theme="light"] .home-featured-course-card__meta { border-top-color: rgba(23, 62, 43, .12); }
:root[data-theme="light"] .home-featured-course-card__meta strong { color: #348000; }

@media (max-width: 1100px) {
  .home-featured-courses__track { grid-auto-columns: calc((100% - 18px) / 2); }
}

@media (max-width: 720px) {
  .home-featured-courses { padding: 54px 18px; }
  .home-featured-courses__heading { display: block; margin-bottom: 24px; }
  .home-featured-courses__heading h2 { font-size: clamp(32px, 10vw, 44px); }
  .home-featured-courses__heading > a { margin-top: 18px; }
  .home-featured-courses__slider-shell { display: block; }
  .home-featured-courses__track { grid-auto-columns: min(86vw, 340px); gap: 14px; }
  .home-featured-courses__control { display: none; }
  .home-featured-courses__status { margin-inline: 0; }
  .home-featured-course-card__body { min-height: 0; }
}
/* A self-contained ninth section; the original eight scroll chapters are intact. */
.motion-showcase {
  position: relative;
  z-index: 6;
  padding: clamp(64px, 8vw, 120px) max(22px, calc((100vw - 1320px) / 2)) 64px;
  background: #edf1ef;
  color: #172324;
  scroll-margin-top: 94px;
}

:root[data-theme="dark"] .motion-showcase {
  background: #101716;
  color: #edf3ef;
}

.motion-showcase__intro {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: end;
  gap: 48px;
  margin-bottom: 42px;
}

.motion-showcase__intro h2 {
  margin: 16px 0 0;
  font-size: clamp(36px, 5.6vw, 76px);
  line-height: 1.35;
  letter-spacing: -0.04em;
  font-weight: 850;
}

.motion-showcase__intro h2 em {
  color: #348000;
  font-style: normal;
}

:root[data-theme="dark"] .motion-showcase__intro h2 em {
  color: #94e751;
}

.motion-showcase__lead {
  max-width: 390px;
  justify-self: end;
  padding-bottom: 9px;
}

.motion-showcase__lead p {
  font-size: 17px;
  line-height: 1.95;
  opacity: 0.75;
}

.motion-showcase__lead a {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  margin-top: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid currentColor;
  color: inherit;
  font-size: 15px;
  font-weight: 700;
}

.motion-stage {
  position: relative;
  isolation: isolate;
  height: clamp(560px, 58vw, 760px);
  overflow: hidden;
  border: 1px solid #34413f;
  border-radius: 10px;
  background: #11191b;
  color: #eaf1ed;
  scroll-margin-top: 94px;
}

#motion-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: grab;
}

#motion-canvas:active {
  cursor: grabbing;
}

.motion-stage__top {
  position: absolute;
  top: 24px;
  right: 28px;
  left: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  pointer-events: none;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.motion-stage__badge {
  color: #b0c6b6;
  letter-spacing: 0;
  font-size: 13px;
}

.motion-stage__annotation {
  position: absolute;
  bottom: 113px;
  right: 32px;
  width: min(280px, 28%);
  pointer-events: none;
  text-shadow: 0 2px 12px #101819;
}

.motion-stage__number {
  color: #a5d988;
  font: 12px/1.6 ui-monospace, monospace;
}

.motion-stage__annotation h3 {
  margin: 8px 0 6px;
  font-size: 23px;
  line-height: 1.5;
}

.motion-stage__annotation p {
  margin: 0;
  color: #becbc5;
  font-size: 14px;
  line-height: 1.8;
}

.motion-stage__hint {
  position: absolute;
  bottom: 110px;
  left: 28px;
  margin: 0;
  color: #aabdb3;
  font-size: 13px;
  pointer-events: none;
}

.motion-stage__transport {
  position: absolute;
  right: 24px;
  bottom: 20px;
  left: 24px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 20px;
  padding: 18px 0 0;
  border-top: 1px solid #41524d;
}

.motion-stage .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.motion-stage__transport button {
  min-height: 42px;
  padding: 7px 15px;
  border: 1px solid #4d6158;
  border-radius: 7px;
  background: #213029;
  color: #eaf1ed;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.motion-stage__transport button:hover:not(:disabled) {
  border-color: #a6d788;
  background: #304335;
}

.motion-stage__transport button:disabled {
  opacity: 0.45;
  cursor: default;
}

#motion-timeline {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  margin: 0;
  accent-color: #a7db88;
  cursor: ew-resize;
}

#motion-time {
  color: #b7c7bd;
  font: 12px/1.5 ui-monospace, monospace;
  white-space: nowrap;
}

.motion-stage__loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 30px;
  background: #11191b;
  text-align: center;
  pointer-events: none;
}

.motion-stage.is-ready .motion-stage__loading {
  display: none;
}

.motion-stage__loader {
  width: 28px;
  height: 28px;
  border: 2px solid #41594b;
  border-top-color: #a7db88;
  border-radius: 50%;
  animation: motion-loader-turn 1s linear infinite;
}

.motion-stage.is-unavailable .motion-stage__loader {
  display: none;
}

.motion-shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid #63726b40;
}

.motion-shots button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 26px 24px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: right;
  cursor: pointer;
  transition: background 180ms, border-color 180ms;
}

.motion-shots button + button {
  border-right: 1px solid #63726b40;
}

.motion-shots button.is-selected {
  border-bottom-color: #78b94a;
  background: #78b94a0d;
}

.motion-shots button > span {
  color: #63806c;
  font: 12px/1.6 ui-monospace, monospace;
  letter-spacing: 0.05em;
}

:root[data-theme="dark"] .motion-shots button > span {
  color: #a2bdad;
}

.motion-shots strong {
  font-size: 20px;
  font-weight: 750;
}

.motion-shots small {
  opacity: 0.68;
  font-size: 14px;
}

.motion-showcase__note {
  margin-top: 20px;
  max-width: 800px;
  font-size: 13px;
  line-height: 1.9;
  opacity: 0.62;
}

.motion-showcase :focus-visible {
  outline: 2px solid #89bd65;
  outline-offset: 5px;
}

body.in-motion-showcase .chapter-progress {
  visibility: hidden;
  pointer-events: none;
}

@keyframes motion-loader-turn {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .motion-showcase__intro {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 28px;
  }

  .motion-showcase__lead {
    justify-self: start;
  }

  .motion-showcase__lead p {
    font-size: 16px;
  }

  .motion-stage {
    height: 590px;
  }

  .motion-stage__top {
    top: 20px;
    right: 18px;
    left: 18px;
    font-size: 11px;
  }

  .motion-stage__annotation {
    right: 20px;
    bottom: 144px;
    width: calc(100% - 40px);
  }

  .motion-stage__annotation h3 {
    font-size: 20px;
  }

  .motion-stage__annotation p {
    max-width: 290px;
  }

  .motion-stage__hint {
    display: none;
  }

  .motion-stage__transport {
    right: 16px;
    left: 16px;
    gap: 10px;
    grid-template-columns: auto 1fr auto;
  }

  #motion-timeline {
    grid-row: 1;
    grid-column: 1 / -1;
  }

  #motion-play { grid-column: 1; }
  #motion-time { grid-column: 2; justify-self: center; }
  #motion-reset { grid-column: 3; }

  .motion-stage__transport button {
    padding-inline: 9px;
    font-size: 13px;
  }

  .motion-shots button {
    padding: 20px 10px;
    gap: 7px;
  }

  .motion-shots button > span {
    font-size: 11px;
    letter-spacing: 0;
  }

  .motion-shots strong {
    font-size: 16px;
  }

  .motion-shots small {
    font-size: 12px;
    line-height: 1.8;
  }
}

@media (prefers-reduced-motion: reduce) {
  .motion-stage__loader { animation: none; }
  .motion-shots button { transition: none; }
}

.motion-videos {
  position: relative;
  z-index: 6;
  padding: 72px max(22px, calc((100vw - 1320px) / 2)) 100px;
  background: #e4eae6;
  color: #172324;
  scroll-margin-top: 94px;
}

:root[data-theme="dark"] .motion-videos {
  background: #0b1110;
  color: #edf3ef;
}

:root[data-theme="dark"] .motion-showcase {
  background: linear-gradient(145deg, #0b1210, #111b16 48%, #080c0d);
}

:root[data-theme="dark"] .motion-videos {
  background: linear-gradient(145deg, #080d0c, #0f1713 52%, #07090b);
}

.motion-videos__heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  margin-bottom: 32px;
}

.motion-videos__heading h2 {
  margin: 12px 0 0;
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1.4;
}

.motion-videos__heading > p {
  max-width: 360px;
  font-size: 16px;
  line-height: 1.9;
  opacity: 0.7;
}

.motion-videos__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.motion-video {
  min-width: 0;
}

.motion-video .ct-video-player__viewport {
  aspect-ratio: 16 / 10;
}

.motion-video > video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border: 1px solid #41534b;
  border-radius: 9px;
  background: #11191b;
  object-fit: contain;
}

.motion-video > div:not(.ct-video-player) {
  padding: 20px 0 0;
}

.motion-video span {
  color: #63806c;
  font: 12px/1.6 ui-monospace, monospace;
}

:root[data-theme="dark"] .motion-video span {
  color: #a2bdad;
}

.motion-video h3 {
  margin: 8px 0;
  font-size: 20px;
  line-height: 1.5;
}

.motion-video p {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  opacity: 0.7;
}

.motion-videos__note {
  margin: 32px 0 0;
  padding-top: 18px;
  border-top: 1px solid #63726b40;
  font-size: 13px;
  line-height: 1.9;
  opacity: 0.66;
}

@media (max-width: 800px) {
  .motion-videos__heading { display: block; }
  .motion-videos__heading > p { margin-top: 16px; }
  .motion-videos__grid { grid-template-columns: 1fr; gap: 32px; }
}

.model-credits {
  margin: 0;
  padding: 12px 24px;
  background: var(--deep-2);
  color: var(--chapter-muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
}

.model-credits a {
  color: inherit;
  text-underline-offset: 3px;
}

/* ============================================================
   Mobile layout consolidation
   Keep compact phones usable in both WebGL and image-fallback modes.
   ============================================================ */

@media (max-width: 720px) {
  body {
    min-width: 0;
  }

  main,
  .chapter,
  .chapter__frame,
  .component-frame,
  .vehicle-scan,
  .motion-showcase,
  .motion-videos,
  .site-footer {
    max-width: 100%;
  }

  .site-header {
    right: max(8px, env(safe-area-inset-right));
    left: max(8px, env(safe-area-inset-left));
    overflow: visible;
  }

  .site-header .brand {
    flex: 1 1 auto;
    font-size: clamp(13px, 4.1vw, 15.5px);
  }

  .site-header .header-actions {
    flex: 0 0 auto;
  }

  .site-header .header-actions .menu-button {
    width: 34px;
    height: 34px;
    padding: 6px;
  }

  .chapter h1,
  .chapter h2,
  .hero-chapter h1,
  .motion-showcase__intro h2,
  .motion-videos__heading h2,
  .vehicle-scan__copy h2 {
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  .hero-chapter .actions,
  .growth .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .hero-chapter .actions a,
  .growth .actions a {
    width: 100%;
    padding-inline: 8px;
    text-align: center;
  }

  .vehicle-scan {
    width: calc(100% - 24px);
    gap: 20px;
    padding: 58px 0;
    overflow: clip;
  }

  .vehicle-scan__copy {
    padding: 22px 18px;
    border-radius: 10px;
  }

  .vehicle-scan__copy h2 {
    margin-top: 10px;
    margin-bottom: 14px;
    font-size: clamp(32px, 9vw, 42px);
  }

  .vehicle-scan__copy > p:last-of-type {
    font-size: 14px;
    line-height: 1.9;
  }

  .vehicle-scan__legend {
    gap: 10px 12px;
    margin-top: 20px;
    padding-top: 14px;
  }

  .vehicle-scan__studies {
    gap: 16px;
    margin-top: 0;
  }

  .vehicle-scan__study > div {
    padding: 18px;
  }

  .motion-showcase,
  .motion-videos {
    padding-right: 16px;
    padding-left: 16px;
  }

  .motion-showcase__intro h2 {
    font-size: clamp(32px, 9vw, 42px);
  }

  .motion-stage {
    height: clamp(520px, 82svh, 590px);
  }

  .motion-stage__top {
    gap: 8px;
  }

  .motion-stage__top > span:first-child {
    font-size: 10px;
  }

  .motion-stage__badge {
    font-size: 12px;
  }

  .motion-shots {
    grid-template-columns: 1fr;
  }

  .motion-shots button {
    padding: 18px 14px;
    border-bottom: 1px solid #63726b40;
  }

  .motion-shots button + button {
    border-right: 0;
  }

  .motion-shots button.is-selected {
    border-right: 3px solid #78b94a;
    border-bottom-color: #63726b40;
  }

  .site-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .model-credits {
    padding-right: 16px;
    padding-left: 16px;
    overflow-wrap: anywhere;
  }

  /* A short phone needs more room for the model than the desktop copy does. */
  @media (max-height: 740px) {
    .component-copy .lede {
      display: none;
    }

    .component-copy {
      padding-top: 13px;
      padding-bottom: 13px;
    }

    .component-copy h2 {
      font-size: clamp(27px, 7.7vw, 32px);
    }
  }

  /* Without WebGL there is no scroll-driven scene. Use a normal document
     layout so content never gets trapped inside a short sticky viewport. */
  body.webgl-unavailable .chapter:not(.hero-chapter),
  body.webgl-unavailable .component-chapter,
  body.webgl-unavailable .component-chapter.ecu-chapter {
    min-height: auto;
    scroll-margin-top: 78px;
  }

  body.webgl-unavailable .chapter:not(.hero-chapter) .chapter__frame,
  body.webgl-unavailable .component-frame {
    position: relative;
    top: auto;
    height: auto;
    min-height: calc(100svh - 72px);
    padding: 28px 18px 18px;
    align-content: start;
    overflow: visible;
  }

  body.webgl-unavailable .component-frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 16px;
  }

  body.webgl-unavailable .component-copy,
  body.webgl-unavailable .chapter:not(.hero-chapter) .copy {
    position: relative;
    grid-column: 1;
    grid-row: auto;
    inset: auto;
    width: 100%;
    max-width: none;
    opacity: 1;
    transform: none;
  }

  body.webgl-unavailable .component-copy .lede {
    display: block;
  }

  body.webgl-unavailable .component-frame::after,
  body.webgl-unavailable .remap-chapter .component-frame::after,
  body.webgl-unavailable .engine-chapter .component-frame::after {
    position: relative;
    inset: auto;
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    height: clamp(210px, 46vw, 300px);
    margin: 0;
    transform: none;
  }

  body.webgl-unavailable .ecu-chapter .component-frame::after {
    background-image:
      linear-gradient(rgba(4, 10, 12, 0.04), rgba(4, 10, 12, 0.28)),
      url('../img/home/mobile-sections/ecu-exploded-v1.webp');
    background-position: center;
    background-size: cover;
  }

  body.webgl-unavailable .remap-chapter .component-frame::after {
    background-image:
      linear-gradient(rgba(4, 10, 12, 0.04), rgba(4, 10, 12, 0.28)),
      url('../img/home/mobile-sections/ecu-calibration-v1.webp');
    background-position: center;
    background-size: cover;
  }

  body.webgl-unavailable .wiring-chapter .component-frame::after {
    background-image:
      linear-gradient(rgba(3, 8, 6, 0.02), rgba(3, 8, 6, 0.24)),
      url('../img/home/mobile-sections/wiring-harness-v1.webp');
    background-position: center;
    background-size: cover;
  }

  body.webgl-unavailable .engine-chapter .component-frame::after {
    background-image:
      linear-gradient(rgba(4, 10, 12, 0.02), rgba(4, 10, 12, 0.24)),
      url('../img/home/mobile-sections/engine-structure-v1.webp');
    background-position: center;
    background-size: cover;
  }

  body.webgl-unavailable .suspension-chapter .component-frame::after {
    background-image:
      linear-gradient(rgba(4, 10, 12, 0.02), rgba(4, 10, 12, 0.24)),
      url('../img/home/mobile-sections/suspension-assembly-v1.webp');
    background-position: center;
    background-size: cover;
  }

  body.webgl-unavailable .chapter:not(.hero-chapter) .object {
    display: none;
  }

  body.webgl-unavailable .chapter:not(.hero-chapter) .chapter-label,
  body.webgl-unavailable .component-frame .chapter-label {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    margin-top: auto;
  }

}

@media (max-width: 380px) {
  .site-header .brand-mark {
    display: none;
  }

  .site-header .brand {
    font-size: clamp(12.5px, 4vw, 14px);
  }

  .site-header .header-actions .join-button {
    padding-right: 8px;
    padding-left: 8px;
  }

  .chapter__frame,
  .component-frame {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hero-chapter.is-active .copy {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hero-chapter .actions,
  .growth .actions {
    gap: 6px;
  }

  .metric-row {
    gap: 4px;
  }

  .metric {
    padding-inline: 4px;
  }

  .metric strong {
    font-size: 17px;
  }

  .metric span {
    font-size: 11.5px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-brand {
    grid-column: 1;
  }
}

/* ============================================================
   Final mobile layout pass
   Keep the interactive story readable on narrow and short phones.
   ============================================================ */

.brand-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.webgl-unavailable .ecu-callouts {
  display: none;
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: calc(76px + env(safe-area-inset-top));
  }

  body,
  main {
    width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  .site-header {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    max-width: none;
    padding: 6px 8px;
  }

  .site-header .brand {
    min-width: 0;
    /* max-width: 48%; */
    direction: ltr;
  }

  .site-header .brand-name {
    display: block;
  }

  .site-header .header-actions {
    min-width: max-content;
    margin: 0;
  }

  .site-header .header-actions .join-button {
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav.open {
    top: calc(72px + env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    left: max(8px, env(safe-area-inset-left));
    max-height: calc(100dvh - 88px - env(safe-area-inset-top));
    overflow-y: auto;
  }

  .hero-chapter {
    min-height: 190svh;
  }

  .component-chapter {
    min-height: 180svh;
  }

  .component-chapter.ecu-chapter {
    min-height: 290svh;
  }

  #journal,
  #start {
    min-height: 155svh;
  }

  .chapter__frame,
  .component-frame {
    min-width: 0;
    padding-right: 18px;
    padding-left: 18px;
  }

  .copy,
  .component-copy,
  .chapter h1,
  .chapter h2,
  .lede,
  .layer-rail,
  .engine-specs,
  .map-legend {
    min-width: 0;
    max-width: 100%;
  }

  .component-copy {
    padding: 15px 16px;
  }

  .component-copy h2 {
    font-size: clamp(28px, 8.2vw, 34px);
    line-height: 1.38;
  }

  .component-copy .lede {
    max-width: 100%;
  }

  .layer-rail span,
  .engine-specs span,
  .map-legend span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .chapter-label {
    right: 18px;
    left: 18px;
  }

  .vehicle-scan,
  .motion-showcase,
  .motion-videos {
    min-width: 0;
  }

  .vehicle-scan__study,
  .vehicle-scan__visual,
  .motion-stage,
  .motion-video,
  .motion-video > video,
  .motion-video .ct-video-player {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 720px) and (max-height: 740px) {
  .component-copy {
    padding: 12px 14px;
  }

  .component-copy .lede {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    font-size: 12.5px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .component-copy .layer-rail,
  .component-copy .engine-specs,
  .component-copy .map-legend {
    margin-top: 8px;
    padding-top: 8px;
  }

  .component-copy .layer-rail span,
  .component-copy .engine-specs span,
  .component-copy .map-legend span {
    font-size: 11.5px;
    line-height: 1.55;
  }

  /* The journal and final CTA use nearly the full compact viewport. Their
     decorative vehicle and controls otherwise sit on top of the readable
     content when the browser chrome reduces the available height. */
  body:not(.webgl-unavailable)[data-active-chapter="6"] #ecu-canvas,
  body:not(.webgl-unavailable)[data-active-chapter="7"] #ecu-canvas,
  .component-readout[data-chapter="6"],
  .component-readout[data-chapter="7"],
  .model-controls[data-active="6"],
  .model-controls[data-active="7"] {
    visibility: hidden;
    opacity: 0 !important;
    pointer-events: none;
  }

  #journal .object,
  #start .object {
    display: none;
  }

  #journal .article-list,
  #start .metric-row {
    margin-top: 14px;
  }

  #journal .article {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  #start .actions {
    margin-top: 14px;
  }
}

@media (max-width: 380px) {
  .site-header .brand {
    flex: 0 0 auto;
    width: 28px;
    max-width: 28px;
  }

  .site-header .brand-name {
    display: none;
  }

  .site-header .brand-mark {
    width: 28px;
    height: 28px;
    display: grid;
    flex-basis: 28px;
  }

  .site-header .header-actions {
    margin-right: auto;
  }

  .site-header .header-actions .join-button {
    max-width: 96px;
    padding-right: 9px;
    padding-left: 9px;
  }

  .chapter__frame,
  .component-frame {
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero-chapter.is-active .copy {
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero-chapter h1,
  .chapter h2,
  .component-copy h2 {
    font-size: clamp(26px, 8.5vw, 31px);
  }

  .hero-chapter .lede,
  .chapter .lede {
    font-size: 13px;
  }

  .hero-chapter .actions,
  .growth .actions {
    gap: 6px;
  }

  .hero-chapter .actions a,
  .growth .actions a {
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
    font-size: 11.5px;
  }

  .chapter-label {
    right: 14px;
    left: 14px;
  }

  .footer-brand .brand {
    width: auto;
    max-width: 100%;
  }

  .footer-brand .brand-name {
    display: block;
  }
}

/* ============================================================
   Chapters 03–08 — staged editorial motion
   ============================================================ */

#tools,
#diagnostics {
  --story-enter-x: -28px;
}

#plan,
#workshop,
#journal,
#start {
  --story-enter-x: 28px;
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop) .component-copy {
  position: relative;
  overflow: hidden;
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop) .component-copy > :is(.kicker, h2, .lede, .map-legend, .layer-rail, .engine-specs),
body.model-ready :is(#journal, #start) .copy > :is(.kicker, h2, .lede, .article-list, .metric-row, .actions) {
  opacity: 0;
  filter: blur(6px);
  transform: translate3d(var(--story-enter-x), 12px, 0);
  transition:
    opacity 620ms ease,
    transform 780ms cubic-bezier(.16, 1, .3, 1),
    filter 620ms ease;
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop, #journal, #start).is-active .copy > :is(.kicker, h2, .lede, .map-legend, .layer-rail, .engine-specs, .article-list, .metric-row, .actions) {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0);
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop, #journal, #start) .copy > .kicker {
  transition-delay: 40ms;
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop, #journal, #start) .copy > h2 {
  transition-delay: 110ms;
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop, #journal, #start) .copy > .lede {
  transition-delay: 200ms;
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop) .copy > :is(.map-legend, .layer-rail, .engine-specs),
body.model-ready :is(#journal, #start) .copy > :is(.article-list, .metric-row) {
  transition-delay: 300ms;
}

body.model-ready #start .copy > .actions {
  transition-delay: 430ms;
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop) .component-copy::after {
  content: '';
  position: absolute;
  z-index: 6;
  top: -18%;
  bottom: -18%;
  left: -32%;
  width: 17%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(157, 255, 89, 0.16), rgba(220, 255, 194, 0.32), transparent);
  filter: blur(8px);
  opacity: 0;
  transform: skewX(-12deg);
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop).is-active .component-copy::after {
  animation: ct-story-scan 1.35s 180ms cubic-bezier(.22, 1, .36, 1) both;
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop) :is(.map-legend, .layer-rail, .engine-specs) span,
body.model-ready #journal .article,
body.model-ready #start .metric,
body.model-ready #start .actions > * {
  opacity: 0;
  transform: translate3d(0, 13px, 0) scale(.985);
  transition:
    opacity 480ms ease,
    transform 620ms cubic-bezier(.16, 1, .3, 1),
    border-color 320ms ease,
    box-shadow 320ms ease;
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop).is-active :is(.map-legend, .layer-rail, .engine-specs) span,
body.model-ready #journal.is-active .article,
body.model-ready #start.is-active .metric,
body.model-ready #start.is-active .actions > * {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop).is-active :is(.map-legend, .layer-rail, .engine-specs) span:nth-child(1),
body.model-ready #journal.is-active .article:nth-child(1),
body.model-ready #start.is-active .metric:nth-child(1) {
  transition-delay: 390ms;
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop).is-active :is(.map-legend, .layer-rail, .engine-specs) span:nth-child(2),
body.model-ready #journal.is-active .article:nth-child(2),
body.model-ready #start.is-active .metric:nth-child(2) {
  transition-delay: 470ms;
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop).is-active :is(.map-legend, .layer-rail, .engine-specs) span:nth-child(3),
body.model-ready #journal.is-active .article:nth-child(3),
body.model-ready #start.is-active .metric:nth-child(3) {
  transition-delay: 550ms;
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop).is-active :is(.map-legend, .layer-rail, .engine-specs) span:nth-child(4) {
  transition-delay: 630ms;
}

body.model-ready #start.is-active .actions > :nth-child(1) {
  transition-delay: 600ms;
}

body.model-ready #start.is-active .actions > :nth-child(2) {
  transition-delay: 680ms;
}

body.model-ready #tools .map-legend i {
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 780ms cubic-bezier(.16, 1, .3, 1);
}

body.model-ready #tools.is-active .map-legend span:nth-child(1) i { transition-delay: 480ms; }
body.model-ready #tools.is-active .map-legend span:nth-child(2) i { transition-delay: 560ms; }
body.model-ready #tools.is-active .map-legend span:nth-child(3) i { transition-delay: 640ms; }

body.model-ready #tools.is-active .map-legend i {
  transform: scaleX(1);
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop, #journal, #start) .chapter-label {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 520ms 460ms ease, transform 680ms 460ms cubic-bezier(.16, 1, .3, 1);
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop, #journal, #start).is-active .chapter-label {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

body.model-ready :is(#tools, #plan, #diagnostics, #workshop, #journal, #start).is-active h2 em {
  animation: ct-story-accent 2.6s 520ms ease-in-out 2;
}

body.model-ready #journal.is-active .article > span:last-child {
  animation: ct-story-arrow 1.15s 900ms ease-in-out 2;
}

body.model-ready #start.is-active .primary {
  animation: ct-story-cta 2.4s 1s ease-in-out 2;
}

@keyframes ct-story-scan {
  0% { left: -32%; opacity: 0; }
  18% { opacity: .72; }
  72% { opacity: .34; }
  100% { left: 116%; opacity: 0; }
}

@keyframes ct-story-accent {
  0%, 100% { text-shadow: 0 0 0 rgba(9, 30, 53, 0); }
  50% { text-shadow: 0 0 24px rgba(9, 30, 53, 0.28); }
}

@keyframes ct-story-arrow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-6px); }
}

@keyframes ct-story-cta {
  0%, 100% { box-shadow: 0 14px 38px rgba(9, 30, 53, 0.16); }
  50% { box-shadow: 0 18px 48px rgba(9, 30, 53, 0.32); }
}

@media (max-width: 720px) {
  #tools,
  #diagnostics {
    --story-enter-x: -16px;
  }

  #plan,
  #workshop,
  #journal,
  #start {
    --story-enter-x: 16px;
  }

  body.model-ready :is(#tools, #plan, #diagnostics, #workshop) .component-copy > :is(.kicker, h2, .lede, .map-legend, .layer-rail, .engine-specs),
  body.model-ready :is(#journal, #start) .copy > :is(.kicker, h2, .lede, .article-list, .metric-row, .actions) {
    filter: blur(3px);
  }

  body.model-ready :is(#tools, #plan, #diagnostics, #workshop, #journal, #start).is-active .copy > :is(.kicker, h2, .lede, .map-legend, .layer-rail, .engine-specs, .article-list, .metric-row, .actions) {
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.model-ready :is(#tools, #plan, #diagnostics, #workshop, #journal, #start) .copy > *,
  body.model-ready :is(#tools, #plan, #diagnostics, #workshop, #journal, #start) .chapter-label,
  body.model-ready :is(#tools, #plan, #diagnostics, #workshop) :is(.map-legend, .layer-rail, .engine-specs) span,
  body.model-ready #journal .article,
  body.model-ready #start .metric,
  body.model-ready #start .actions > *,
  body.model-ready #tools .map-legend i {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  body.model-ready :is(#tools, #plan, #diagnostics, #workshop) .component-copy::after {
    display: none;
  }
}

/* Keep the shared three-light ambient layer between each chapter background
   and the sticky foreground. The generic site layer puts main above the
   lights; this page needs its 3D canvas and chapter frames to straddle it. */
body.home-automotive-page > main {
  z-index: auto;
}

body.home-automotive-page > .ct-site-ambient {
  z-index: 1;
}

body.home-automotive-page .component-chapter {
  isolation: auto;
}

@media (max-width: 720px) {
  body.model-ready main > .chapter {
    touch-action: pan-y pinch-zoom;
  }
}

/* Independent reference vehicles with baked contours; no image-to-model swap. */
.hero-scan__canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-scan__loading {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #dfffd1;
  font-size: 15px;
  line-height: 1.8;
}

.hero-scan__loading[hidden] {
  display: none;
}

.hero-unavailable .hero-scan {
  display: none;
}

.hero-unavailable .hero-chapter .copy {
  opacity: 1;
  transform: none;
}

.hero-scan__analysis {
  position: absolute;
  z-index: 7;
  inset: 0;
  display: block;
  overflow: visible;
  opacity: var(--hero-analysis-opacity, 0.08);
  transform: translate3d(var(--hero-analysis-x, -28px), 0, 0);
  pointer-events: none;
}

.hero-scan__analysis-tether {
  position: absolute;
  top: 48%;
  left: 48%;
  width: 20%;
  height: 1px;
  background: linear-gradient(90deg, rgba(160, 255, 78, 0.12), rgba(160, 255, 78, 0.92));
  box-shadow: 0 0 12px rgba(9, 30, 53, 0.52);
  transform: scaleX(var(--hero-scan-progress, 0));
  transform-origin: left center;
}

.hero-scan__analysis-panel {
  position: absolute;
  top: 17%;
  right: clamp(28px, 5vw, 76px);
  display: grid;
  width: min(26vw, 310px);
  padding: 15px 17px;
  gap: 8px;
  border: 1px solid rgba(137, 255, 51, 0.34);
  border-radius: 8px;
  background: rgba(4, 18, 11, 0.78);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22), inset 3px 0 0 rgba(9, 30, 53, 0.72);
  color: rgba(229, 255, 216, 0.82);
  direction: ltr;
  font: 700 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.08em;
}

.hero-scan__analysis-panel b {
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(137, 255, 51, 0.2);
  color: #8dff39;
  font-size: 11px;
}

.hero-scan__analysis-panel > span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.hero-scan__analysis-panel i {
  color: rgba(225, 245, 227, 0.56);
  font-style: normal;
}

.hero-scan__analysis-panel strong {
  color: #dfffd1;
  font-weight: 800;
}

.hero-scan__intro {
  position: absolute;
  z-index: 7;
  top: 15%;
  right: clamp(28px, 5vw, 78px);
  left: auto;
  width: min(38vw, 520px);
  direction: rtl;
  text-align: right;
  pointer-events: none;
  color: #f0ffe9;
}

.hero-scan__intro-kicker {
  margin: 0 0 14px;
  color: #42c0fe;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.hero-scan__intro h1 {
  margin: 0;
  font-size: clamp(38px, 4.6vw, 72px);
  line-height: 1.2;
  letter-spacing: -.045em;
}

.hero-scan__intro h1 em {
  color: #8dff39;
  font-style: normal;
}

.hero-scan__intro > p:last-child {
  max-width: 420px;
  margin: 18px 0 0;
  color: rgba(225, 245, 227, .72);
  font-size: 16px;
  line-height: 1.9;
}

.hero-chapter .chapter__frame {
  top: 0;
  width: 100%;
  height: 100svh;
  padding-top: max(92px, 8vh);
}

@media (max-width: 720px) {
  .hero-scan__canvas,
  .hero-scan__analysis,
  .hero-scan__intro {
    display: none;
  }

}

@media (max-width: 720px) {
  .hero-chapter .chapter__frame {
    top: 0;
    height: 100svh;
    padding: 0;
  }

  .hero-scan {
    inset: 0;
    width: 100vw;
    height: 100svh;
    aspect-ratio: auto;
    background:
      radial-gradient(circle at 50% 34%, rgba(34, 91, 47, 0.28), transparent 38%),
      linear-gradient(180deg, #030806, #07120c 58%, #030705);
  }

}

/* Keep the opening card on the same content line as chapters 07 and 08. */
@media (min-width: 901px) {
  .hero-chapter .chapter__frame {
    width: var(--wrap);
  }

  .hero-chapter .copy {
    grid-column: 7 / 13;
    width: 100%;
    max-width: 560px;
  }
}

@media (min-width: 721px) and (max-width: 900px) and (min-height: 561px) {
  .component-readout[data-chapter="0"] {
    display: none;
  }

  .hero-chapter .chapter__frame {
    width: 100%;
    padding: 98px 18px 64px;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .hero-chapter .copy {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

  .hero-chapter .object,
  .hero-chapter .chapter-label {
    grid-column: 1;
  }

  .hero-chapter .chapter-label {
    grid-row: 2;
  }
}

@media (min-width: 721px) and (max-width: 900px) and (max-height: 560px) {
  .hero-chapter .chapter__frame {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }

  .hero-chapter .copy {
    grid-column: 2;
    width: 100%;
    max-width: none;
    max-height: calc(var(--stage-height) - 110px);
    overflow-y: auto;
  }

  .hero-chapter .object {
    grid-column: 1;
  }

  .hero-chapter .chapter-label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .hero-chapter.is-active .copy {
    right: 18px;
    left: 18px;
    width: auto;
  }
}

/* Phones use static chapter artwork instead of the scroll-driven 3D scene.
   Let each chapter follow its real content height so no empty viewport-sized
   gaps remain between the text, artwork and the next section. */
@media (max-width: 720px) {
  body.webgl-unavailable .hero-chapter,
  body.webgl-unavailable .hero-chapter .chapter__frame {
    min-height: 100svh;
  }

  body.webgl-unavailable .chapter:not(.hero-chapter),
  body.webgl-unavailable .component-chapter,
  body.webgl-unavailable .component-chapter.ecu-chapter,
  body.webgl-unavailable #journal,
  body.webgl-unavailable #start {
    min-height: 0;
  }

  body.webgl-unavailable .chapter:not(.hero-chapter) .chapter__frame,
  body.webgl-unavailable .component-frame {
    min-height: 0;
  }

  body.webgl-unavailable .component-frame {
    gap: 12px;
    padding-top: 22px;
    padding-bottom: 20px;
  }

  body.webgl-unavailable .component-frame::after,
  body.webgl-unavailable .remap-chapter .component-frame::after,
  body.webgl-unavailable .engine-chapter .component-frame::after {
    height: clamp(200px, 58vw, 250px);
  }

  body.webgl-unavailable .chapter:not(.hero-chapter) .chapter-label,
  body.webgl-unavailable .component-frame .chapter-label {
    margin-top: 4px;
  }

  body.webgl-unavailable #journal .chapter__frame,
  body.webgl-unavailable #start .chapter__frame {
    padding-top: 44px;
    padding-bottom: 32px;
  }
}

/* Lightweight mobile opening: retain the desktop digital-twin character
   without downloading Three.js, the HDR environment or vehicle GLB files. */
.hero-scan__mobile-art,
.hero-scan__mobile-interface {
  display: none;
}

@media (max-width: 720px) {
  body.webgl-unavailable .hero-chapter,
  body.webgl-unavailable .hero-chapter .chapter__frame {
    min-height: 0;
  }

  body.webgl-unavailable .hero-chapter .chapter__frame {
    position: relative;
    top: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: calc(82px + env(safe-area-inset-top)) 14px 22px;
    overflow: hidden;
  }

  body.webgl-unavailable .hero-scan {
    position: relative;
    inset: auto;
    left: auto;
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    align-self: stretch;
    height: clamp(218px, 60vw, 268px);
    border: 1px solid rgba(140, 255, 65, 0.24);
    border-radius: 14px;
    background: #030806;
    box-shadow:
      0 24px 54px rgba(0, 0, 0, 0.26),
      0 0 0 1px rgba(255, 255, 255, 0.025) inset,
      0 0 46px rgba(9, 30, 53, 0.08);
    opacity: 1;
    transform: none;
  }

  .hero-scan__loading,
  .hero-scan figcaption {
    display: none;
  }

  .hero-scan__mobile-art {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: block;
    background-image:
      linear-gradient(180deg, rgba(2, 8, 5, 0.02), rgba(2, 8, 5, 0.18)),
      url('../home-automotive/assets/digital-twin-green.webp');
    background-position: center;
    background-size: cover;
    filter: saturate(1.05) contrast(1.03) brightness(0.9);
    transform: scale(1.025);
    animation: ct-mobile-hero-breathe 8s ease-in-out infinite alternate;
  }

  .hero-scan__mobile-interface {
    position: absolute;
    z-index: 7;
    inset: 0;
    display: block;
    overflow: hidden;
    color: #e4ffd6;
    direction: ltr;
    pointer-events: none;
  }

  .hero-scan__mobile-status {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    border: 1px solid rgba(144, 255, 69, 0.34);
    border-radius: 7px;
    background: rgba(3, 13, 8, 0.68);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    font: 800 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: 0.1em;
    backdrop-filter: blur(7px);
  }

  .hero-scan__mobile-status i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8dff39;
    box-shadow: 0 0 11px rgba(141, 255, 57, 0.9);
    animation: ct-mobile-status-pulse 1.8s ease-in-out infinite;
  }

  .hero-scan__mobile-data {
    position: absolute;
    right: 12px;
    bottom: 14px;
    display: grid;
    width: min(49%, 172px);
    gap: 5px;
    padding: 9px 10px;
    border: 1px solid rgba(144, 255, 69, 0.28);
    border-radius: 7px;
    background: rgba(2, 12, 7, 0.72);
    box-shadow:
      0 10px 30px rgba(0, 0, 0, 0.28),
      inset 2px 0 0 rgba(9, 30, 53, 0.74);
    font: 700 7px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: 0.06em;
    backdrop-filter: blur(7px);
  }

  .hero-scan__mobile-data b {
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(144, 255, 69, 0.18);
    color: #8dff39;
    font-size: 7.5px;
  }

  .hero-scan__mobile-data > span {
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }

  .hero-scan__mobile-data i {
    color: rgba(224, 245, 227, 0.58);
    font-style: normal;
  }

  .hero-scan__mobile-data strong {
    color: #e4ffd6;
    font-weight: 800;
  }

  .hero-scan__mobile-sweep {
    position: absolute;
    z-index: 8;
    top: 0;
    bottom: 0;
    left: -18%;
    width: 16%;
    border-right: 1px solid rgba(220, 255, 191, 0.92);
    background: linear-gradient(90deg, transparent, rgba(9, 30, 53, 0.2));
    filter: drop-shadow(0 0 10px rgba(9, 30, 53, 0.85));
    animation: ct-mobile-hero-scan 4.8s 0.8s cubic-bezier(.55, 0, .45, 1) infinite;
  }

  body.webgl-unavailable .hero-chapter .object {
    display: none;
  }

  body.webgl-unavailable .hero-chapter .copy,
  body.webgl-unavailable .hero-chapter.is-active .copy {
    position: relative;
    inset: auto;
    z-index: 42;
    width: auto;
    max-width: 100%;
    align-self: stretch;
    margin: -26px 0 0;
    padding: 25px 18px 20px;
    border: 1px solid rgba(223, 245, 225, 0.14);
    border-radius: 12px;
    background:
      radial-gradient(circle at 92% 0, rgba(9, 30, 53, 0.11), transparent 32%),
      linear-gradient(145deg, rgba(5, 6, 24, 0.94), rgba(8, 9, 18, 0.88));
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.2);
    opacity: 1;
    transform: none;
    backdrop-filter: blur(14px) saturate(1.08);
  }

  body.webgl-unavailable .hero-chapter h1 {
    font-size: clamp(29px, 8.2vw, 35px);
    line-height: 1.4;
  }

  body.webgl-unavailable .hero-chapter .lede {
    margin-top: 11px;
    font-size: 13.5px;
    line-height: 1.82;
  }

  body.webgl-unavailable .hero-chapter .actions {
    margin-top: 16px;
  }

  body.webgl-unavailable .hero-chapter .chapter-label {
    position: relative;
    inset: auto;
    width: 100%;
    margin-top: 14px;
    padding: 12px 2px 0;
  }

  :root[data-theme="light"] body.webgl-unavailable .hero-chapter .copy {
    border-color: rgba(23, 63, 40, 0.14);
    background:
      radial-gradient(circle at 92% 0, rgba(9, 30, 53, 0.09), transparent 32%),
      rgba(250, 253, 251, 0.94);
    box-shadow: 0 20px 44px rgba(23, 63, 40, 0.13);
  }
}

@keyframes ct-mobile-hero-scan {
  0%, 14% { transform: translateX(0); opacity: 0; }
  22% { opacity: 1; }
  72% { opacity: 0.82; }
  86%, 100% { transform: translateX(760%); opacity: 0; }
}

@keyframes ct-mobile-hero-breathe {
  from { transform: scale(1.025); }
  to { transform: scale(1.055); }
}

@keyframes ct-mobile-status-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1); }
}

/* Keep the homepage headings compact and consistent across every viewport. */
body.home-automotive-page #hero-title {
  font-size: 27px;
}

body.home-automotive-page .chapter h2,
body.home-automotive-page .vehicle-scan__copy h2,
body.home-automotive-page .motion-showcase__intro h2,
body.home-automotive-page .motion-videos__heading h2 {
  font-size: 27px;
}

body.home-automotive-page .vehicle-scan__study h3,
body.home-automotive-page .motion-video h3 {
  font-size: 18px;
}

body.home-automotive-page .motion-stage__annotation h3 {
  font-size: 21px;
}

@media (max-width: 720px) {
  body.home-automotive-page .chapter h2,
  body.home-automotive-page .component-copy h2,
  body.home-automotive-page .vehicle-scan__copy h2,
  body.home-automotive-page .motion-showcase__intro h2,
  body.home-automotive-page .motion-videos__heading h2 {
    font-size: 27px;
  }

  body.home-automotive-page .vehicle-scan__study h3,
  body.home-automotive-page .motion-video h3,
  body.home-automotive-page .motion-stage__annotation h3 {
    font-size: 17px;
  }
}

/* Keep technical labels fully inside the visual instead of letting the
   overlapping copy card cover their lower edge. */
@media (max-width: 720px) {
  .hero-scan__mobile-data {
    bottom: 38px;
  }
}

@media (min-width: 721px) and (max-width: 900px) {
  .hero-scan figcaption {
    gap: 18px;
  }

  .hero-scan figcaption span:last-child {
    display: none;
  }
}

/* Chapters 07 and 08 stage and assemble four vehicle systems. A little more
   scroll distance keeps each path readable without making the sequence drag. */
@media (min-width: 721px) {
  #journal,
  #start {
    min-height: 180svh;
  }
}

/* The homepage uses its own mobile header, so give its menu trigger a
   dedicated high-contrast light-theme treatment. */
@media (max-width: 720px) {
  :root[data-theme="light"] .home-automotive-page .site-header .menu-button {
    display: grid;
    place-items: center;
    color: #174922;
    border: 1px solid #b8d5a9;
    background: #f4faef;
    box-shadow: 0 3px 10px rgb(23 73 34 / .08);
  }

  :root[data-theme="light"] .home-automotive-page .site-header .menu-button:hover,
  :root[data-theme="light"] .home-automotive-page .site-header .menu-button:focus-visible,
  :root[data-theme="light"] .home-automotive-page .site-header .menu-button[aria-expanded="true"] {
    color: #123a1b;
    border-color: var(--lime);
    background: var(--lime);
  }
}

/* The mobile hero originally kept its dark overlay in light mode while the
   theme changed the copy to dark ink. Give the reading area its own light
   surface so the Persian heading and description remain legible. */
@media (max-width: 720px) {
  :root[data-theme="light"] .home-automotive-page .hero-chapter.is-active .copy {
    background:
      linear-gradient(
        180deg,
        rgb(249 250 251 / .9),
        rgb(249 250 251 / .97) 28%,
        rgb(244 246 247 / .94) 78%,
        rgb(244 246 247 / .88)
      );
  }

  :root[data-theme="light"] .home-automotive-page .hero-chapter.is-active .copy h1,
  :root[data-theme="light"] .home-automotive-page .hero-chapter.is-active .copy h2 {
    color: #161a20;
    text-shadow: none;
  }

  :root[data-theme="light"] .home-automotive-page .hero-chapter.is-active .copy .lede {
    color: #4d5863;
    text-shadow: none;
  }
}

/* The technical component chapters keep a dark visual stage in light mode,
   but their copy cards should use a readable light surface. */
:root[data-theme="light"] .home-automotive-page .component-copy {
  border-color: rgb(22 26 32 / .14);
  background:
    linear-gradient(
      145deg,
      rgb(255 255 255 / .96),
      rgb(245 247 248 / .92)
    );
  box-shadow: 0 20px 52px rgb(0 0 0 / .14);
}

:root[data-theme="light"] .home-automotive-page .component-copy h2 {
  color: #161a20;
}

:root[data-theme="light"] .home-automotive-page .component-copy .lede {
  color: #4d5863;
}

:root[data-theme="light"] .home-automotive-page .component-copy :is(
  .layer-rail span,
  .engine-specs span,
  .map-legend span
) {
  color: #4d5863;
}

/* iOS needs a stable 44px touch target and a reset native button appearance. */
@media (max-width: 720px) {
  .home-automotive-page .site-header .header-actions .theme-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    padding: 0;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .home-automotive-page .site-header .header-actions .theme-button .icon {
    width: 20px;
    height: 20px;
    pointer-events: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .home-automotive-page .site-header .header-actions .theme-button:hover {
    transform: none;
  }
}

/* The shared mobile navigation has more destinations than the desktop home
   header. Keep every item reachable on short iPhone viewports. */
@media (max-width: 720px) {
  .home-automotive-page .mobile-nav.open {
    max-height: calc(100dvh - 88px - env(safe-area-inset-top));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }
}

/* Prevent the full-screen hero layer from widening the mobile viewport.
   The earlier desktop centering transform must not survive after inset: 0. */
@media (max-width: 720px) {
  html,
  body.home-automotive-page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
  }

  body.home-automotive-page .hero-scan {
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    transform: none;
  }
}


/* ============================================================
   Opening hero — application blue + mint palette
   The original digital-twin presentation used baked neon-green effects.
   Keep the cinematic background solid and reserve the gradient for the scan.
   ============================================================ */

.hero-scan {
  background:
    radial-gradient(circle at 50% 45%, rgb(35 182 255 / 0.15), transparent 54%),
    linear-gradient(135deg, #050a10, #0a233d 48%, #050a10);
}

.hero-scan::after {
  background:
    linear-gradient(180deg, rgb(5 10 16 / 0.14), transparent 22%, transparent 72%, rgb(5 10 16 / 0.58)),
    linear-gradient(90deg, rgb(35 182 255 / 0.07), transparent 13%, transparent 87%, rgb(20 224 165 / 0.045)),
    repeating-linear-gradient(0deg, rgb(35 182 255 / 0.03) 0 1px, transparent 1px 5px);
}

.hero-scan__signal {
  background:
    radial-gradient(ellipse, rgb(35 182 255 / 0.22), transparent 62%),
    repeating-linear-gradient(166deg, transparent 0 8px, rgb(20 224 165 / 0.16) 9px 10px, transparent 11px 19px);
  filter: blur(1px) drop-shadow(0 0 16px rgb(35 182 255 / 0.48));
}

.hero-scan__conceal {
  background:
    radial-gradient(circle at 0 58%, rgb(35 182 255 / 0.16), transparent 31%),
    linear-gradient(90deg, rgb(10 35 61 / 0.10), rgb(10 35 61 / 0.24) 48%, rgb(5 10 16 / 0.38)),
    repeating-linear-gradient(0deg, transparent 0 17px, rgb(35 182 255 / 0.025) 18px 19px);
  box-shadow: -7px 0 22px rgb(35 182 255 / 0.10);
}

.hero-scan__beam {
  border-right-color: rgb(180 242 255 / 0.98);
  background: linear-gradient(90deg, transparent, rgb(35 182 255 / 0.18) 54%, rgb(20 224 165 / 0.38));
  filter: drop-shadow(0 0 12px rgb(35 182 255 / 0.92));
}

.hero-scan__flaps i {
  border-right-color: rgb(35 182 255 / 0.20);
  background:
    linear-gradient(180deg, rgb(10 35 61 / 0.50), rgb(5 10 16 / 0.72)),
    repeating-linear-gradient(0deg, transparent 0 13px, rgb(35 182 255 / 0.08) 14px 15px);
  box-shadow: inset 0 -20px 38px rgb(20 224 165 / 0.07);
}

.hero-scan__flaps i::after {
  background: linear-gradient(90deg, #23b6ff, #14e0a5);
  box-shadow: 0 0 11px rgb(35 182 255 / 0.92);
}

.hero-scan__loading,
.hero-scan__intro,
.hero-scan__intro > p:last-child,
.hero-scan figcaption {
  color: rgb(230 243 252 / 0.82);
}

.hero-scan__intro h1 em {
  color: #23b6ff;
  background: linear-gradient(135deg, #23b6ff, #14e0a5);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-scan__analysis-tether {
  background: linear-gradient(90deg, rgb(35 182 255 / 0.12), rgb(20 224 165 / 0.92));
  box-shadow: 0 0 12px rgb(35 182 255 / 0.52);
}

.hero-scan__analysis-panel {
  border-color: rgb(35 182 255 / 0.34);
  background: rgb(5 10 16 / 0.80);
  box-shadow: 0 18px 48px rgb(0 0 0 / 0.22), inset 3px 0 0 rgb(20 224 165 / 0.72);
  color: rgb(230 243 252 / 0.82);
}

.hero-scan__analysis-panel b,
.hero-scan__mobile-data b {
  color: #23b6ff;
  border-bottom-color: rgb(35 182 255 / 0.20);
}

@media (max-width: 720px) {
  body.webgl-unavailable .hero-scan {
    border-color: rgb(35 182 255 / 0.25);
    background: #050a10;
    box-shadow:
      0 24px 54px rgb(0 0 0 / 0.26),
      0 0 0 1px rgb(255 255 255 / 0.025) inset,
      0 0 46px rgb(35 182 255 / 0.10);
  }

  .hero-scan__mobile-art {
    filter: hue-rotate(78deg) saturate(1.12) contrast(1.03) brightness(0.92);
  }

  .hero-scan__mobile-interface {
    color: #e6f3fc;
  }

  .hero-scan__mobile-status,
  .hero-scan__mobile-data {
    border-color: rgb(35 182 255 / 0.32);
    background: rgb(5 10 16 / 0.74);
  }

  .hero-scan__mobile-status i {
    background: #23b6ff;
    box-shadow: 0 0 11px rgb(35 182 255 / 0.90);
  }

  .hero-scan__mobile-data {
    box-shadow:
      0 10px 30px rgb(0 0 0 / 0.28),
      inset 2px 0 0 rgb(20 224 165 / 0.74);
  }

  .hero-scan__mobile-data strong {
    color: #e6f3fc;
  }

  .hero-scan__mobile-sweep {
    border-right-color: rgb(180 242 255 / 0.94);
    background: linear-gradient(90deg, transparent, rgb(35 182 255 / 0.20), rgb(20 224 165 / 0.24));
    filter: drop-shadow(0 0 10px rgb(35 182 255 / 0.86));
  }
}


/* Final motion-control override: this must remain after the legacy motion
   block so native range controls and selected shots cannot restore lime. */
.motion-stage__number,
.motion-showcase .kicker {
  color: #23b6ff !important;
}

.motion-stage__transport {
  border-top-color: #29435d !important;
}

.motion-stage__transport button {
  color: #f3f7fb !important;
  border-color: #3a5873 !important;
  background: #102a43 !important;
}

.motion-stage__transport button:hover:not(:disabled) {
  color: #031820 !important;
  border-color: #23b6ff !important;
  background: #23b6ff !important;
}

#motion-timeline {
  accent-color: #23b6ff !important;
}

#motion-timeline::-moz-range-progress {
  background: #23b6ff;
}

#motion-timeline::-moz-range-thumb {
  border-color: #23b6ff;
  background: #23b6ff;
}

.motion-shots button.is-selected {
  border-bottom-color: #23b6ff !important;
  background: rgb(35 182 255 / 0.08) !important;
  box-shadow: inset 0 -2px 0 #23b6ff !important;
}

.motion-shots button > span,
:root[data-theme="dark"] .motion-shots button > span {
  color: #7dd5ff !important;
}

@media (max-width: 800px) {
  .motion-shots button.is-selected {
    border-right-color: #23b6ff !important;
    border-bottom-color: rgb(41 67 93 / 0.72) !important;
    box-shadow: inset -2px 0 0 #23b6ff !important;
  }
}
