/* NOKTOA HP — v3.css（トップ試作v3の追加分。base.css + fx.css の上に載る。2026-11-12）
   足すのは5つだけ: ①スクロールで映像を送る ②積み重なる4章 ③上映室 ④育つ見出し ⑤数字の数え上げ
   どれも縦にだけ動き、「動きを減らす」設定と非対応ブラウザでは静止する。色と字は base.css のトークンのみ。 */

/* ---- ④ 育つ見出し: 可変フォントの太さがスクロールで 300→700 に育つ ---- */
@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        @keyframes grow { from { font-weight: 300; letter-spacing: -.02em; } }
        html:not(.reduce-motion) .sec .h1, html:not(.reduce-motion) .services-intro .h1 { animation: grow linear both; animation-timeline: view(); animation-range: entry 10% cover 42%; }
    }
}

/* ---- 時刻（ヒーロー左下） ---- */
.phero-kicker time { margin-left: 1.2em; font-variant-numeric: tabular-nums; opacity: .8; }

/* ---- ① スクロールで映像を送る（編集のタイムラインをたどる） ---- */
.scrub { position: relative; height: 460svh; background: var(--ink); color: var(--text-d); }
.scrub-stick { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(32px, 6vw, 110px); width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; padding-top: var(--header-h); }
.scrub-copy { position: relative; align-self: center; min-height: 15em; }
.scrub-copy .label { margin-bottom: 26px; }
.scrub-line { position: absolute; left: 0; right: 0; top: 3.2em; opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.scrub-line.on { opacity: 1; transform: none; }
.scrub-line.past { transform: translateY(-26px); }
.scrub-line h2 { font-size: clamp(2rem, 5.2vw, 4.4rem); font-weight: 700; line-height: 1.16; letter-spacing: -.045em; color: #fff; }
.scrub-line p { margin-top: 22px; max-width: 26em; font-size: clamp(.98rem, 1.4vw, 1.12rem); line-height: 2; color: var(--text-d2); }
.scrub-stage { justify-self: end; display: grid; gap: 18px; }
.scrub-frame { position: relative; height: min(72svh, 800px); aspect-ratio: 9 / 16; border-radius: 28px; overflow: hidden; background: var(--ink-2); }
.scrub-frame canvas, .scrub-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scrub-frame img { position: absolute; inset: 0; transition: opacity .8s var(--ease); }
.scrub-frame.live img { opacity: 0; }
.scrub-tl { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.scrub-tc { font: 500 .74rem/1 var(--font); letter-spacing: .08em; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .86); }
.scrub-ruler { position: relative; height: 18px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .34) 0 1px, transparent 1px 8px) center / 100% 6px no-repeat; }
.scrub-ruler::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(255, 255, 255, .16); }
.scrub-head { position: absolute; top: 0; bottom: 0; left: calc(var(--p, 0) * 100%); width: 2px; margin-left: -1px; border-radius: 2px; background: var(--matcha-d); }
.scrub-hint { font-size: .7rem; letter-spacing: .2em; color: rgba(255, 255, 255, .5); grid-column: 1 / -1; transition: opacity .8s var(--ease); }
.scrub.moved .scrub-hint { opacity: 0; }
@media (max-width: 820px) {
    .scrub { height: 420svh; }
    .scrub-stick { display: block; width: 100%; padding-top: 0; }
    .scrub-stage { position: absolute; inset: 0; display: block; }
    .scrub-frame { height: 100%; width: 100%; aspect-ratio: auto; border-radius: 0; }
    .scrub-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(var(--ink-rgb), .92) 0%, rgba(var(--ink-rgb), .5) 34%, rgba(var(--ink-rgb), 0) 60%, rgba(var(--ink-rgb), .35) 100%); }
    .scrub-tl { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 3; }
    .scrub-copy { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 3; min-height: 13.5em; }
    .scrub-line { top: 2.6em; }
    .scrub-line p { margin-top: 14px; font-size: .92rem; line-height: 1.9; color: rgba(255, 255, 255, .82); }
    .scrub-copy .label { color: rgba(255, 255, 255, .8); margin-bottom: 14px; }
}
/* 静止（動きを減らす／JSなし）: 1コマと3つの文を縦に並べる */
.reduce-motion .scrub, html:not(.js) .scrub { height: auto; }
.reduce-motion .scrub-stick, html:not(.js) .scrub-stick { position: relative; height: auto; display: grid; grid-template-columns: 1fr; padding: clamp(110px, 16vw, 200px) 0; width: min(100% - var(--gutter) * 2, var(--max)); }
.reduce-motion .scrub-copy, html:not(.js) .scrub-copy { position: static; min-height: 0; }
.reduce-motion .scrub-line, html:not(.js) .scrub-line { position: static; opacity: 1; transform: none; margin-bottom: 48px; }
.reduce-motion .scrub-stage, html:not(.js) .scrub-stage { position: static; justify-self: start; display: grid; }
.reduce-motion .scrub-frame, html:not(.js) .scrub-frame { height: min(70svh, 640px); width: auto; aspect-ratio: 9 / 16; border-radius: 28px; }
.reduce-motion .scrub-frame::after, .reduce-motion .scrub-tl, html:not(.js) .scrub-tl { display: none; }

