/* nabeAI トップ「螺旋の劇場」r4（2026-10-09）。色は nabe の DESIGN_CORE と r3 の役割を継ぐ（DESIGN.md の inherited_tokens）。
   等幅の飾りは使わない。和文の見出しは約物を詰め（palt）、句で折り返す。紙の地は相談の段だけ（灯りの入った舞台）。 */
:root{
 --ink:#141110;--ink2:#221d19;--paper:#faf8f4;--sumi:#2b2622;
 --text:#f1ebe1;--muted:rgba(241,235,225,.66);--faint:rgba(241,235,225,.16);
 --orange:#e8833a;--orange-hot:#ff9b59;--orange-paper:#c4611c;
 --sans:"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP","Yu Gothic Medium","Yu Gothic",Meiryo,sans-serif;
 --display:"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP","Yu Gothic",Meiryo,sans-serif;
 --gutter:clamp(20px,4vw,56px);
 --ease:cubic-bezier(.16,1,.3,1);
 color-scheme:dark;
}
*{box-sizing:border-box}
html{scrollbar-color:#3b332d var(--ink);-webkit-text-size-adjust:100%}
html,body{margin:0}
body{background:var(--ink);color:var(--text);font:400 16px/1.9 var(--sans);letter-spacing:.02em;-webkit-font-smoothing:antialiased;font-kerning:normal}
::selection{background:rgba(232,131,58,.42);color:#fff}
a{color:inherit;text-underline-offset:.24em;text-decoration-thickness:1px}
:focus-visible{outline:2px solid var(--orange-hot);outline-offset:3px}
h1,h2,h3{margin:0;font-family:var(--display);font-weight:800;line-height:1.28;letter-spacing:.01em;font-feature-settings:"palt" 1;word-break:auto-phrase;text-wrap:balance}
em{font-style:normal;color:var(--orange-hot)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.skip{position:absolute;left:16px;top:10px;z-index:40;padding:10px 14px;background:var(--paper);color:var(--ink);transform:translateY(-180%);font-size:14px;text-decoration:none}.skip:focus{transform:none}

/* ---- header ---- */
.top{position:fixed;z-index:20;inset:0 0 auto 0;display:flex;align-items:center;justify-content:space-between;padding:20px var(--gutter);pointer-events:none;transition:background-color .3s,box-shadow .3s}
.top>*{pointer-events:auto}
.brand{font:800 20px/1 var(--display);letter-spacing:.01em;text-decoration:none;color:var(--text)}.brand b{color:var(--orange)}
.topnav{display:flex;gap:28px;font:700 13px/1 var(--sans);letter-spacing:.04em}
.topnav a{padding:8px 0;text-decoration:none;color:var(--text);opacity:.78;transition:opacity .2s,color .2s}.topnav a:hover{opacity:1;color:var(--orange-hot)}
.top.on-ink{background:var(--ink);box-shadow:0 1px 0 var(--faint)}
.top.on-paper{background:rgba(250,248,244,.96);box-shadow:0 1px 0 rgba(43,38,34,.1)}
.top.on-paper .brand,.top.on-paper .topnav a{color:var(--sumi)}

/* ---- the theater ---- */
#experience{position:relative;height:820svh}
.stage{position:sticky;top:0;height:100svh;min-height:600px;overflow:hidden;background:var(--ink);isolation:isolate}
#world{position:absolute;inset:0;width:100%;height:100%;display:block;opacity:0;transition:opacity 1.6s var(--ease)}
.stage.is-lit #world{opacity:1}
.veil{position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,rgba(20,17,16,.9) 0,rgba(20,17,16,.64) 27%,rgba(20,17,16,0) 50%)}
.copy{position:absolute;z-index:3;left:max(var(--gutter),calc(50% - 640px));top:50%;transform:translateY(-50%);width:min(480px,37vw);height:min(600px,74svh)}
.scene-copy{--strike:1;--land:1;position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;opacity:0;transform:translateY(16px);filter:blur(6px);visibility:hidden;transition:opacity .7s var(--ease),transform .7s var(--ease),filter .7s var(--ease),visibility 0s linear .7s;pointer-events:none}
.scene-copy.is-on{opacity:1;transform:none;filter:none;pointer-events:auto;visibility:visible;transition-delay:0s}
h1{font-size:clamp(40px,4.3vw,66px);line-height:1.24}
.lead{margin:26px 0 0;max-width:30em;color:rgba(241,235,225,.86);line-height:1.95}
.cue{display:flex;align-items:center;gap:14px;margin:34px 0 0;font:700 13px/1 var(--sans);letter-spacing:.04em;color:var(--muted)}
.cue span{width:44px;height:1px;background:var(--orange)}

/* each stage's heading: the old number is struck by the AI light, then the new one lands, big (driven by --strike / --land) */
.scene-copy h2{--big:clamp(84px,9vw,138px);font-size:clamp(24px,2.3vw,34px);line-height:1.3}
.scene-copy h2 .was,.scene-copy h2 .now{display:block}
/* the new number takes its room only as it lands: before the light arrives the heading and the text sit together, no empty slot */
.scene-copy h2 .now{max-height:calc(var(--land)*var(--big)*1.2);overflow:hidden}
.scene-copy h2 s{position:relative;text-decoration:none;white-space:nowrap;color:rgba(241,235,225,calc(1 - var(--strike)*.45))}
.scene-copy h2 s::after{content:"";position:absolute;left:-.06em;right:-.06em;top:52%;height:.1em;background:var(--orange-hot);transform-origin:left center;transform:scaleX(var(--strike))}
.scene-copy h2 .now{margin-top:.06em;opacity:var(--land);transform:translateY(calc((1 - var(--land))*.45em));filter:blur(calc((1 - var(--land))*10px))}
.scene-copy h2 b{font-size:var(--big);line-height:.98;letter-spacing:-.025em;color:var(--orange-hot);margin-right:.04em}
.fn{margin-left:.2em;font-size:.5em;vertical-align:super;line-height:0;color:var(--muted);text-decoration:none;font-weight:700}.fn:hover{color:var(--orange-hot)}
.scene-copy .lead{margin-top:22px;font-size:16px}
.does{margin:22px 0 0;padding-top:16px;border-top:1px solid var(--faint);max-width:30em;font-size:14.5px;line-height:1.85;color:var(--muted)}
.does b{margin-right:.9em;color:var(--orange-hot);font-weight:700}
.scene-copy h2.finale{font-size:clamp(30px,3vw,44px);line-height:1.3}
.go{align-self:flex-start;display:inline-flex;align-items:center;gap:14px;margin-top:32px;padding:16px 26px;background:var(--orange);color:var(--ink);text-decoration:none;font:800 15px/1 var(--display);letter-spacing:.06em;transition:background-color .2s}
.go:hover{background:var(--orange-hot)}
.go svg,.button svg{width:18px;height:10px;fill:none;stroke:currentColor;stroke-width:1.6;transition:transform .3s var(--ease)}
.go:hover svg,.button:hover svg{transform:translateX(4px)}

/* one chapter index under the words: the four effects, the current one lit (never over the stage) */
.chapters{position:absolute;z-index:4;left:max(var(--gutter),calc(50% - 640px));bottom:28px;display:flex;gap:28px;transition:opacity .25s}
.chapters button{position:relative;min-height:44px;padding:14px 0 0;border:0;background:none;color:var(--muted);font:700 13px/1 var(--sans);letter-spacing:.04em;text-align:left;cursor:pointer;transition:color .25s}
.chapters button::before,.chapters button::after{content:"";position:absolute;left:0;right:0;top:0;height:2px;background:rgba(241,235,225,.22)}
.chapters button::after{background:var(--orange);transform:scaleX(0);transform-origin:left center;transition:transform .5s var(--ease)}
.chapters button:hover,.chapters button[aria-current]{color:var(--text)}
.chapters button[aria-current]::after{transform:none}
#experience.leaving .chapters,#experience:has(.scene-copy[data-scene="5"].is-on) .chapters{opacity:0;pointer-events:none}
.fallback-note{position:absolute;left:var(--gutter);bottom:24px;margin:0;font-size:13px;color:var(--muted)}

/* ---- after the theater: the programme, still in the theater's ink ---- */
.plain{background:var(--ink);color:var(--text);font-size:17px}
.wrap{max-width:1200px;margin:0 auto;padding:clamp(88px,11vw,152px) var(--gutter)}
.plain .wrap>h2{font-size:clamp(28px,3.3vw,48px);max-width:17em}
.ledger{list-style:none;margin:clamp(48px,6vw,84px) 0 0;padding:0;border-top:1px solid var(--faint)}
.ledger li{display:grid;grid-template-columns:minmax(7em,1fr) minmax(0,2.3fr) minmax(0,2fr);align-items:baseline;gap:clamp(16px,3vw,48px);padding:clamp(26px,3.2vw,40px) 0;border-bottom:1px solid var(--faint)}
.ledger h3{font-size:18px;line-height:1.4;font-weight:800}
.fig{display:flex;flex-wrap:wrap;align-items:baseline;gap:.2em .55em;margin:0;font-family:var(--display);font-weight:800;font-feature-settings:"palt" 1}
/* the struck number sits in a slot as wide as the longest one (年24万円), so the big numbers start on one vertical line in every row */
.fig s{min-width:5em;font-size:clamp(18px,1.8vw,24px);color:var(--muted);text-decoration:line-through;text-decoration-color:var(--orange-hot);text-decoration-thickness:2px}
.fig b{font-size:clamp(56px,6.4vw,94px);line-height:1;letter-spacing:-.02em;color:var(--orange-hot)}
.ledger li>p:last-child{margin:0;line-height:1.85;color:rgba(241,235,225,.84)}
.note{margin:28px 0 0;max-width:46em;font-size:14px;color:var(--muted)}
.method{display:grid;grid-template-columns:minmax(7em,1fr) minmax(0,4.3fr);gap:clamp(16px,3vw,48px);margin-top:clamp(96px,11vw,152px)}
.method h2{font-size:clamp(22px,2vw,28px)}
.method ol{list-style:none;margin:0;padding:0;counter-reset:m;border-top:1px solid var(--faint)}
.method li{counter-increment:m;display:grid;grid-template-columns:2.6rem minmax(0,1fr) minmax(0,1.25fr);gap:0 clamp(16px,3vw,40px);align-items:baseline;padding:22px 0;border-bottom:1px solid var(--faint);line-height:1.85;color:rgba(241,235,225,.8)}
.method li::before{content:counter(m);font:800 26px/1 var(--display);color:var(--orange-hot)}
.method li b{font:800 19px/1.5 var(--display);color:var(--text);font-feature-settings:"palt" 1}

/* ---- consult: the one lit stage, on paper ---- */
.consult{background:var(--paper);color:var(--sumi);color-scheme:light;font-size:17px}
.consult .wrap{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:clamp(32px,6vw,96px);align-items:end}
.consult h2{font-size:clamp(32px,3.5vw,50px);line-height:1.24}
.consult-body p{margin:0;max-width:30em;line-height:1.95}
.button{display:inline-flex;align-items:center;gap:14px;margin-top:28px;padding:18px 30px;background:var(--sumi);color:var(--paper);text-decoration:none;font:800 16px/1 var(--display);letter-spacing:.06em;transition:background-color .2s}
.button svg{stroke:var(--orange-hot)}
.button:hover{background:#000}
.consult :focus-visible{outline-color:var(--orange-paper)}
.consult ::selection{background:rgba(232,131,58,.3);color:var(--sumi)}
.foot{grid-column:1/-1;display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px 32px;margin-top:clamp(56px,7vw,96px);padding-top:22px;border-top:1px solid rgba(43,38,34,.16);font-size:14px;color:rgba(43,38,34,.74)}
.foot p{margin:0}

/* ---- without the theater (JS off, WebGL unavailable): the same words as plain reading ---- */
html.no-js #experience,html.static-mode #experience{height:auto}
html.no-js .stage,html.static-mode .stage{position:static;height:auto;min-height:0;padding:128px var(--gutter) 16px}
html.no-js #world,html.no-js .veil,html.no-js .chapters,html.no-js .cue,html.static-mode #world,html.static-mode .veil,html.static-mode .chapters,html.static-mode .cue{display:none}
html.no-js .copy,html.static-mode .copy{position:static;transform:none;width:auto;max-width:640px;height:auto;margin-left:max(0px,calc(50% - 640px))}
html.no-js .scene-copy,html.static-mode .scene-copy{position:static;opacity:1;transform:none;filter:none;pointer-events:auto;visibility:visible;margin-bottom:80px}
html.no-js .top,html.static-mode .top:not(.on-paper){background:rgba(20,17,16,.94);box-shadow:0 1px 0 var(--faint)}
html.static-mode .fallback-note{position:static;margin:0 0 0 max(0px,calc(50% - 640px))}

@media (max-width:860px){
 .top{padding:16px 20px}.topnav{display:none}
 .copy{left:20px;right:20px;top:auto;bottom:92px;transform:none;width:auto;height:auto}
 .scene-copy{inset:auto 0 0 0;justify-content:flex-end}
 h1{font-size:31px}
 .lead,.scene-copy .lead{margin-top:16px;font-size:15px;line-height:1.85}
 .cue{margin-top:20px}
 .scene-copy h2{font-size:21px}
 .scene-copy h2{--big:76px}
 .scene-copy h2.finale{font-size:25px}
 .does{display:none}
 .go{margin-top:22px}
 .veil{background:linear-gradient(180deg,rgba(20,17,16,0) 34%,rgba(20,17,16,.8) 57%,rgba(20,17,16,.96) 100%)}
 .chapters{left:16px;right:16px;bottom:14px;gap:6px}
 .chapters button{flex:1;min-height:46px;font-size:11px;letter-spacing:.02em}
 .ledger li{grid-template-columns:1fr;gap:6px;padding:30px 0}
 .fig b{font-size:60px}
 .method{grid-template-columns:1fr}
 .method li{display:block;position:relative;padding:20px 0 20px 2.6rem}
 .method li::before{position:absolute;left:0;top:24px}
 .method li b{display:block}
 .consult .wrap{grid-template-columns:1fr;align-items:start}
 .consult h2{font-size:32px}
}
@media (prefers-reduced-motion:reduce){
 #world,.scene-copy,.chapters button::after,.go svg,.button svg{transition:none}
 .scene-copy{transform:none;filter:none}
}
