@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@500;600;700;800&family=IBM+Plex+Mono:wght@500;600;700&family=Noto+Sans+JP:wght@500;600;700;800&display=swap");

:root {
  --paper: #f4f0e7;
  --panel: #fffdf8;
  --ink: #171914;
  --muted: #68706a;
  --line: #cfd2c8;
  --coral: #ff6e58;
  --acid: #b4ff2b;
  --blue: #6d75f7;
  --mint: #66dec0;
  --yellow: #ffd86f;
  --purple: #8b5cf6;
  --sticky-offset: 56px;
  --shadow: 0 18px 50px rgb(28 31 24 / 10%);
  font-family: "DM Sans", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 5% 1%, rgb(109 117 247 / 14%), transparent 25rem),
    radial-gradient(circle at 95% 4%, rgb(255 110 88 / 13%), transparent 28rem),
    var(--paper);
}
button, input { font: inherit; }
button { color: inherit; }
code, pre { font-family: "IBM Plex Mono", monospace; }

.page { width: min(1580px, calc(100% - 36px)); margin: 0 auto; padding: 30px 0 24px; }
.hero { position: relative; min-height: 184px; padding: 8px 12px 24px; }
.eyebrow,
.section-heading p,
.control-intro p,
.code-heading p {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 9px; color: #08765e; }
.eyebrow i { width: 18px; height: 18px; border: 2px solid currentColor; border-radius: 50%; box-shadow: 6px 6px 0 var(--acid); }
h1 { margin: 12px 0 7px; font-size: clamp(46px, 5vw, 78px); line-height: .94; letter-spacing: 0; font-weight: 800; white-space: nowrap; }
.lead { margin: 18px 0 0; padding-right: 500px; color: var(--muted); font-size: clamp(16px, 1.45vw, 22px); font-weight: 700; }
.lead strong { color: var(--ink); }
.hero-actions { position: absolute; right: 12px; bottom: 24px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.action-button { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 13px; background: rgb(255 253 248 / 84%); cursor: pointer; font-size: 12px; font-weight: 800; }
.action-button.dark { color: white; border-color: var(--ink); background: var(--ink); }
.action-button[aria-pressed="true"] { color: white; border-color: var(--purple); background: var(--purple); }
button:focus-visible, input:focus-visible, .preview-scroller:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.lab, .anatomy-panel, .code-panel { border: 1px solid var(--line); border-radius: 26px; background: var(--panel); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: center; gap: 13px; min-height: 84px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.section-number { display: grid; place-items: center; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 15px; color: white; background: var(--coral); font-family: "IBM Plex Mono", monospace; font-size: 13px; font-weight: 800; }
.section-number.blue { background: var(--blue); }
.section-heading p { color: #08765e; }
.section-heading h2, .code-heading h2 { margin: 2px 0 0; font-size: clamp(20px, 2vw, 29px); line-height: 1.15; }
.heading-stats { display: flex; gap: 8px; margin-left: auto; }
.heading-stats span { padding: 8px 10px; border-radius: 999px; color: #4e57c9; background: #edf0ff; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; }
.heading-stats b { color: var(--blue); font-size: 15px; }

.lab-body { display: grid; grid-template-columns: 286px minmax(0, 1fr); min-height: 760px; }
.controls { padding: 22px; border-right: 1px solid var(--line); border-radius: 0 0 0 26px; background: #faf7ef; }
.control-intro { margin-bottom: 16px; }
.control-intro p { color: #08765e; }
.control-intro h3 { margin: 4px 0 0; font-size: 20px; }
.pattern-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.pattern-list button { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 0 7px; min-height: 59px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: white; text-align: left; cursor: pointer; }
.pattern-list button[data-uses-js="true"]::after { content: "JS"; grid-column: 3; grid-row: 2; align-self: center; padding: 3px 5px; border: 1px solid #4650cf; border-radius: 999px; color: #4650cf; background: #eef0ff; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; line-height: 1; }
.pattern-list button > span { grid-column: 1; grid-row: 1 / 3; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; color: #59605b; background: #edf0eb; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; }
.pattern-list button b { grid-column: 2 / 4; grid-row: 1; overflow: hidden; font-size: 10px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.pattern-list button small { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 10px; font-weight: 700; }
.pattern-list button[aria-pressed="true"] { color: white; border-color: var(--ink); background: var(--ink); }
.pattern-list button[aria-pressed="true"] > span { color: var(--ink); background: var(--acid); }
.pattern-list button[aria-pressed="true"] small { color: #b7beb6; }
.pattern-list button[data-uses-js="true"][aria-pressed="true"]::after { border-color: var(--acid); color: var(--ink); background: var(--acid); }
.pattern-legend { display: flex; align-items: center; gap: 6px; margin: 9px 0 0; color: #686f69; font-size: 10px; font-weight: 700; line-height: 1.4; }
.pattern-legend span { flex: 0 0 auto; padding: 3px 5px; border: 1px solid #4650cf; border-radius: 999px; color: #4650cf; background: #eef0ff; font-family: "IBM Plex Mono", monospace; font-size: 10px; line-height: 1; }
.control-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.control-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.control-title div { display: grid; gap: 3px; }
.control-title span { color: #347269; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.control-title b { font-size: 13px; }
.control-title output { color: #4f59dc; font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 700; }
input[type="range"] { width: 100%; margin: 17px 0 0; accent-color: var(--blue); }
.range-labels { display: flex; justify-content: space-between; color: #7c837d; font-family: "IBM Plex Mono", monospace; font-size: 10px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row span { display: grid; gap: 3px; }
.switch-row b { font-size: 13px; }
.switch-row small { color: var(--muted); font-size: 10px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { position: relative; width: 46px; height: 26px; border-radius: 999px; background: #d5d7d0; transition: background .2s; }
.switch-row i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: white; transition: translate .2s; }
.switch-row input:checked + i { background: var(--purple); }
.switch-row input:checked + i::after { translate: 20px 0; }
.pattern-note { margin-top: 20px; padding: 14px; border: 1px solid #aad7c8; border-radius: 13px; background: #e8fff7; }
.pattern-note span { color: #08775c; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; }
.pattern-note p { margin: 6px 0 0; color: #515a54; font-size: 10px; line-height: 1.55; font-weight: 600; }
.pattern-note code { color: #3f48c9; font-size: 10px; }

.preview-wrap { min-width: 0; padding: 20px; border-radius: 0 0 26px 0; background: #e8ebe5; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; height: 48px; padding: 0 16px; border: 1px solid #bdc2b9; border-bottom: 0; border-radius: 16px 16px 0 0; background: #d8ddd5; }
.preview-toolbar p { display: flex; align-items: center; gap: 6px; margin: 0; color: #6a716b; font-size: 11px; font-weight: 700; }
.preview-toolbar p i { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.preview-toolbar p i:nth-child(2) { background: var(--yellow); }
.preview-toolbar p i:nth-child(3) { background: var(--mint); }
.preview-toolbar div { display: flex; align-items: center; gap: 9px; }
.preview-toolbar span { font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; }
.preview-toolbar b { padding: 6px 9px; border-radius: 7px; color: white; background: var(--ink); font-size: 10px; }
.preview-toolbar b.hybrid { color: var(--ink); background: var(--yellow); }

.preview-scroller { position: relative; overflow: auto; height: 650px; overscroll-behavior: contain; border: 1px solid #bdc2b9; border-radius: 0 0 16px 16px; background: #f8f5ed; scroll-behavior: smooth; scrollbar-color: var(--blue) #e1e3dd; }
.preview-scroller::before { content: "SCROLL ↓"; position: sticky; z-index: 90; top: 10px; left: calc(100% - 82px); display: grid; place-items: center; width: 70px; height: 28px; margin: 10px 10px -38px auto; border-radius: 999px; color: white; background: var(--ink); font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 700; pointer-events: none; }
.sticky-guide { position: sticky; z-index: 120; top: var(--sticky-offset); height: 0; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sticky-guide::after { content: ""; position: absolute; left: 0; right: 0; top: 0; border-top: 2px dashed var(--purple); }
.sticky-guide span { position: absolute; top: -23px; left: 12px; padding: 4px 7px; border-radius: 5px; color: white; background: var(--purple); font-family: "IBM Plex Mono", monospace; font-size: 8px; font-weight: 700; }
.preview-scroller:has(.demo-root[data-structure="true"]) .sticky-guide { opacity: 1; }
.demo-root { min-height: 100%; background-color: #f8f5ed; background-image: linear-gradient(rgb(23 25 20 / 4%) 1px, transparent 1px), linear-gradient(90deg, rgb(23 25 20 / 4%) 1px, transparent 1px); background-size: 28px 28px; }
.demo-root[data-structure="true"] .sticky-target { outline: 4px solid var(--purple); outline-offset: -2px; }
.demo-root[data-structure="true"] .sticky-context { outline: 3px solid var(--coral); outline-offset: -3px; }
.demo-root[data-structure="true"] .sticky-target::after { content: "STICKY"; position: absolute; z-index: 20; top: 7px; right: 7px; padding: 3px 6px; border-radius: 4px; color: white; background: var(--purple); font-family: "IBM Plex Mono", monospace; font-size: 8px; font-style: normal; font-weight: 700; }

.transport { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto; align-items: center; gap: 14px; min-height: 72px; margin-top: 10px; padding: 10px 13px; border: 1px solid #c5c9c1; border-radius: 13px; background: #fff; }
.transport > button { height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #f2f2ed; cursor: pointer; font-size: 10px; font-weight: 800; }
.progress-track { overflow: hidden; height: 6px; border-radius: 999px; background: #e3e5df; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--coral)); }
.transport dl { display: flex; gap: 18px; margin: 0; }
.transport dl div { min-width: 72px; }
.transport dt { color: #707771; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; }
.transport dd { margin: 2px 0 0; font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 700; }
#stateValue { color: #08775c; }

/* Shared miniature demo language */
.scene { position: relative; min-height: 1300px; color: #141711; background: #f8f5ed; }
.scene-kicker { margin: 0 0 10px; font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.scene-title { margin: 0; font-size: clamp(33px, 5vw, 68px); line-height: .92; letter-spacing: 0; }
.scene-copy { max-width: 480px; margin: 16px 0 0; color: #59605b; font-size: 12px; line-height: 1.65; font-weight: 700; }
.mini-button { display: inline-flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 13px; border: 2px solid var(--ink); border-radius: 999px; color: white; background: var(--ink); font-size: 10px; font-weight: 800; }
.scene-end { display: grid; place-items: center; min-height: 300px; padding: 40px; text-align: center; }
.scene-end b { font-size: 30px; }
.scene-end span { display: block; margin-top: 7px; color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 9px; }

/* 01 Stacking cards */
.scene-stack { padding: 54px clamp(20px, 6vw, 70px) 0; background: #f7f3ea; }
.stack-intro { min-height: 330px; padding-top: 52px; }
.stack-list { position: relative; padding-bottom: 180px; }
.stack-card { position: sticky; top: calc(var(--sticky-offset) + var(--stack-offset)); min-height: 270px; margin-bottom: 190px; padding: 28px; overflow: hidden; border: 2px solid var(--ink); border-radius: 24px; background: var(--card); box-shadow: 10px 10px 0 rgb(23 25 20 / 16%); }
.stack-card:nth-child(1) { --card: var(--coral); }
.stack-card:nth-child(2) { --card: var(--acid); }
.stack-card:nth-child(3) { --card: var(--blue); }
.stack-card:nth-child(4) { --card: var(--yellow); }
.stack-card header { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.stack-card header span { font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; }
.stack-card header b { font-size: 11px; }
.stack-card h3 { max-width: 650px; margin: 76px 0 0; font-size: clamp(28px, 4vw, 51px); line-height: .95; }
.stack-card p { margin: 12px 0 0; font-size: 11px; font-weight: 700; }

/* 02 Story */
.scene-story { padding: 65px clamp(20px, 5vw, 60px) 120px; background: #111611; color: #f7f5ed; }
.story-head { padding: 40px 0 90px; }
.story-head .scene-copy { color: #aeb5ae; }
.story-layout { display: grid; grid-template-columns: minmax(270px, .9fr) minmax(280px, 1.1fr); gap: clamp(24px, 5vw, 70px); }
.story-visual { position: sticky; top: var(--sticky-offset); align-self: start; overflow: hidden; height: 440px; border: 2px solid #f7f5ed; border-radius: 24px; background: var(--coral); transition: background .3s; }
.story-visual[data-active="1"] { background: var(--acid); color: var(--ink); }
.story-visual[data-active="2"] { background: var(--blue); }
.story-visual[data-active="3"] { background: var(--yellow); color: var(--ink); }
.story-orbit { position: absolute; width: 260px; height: 260px; top: 70px; left: 50%; translate: -50% 0; border: 2px solid currentColor; border-radius: 50%; }
.story-orbit::before, .story-orbit::after { content: ""; position: absolute; border: 2px solid currentColor; border-radius: 50%; }
.story-orbit::before { inset: 38px; }
.story-orbit::after { inset: 76px; background: currentColor; }
.story-visual b { position: absolute; left: 24px; bottom: 24px; font-size: 29px; }
.story-step { display: grid; align-content: center; min-height: 360px; padding: 26px 0; border-top: 1px solid #3d443d; }
.story-step span { color: var(--mint); font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; }
.story-step h3 { margin: 12px 0 0; font-size: clamp(25px, 3.5vw, 44px); line-height: 1; }
.story-step p { max-width: 450px; margin: 14px 0 0; color: #aeb5ae; font-size: 11px; line-height: 1.65; }

/* 03 Chapters */
.scene-chapters { padding: 80px clamp(20px, 5vw, 64px) 150px; }
.chapters-head { max-width: 760px; margin-bottom: 90px; }
.chapter-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); }
.chapter-nav { position: sticky; top: var(--sticky-offset); align-self: start; padding: 17px; border: 2px solid var(--ink); border-radius: 17px; background: var(--yellow); box-shadow: 7px 7px 0 var(--ink); }
.chapter-nav > b { display: block; margin-bottom: 13px; font-family: "IBM Plex Mono", monospace; font-size: 9px; }
.chapter-nav a { display: flex; gap: 8px; padding: 9px 0; border-top: 1px solid rgb(23 25 20 / 25%); color: inherit; font-size: 10px; font-weight: 700; text-decoration: none; }
.chapter-nav a.active { color: #4d54cf; }
.chapter-content article { min-height: 390px; padding: 30px; border-top: 2px solid var(--ink); }
.chapter-content article:nth-child(2) { background: rgb(180 255 43 / 35%); }
.chapter-content article:nth-child(3) { background: rgb(109 117 247 / 24%); }
.chapter-content article:nth-child(4) { background: rgb(255 110 88 / 25%); }
.chapter-content span { font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; }
.chapter-content h3 { margin: 65px 0 0; font-size: clamp(28px, 4vw, 52px); line-height: .95; }
.chapter-content p { max-width: 550px; font-size: 12px; line-height: 1.7; }

/* 04 labels */
.scene-labels { padding: 70px clamp(18px, 5vw, 60px) 150px; background: #eeeee7; }
.labels-head { margin-bottom: 90px; }
.label-groups { overflow: clip; border: 2px solid var(--ink); border-radius: 24px; background: white; }
.label-group { position: relative; }
.group-label { position: sticky; z-index: 3; top: var(--sticky-offset); display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 0 22px; border-bottom: 2px solid var(--ink); background: var(--group); }
.label-group:nth-child(1) { --group: var(--coral); }
.label-group:nth-child(2) { --group: var(--acid); }
.label-group:nth-child(3) { --group: var(--blue); }
.label-group:nth-child(4) { --group: var(--yellow); }
.group-label b { font-size: 22px; }
.group-label span { font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 700; }
.label-items { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 420px; padding: 18px; background: #fffdf8; }
.label-items article { min-height: 170px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f6f4ed; }
.label-items span { color: #5a62da; font-family: "IBM Plex Mono", monospace; font-size: 9px; }
.label-items h3 { margin: 42px 0 0; font-size: 22px; }

/* 05 Product */
.scene-product { padding: 70px clamp(20px, 5vw, 64px) 140px; background: #f4d8cc; }
.product-head { margin-bottom: 90px; }
.product-layout { display: grid; grid-template-columns: minmax(290px, 1fr) minmax(280px, .9fr); gap: clamp(24px, 5vw, 70px); }
.product-visual { position: sticky; top: var(--sticky-offset); align-self: start; display: grid; place-items: center; height: 500px; overflow: hidden; border: 2px solid var(--ink); border-radius: 26px; background: #fbf8ef; box-shadow: 10px 10px 0 var(--ink); }
.product-shape { position: relative; width: 260px; height: 320px; border: 3px solid var(--ink); border-radius: 120px 120px 45px 45px; background: var(--coral); transition: background .3s, border-radius .3s, rotate .3s; }
.product-shape::before { content: ""; position: absolute; inset: 48px; border: 3px solid var(--ink); border-radius: inherit; background: var(--acid); }
.product-visual[data-active="1"] .product-shape { border-radius: 32px; background: var(--blue); rotate: 4deg; }
.product-visual[data-active="2"] .product-shape { border-radius: 50%; background: var(--yellow); rotate: -5deg; }
.product-visual[data-active="3"] .product-shape { border-radius: 34px 130px 34px 130px; background: var(--acid); rotate: 7deg; }
.product-visual > span { position: absolute; left: 22px; bottom: 20px; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; }
.product-step { display: grid; align-content: center; min-height: 390px; border-top: 2px solid var(--ink); }
.product-step span { font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; }
.product-step h3 { margin: 13px 0 0; font-size: clamp(27px, 4vw, 48px); line-height: .95; }
.product-step p { font-size: 11px; line-height: 1.65; }
.swatches { display: flex; gap: 8px; margin-top: 16px; }
.swatches i { width: 28px; height: 28px; border: 2px solid var(--ink); border-radius: 50%; background: var(--swatch); }

/* 06 Compare */
.scene-compare { padding: 72px clamp(20px, 5vw, 60px) 130px; background: #dfe3ff; }
.compare-head { margin-bottom: 90px; }
.compare-layout { display: grid; grid-template-columns: minmax(250px, .85fr) minmax(300px, 1.15fr); gap: 18px; }
.reference-card { position: sticky; top: var(--sticky-offset); align-self: start; min-height: 430px; padding: 24px; border: 2px solid var(--ink); border-radius: 22px; background: var(--ink); color: white; }
.reference-card span, .candidate span { font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 700; }
.reference-card .sample, .candidate .sample { display: grid; place-items: center; height: 210px; margin-top: 34px; border-radius: 50%; background: var(--blue); font-size: 62px; font-weight: 800; }
.reference-card h3 { margin: 22px 0 0; font-size: 29px; }
.candidate-list { display: grid; gap: 20px; }
.candidate { min-height: 360px; padding: 22px; border: 2px solid var(--ink); border-radius: 20px; background: #fffdf8; }
.candidate:nth-child(2) { background: var(--acid); }
.candidate:nth-child(3) { background: var(--coral); }
.candidate .sample { width: 180px; height: 180px; margin-inline: auto; background: var(--candidate, var(--yellow)); font-size: 45px; }
.candidate h3 { margin: 18px 0 0; font-size: 26px; }

/* 07 CTA */
.scene-footer { padding: 64px clamp(18px, 5vw, 60px) 0; background: #151a15; color: #f8f5ed; }
.footer-head { min-height: 440px; padding-top: 70px; }
.footer-head .scene-copy { color: #aeb6ae; }
.article-feed { position: relative; padding-bottom: 60px; }
.feed-card { min-height: 330px; padding: 40px; border-top: 1px solid #444b44; background: #151a15; }
.feed-card span { color: var(--mint); font-family: "IBM Plex Mono", monospace; font-size: 9px; }
.feed-card h3 { max-width: 680px; margin: 75px 0 0; font-size: clamp(28px, 4vw, 48px); line-height: .98; }
.sticky-cta { position: sticky; z-index: 5; bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 25px; min-height: 104px; padding: 20px 24px; border: 2px solid var(--ink); border-radius: 20px; color: var(--ink); background: var(--acid); box-shadow: 9px 9px 0 var(--coral); }
.sticky-cta span { font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 700; }
.sticky-cta b { display: block; margin-top: 4px; font-size: 22px; }
.footer-outro { display: grid; place-items: center; min-height: 500px; margin: 180px clamp(-60px, -5vw, -18px) 0; background: var(--blue); text-align: center; }
.footer-outro b { max-width: 600px; font-size: clamp(36px, 6vw, 76px); line-height: .9; }

/* 08 Horizontal */
.scene-horizontal { padding-top: 70px; background: #efece2; }
.horizontal-head { min-height: 300px; padding: 38px clamp(20px, 5vw, 64px); }
.horizontal-run { position: relative; height: 1900px; }
.horizontal-stage { position: sticky; top: var(--sticky-offset); overflow: hidden; height: 460px; border-block: 2px solid var(--ink); background: var(--ink); }
.horizontal-track { display: flex; width: max-content; height: 100%; transition: transform 40ms linear; will-change: transform; }
.horizontal-meter { position: absolute; z-index: 4; top: 14px; left: 18px; right: 18px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; color: white; font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 700; pointer-events: none; }
.horizontal-meter > i { overflow: hidden; height: 5px; border-radius: 999px; background: rgb(255 255 255 / 24%); }
.horizontal-meter > i::after { content: ""; display: block; width: var(--horizontal-progress, 0%); height: 100%; border-radius: inherit; background: white; }
.horizontal-panel { display: grid; grid-template-rows: auto 1fr auto; width: min(720px, 72vw); height: 100%; padding: 28px; border-right: 2px solid var(--ink); color: var(--ink); background: var(--panel-color); }
.horizontal-panel:nth-child(1) { --panel-color: var(--coral); }
.horizontal-panel:nth-child(2) { --panel-color: var(--acid); }
.horizontal-panel:nth-child(3) { --panel-color: var(--blue); }
.horizontal-panel:nth-child(4) { --panel-color: var(--yellow); }
.horizontal-panel span { font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 700; }
.horizontal-panel h3 { align-self: center; margin: 0; font-size: clamp(38px, 6vw, 76px); line-height: .88; }
.horizontal-panel p { margin: 0; font-size: 11px; font-weight: 700; }
.horizontal-end { min-height: 520px; padding: 240px clamp(20px, 5vw, 64px) 60px; }
.horizontal-end b { font-size: 45px; }

/* 09 Table */
.scene-table { min-height: 1280px; padding: 70px clamp(18px, 5vw, 60px) 150px; background: #dbe0fa; }
.table-head { min-height: 340px; padding-top: 50px; }
.table-head .scene-copy { max-width: 620px; }
.table-instruction { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 12px; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; }
.table-instruction span:last-child { color: #5059d4; }
.table-scroll { position: relative; overflow: auto; height: 470px; border: 2px solid var(--ink); border-radius: 20px; background: #fffdf8; box-shadow: 10px 10px 0 var(--ink); overscroll-behavior: contain; scrollbar-color: var(--blue) #e4e5de; }
.data-table { width: 100%; min-width: 1120px; border-spacing: 0; border-collapse: separate; font-size: 11px; }
.data-table th, .data-table td { height: 54px; padding: 0 15px; border-right: 1px solid #c9cdc4; border-bottom: 1px solid #c9cdc4; text-align: left; white-space: nowrap; }
.data-table thead th { position: sticky; z-index: 4; top: 0; color: white; background: var(--ink); font-family: "IBM Plex Mono", monospace; font-size: 10px; }
.data-table thead th:first-child { z-index: 7; left: 0; background: var(--purple); }
.data-table tbody th { position: sticky; z-index: 3; left: 0; min-width: 170px; background: var(--acid); font-size: 11px; }
.data-table tbody tr:nth-child(even) td { background: #f2f3ed; }
.data-table td strong { display: inline-block; min-width: 45px; color: #4750c6; }
.data-table .status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border: 1px solid var(--ink); border-radius: 50%; background: var(--status, var(--mint)); }
.table-outro { min-height: 330px; padding-top: 150px; }
.table-outro b { font-size: clamp(30px, 5vw, 58px); line-height: .94; }
.table-outro p { max-width: 520px; color: var(--muted); font-size: 11px; line-height: 1.65; }

/* 10 Before / After */
.scene-wipe { padding-top: 70px; background: #efe9df; }
.wipe-head { min-height: 320px; padding: 42px clamp(20px, 5vw, 64px); }
.wipe-run { position: relative; height: 1800px; }
.wipe-stage { position: sticky; top: var(--sticky-offset); overflow: hidden; height: 470px; border-block: 2px solid var(--ink); background: #242724; }
.wipe-layer { position: absolute; inset: 0; overflow: hidden; }
.wipe-before { color: #d1d4ce; background: #292d2a; }
.wipe-after { color: var(--ink); background: #fffaf0; clip-path: inset(0 100% 0 0); will-change: clip-path; }
.wipe-board { display: grid; grid-template-rows: auto 1fr auto; width: 100%; height: 100%; padding: 26px clamp(22px, 4vw, 48px); }
.wipe-nav { display: flex; justify-content: space-between; gap: 16px; align-items: center; font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 700; }
.wipe-nav i { width: 52px; height: 13px; border-radius: 999px; background: currentColor; }
.wipe-content { display: grid; grid-template-columns: 1.05fr .95fr; gap: 26px; align-items: center; }
.wipe-content h3 { max-width: 560px; margin: 0; font-size: clamp(34px, 5.5vw, 70px); line-height: .88; }
.wipe-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wipe-card { min-height: 112px; padding: 14px; border: 2px solid currentColor; border-radius: 15px; }
.wipe-card span { font-family: "IBM Plex Mono", monospace; font-size: 8px; font-weight: 700; }
.wipe-card b { display: block; margin-top: 35px; font-size: 17px; }
.wipe-before .wipe-content { align-items: end; }
.wipe-before .wipe-content h3 { translate: 0 24px; color: #747a75; }
.wipe-before .wipe-cards { rotate: -3deg; translate: 18px 20px; gap: 18px; }
.wipe-before .wipe-card:nth-child(2) { translate: 0 32px; }
.wipe-before .wipe-card:nth-child(3) { translate: 22px -10px; }
.wipe-after .wipe-card:nth-child(1) { background: var(--coral); }
.wipe-after .wipe-card:nth-child(2) { background: var(--acid); }
.wipe-after .wipe-card:nth-child(3) { background: var(--blue); }
.wipe-after .wipe-card:nth-child(4) { background: var(--yellow); }
.wipe-foot { display: flex; justify-content: space-between; gap: 20px; align-items: end; font-size: 10px; font-weight: 700; }
.wipe-divider { position: absolute; z-index: 8; top: 0; bottom: 0; left: 0; width: 3px; translate: -1px 0; background: white; box-shadow: 0 0 0 1px rgb(23 25 20 / 18%); pointer-events: none; }
.wipe-divider::before { content: ""; position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; translate: -50% -50%; border: 2px solid var(--ink); border-radius: 50%; background: var(--acid); }
.wipe-divider::after { content: "↔"; position: absolute; top: 50%; left: 50%; translate: -50% -54%; color: var(--ink); font-size: 19px; font-weight: 800; }
.wipe-meter { position: absolute; z-index: 10; top: 14px; left: 18px; display: flex; gap: 8px; align-items: center; padding: 6px 9px; border-radius: 999px; color: white; background: rgb(23 25 20 / 80%); font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 700; pointer-events: none; }
.wipe-outro { min-height: 500px; padding: 230px clamp(20px, 5vw, 64px) 60px; }
.wipe-outro b { font-size: clamp(34px, 5vw, 62px); line-height: .92; }
.wipe-outro p { max-width: 520px; color: var(--muted); font-size: 11px; line-height: 1.65; }

/* 11 Bottom-aware Sidebar */
.sidebar-head { padding: 88px clamp(24px, 6vw, 76px) 58px; border-bottom: 2px solid var(--ink); background: var(--yellow); }
.sidebar-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 34%); gap: 22px; align-items: start; padding: 24px; background: #eceee8; }
.sidebar-feed { display: grid; gap: 14px; }
.sidebar-feed-title { display: flex; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 2px solid var(--ink); border-radius: 15px; background: var(--ink); color: white; font-family: "IBM Plex Mono", monospace; font-size: 10px; }
.sidebar-feed article { min-height: 260px; padding: 28px; border: 2px solid var(--ink); border-radius: 20px; background: #fffdf7; }
.sidebar-feed article:nth-child(3n) { background: #e8fff7; }
.sidebar-feed article:nth-child(3n + 1) { background: #eef0ff; }
.sidebar-feed article span { color: #08765e; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; }
.sidebar-feed article h3 { margin: 70px 0 10px; font-size: clamp(24px, 3vw, 42px); line-height: 1; }
.sidebar-feed article p { max-width: 480px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; font-weight: 700; }
.sidebar-column { align-self: stretch; min-width: 0; }
.sidebar-panel { position: sticky; top: min(var(--sticky-offset), calc(var(--scrollport-height, 650px) - var(--sidebar-height, 860px) - 18px)); min-height: 860px; overflow: hidden; border: 2px solid var(--ink); border-radius: 22px; color: white; background: var(--ink); box-shadow: 9px 9px 0 var(--coral); }
.sidebar-panel > header, .sidebar-panel > footer { display: flex; justify-content: space-between; gap: 12px; padding: 16px 18px; font-family: "IBM Plex Mono", monospace; font-size: 10px; }
.sidebar-panel > header { border-bottom: 1px solid #464a44; }
.sidebar-panel > footer { position: absolute; inset: auto 0 0; align-items: center; min-height: 62px; color: var(--ink); background: var(--acid); }
.sidebar-summary { padding: 34px 20px 24px; }
.sidebar-summary > span, .sidebar-callout > span { color: var(--acid); font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 700; }
.sidebar-summary h3 { margin: 12px 0; font-size: clamp(30px, 4vw, 52px); line-height: .92; }
.sidebar-summary p { margin: 0; color: #bec5bd; font-size: 11px; line-height: 1.65; font-weight: 700; }
.sidebar-panel dl { display: grid; margin: 0 18px; border-top: 1px solid #464a44; }
.sidebar-panel dl div { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid #464a44; }
.sidebar-panel dt, .sidebar-panel dd { margin: 0; font-family: "IBM Plex Mono", monospace; font-size: 10px; }
.sidebar-panel dd { color: var(--acid); font-weight: 700; }
.sidebar-checks { display: grid; gap: 10px; padding: 22px 18px; }
.sidebar-checks p { display: flex; align-items: center; gap: 9px; margin: 0; color: #d4d9d2; font-size: 10px; font-weight: 700; }
.sidebar-checks i { width: 12px; height: 12px; border: 2px solid var(--acid); border-radius: 50%; }
.sidebar-callout { margin: 0 18px 86px; padding: 18px; border: 1px solid #51564f; border-radius: 14px; background: #222720; }
.sidebar-callout b { display: block; margin-top: 10px; font-size: 12px; line-height: 1.5; }
.sidebar-callout code { color: var(--yellow); }
.sidebar-outro { min-height: 440px; padding: 170px clamp(24px, 6vw, 76px) 60px; background: var(--coral); }
.sidebar-outro b { font-size: clamp(34px, 5vw, 64px); line-height: .92; }
.sidebar-outro p { max-width: 500px; color: #4d2821; font-size: 11px; line-height: 1.65; font-weight: 700; }

.detail-grid { display: grid; grid-template-columns: .88fr 1.12fr; gap: 18px; margin-top: 18px; }
.section-heading.compact { min-height: 78px; }
.anatomy-visual { margin: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #f1f2ed; }
.scrollport-model { position: relative; overflow: hidden; height: 190px; border: 2px solid var(--ink); border-radius: 14px; background: repeating-linear-gradient(0deg, #fff 0 28px, #f2f2ed 28px 29px); }
.scrollport-model > span { position: absolute; top: 9px; left: 11px; font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 700; }
.start-line { position: absolute; top: 55px; left: 0; right: 0; border-top: 2px dashed var(--purple); }
.start-line::after { content: "top: 56px"; position: absolute; right: 8px; top: -21px; color: var(--purple); font-family: "IBM Plex Mono", monospace; font-size: 8px; font-style: normal; }
.parent-model { position: absolute; top: 34px; left: 18%; width: 55%; height: 140px; border: 3px solid var(--coral); border-radius: 10px; }
.parent-model b { position: absolute; left: 7px; bottom: 6px; color: var(--coral); font-family: "IBM Plex Mono", monospace; font-size: 8px; }
.parent-model em { position: absolute; top: 18px; left: 17%; display: grid; place-items: center; width: 68%; height: 58px; border: 3px solid var(--purple); border-radius: 8px; color: white; background: var(--blue); font-family: "IBM Plex Mono", monospace; font-size: 9px; font-style: normal; font-weight: 700; }
.principles { display: grid; gap: 9px; padding: 0 22px 22px; }
.principles > div { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; padding: 11px; border: 1px solid var(--line); border-radius: 12px; }
.principles span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; color: white; background: var(--ink); font-family: "IBM Plex Mono", monospace; font-size: 10px; }
.principles p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.principles b { display: block; color: var(--ink); font-size: 12px; }
.principles code { color: #4e58ce; font-size: 10px; }

.code-panel { overflow: hidden; color: #f7f5ee; border-color: #121611; background: #121611; }
.code-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 78px; padding: 18px 22px; border-bottom: 1px solid #343a34; }
.code-heading p { color: var(--acid); }
.code-heading button { min-height: 42px; padding: 0 15px; border: 0; border-radius: 11px; background: var(--coral); cursor: pointer; font-size: 11px; font-weight: 800; }
.code-tabs { display: flex; gap: 4px; margin: 17px 20px 0; padding: 4px; border: 1px solid #3c433c; border-radius: 11px; background: #1b201b; }
.code-tabs button { flex: 1; height: 34px; border: 0; border-radius: 7px; color: #9ca39b; background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; }
.code-tabs button[hidden] { display: none; }
.code-tabs button[aria-selected="true"] { color: var(--ink); background: var(--acid); }
pre { min-height: 300px; max-height: 370px; margin: 10px 20px 0; padding: 18px; overflow: auto; border: 1px solid #353b35; border-radius: 13px; color: #d9ded8; background: #080b08; font-size: 10px; line-height: 1.65; }
.code-caption { min-height: 57px; margin: 0; padding: 15px 20px 20px; color: #aab1a9; font-size: 10px; line-height: 1.55; }
.code-caption code { color: var(--acid); font-size: 10px; }
.page-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 8px 0; color: #687069; font-size: 11px; }
.page-footer span { font-family: "IBM Plex Mono", monospace; font-weight: 700; }
.page-footer p { margin: 0; }

@media (max-width: 1120px) {
  .hero { min-height: 0; }
  .lead { padding-right: 0; }
  .hero-actions { position: static; justify-content: flex-start; margin-top: 18px; }
  .lab-body { grid-template-columns: 254px minmax(0, 1fr); }
  .pattern-list { grid-template-columns: 1fr; }
  .pattern-list button { min-height: 48px; }
  .preview-scroller { height: 610px; }
}

@media (max-width: 840px) {
  .page { width: min(100% - 20px, 760px); padding-top: 18px; }
  .hero { padding-inline: 4px; }
  .lab-body { grid-template-columns: 1fr; }
  .controls { border-right: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .pattern-list { grid-template-columns: 1fr 1fr; }
  .preview-wrap { border-radius: 0 0 26px 26px; }
  .detail-grid { grid-template-columns: 1fr; }
  .preview-scroller { height: 580px; }
  .story-layout, .product-layout, .compare-layout { grid-template-columns: 1fr; }
  .sidebar-layout { grid-template-columns: minmax(0, 1fr) minmax(220px, 38%); }
  .story-visual, .product-visual, .reference-card { top: var(--sticky-offset); height: 330px; min-height: 0; }
  .chapter-layout { grid-template-columns: 140px minmax(0, 1fr); }
}

@media (max-width: 560px) {
  h1 { font-size: clamp(32px, 10vw, 48px); white-space: normal; }
  .heading-stats { display: none; }
  .section-heading { padding-inline: 15px; }
  .section-number { width: 42px; height: 42px; border-radius: 13px; }
  .preview-wrap { padding: 10px; }
  .preview-toolbar p { max-width: 145px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .preview-toolbar span { display: none; }
  .transport { grid-template-columns: auto 1fr; }
  .transport dl { grid-column: 1 / -1; justify-content: space-between; }
  .transport dl div { min-width: 0; }
  .scene-title { font-size: 38px; }
  .scene-stack { padding-inline: 14px; }
  .stack-card { padding: 18px; }
  .story-layout, .product-layout, .compare-layout { display: block; }
  .story-visual, .product-visual, .reference-card { margin-bottom: 36px; }
  .chapter-layout { grid-template-columns: 1fr; }
  .chapter-nav { z-index: 6; display: flex; gap: 10px; overflow: auto; padding: 10px; }
  .chapter-nav > b { display: none; }
  .chapter-nav a { flex: 0 0 auto; border: 0; }
  .label-items { grid-template-columns: 1fr; }
  .sticky-cta { display: grid; }
  .horizontal-panel { width: 82vw; }
  .table-scroll { height: 430px; }
  .wipe-content { grid-template-columns: 1fr; }
  .wipe-content h3 { font-size: 34px; }
  .wipe-cards { grid-template-columns: repeat(4, minmax(90px, 1fr)); overflow: hidden; }
  .wipe-card { min-height: 90px; }
  .sidebar-layout { grid-template-columns: minmax(260px, 1fr) 220px; min-width: 540px; padding: 14px; }
  .sidebar-feed article { min-height: 230px; padding: 20px; }
  .sidebar-panel { min-height: 780px; }
  .page-footer { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