/* ---- ② 積み重なる4章: 次の章が下から重なり、前の章は一歩さがる ---- */
.stack { position: relative; background: var(--ink); }
.stack .chapter { position: sticky; top: min(0px, calc(100svh - var(--h, 100svh))); min-height: 100svh; display: grid; align-items: center; overflow: hidden; border-top: 0; padding: clamp(96px, 12vw, 150px) 0; }
.stack .chapter + .chapter { border-radius: var(--r-l) var(--r-l) 0 0; box-shadow: 0 -24px 60px rgba(0, 0, 0, .28), 0 -4px 12px rgba(0, 0, 0, .16); }
.stack .chapter .wrap { transform-origin: 50% 0; transform: scale(calc(1 - var(--cover, 0) * .05)) translateY(calc(var(--cover, 0) * -18px)); opacity: calc(1 - var(--cover, 0) * .7); will-change: transform, opacity; }
.stack .chapter-head { position: static; }
.stack .chapter::before { content: attr(data-no); position: absolute; right: clamp(-12px, -1vw, 0px); bottom: -.3em; font: 800 clamp(9rem, 24vw, 20rem)/1 var(--mincho); letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .13); pointer-events: none; font-variant-numeric: tabular-nums; }
.stack .chapter.paper::before { -webkit-text-stroke-color: rgba(0, 0, 0, .1); }
.stack .chapter .wrap { position: relative; }
.reduce-motion .stack .chapter { position: relative; top: auto; min-height: 0; }
.reduce-motion .stack .chapter .wrap { transform: none; opacity: 1; }

/* ---- ③ 上映室: 作品を押すと、その1本が画面中央へ広がる ---- */
.reel-btn { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--ink-2); border-radius: 22px; overflow: hidden; cursor: pointer; aspect-ratio: 9 / 16; color: #fff; font: inherit; -webkit-tap-highlight-color: transparent; }
.reel-btn img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease), filter 1.4s var(--ease); }
.reel-btn:hover img { transform: scale(1.035); }
.reel-btn .play { position: absolute; left: 18px; bottom: 18px; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px 0 14px; border-radius: 999px; background: rgba(var(--ink-rgb), .5); -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px); font-size: .8rem; font-weight: 500; letter-spacing: .06em; }
.reel-btn .play::before { content: ""; width: 0; height: 0; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
#theater { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(var(--ink-rgb), .94); color: #fff; overflow: hidden; }
#theater::backdrop { background: rgba(var(--ink-rgb), .6); }
#theater[open] { display: grid; place-items: center; }
#theater video { height: min(86svh, 980px); max-width: calc(100vw - 32px); aspect-ratio: 9 / 16; border-radius: 28px; background: #000; object-fit: cover; }
.theater-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; transition: background .5s var(--ease); }
.theater-close:hover { background: rgba(255, 255, 255, .22); }
.theater-cap { position: absolute; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom)); text-align: center; font-size: .74rem; letter-spacing: .14em; color: rgba(255, 255, 255, .7); pointer-events: none; }
::view-transition-group(reel) { animation-duration: .7s; animation-timing-function: var(--ease); }
::view-transition-old(reel), ::view-transition-new(reel) { height: 100%; width: 100%; object-fit: cover; border-radius: 24px; overflow: clip; }
html.theater-on #fx { opacity: 0; }

