/* HUVOT: the knowledge agent case study. Built on ../style.css (header, sections, footer, the spectrum). Transforms and opacity only. */
.kpage { --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Noto Sans Mono', monospace; --violet: #5c00ff; --bad: #e0004a; }

/* Hero */
.k-hero { position: relative; overflow: hidden; isolation: isolate; min-height: 720px; height: calc(100svh - var(--head)); max-height: 980px; display: flex; flex-direction: column; justify-content: center; }
.k-hero-in { width: 100%; padding-top: 20px; padding-bottom: 110px; position: relative; z-index: 1; pointer-events: none; }
.k-kicker { margin: 0 0 26px; }
.k-name { margin: 0; font-weight: 400; line-height: .9; }
.k-name-word {
  display: block; font-size: clamp(84px, 13vw, 200px); letter-spacing: -.07em; margin-left: -.04em;
  background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .05em;
}
.k-name-ja { display: block; font-size: clamp(22px, 2.6vw, 36px); letter-spacing: -.01em; margin-top: 18px; }
.k-lead { max-width: 640px; font-size: 17px; line-height: 2; margin: 30px 0 0; }
.k-lead-sub { max-width: 640px; font-size: 14px; line-height: 1.9; color: var(--muted); margin: 12px 0 0; }
.k-hero .k-lead, .k-hero .k-lead-sub, .k-name-ja, .k-kicker { text-shadow: 0 0 8px var(--paper), 0 0 18px var(--paper); }
.k-hero-foot { position: absolute; left: 0; right: 0; bottom: 23px; }
.k-hero-foot::before { content: ''; position: absolute; left: var(--gutter); right: var(--gutter); top: 0; border-top: 1px solid #c8c8c8; }
.k-hero-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; }

/* Shared section type */
.k-title { font-size: clamp(30px, 3.6vw, 52px); font-weight: 400; letter-spacing: -.04em; line-height: 1.2; margin: 0 0 16px; }
.k-intro { font-size: 17px; line-height: 1.9; max-width: 720px; margin: 0 0 44px; color: #3e3e42; }
.k-ingest, .k-term, .k-ground, .k-deliver, .k-secure, .k-stack { background: var(--paper); }
.k-cut, .k-search, .k-orch, .k-rely, .k-lessons { background: #eeeeeb; }

/* 01 Ingest: sticky stage + steps */
.scrolly { display: grid; grid-template-columns: 1.05fr 1fr; gap: 6vw; align-items: start; }
.stage-col { position: sticky; top: max(24px, calc(50vh - 290px)); }
.stage { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.stage::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--spectrum); }
.stage-svg { display: block; width: 100%; height: auto; }
.stage-svg text { font-family: inherit; font-size: 20px; fill: var(--ink); text-anchor: middle; dominant-baseline: auto; }
.stage-svg .b { font-weight: 700; letter-spacing: .08em; font-size: 20px; }
.stage-svg .cap { font-size: 22px; }
.stage-svg .sub { fill: var(--muted); }
.stage-svg .mono { font-family: var(--mono); text-anchor: start; font-size: 20px; fill: #3b3b40; }
.stage-svg .tag { text-anchor: start; font-size: 20px; fill: var(--violet); font-weight: 700; }
.stage-svg rect, .stage-svg ellipse { fill: #fff; stroke: #c9c9c4; stroke-width: 1.5; }
.stage-svg path { fill: none; stroke: #c9c9c4; stroke-width: 2; stroke-linecap: round; }

.scene { opacity: 0; transition: opacity .6s ease; }
.stage[data-s='1'] .sc-src, .stage[data-s='2'] .sc-src,
.stage[data-s='3'] .sc-page, .stage[data-s='4'] .sc-chunk,
.stage[data-s='5'] .sc-index, .stage[data-s='6'] .sc-read { opacity: 1; }

/* Scene 1: scattered; scene 2: they fall into the database. */
.src { transition: transform 1s cubic-bezier(.65, 0, .35, 1), opacity .8s ease; }
.src rect { stroke: transparent; fill: #f4f4f1; }
.src:nth-child(2) rect { fill: #fff2e3; } .src:nth-child(3) rect { fill: #ffe6f1; } .src:nth-child(4) rect { fill: #f9e5ff; }
.src:nth-child(5) rect { fill: #ece5ff; } .src:nth-child(6) rect { fill: #e3eaff; } .src:nth-child(7) rect { fill: #def9f8; } .src:nth-child(8) rect { fill: #f1f1ee; }
.s1 { transform: translate(95px, 80px); } .s2 { transform: translate(300px, 80px); } .s3 { transform: translate(505px, 80px); }
.s4 { transform: translate(180px, 228px) rotate(-4deg); } .s5 { transform: translate(420px, 228px) rotate(3deg); }
.s6 { transform: translate(180px, 380px) rotate(2deg); } .s7 { transform: translate(420px, 380px) rotate(-3deg); }
.stage[data-s='1'] .s1 { animation: bob 5s ease-in-out infinite; } .stage[data-s='1'] .s5 { animation: bob 6s ease-in-out -2s infinite; }
@keyframes bob { 50% { opacity: .75; } }
/* Scene 2: seven sources feed the tables of one database; rows pile up and one SQL scan runs across them all. */
.db2 { opacity: 0; transition: opacity .6s ease .35s; }
.stage[data-s='2'] .db2 { opacity: 1; }
.stage-svg .db2-body { fill: #faf8ff; stroke: var(--violet); stroke-width: 2.5; }
.stage-svg .db2-top { fill: #f1ecff; stroke: var(--violet); stroke-width: 2.5; }
.stage-svg .db2-name { font-weight: 700; fill: var(--violet); }
.stage-svg .db2-flow { stroke: #d9d0f7; stroke-width: 2; stroke-dasharray: 5 7; }
.stage[data-s='2'] .db2-flow { animation: dash 1.2s linear infinite; }
.stage-svg .db2-band rect { fill: #fff; stroke: #ddd6f5; }
.stage-svg .db2-band > text { text-anchor: start; }
.stage-svg .dbp rect { stroke: none; fill: #e6defe; opacity: .25; }
.stage[data-s='2'] .dbp rect { animation: rowpile 5.2s ease-in-out infinite; }
.dbp rect:nth-child(2) { animation-delay: .5s !important; } .dbp rect:nth-child(3) { animation-delay: 1s !important; } .dbp rect:nth-child(4) { animation-delay: 1.5s !important; }
.b1 .dbp rect { fill: #ffd9a8; } .b2 .dbp rect { fill: #ffb3d4; } .b3 .dbp rect { fill: #f2b0fa; }
.b4 .dbp rect { fill: #c9b0ff; } .b5 .dbp rect { fill: #b0c1ff; } .b6 .dbp rect { fill: #9fece8; }
@keyframes rowpile { 0%, 8% { opacity: .25; } 18%, 82% { opacity: 1; } 100% { opacity: .25; } }
.stage-svg .db2-scan { fill: rgba(92, 0, 255, .1); stroke: var(--violet); stroke-width: 2; opacity: 0; }
.stage[data-s='2'] .db2-scan { animation: dbscan 3.2s cubic-bezier(.65, 0, .35, 1) 1.2s infinite; }
@keyframes dbscan { 0% { opacity: 0; transform: translateY(0); } 8% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; transform: translateY(280px); } }
.stage-svg .db2-chip rect { stroke: none; fill: #f4f4f1; }
.db2-chip { opacity: 0; transform: translateX(-24px); transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.stage[data-s='2'] .db2-chip { opacity: 1; transform: none; }
.c1 rect { fill: #fff2e3 !important; } .c2 rect { fill: #ffe6f1 !important; } .c3 rect { fill: #ffe6f1 !important; } .c4 rect { fill: #f9e5ff !important; }
.c5 rect { fill: #ece5ff !important; } .c6 rect { fill: #e3eaff !important; } .c7 rect { fill: #def9f8 !important; }
.stage[data-s='2'] .c2 { transition-delay: .06s; } .stage[data-s='2'] .c3 { transition-delay: .12s; } .stage[data-s='2'] .c4 { transition-delay: .18s; }
.stage[data-s='2'] .c5 { transition-delay: .24s; } .stage[data-s='2'] .c6 { transition-delay: .3s; } .stage[data-s='2'] .c7 { transition-delay: .36s; }
.stage-svg .db2-dot { stroke: #fff; stroke-width: 2; }
.stage[data-s='2'] .src { opacity: 0; transform: translate(90px, 260px) scale(.3); }
.stage[data-s='2'] .s2 { transition-delay: .05s; } .stage[data-s='2'] .s3 { transition-delay: .1s; } .stage[data-s='2'] .s4 { transition-delay: .15s; }
.stage[data-s='2'] .s5 { transition-delay: .2s; } .stage[data-s='2'] .s6 { transition-delay: .25s; } .stage[data-s='2'] .s7 { transition-delay: .3s; }

/* Scene 3: page splits. */
.pg { transition: transform .9s cubic-bezier(.2, .7, .2, 1) .2s, opacity .6s ease .2s; }
.pg-img, .pg-txt { opacity: 0; transform: translate(0, -60px) scale(.9); }
.stage[data-s='3'] .pg-img, .stage[data-s='3'] .pg-txt { opacity: 1; transform: none; }
.stage[data-s='3'] .pg-txt { transition-delay: .35s; }
.pg-img .pic { fill: #ece5ff; stroke: none; }
.flow-line { stroke: var(--violet) !important; stroke-dasharray: 6 8; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -28; } }

.steps { list-style: none; margin: 0; padding: 0; }
.step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; opacity: .3; transition: opacity .5s ease; }
.no-js .step, .step.on { opacity: 1; }
.step:first-child { min-height: 52vh; justify-content: flex-start; padding-top: 30px; }
.step:last-child { min-height: 60vh; }
.step-no { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ink); font-size: 15px; margin-bottom: 22px; transition: background-color .3s, color .3s, border-color .3s; }
.step.on .step-no { background: var(--spectrum); border-color: transparent; color: #fff; }
.step h3 { font-size: clamp(26px, 2.6vw, 38px); font-weight: 400; letter-spacing: -.035em; line-height: 1.3; margin: 0 0 18px; }
.step p { font-size: 16px; line-height: 2.05; margin: 0; color: #3e3e42; }

/* 02 Search */
.console { background: #fff; color: var(--ink); border-radius: 22px; overflow: hidden; position: relative; border: 1px solid var(--line); }
.console::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--spectrum); }
.console-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 26px 28px 0; }
.console-tabs button, .orch-tabs button { border: 1px solid #c7c7c2; background: #fff; color: var(--ink); border-radius: 999px; padding: 10px 16px; font-size: 14px; min-height: 44px; transition: background-color .2s, color .2s, border-color .2s; }
.console-tabs button[aria-selected='true'], .orch-tabs button[aria-selected='true'] { background: var(--ink); color: #fff; border-color: var(--ink); }
.console-tabs button:hover, .orch-tabs button:hover { border-color: var(--ink); }
.console-q { margin: 22px 28px 0; padding: 18px 20px; background: #f4f4f1; border-radius: 14px; font-size: 16px; line-height: 1.8; }
.console-q::before { content: 'Q'; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--spectrum); color: #fff; font-size: 13px; font-weight: 700; margin-right: 12px; vertical-align: 1px; }
.console-body { list-style: none; margin: 0; padding: 18px 28px 6px; min-height: 420px; }
.cl { display: grid; grid-template-columns: 112px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid #ecece8; opacity: 0; transform: translate3d(0, 10px, 0); transition: opacity .4s ease, transform .4s ease; }
.cl:first-child { border-top: 0; }
.cl.show { opacity: 1; transform: none; }
.no-js .cl, .cl.still { opacity: 1; transform: none; transition: none; }
.cl-kind { font-size: 12px; letter-spacing: .1em; color: var(--muted); padding-top: 3px; }
.cl-kind b { display: inline-block; font-weight: 700; color: var(--violet); font-family: var(--mono); letter-spacing: 0; font-size: 13px; }
.cl-main { font-size: 15px; line-height: 1.75; min-width: 0; }
.cl-main code { display: block; font-family: var(--mono); font-size: 13px; line-height: 1.7; color: #3b2a8c; background: #f5f3fd; border-radius: 8px; padding: 10px 12px; margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cl-res { display: block; color: #007a74; font-size: 14px; margin-top: 6px; }
.cl-par { display: inline-block; font-size: 12px; letter-spacing: .08em; border: 1px solid #c7c7c2; border-radius: 999px; padding: 2px 8px; margin-left: 8px; color: var(--muted); vertical-align: 1px; }
.cl.think .cl-main { color: var(--muted); }
.cl.answer { grid-template-columns: 1fr; }
.cl.answer .cl-main { background: #f3efff; color: var(--ink); border-radius: 14px; padding: 18px 20px; font-size: 15px; line-height: 1.9; }
.cl.answer .cite { display: block; margin-top: 10px; font-size: 13px; color: var(--muted); }
.cl.gate .cl-res { color: #b25a00; }
.console-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 28px 24px; color: var(--muted); }


/* 03 Grounding */
.ground { display: grid; grid-template-columns: 1fr 1fr; gap: 6vw; align-items: start; }
.ground-switch { display: inline-flex; border: 1px solid var(--ink); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.ground-switch button { border: 0; background: transparent; border-radius: 999px; padding: 10px 18px; font-size: 14px; min-height: 40px; }
.ground-switch button[aria-pressed='true'] { background: var(--ink); color: #fff; }
.answer-card { background: #fff; border-radius: 20px; padding: 26px 28px 28px; position: relative; overflow: hidden; border: 1px solid var(--line); min-height: 330px; }
.answer-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--spectrum); transition: opacity .4s; }
.answer-card[data-mode='off']::before { opacity: 0; }
.answer-card[data-mode='off'] { border-color: #ffc1d4; }
.aq { font-size: 15px; color: var(--muted); margin: 0 0 16px; }
.aa p { font-size: 17px; line-height: 1.95; margin: 0; }
.aa { transition: opacity .45s ease, transform .45s ease; }
.answer-card[data-mode='on'] .aa-off, .answer-card[data-mode='off'] .aa-on { display: none; }
.flags { list-style: none; margin: 18px 0 0; padding: 0; }
.flags li { font-size: 14px; line-height: 1.7; padding: 8px 0 8px 28px; position: relative; color: var(--bad); border-top: 1px solid #ffe0ea; }
.flags li::before { content: '×'; position: absolute; left: 4px; top: 7px; font-weight: 700; }
.cite { font-size: 13px !important; color: var(--muted); margin-top: 14px !important; line-height: 1.8 !important; }
.ground-note { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.rules { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rules li { counter-increment: r; position: relative; padding: 20px 0 20px 56px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.95; color: #3e3e42; }
.rules li::before { content: counter(r, decimal-leading-zero); position: absolute; left: 0; top: 21px; font-weight: 700; background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 15px; }
.rules b { display: block; font-size: 18px; color: var(--ink); font-weight: 700; margin-bottom: 4px; }

/* 06 Orchestration */
.orch-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.orch-stage { background: #fff; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); position: relative; display: grid; grid-template-columns: 290px 1fr; align-items: center; gap: 8px; padding: 26px 0 18px 26px; }
.orch-map { min-width: 0; }
/* The phone in front: what the person sees while the AIs pass the work along behind it. */
.ph { position: relative; height: 540px; border: 10px solid #e7e7e3; border-radius: 40px; background: #fbfbf9; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 18px 40px rgba(17, 17, 20, .08); }
.ph-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 10px; border-bottom: 1px solid #ecece8; font-size: 13px; letter-spacing: .12em; }
.ph-bar b { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-time { font-family: var(--mono); color: var(--muted); letter-spacing: 0; }
.ph-msgs { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 14px 14px 10px; overflow: hidden; }
.ph-b, .ph-file, .ph-ask { max-width: 88%; font-size: 14px; line-height: 1.7; border-radius: 16px; padding: 9px 13px; opacity: 0; transform: translateY(10px); transition: opacity .35s ease, transform .35s cubic-bezier(.2, .7, .2, 1); }
.ph-msgs .in { opacity: 1; transform: none; }
.ph-b.me { align-self: flex-end; background: #ece5ff; border-bottom-right-radius: 4px; }
.ph-b.ai { align-self: flex-start; background: #fff; border: 1px solid #e3e3de; border-bottom-left-radius: 4px; }
.ph-cite { display: block; margin-top: 6px; font-size: 12px; color: var(--violet); }
.ph-file { align-self: flex-start; background: #fff; border: 1.5px solid var(--violet); display: flex; flex-direction: column; }
.ph-file b { font-family: var(--mono); font-size: 13px; }
.ph-file span { font-size: 12px; color: #0a8a55; }
.ph-file span::before { content: '✓ '; }
.ph-ask { align-self: flex-start; background: #fff; border: 1.5px dashed var(--violet); }
.ph-ask p { margin: 0 0 8px; }
.ph-ask-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ph-ask button { font: inherit; font-size: 13px; border: 1px solid var(--violet); color: var(--violet); background: #fff; border-radius: 999px; padding: 6px 12px; min-height: 36px; cursor: pointer; }
.ph-ask button.pressed { background: var(--violet); color: #fff; }
.ph-ask button:disabled { cursor: default; }
.ph-input { margin: 0 12px 12px; border: 1px solid #deded9; border-radius: 999px; padding: 9px 14px; font-size: 13px; color: var(--muted); background: #fff; }
.ph-off { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(233, 233, 229, .94); opacity: 0; pointer-events: none; transition: opacity .5s ease; text-align: center; padding: 24px; }
.ph-off span { font-size: 14px; color: var(--muted); line-height: 1.8; }
.ph.off .ph-off { opacity: 1; }
.ph-note { position: absolute; z-index: 2; left: 10px; right: 10px; top: 10px; background: #fff; border: 1px solid #e3e3de; border-radius: 14px; padding: 10px 14px; font-size: 13px; box-shadow: 0 8px 20px rgba(17, 17, 20, .1); transform: translateY(-130%); transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.ph-note::before { content: 'HUVOT'; display: block; font-size: 12px; letter-spacing: .12em; color: var(--violet); }
.ph-note.on { transform: none; }
.o-fan { font-size: 20px !important; fill: var(--violet) !important; opacity: 0; transition: opacity .3s; }
.o-fan.on { opacity: 1; }
.orch-stage::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--spectrum); }
.orch-svg { display: block; width: 100%; height: auto; }
.orch-svg text { font-family: inherit; font-size: 22px; fill: var(--ink); text-anchor: middle; }
.orch-svg .t3 { font-size: 17px; fill: var(--muted); }
.orch-svg .big { font-size: 44px; letter-spacing: -.04em; font-weight: 700; fill: var(--violet); }
.o-edges path { fill: none; stroke: #d6d6d1; stroke-width: 2.5; stroke-linecap: round; transition: stroke .4s, opacity .4s; }
.o-edges path.lit { stroke: var(--violet); stroke-width: 3; }
.on-node rect, .on-node circle { fill: #f6f6f3; stroke: #d6d6d1; stroke-width: 1.5; transition: fill .4s, stroke .4s, opacity .4s; }
.on-node .halo { fill: url(#glow); stroke: none; opacity: .5; }
.on-node .core { fill: #fff; stroke: var(--violet); stroke-width: 3; }
.on-node.lit rect, .on-node.lit circle:not(.halo):not(.core) { fill: #f3efff; stroke: var(--violet); }
.on-node.dim { opacity: .35; }
.o-edges path.dim { opacity: .35; }
.o-dots circle { fill: var(--violet); }
[data-node='core'] .halo { transform-box: fill-box; transform-origin: center; animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); opacity: .3; } }
.orch-hint { display: none; }
.orch-text { margin-top: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 6vw; }
.orch-text h3 { font-size: 30px; font-weight: 400; letter-spacing: -.03em; margin: 0 0 14px; }
.orch-text p { font-size: 15px; line-height: 2; color: #3e3e42; margin: 0 0 12px; }
.orch-text ol { margin: 0; padding: 0; list-style: none; counter-reset: o; }
.orch-text li { counter-increment: o; position: relative; padding: 10px 0 10px 40px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.8; }
.orch-text li::before { content: counter(o); position: absolute; left: 0; top: 11px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid #a8a8a8; display: grid; place-items: center; font-size: 12px; }
.orch-text li.on::before { background: var(--spectrum); border-color: transparent; color: #fff; }

/* 07 Deliver: gates */
.gates { display: grid; grid-template-columns: 1.1fr 1fr; gap: 5vw; align-items: start; margin-bottom: 70px; }
.gate-sheet { background: #fff; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px 20px; font-size: 14px; border-bottom: 1px solid var(--line); background: #f4f4f1; }
.sheet-rows { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.sheet { width: 100%; border-collapse: collapse; font-size: 13px; }
.sheet th, .sheet td { text-align: left; padding: 12px 12px; border-bottom: 1px solid #ecece8; white-space: nowrap; }
.sheet th { font-weight: 700; font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.sheet tbody tr { opacity: 0; transform: translate3d(-14px, 0, 0); transition: opacity .4s ease, transform .4s ease; }
.gates:not([data-g='0']) .sheet tbody tr { opacity: 1; transform: none; }
.sheet tbody tr:nth-child(2) { transition-delay: .08s; } .sheet tbody tr:nth-child(3) { transition-delay: .16s; } .sheet tbody tr:nth-child(4) { transition-delay: .24s; }
.no-js .sheet tbody tr { opacity: 1; transform: none; }
.v-ok { display: none; }
.gates[data-g='1'] .bad-col { background: #fff0f5; color: var(--bad); }
.gates[data-g='2'] .v-bad, .gates[data-g='3'] .v-bad, .gates[data-g='4'] .v-bad { display: none; }
.gates[data-g='2'] .v-ok, .gates[data-g='3'] .v-ok, .gates[data-g='4'] .v-ok { display: inline; }
.gates[data-g='2'] .bad-col { background: #f1fbf9; }
.gate-list { list-style: none; margin: 0; padding: 0; }
.gate { display: grid; grid-template-columns: 48px 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); opacity: .4; transition: opacity .4s; }
.gate.on, .gate.done, .no-js .gate { opacity: 1; }
.gate-no { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--ink); display: grid; place-items: center; font-size: 16px; transition: background-color .3s, color .3s, border-color .3s; }
.gate.on .gate-no { background: var(--ink); color: #fff; }
.gate.done .gate-no { background: var(--spectrum); color: #fff; border-color: transparent; }
.gate h3 { font-size: 22px; font-weight: 400; letter-spacing: -.02em; margin: 6px 0 8px; }
.gate p { font-size: 15px; line-height: 1.9; margin: 0; color: #3e3e42; }
.gate-res { margin-top: 10px !important; font-size: 14px !important; min-height: 1.9em; }
.gate-res span { display: none; }
.gate.ng .r-ng { display: inline; color: var(--bad); font-weight: 700; }
.gate.done .r-ok { display: inline; color: #007a74; font-weight: 700; }
.no-js .gate .r-ok { display: inline; }
.k-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.k-cards-4 { grid-template-columns: repeat(4, 1fr); }
.k-card { background: #fff; border-radius: 18px; padding: 26px 24px 28px; position: relative; overflow: hidden; }
.k-card { background: #fff; }
.k-term .k-card, .k-deliver .k-card, .k-secure .k-card, .k-ground .k-card { background: #eeeeeb; }
.k-card::before { content: ''; position: absolute; left: 0; top: 0; width: 36px; height: 4px; background: var(--spectrum); transition: width .5s ease; }
.k-card:hover::before { width: 100%; }
.k-card h3 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 6px 0 12px; line-height: 1.45; }
.k-card p { font-size: 15px; line-height: 1.95; margin: 0; color: #3e3e42; }

/* 08 Keep going: one long task meets trouble on the way and carries on from where it was. */
.run { background: #fff; border-radius: 22px; padding: 26px 28px 30px; }
.run-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; letter-spacing: .08em; color: var(--muted); margin-bottom: 18px; }
.run-state { color: var(--violet); font-weight: 700; letter-spacing: 0; transition: color .3s; }
.run-state.bad { color: #d4183a; }
.run-track { position: relative; height: 6px; border-radius: 3px; background: #e6e6e2; margin: 0 0 8px; }
.run-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.run-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 3px; background: var(--spectrum); transition: width .9s cubic-bezier(.65, 0, .35, 1); }
.run-dot { position: absolute; top: 50%; left: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #fff; border: 4px solid var(--violet); transition: left .9s cubic-bezier(.65, 0, .35, 1), border-color .3s; }
.run.bad .run-dot { border-color: #d4183a; animation: shake .45s ease-in-out 2; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.run-evs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.ev { border: 1.5px solid #e3e3de; border-radius: 14px; padding: 12px 12px 14px; background: #fbfbf9; opacity: .45; transition: opacity .4s, border-color .3s, background-color .3s; display: flex; flex-direction: column; gap: 6px; }
.ev b { font-size: 14px; }
.ev span { font-size: 13px; line-height: 1.7; color: #3e3e42; }
.ev.cur, .ev.done { opacity: 1; }
.ev.cur { border-color: var(--violet); background: #faf8ff; }
.ev-bad b::before { content: '!'; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; background: #e6e6e2; color: #fff; font-size: 12px; vertical-align: 1px; transition: background-color .3s; }
.ev-bad.hit { border-color: #d4183a; background: #fff3f5; }
.ev-bad.hit b::before, .ev-bad.fixed b::before { background: #d4183a; }
.ev-fix { opacity: 0; transform: translateY(4px); transition: opacity .4s, transform .4s; color: #0a7a4c !important; font-weight: 700; }
.ev-fix::before { content: '→ '; }
.ev.fixed .ev-fix { opacity: 1; transform: none; }
.ev.fixed { border-color: #9fdcc2; background: #f3fbf7; }
.ev-end.done { border-color: var(--violet); background: #f3efff; }
/* 09 Protect: four rings around the data; attempts stop at the ring that guards them. */
.shield { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4vw; align-items: center; background: #fff; border-radius: 22px; padding: 28px; }
.shield-svg { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; overflow: visible; }
.sh-ring { fill: none; stroke-width: 62; transition: stroke .3s; }
.sh-ring.r1 { stroke: #f6f3ff; } .sh-ring.r2 { stroke: #ede6ff; } .sh-ring.r3 { stroke: #e3d9ff; } .sh-ring.r4 { stroke: #d8caff; stroke-width: 74; }
.sh-ring.flash { stroke: #ffd5dd; }
.sh-ring.flash-ok { stroke: #ffe7b8; }
.sh-core circle { fill: var(--violet); }
.sh-core text, .sh-lab { font-family: inherit; font-size: 22px; text-anchor: middle; }
.sh-core text { fill: #fff; font-weight: 700; }
.sh-lab { fill: #4a2aa8; font-weight: 700; }
@media (max-width: 1000px) { .sh-core text, .sh-lab { font-size: 24px; } }
.sh-dot { fill: var(--ink); }
.sh-x { stroke: #d4183a; stroke-width: 4; stroke-linecap: round; fill: none; transition: opacity 1.2s; }
.sh-x.old { opacity: .35; }
.sh-ok { fill: #0a7a4c; }
.sh-cap { font-size: 13px; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.sh-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sh-log li { display: grid; gap: 2px; border: 1.5px solid #ecece8; border-radius: 14px; padding: 10px 14px 10px 44px; position: relative; opacity: .45; transition: opacity .3s, border-color .3s, background-color .3s; }
.sh-log li::before { content: ''; position: absolute; left: 14px; top: 13px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #c9c9c4; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.sh-try { font-size: 14px; font-weight: 700; }
.sh-res { font-size: 13px; color: #3e3e42; line-height: 1.7; }
.sh-log li.cur { opacity: 1; border-color: var(--ink); }
.sh-log li.no, .sh-log li.yes { opacity: 1; }
.sh-log li.no::before { content: '✕'; background: #d4183a; border-color: #d4183a; }
.sh-log li.yes::before { content: '✓'; background: #0a7a4c; border-color: #0a7a4c; }
.sh-log li.no .sh-res { color: #b0102c; }
.sh-log li.yes .sh-res { color: #0a7a4c; }
.sh-log li .sh-res { opacity: 0; transition: opacity .3s; }
.sh-log li.no .sh-res, .sh-log li.yes .sh-res { opacity: 1; }

/* Lessons: one line each, what happened and what changed. */
.lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lesson { display: grid; grid-template-columns: 1fr 48px 1fr; align-items: center; background: #fff; border-radius: 16px; padding: 18px 24px; }
.l-what, .l-fix { margin: 0; font-size: 16px; line-height: 1.6; }
.l-what { color: #c4005e; }
.l-fix { font-weight: 700; }
.l-arrow { text-align: center; font-size: 20px; background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
.js .lessons.in .lesson { animation: rowin .6s cubic-bezier(.2, .7, .2, 1) both; }
.lessons .lesson:nth-child(2) { animation-delay: .08s; } .lessons .lesson:nth-child(3) { animation-delay: .16s; } .lessons .lesson:nth-child(4) { animation-delay: .24s; } .lessons .lesson:nth-child(5) { animation-delay: .32s; } .lessons .lesson:nth-child(6) { animation-delay: .4s; }

/* 09 Platform */
.stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5vw; }
.stack h3 { font-size: 24px; font-weight: 400; letter-spacing: -.02em; margin: 0 0 18px; }
.stack .tags { margin-bottom: 18px; }
.stack p { font-size: 15px; line-height: 2; margin: 0; color: #3e3e42; }

@media (max-width: 1360px) {
  .orch-stage { grid-template-columns: 1fr; padding: 16px 0 0; gap: 4px; }
  .ph { height: 250px; margin: 0 16px; max-width: 420px; justify-self: center; width: calc(100% - 32px); border-width: 6px; border-radius: 26px; box-shadow: none; }
  .ph-msgs > :not(:nth-last-child(-n+2)) { display: none; }
  .orch-map { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .orch-svg { min-width: 900px; }
}
@media (max-width: 1100px) {
  .k-cards-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .k-hero { min-height: 640px; height: auto; max-height: none; padding: 40px 0 100px; }
  .k-hero-in { padding-bottom: 20px; }
  .k-lead { font-size: 16px; }
    .k-intro { font-size: 16px; margin-bottom: 44px; }
  /* The stage sits at the top while the steps scroll under it; it runs edge to edge so its text stays 12px or more. */
  .scrolly { grid-template-columns: 1fr; gap: 0; }
  .stage-col { top: 0; z-index: 2; margin: 0 calc(-1 * var(--gutter)); padding: 10px 0; background: var(--paper); }
  .stage { border-radius: 0; border-left: 0; border-right: 0; max-width: 620px; margin: 0 auto; }
  .step, .step:first-child, .step:last-child { min-height: 64vh; justify-content: flex-start; padding-top: 34px; }
  .step:last-child { min-height: 40vh; }
  .console-tabs, .console-foot { padding-left: 18px; padding-right: 18px; }
  .console-q { margin-left: 18px; margin-right: 18px; }
  .console-body { padding-left: 18px; padding-right: 18px; min-height: 0; }
  .cl { grid-template-columns: 1fr; gap: 4px; }
  .ground, .gates, .orch-text { grid-template-columns: 1fr; gap: 36px; }
  /* The diagram keeps a readable size and scrolls sideways inside its own box. */
  .orch-svg { width: 900px; max-width: none; }
  .orch-hint { display: block; text-align: center; font-size: 12px; letter-spacing: .1em; color: var(--muted); margin: 12px 0 0; }
  .gate-sheet { overflow-x: auto; }
  .k-cards, .k-cards-4, .stack { grid-template-columns: 1fr; }
  .lesson { grid-template-columns: 1fr; gap: 4px; padding: 16px 18px; }
  .l-arrow { text-align: left; transform: rotate(90deg); width: 20px; }
  .stack { gap: 44px; }
  .run { padding: 20px 18px 22px; }
  .run-track { display: none; }
  .run-evs { grid-template-columns: 1fr; gap: 8px; }
  .ev { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; padding: 10px 14px; }
  .shield { grid-template-columns: 1fr; padding: 18px 14px; }
}
@media (max-width: 520px) {
    .answer-card { padding: 22px 20px 24px; }
}

/* Paused or reduced: everything holds still and visible. */
.paused .stage *, .paused .run-dot, .paused .flow-line, .paused [data-node='core'] .halo { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .ph-b, .ph-file, .ph-ask, .ph-off, .ph-note { transition: none !important; }
  .stage *, .scene, .cl, .gate, .step, .sheet tbody tr, .src, .db2, .db2-chip, .dbp rect, .db2-flow, .db2-scan, .pg, .aa { transition: none !important; animation: none !important; }
  .stage-svg .dbp rect { opacity: 1; }
  .run-fill, .run-dot, .ev, .ev-fix, .sh-log li, .sh-log li .sh-res, .sh-x { transition: none !important; animation: none !important; }
  .flow-line, [data-node='core'] .halo { animation: none !important; }
}

/* Chapters: INPUT and OUTPUT. Dots flow into the sink (input) or out of the source (output). */
.chapter { position: relative; overflow: hidden; background: #fff; border-top: 1px solid var(--line); padding: 90px 0 130px; }
.chapter-no { margin: 0 0 18px; }
.chapter-word { margin: 0; font-size: clamp(56px, 9vw, 132px); font-weight: 400; letter-spacing: -.07em; line-height: .9; margin-left: -.04em; background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .04em; }
.chapter-ja { font-size: clamp(18px, 1.8vw, 24px); letter-spacing: -.01em; line-height: 1.6; margin: 26px 0 0; max-width: 820px; }
.chapter-map { list-style: none; margin: 46px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chapter-map a { display: inline-flex; align-items: center; gap: 12px; border: 1px solid #c7c7c2; border-radius: 999px; padding: 12px 20px; font-size: 15px; min-height: 48px; transition: background-color .2s, color .2s, border-color .2s; }
.chapter-map a b { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chapter-map a:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.chapter-flow { position: absolute; left: 0; right: 0; bottom: 46px; height: 22px; }
.chapter-flow i { position: absolute; top: 5px; left: 0; width: 12px; height: 12px; border-radius: 50%; opacity: 0; animation: flowin 6s linear infinite; }
.chapter-flow i:nth-child(1) { background: #ff9814; } .chapter-flow i:nth-child(2) { background: #ff1882; animation-delay: -.75s; } .chapter-flow i:nth-child(3) { background: #e000ef; animation-delay: -1.5s; }
.chapter-flow i:nth-child(4) { background: #5c00ff; animation-delay: -2.25s; } .chapter-flow i:nth-child(5) { background: #0038ff; animation-delay: -3s; } .chapter-flow i:nth-child(6) { background: #00e6df; animation-delay: -3.75s; }
.chapter-flow i:nth-child(7) { background: #ff1882; animation-delay: -4.5s; } .chapter-flow i:nth-child(8) { background: #5c00ff; animation-delay: -5.25s; }
.chapter-out .chapter-flow i:nth-child(2) { background: #ff9814; } .chapter-out .chapter-flow i:nth-child(3) { background: #ff1882; animation-delay: -.75s; } .chapter-out .chapter-flow i:nth-child(4) { background: #e000ef; animation-delay: -1.5s; }
.chapter-out .chapter-flow i:nth-child(5) { background: #5c00ff; animation-delay: -2.25s; } .chapter-out .chapter-flow i:nth-child(6) { background: #0038ff; animation-delay: -3s; } .chapter-out .chapter-flow i:nth-child(7) { background: #00e6df; animation-delay: -3.75s; }
.chapter-out .chapter-flow i:nth-child(8) { background: #ff1882; animation-delay: -4.5s; } .chapter-out .chapter-flow i:nth-child(9) { background: #5c00ff; animation-delay: -5.25s; }
.chapter-in .chapter-flow i { animation-name: flowin; }
.chapter-out .chapter-flow i { animation-name: flowout; }
@keyframes flowin { 0% { transform: translateX(-20px); opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translateX(calc(78vw - 6px)); opacity: 0; } }
@keyframes flowout { 0% { transform: translateX(22vw); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateX(100vw); opacity: 0; } }
.chapter-sink, .chapter-source { position: absolute; top: -9px; width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--violet); background: #fff; }
.chapter-sink { left: 78vw; }
.chapter-source { left: calc(22vw - 34px); background: var(--spectrum); border-color: transparent; }
.chapter-flow::before { content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: #ecece8; }

/* 02 Cut & save */
.cutter { display: grid; grid-template-columns: 0.9fr 1.2fr 1.3fr; gap: 18px; align-items: stretch; margin-bottom: 16px; }
.cut-col { background: #fff; border-radius: 20px; padding: 20px 20px 22px; position: relative; overflow: hidden; min-width: 0; }
.cut-cap { font-size: 13px; letter-spacing: .08em; color: var(--muted); margin: 0 0 14px; display: flex; justify-content: space-between; gap: 8px; }
.cut-cap span { font-family: var(--mono); color: var(--violet); }
.cut-pages { position: relative; display: grid; gap: 10px; }
.cp { border: 1px solid #e3e3de; border-radius: 10px; padding: 12px 14px 14px; background: #fbfbf9; transition: background-color .3s, border-color .3s, transform .3s; }
.cp-no { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.cp b { display: block; font-size: 15px; margin: 4px 0 8px; }
.cp i { display: block; height: 6px; border-radius: 3px; background: #e6e6e1; margin-top: 6px; width: 92%; }
.cp i.s { width: 64%; }
.cp.on { background: #f3efff; border-color: var(--violet); transform: translateX(6px); }
.cp.done { opacity: .55; }
.cut-scan { position: absolute; left: -6px; right: -6px; top: 0; height: 3px; border-radius: 2px; background: var(--spectrum); box-shadow: 0 0 12px rgba(92, 0, 255, .5); transition: transform .5s cubic-bezier(.65, 0, .35, 1); opacity: 0; }
.cutter.run .cut-scan { opacity: 1; }
.cut-chunk { border: 2px dashed #cfc6f3; border-radius: 14px; padding: 16px 18px 18px; min-height: 230px; background: #fcfbff; transition: transform .6s cubic-bezier(.65, 0, .35, 1), opacity .4s ease; }
.cut-chunk.fly { transform: translate3d(40%, 10px, 0) scale(.6); opacity: 0; }
.cut-chunk.cut { border-style: solid; border-color: var(--violet); }
.cc-tag { margin: 0; font-size: 14px; font-weight: 700; color: var(--violet); min-height: 1.6em; line-height: 1.6; }
.cc-text { margin: 10px 0 0; font-size: 15px; line-height: 1.8; min-height: 3.6em; }
.cc-idx { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: end; margin-top: 12px; }
.cc-vec { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.cc-vec i { width: 6px; border-radius: 2px; background: var(--spectrum); background-size: 300px 100%; transform-origin: bottom; transform: scaleY(0); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.cc-vec.on i { transform: scaleY(1); }
.cc-words { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-words span { font-family: var(--mono); font-size: 12px; border: 1px solid #ffb3d4; color: #c4005e; background: #fff4f9; border-radius: 999px; padding: 3px 9px; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.cc-words.on span { opacity: 1; transform: none; }
.cut-steps { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cut-steps li { font-size: 13px; border: 1px solid #d6d6d1; border-radius: 999px; padding: 6px 12px; color: var(--muted); transition: background-color .25s, color .25s, border-color .25s; }
.cut-steps li.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.cut-steps li.done { color: var(--ink); border-color: var(--ink); }
.cut-table-wrap { overflow-x: auto; }
.cut-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cut-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cut-table td { padding: 12px 8px; border-bottom: 1px solid #ecece8; vertical-align: middle; }
.cut-table td:first-child, .cut-table td:nth-child(3) { font-family: var(--mono); white-space: nowrap; }
.cut-table td:nth-child(2) { color: var(--violet); font-weight: 700; }
.cut-table tr { transition: background-color 1.2s ease; }
.cut-table tr.new { background: #f3efff; }
.cut-table tr.new td { animation: rowin .5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rowin { from { opacity: 0; transform: translateX(-16px); } }
.mini-idx { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; vertical-align: middle; margin-right: 8px; }
.mini-idx i { width: 3px; border-radius: 1px; background: var(--violet); }
.mini-w { font-family: var(--mono); font-size: 12px; color: #c4005e; }

/* 03 PC terminal */
.term { display: grid; grid-template-columns: 0.8fr 1.4fr; gap: 18px; align-items: stretch; margin-bottom: 16px; }
.term-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: t; }
.term-flow li { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 16px; background: #eeeeeb; border-radius: 18px; padding: 16px 18px; position: relative; transition: background-color .3s, transform .3s; }
.term-flow li + li::before { content: '↓'; position: absolute; top: -17px; left: 46px; font-size: 14px; color: #a8a8a8; }
.term-flow b { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 1px solid #d6d6d1; font-size: 18px; letter-spacing: .02em; }
.term-flow span { font-size: 15px; line-height: 1.6; }
.term-flow li.on { background: #f3efff; transform: translateX(6px); }
.term-flow li.on b { background: var(--spectrum); color: #fff; border-color: transparent; }
.term-win { background: #fbfbf9; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; min-height: 440px; }
.term-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f1f1ee; font-size: 13px; color: var(--muted); }
.term-dots { display: inline-flex; gap: 6px; }
.term-dots i { width: 11px; height: 11px; border-radius: 50%; background: #d6d6d1; }
.term-dots i:nth-child(1) { background: #ff9814; } .term-dots i:nth-child(2) { background: #e000ef; } .term-dots i:nth-child(3) { background: #00e6df; }
.term-log { list-style: none; margin: 0; padding: 16px 18px 20px; font-family: var(--mono); font-size: 13px; line-height: 1.75; flex: 1; }
.tl { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 4px 0; opacity: 0; transform: translate3d(0, 6px, 0); transition: opacity .3s, transform .3s; }
.tl.show, .tl.still { opacity: 1; transform: none; }
.tl-k { font-weight: 700; }
.tl[data-who='ai'] .tl-k { color: var(--violet); } .tl[data-who='human'] .tl-k { color: #c4005e; } .tl[data-who='pc'] .tl-k { color: #0038ff; } .tl[data-who='db'] .tl-k { color: #007a74; }
.tl-t { min-width: 0; overflow-wrap: anywhere; color: #2c2c30; }
.tl-t em { font-style: normal; color: #007a74; }
.tl-t s { text-decoration: none; color: #b25a00; }
.term-cursor { display: inline-block; width: 8px; height: 15px; background: var(--violet); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.k-cut .ground-note, .k-term .ground-note { margin-bottom: 44px; }
.term-rules { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.term-rules li { font-size: 14px; border: 1px solid var(--ink); border-radius: 999px; padding: 9px 16px; background: #fff; }
.term-rules li::before { content: '✓'; margin-right: 8px; color: var(--violet); font-weight: 700; }

@media (max-width: 1100px) {
  .run-evs { grid-template-columns: repeat(4, 1fr); }
  .run-track, .run-ends { display: none; }
  .cutter { grid-template-columns: 1fr 1fr; }
  .cut-db { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .chapter { padding: 80px 0 110px; }
  .chapter-flow { bottom: 34px; }
  .cutter, .term { grid-template-columns: 1fr; }
  .cut-pages { grid-template-columns: 1fr 1fr; }
  .cut-chunk { min-height: 0; }
  .cc-idx { grid-template-columns: 1fr; }
  .term-win { min-height: 0; }
  .term-log { min-height: 380px; }
  .tl { grid-template-columns: 1fr; gap: 0; padding: 6px 0; }
  .term-flow { grid-template-columns: 1fr 1fr; }
  .term-flow li { grid-template-columns: 1fr; justify-items: start; gap: 10px; padding: 14px; }
  .term-flow li + li::before { content: none; }
  .term-flow b { width: 48px; height: 48px; font-size: 16px; }
}
.paused .chapter-flow i, .paused .term-cursor { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .chapter-flow i, .term-cursor, .cut-table tr.new td { animation: none !important; }
  .chapter-flow i { opacity: 0; }
  .cp, .cut-scan, .cut-chunk, .cc-vec i, .cc-words span, .cut-steps li, .tl, .term-flow li, .term-flow b { transition: none !important; }
}

/* 00 Industries */
.k-ind { background: #eeeeeb; }
.ind { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ind-card { background: #fff; border-radius: 22px; padding: 34px 34px 38px; position: relative; overflow: hidden; }
.ind-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--spectrum); transform: scaleX(0); transform-origin: left; transition: transform 1.1s cubic-bezier(.65, 0, .35, 1) .2s; }
.ind.in .ind-card::before, .no-js .ind-card::before { transform: scaleX(1); }
.ind-card:nth-child(2)::before { transition-delay: .45s; }
.ind-card h3 { font-size: clamp(30px, 3vw, 44px); font-weight: 400; letter-spacing: -.05em; margin: 10px 0 24px; }
.ind-sub { font-size: 13px; letter-spacing: .1em; color: var(--muted); margin: 24px 0 12px; }
.ind-q { list-style: none; margin: 0; padding: 0; }
.ind-q li { position: relative; padding: 14px 0 14px 40px; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.8; }
.ind-q li::before { content: 'Q'; position: absolute; left: 0; top: 15px; width: 26px; height: 26px; border-radius: 50%; background: var(--spectrum); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
@media (max-width: 800px) {
  .ind { grid-template-columns: 1fr; }
  .ind-card { padding: 26px 22px 28px; }
}
@media (prefers-reduced-motion: reduce) { .ind-card::before { transform: scaleX(1); transition: none; } }
/* HUVOT: a drop-shaped rainbow slime with two black eyes. */
.huvot { position: absolute; left: 76%; top: 46%; width: min(34vw, 52vh, 480px); aspect-ratio: 1 / 1; transform: translate(-50%, -50%); z-index: 2; pointer-events: none; }
.huvot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hv-eye { fill: #111114; }
.hv-shine { fill: #fff; }
.hv-shadow { fill: #5c00ff; opacity: .1; }
.hv-slime { pointer-events: visiblePainted; cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent; }
.hv-slime.grab { cursor: grabbing; }
.hv-eyes { transform-box: fill-box; transform-origin: center; animation: hvblink 4.6s ease-in-out infinite; }
@keyframes hvblink { 0%, 44%, 50%, 100% { transform: scaleY(1); } 47% { transform: scaleY(.08); } }
.k-lead b { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 04 SQL search: the query filters the table. */
.sqlv { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 40px; align-items: start; }
.sqlv-left { display: grid; gap: 14px; }
.sqlv-q { margin: 0; background: #fff; border-radius: 16px; padding: 16px 18px; font-size: 16px; line-height: 1.7; display: flex; gap: 12px; align-items: flex-start; }
.q-badge { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--spectrum); color: #fff; font-size: 13px; font-weight: 700; }
.sqlv-code { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; font-family: var(--mono); font-size: 15px; line-height: 2; white-space: normal; overflow-wrap: anywhere; position: relative; }
.sqlv-code .ln { display: block; white-space: pre-wrap; border-radius: 6px; padding: 0 8px; margin: 0 -8px; color: #9a9aa2; transition: background-color .3s, color .3s; }
.sqlv-code .ln b { font-weight: 700; color: inherit; }
.sqlv-code .ln.on { background: #f3efff; color: var(--violet); }
.sqlv-code .ln.done { color: var(--ink); }
.no-js .sqlv-code .ln { color: var(--ink); }
.sqlv-ans { background: #f3efff; border-radius: 16px; padding: 16px 18px; font-size: 17px; line-height: 1.7; opacity: .25; transform: translateY(6px); transition: opacity .4s, transform .4s; }
.sqlv-ans.on, .no-js .sqlv-ans { opacity: 1; transform: none; }
.sqlv-ans b { font-size: 26px; color: var(--violet); margin-right: 4px; }
.sqlv-vs { display: grid; gap: 6px; }
.sqlv-vs p { margin: 0; font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.sqlv-vs span { font-family: var(--mono); font-size: 12px; font-weight: 700; border: 1px solid #c7c7c2; border-radius: 999px; padding: 3px 10px; min-width: 52px; text-align: center; }
.sqlv-vs p.on { color: var(--ink); font-weight: 700; }
.sqlv-vs p.on span { background: var(--ink); color: #fff; border-color: var(--ink); }
.sqlv-table { background: #fff; border-radius: 16px; overflow: hidden; }
.sqlv-head { display: flex; justify-content: space-between; padding: 14px 18px; font-size: 14px; border-bottom: 1px solid var(--line); background: #f4f4f1; }
.sqlv-head span:last-child { font-family: var(--mono); color: var(--violet); font-weight: 700; }
.sqlv-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sqlv-table th { text-align: left; font-size: 12px; color: var(--muted); padding: 8px 14px; border-bottom: 1px solid var(--line); }
.sqlv-table td { padding: 8px 14px; border-bottom: 1px solid #f0f0ec; transition: opacity .5s, background-color .5s, color .5s; }
.sqlv-table td.ng { color: #c4005e; }
.sqlv-table tr.out td { opacity: .16; }
.sqlv-table tr.hit td { background: #f3efff; font-weight: 700; }
@media (max-width: 800px) {
  .k-name-word { font-size: 17vw; }
  /* On a phone HUVOT stands above the title, big enough to grab. */
  .huvot { position: relative; left: auto; right: auto; top: auto; transform: none; width: min(60vw, 300px); margin: 0 auto -18px; }
  .k-hero { justify-content: flex-start; padding-top: 4px; min-height: 0; }
  .sqlv { grid-template-columns: 1fr; }
  .sqlv-code { font-size: 13px; }
}
.paused .huvot * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .huvot *, .hv-eyes, .lessons .lesson { animation: none !important; }
    .sqlv-code .ln, .sqlv-table td, .sqlv-ans { transition: none !important; }
}

/* 02 The five-step overview above the cutter: many manuals → pages → image + text → pieces → rows. One step lights at a time. */
.split { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; counter-reset: sl; }
.sl { position: relative; background: #fff; border: 1.5px solid transparent; border-radius: 18px; padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 2px; counter-increment: sl; }
.sl::before { content: counter(sl); position: absolute; top: 12px; left: 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.sl:not(:last-child)::after { content: ''; position: absolute; top: 50%; right: -13px; width: 8px; height: 8px; border-top: 2px solid var(--violet); border-right: 2px solid var(--violet); transform: translateY(-50%) rotate(45deg); }
.sl svg { display: block; width: 100%; max-width: 180px; height: auto; margin: 4px auto 8px; overflow: visible; }
.sl b { font-size: 15px; }
.sl span { font-size: 13px; color: var(--muted); line-height: 1.6; }
.sl1 span { color: var(--violet); font-weight: 700; font-size: 14px; }
.split.on .sl { animation: sllit 10s infinite; }
.split.on .sl2 { animation-delay: 2s; } .split.on .sl3 { animation-delay: 4s; } .split.on .sl4 { animation-delay: 6s; } .split.on .sl5 { animation-delay: 8s; }
@keyframes sllit { 0%, 20% { border-color: var(--violet); box-shadow: 0 8px 24px rgba(92, 0, 255, .12); } 26%, 100% { border-color: transparent; box-shadow: none; } }
.sl svg rect, .sl svg ellipse, .sl svg circle { fill: #fff; stroke: #c9c9c4; stroke-width: 1.5; }
.sl svg path { fill: none; stroke: #c9c9c4; stroke-width: 2; stroke-linecap: round; }
.sl svg .ln { stroke: #dcdcd7; stroke-width: 4; }
.sl svg .sp { stroke: none; }
.sl svg .sp0 { fill: #ffd9a8; } .sl svg .sp1 { fill: #ffb3d4; } .sl svg .sp2 { fill: #f2b0fa; } .sl svg .sp3 { fill: #c9b0ff; } .sl svg .sp4 { fill: #b0c1ff; } .sl svg .sp5 { fill: #9fece8; }
.sl svg .pull { fill: var(--violet); stroke: none; }
.sl svg .pic { fill: #ece5ff; stroke: none; }
.sl svg .half path { stroke: var(--violet); }
.sl svg .ck rect { fill: #fcfbff; stroke: #cfc6f3; stroke-dasharray: 4 4; }
.sl svg .ck path { stroke: #dcdcd7; stroke-width: 4; }
.sl svg .ck circle { stroke: none; fill: var(--violet); }
.sl svg .k2 circle { fill: #ff1882; } .sl svg .k3 circle { fill: #0038ff; }
.sl svg .cyl { fill: #faf8ff; stroke: var(--violet); stroke-width: 2; }
.sl svg .rw { stroke: none; fill: #c9b0ff; }
.sl svg .w2 { fill: #ffb3d4; } .sl svg .w3 { fill: #9fece8; }
.sl svg * { transform-box: fill-box; }
.split.on .pull { animation: slpull 2.4s ease-in-out infinite; }
@keyframes slpull { 0%, 20% { transform: none; } 50%, 70% { transform: translate(6px, -16px) rotate(8deg); } 100% { transform: none; } }
.split.on .p1 { animation: slfanl 2.4s ease-in-out infinite; } .split.on .p3 { animation: slfanr 2.4s ease-in-out infinite; }
@keyframes slfanl { 50% { transform: translate(-22px, 4px) rotate(-8deg); } }
@keyframes slfanr { 50% { transform: translate(22px, 4px) rotate(8deg); } }
.split.on .hl { animation: slhl 2.4s ease-in-out infinite; } .split.on .hr { animation: slhr 2.4s ease-in-out infinite; }
@keyframes slhl { 0%, 15% { transform: translateX(31px); } 55%, 100% { transform: none; } }
@keyframes slhr { 0%, 15% { transform: translateX(-23px); opacity: .2; } 55%, 100% { transform: none; opacity: 1; } }
.split.on .ck { animation: slck 3s ease-in-out infinite; }
.split.on .k2 { animation-delay: .4s; } .split.on .k3 { animation-delay: .8s; }
@keyframes slck { 0%, 10% { transform: none; } 30%, 80% { transform: translateX(10px); } 100% { transform: none; } }
.split.on .rw { animation: slrow 3s ease-out infinite; }
.split.on .w2 { animation-delay: .35s; } .split.on .w3 { animation-delay: .7s; }
@keyframes slrow { 0% { opacity: 0; transform: translateX(-20px); } 20%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.paused .split * { animation-play-state: paused !important; }
@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; gap: 12px; }
  .sl { display: grid; grid-template-columns: 112px 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center; padding: 10px 16px 10px 30px; }
  .sl svg { grid-row: 1 / 3; margin: 0; }
  .sl b { align-self: end; } .sl span { align-self: start; }
  .sl::before { top: 50%; left: 12px; transform: translateY(-50%); }
  .sl:not(:last-child)::after { top: auto; bottom: -10px; right: auto; left: 50%; transform: rotate(135deg); }
}
@media (prefers-reduced-motion: reduce) { .split * , .split .sl { animation: none !important; } }