/* ---- ⑤ 数字 ---- */
.nl-stat b { font-variant-numeric: tabular-nums; }

/* ================= v3.1「もっと攻める」追加（2026-11-12） ================= */

/* 映像の枠: 入ってくるときだけ奥から起き上がる（縦の軸のみ・PC） */
@media (min-width: 821px) {
    html:not(.reduce-motion) .scrub-stage { perspective: 1400px; }
    html:not(.reduce-motion) .scrub-frame { transform-origin: 50% 100%; transform: rotateX(calc((1 - min(1, var(--p, 0) * 9)) * 14deg)) scale(calc(.9 + min(1, var(--p, 0) * 9) * .1)); transition: transform .5s var(--ease); box-shadow: 0 40px 90px rgba(0, 0, 0, .34), 0 6px 18px rgba(0, 0, 0, .2); }
}
.scrub-tc { font-size: .82rem; }

/* 章の金の光: 黒い章が上がってくるにつれ、右下から光が差す（面としての金） */
.stack .chapter.dark::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(58% 62% at 88% calc(132% - var(--enter, 0) * 26%), rgba(var(--matcha-rgb), calc(.05 + min(1, var(--enter, 0)) * .2)), rgba(var(--matcha-rgb), 0) 68%); }
.reduce-motion .stack .chapter.dark::after { background: radial-gradient(58% 62% at 88% 106%, rgba(var(--matcha-rgb), .22), rgba(var(--matcha-rgb), 0) 68%); }

/* 数字で語る帯 */
.figs { padding: clamp(120px, 17vw, 240px) 0; }
.figs .h1 { color: #fff; }
.fig-list { margin-top: clamp(56px, 9vw, 120px); border-top: 1px solid var(--line-d); }
.fig { display: grid; grid-template-columns: 1fr; gap: 6px; align-items: end; padding: clamp(26px, 4vw, 52px) 0 clamp(22px, 3.4vw, 44px); border-bottom: 1px solid var(--line-d); }
.fig-n { display: flex; align-items: baseline; gap: .12em; line-height: .96; }
.fig-n { white-space: nowrap; }
.fig-n b { font: 700 clamp(3.7rem, 11.5vw, 10rem)/.92 var(--mincho); letter-spacing: -.065em; color: #fff; font-variant-numeric: tabular-nums; }
.fig-n i { font-style: normal; font-size: clamp(1.1rem, 2.6vw, 2.2rem); font-weight: 700; letter-spacing: -.02em; color: #fff; }
.fig dt { font-size: clamp(.86rem, 1.3vw, 1.02rem); letter-spacing: .01em; color: var(--text-d2); line-height: 1.8; }
@media (min-width: 900px) { .fig { grid-template-columns: minmax(0, 1fr) minmax(14em, 22em); gap: 40px; } .fig dt { padding-bottom: 1.1em; } }
@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        @keyframes figgrow { from { font-weight: 200; letter-spacing: -.03em; } }
        html:not(.reduce-motion) .fig-n b { animation: figgrow linear both; animation-timeline: view(); animation-range: entry 0% cover 46%; }
        html:not(.reduce-motion) .figs .h1 { animation: grow linear both; animation-timeline: view(); animation-range: entry 10% cover 42%; }
    }
}

/* 進め方: 縦のタイムライン。金の再生ヘッドが下り、いまの工程だけが灯る */
.steps.tl { position: relative; padding-left: clamp(30px, 4.4vw, 64px); }
.steps.tl::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: var(--line-l); }
.steps.tl::after { content: ""; position: absolute; left: 4px; top: 0; width: 1px; height: calc(var(--tp, 0) * 100%); background: var(--text); }
.tl-head { position: absolute; left: 0; top: calc(var(--tp, 0) * 100%); width: 9px; height: 9px; margin-top: -4px; border-radius: 50%; background: var(--matcha); box-shadow: 0 0 0 5px rgba(var(--matcha-rgb), .22); z-index: 1; }
html.js:not(.reduce-motion) .steps.tl .step.in { opacity: .28; transition: opacity .9s var(--ease), transform 1.3s var(--ease); }
html.js:not(.reduce-motion) .steps.tl .step.in.is-now { opacity: 1; }
.reduce-motion .steps.tl::after, .reduce-motion .tl-head { display: none; }
