/* KIZAMI 第3版 — 写真のようにリアルな表紙と、スクロールで展開する構成。黒・グレー・メタリック。 */
:root {
  --bg: #050506;
  --surface: #0c0c0e;
  --ink: #e9e7e3;
  --muted: #a3a2a0;
  --line: #6e6f75;
  --line-soft: #222326;
  --strong: #ffffff;
  --ease-std: cubic-bezier(0.2, 0, 0, 1);
  --ease-in: cubic-bezier(0.05, 0.7, 0.1, 1);
  --gutter: max(24px, 5vw);
  --serif: "Noto Serif JP", serif;
  --latin: "Inter Tight", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); overflow-x: clip;
  font: 400 16px/1.8 "Noto Sans JP", system-ui, sans-serif; letter-spacing: .03em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 300; word-break: auto-phrase; }
p { margin: 0; word-break: auto-phrase; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
.nw { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--strong); outline-offset: 2px; box-shadow: 0 0 0 5px #000; }
.skip { position: fixed; left: 16px; top: -80px; z-index: 60; background: var(--strong); color: #000; padding: 12px 16px; text-decoration: none; }
.skip:focus { top: 16px; }
.eyebrow { font: 400 14px/1.4 var(--latin); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-bottom: 28px; }
h2 { font-size: clamp(30px, 3.4vw, 52px); line-height: 1.45; letter-spacing: .06em; margin-bottom: 28px; }
h3 { font-weight: 400; font-size: 17px; line-height: 1.5; letter-spacing: .05em; }

/* フィルムの粒子（写真らしさ） */
.grain {
  position: fixed; inset: -50%; z-index: 40; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .9s steps(6) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } 100% { transform: translate(0, 0); } }

/* ---------------------------------------------------------------- ヘッダー */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 30; display: flex; align-items: center; gap: 32px;
  padding: 0 var(--gutter); height: 76px; mix-blend-mode: difference; color: #fff;
}
.wordmark { font: 500 15px/1 var(--latin); letter-spacing: .5em; text-decoration: none; padding: 14px 0; margin-right: auto; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { font: 400 14px/1 var(--latin); letter-spacing: .16em; text-transform: uppercase; text-decoration: none; padding: 15px 10px; min-height: 44px; opacity: .72; transition: opacity .3s var(--ease-std); }
.site-nav a:hover, .site-nav a[aria-current="true"] { opacity: 1; }
.badge { font-size: 14px; line-height: 1; border: 1px solid rgba(255, 255, 255, .6); padding: 8px 10px; white-space: nowrap; }

/* ---------------------------------------------------------------- ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(10, 10, 12, .55); color: var(--ink);
  font: 400 15px/1.2 "Noto Sans JP", sans-serif; letter-spacing: .1em; cursor: pointer; text-decoration: none;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .3s var(--ease-std), border-color .3s var(--ease-std);
}
.btn:hover { border-color: var(--strong); }
.btn[aria-pressed="true"] { border-color: var(--strong); background: rgba(255, 255, 255, .16); }
.btn-small { min-height: 44px; padding: 10px 18px; font-size: 14px; margin-top: 16px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }

/* ---------------------------------------------------------------- 表紙 */
.hero { position: relative; height: 100vh; min-height: 620px; overflow: hidden; background: #040405; }
.hero-stage { position: absolute; inset: 0; overflow: hidden; cursor: ew-resize; }
.hero-frame { position: absolute; left: 0; top: 0; width: 2400px; height: 1500px; transform-origin: 0 0; }
.hero-frame img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.hero-frame .light { opacity: 0; }
.hero-frame .hand { z-index: 10; will-change: transform; }
.hero::after { /* 周辺減光 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 62% 50%, rgba(4, 4, 5, 0) 40%, rgba(4, 4, 5, .55) 78%, rgba(4, 4, 5, .9) 100%);
}
.giant {
  position: absolute; left: calc(var(--gutter) - .06em); bottom: -0.2em; z-index: 3; margin: 0; pointer-events: none;
  font: 100 clamp(96px, 17vw, 330px)/1 var(--latin); letter-spacing: .08em; color: rgba(233, 231, 227, .08);
}
.hero-copy { position: absolute; z-index: 5; left: var(--gutter); top: 50%; transform: translateY(-50%); max-width: 520px; animation: rise 1.2s var(--ease-in) .2s both; }
.meta { font: 300 14px/1.6 var(--latin); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 32px; }
.meta span { opacity: .5; margin: 0 .5em; }
h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 4.1vw, 66px); line-height: 1.5; letter-spacing: .08em; }
.vertical {
  position: absolute; z-index: 5; right: calc(var(--gutter) + 8px); top: 120px; writing-mode: vertical-rl;
  font: 300 18px/1 var(--serif); letter-spacing: .5em; color: var(--muted);
}
.hero-now { position: absolute; z-index: 5; right: var(--gutter); bottom: 48px; text-align: right; }
.now-label { font: 400 14px/1 var(--latin); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.time { font: 300 clamp(30px, 2.6vw, 44px)/1 "IBM Plex Mono", monospace; letter-spacing: .06em; color: var(--strong); font-variant-numeric: tabular-nums; }
.now-note { font-size: 14px; color: var(--muted); margin-top: 8px; }
.scroll-cue { position: absolute; z-index: 5; left: 50%; bottom: 26px; transform: translateX(-50%); display: grid; place-items: center; min-width: 44px; min-height: 44px; text-decoration: none; }
.scroll-cue span { font: 400 14px/1 var(--latin); letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.scroll-cue::after { content: ""; width: 1px; height: 36px; margin-top: 10px; background: linear-gradient(var(--ink), transparent); animation: cue 2s var(--ease-std) infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@keyframes rise { from { opacity: 0; transform: translateY(calc(-50% + 24px)); } to { opacity: 1; transform: translateY(-50%); } }

/* ---------------------------------------------------------------- 固定して展開する章（共通） */
.count, .hscroll, .flip { position: relative; }
.sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }

/* 480 */
.count { height: 240vh; }
.count-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 55% 45%; will-change: transform; }
.count .sticky::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5, 5, 6, .95) 0%, rgba(5, 5, 6, .3) 50%, rgba(5, 5, 6, .55) 100%); }
.count-copy { position: absolute; z-index: 2; left: var(--gutter); right: var(--gutter); bottom: 10vh; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 3vw; }
.big-num { font: 100 clamp(140px, 24vw, 420px)/.78 var(--latin); letter-spacing: -.03em; color: var(--strong); margin: 0; font-variant-numeric: tabular-nums; }
.count-text { font: 300 clamp(16px, 1.4vw, 21px)/2 var(--serif); letter-spacing: .08em; max-width: 480px; padding-bottom: 1.4vw; }

/* 名前：大きな「刻」 */
.kanji { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 4vw; min-height: 100vh; padding: 120px var(--gutter); overflow: hidden; }
.kanji-mark {
  font: 300 clamp(260px, 44vw, 760px)/1 var(--serif); color: transparent; -webkit-text-stroke: 1px rgba(233, 231, 227, .35);
  margin: 0; text-align: center; user-select: none;
}
.kanji-copy { max-width: 520px; }
.kanji-copy h2 { font-family: var(--serif); }
.kanji-copy p:last-child { color: var(--ink); font-size: 17px; line-height: 2; }

/* 細部：横に流れる */
.hscroll { height: 420vh; }
.hs-head { position: absolute; z-index: 2; left: var(--gutter); top: 104px; max-width: 34vw; }
.hs-head h2 { font-family: var(--serif); }
.track { position: absolute; left: 0; top: 0; height: 100%; display: flex; align-items: flex-end; gap: 3vw; padding: 0 var(--gutter) 7vh 38vw; will-change: transform; }
.panel { flex: 0 0 auto; }
.panel img { height: min(48vh, 31vw); width: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface); }
.panel.p-wide img { height: min(54vh, 35vw); }
.panel figcaption { margin-top: 18px; display: flex; gap: 16px; color: var(--muted); font-size: 15px; max-width: 520px; }
.panel .n { font: 300 14px/1.8 "IBM Plex Mono", monospace; color: var(--ink); }

/* 表から裏へ */
.flip { height: 320vh; }
#flip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.flip-kanji { position: absolute; z-index: 1; right: var(--gutter); top: 50%; transform: translateY(-50%); margin: 0; font: 300 clamp(140px, 22vw, 380px)/1 var(--serif); color: rgba(233, 231, 227, .1); }
.flip-kanji span { position: absolute; right: 0; top: 50%; transform: translateY(-50%); transition: opacity .5s var(--ease-std); }
#k-back { opacity: 0; }
.flip-copy { position: absolute; z-index: 2; left: var(--gutter); bottom: 12vh; max-width: 520px; opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease-in), transform .8s var(--ease-in); }
.flip-copy.in { opacity: 1; transform: none; }
.flip-copy h2 { font-family: var(--serif); }

/* 数値の帯 */
.numbers-band { padding: 120px var(--gutter) 40px; }
.numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line-soft); }
.numbers div { padding: 32px 24px 0 0; }
.numbers dt { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.numbers dd { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.numbers .v { font: 100 clamp(46px, 5.6vw, 96px)/1 var(--latin); color: var(--strong); }
.numbers .u { font-size: 14px; color: var(--muted); }

/* 3D */
.explore { padding: 140px var(--gutter) 120px; }
.explore-head { max-width: 640px; margin-bottom: 32px; }
.explore-head h2 { font-family: var(--serif); }
.explore-stage { position: relative; aspect-ratio: 16 / 9; height: min(64vh, 56vw); width: 100%; background: #070708; border-radius: 4px; overflow: hidden; }
#gl { display: block; width: 100%; height: 100%; }
.explore-status { position: absolute; left: 20px; bottom: 16px; font-size: 14px; color: var(--muted); transition: opacity .5s var(--ease-std); }
.explore-status.done { opacity: 0; }
.readout { position: absolute; right: 20px; top: 16px; display: flex; gap: 16px; }
.pair { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.pair .label { font-size: 14px; color: var(--muted); }
.pair .value { font: 300 28px/1 "IBM Plex Mono", monospace; color: var(--strong); font-variant-numeric: tabular-nums; }
.pair .unit { font-size: 14px; }
.hint { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* 仕上げ：大小を組む */
.finishing { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 56px 24px; padding: 140px var(--gutter); }
.fin-head { grid-column: 1 / 6; align-self: end; }
.fin-head h2 { font-family: var(--serif); font-size: clamp(38px, 5vw, 84px); line-height: 1.3; }
.fin-a { grid-column: 6 / 13; }
.fin-b { grid-column: 1 / 7; margin-top: 12vh; }
.fin-c { grid-column: 8 / 13; }
.fin-d { grid-column: 3 / 11; }
.fin img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface); }
.fin figcaption { margin-top: 16px; }
.fin figcaption p { color: var(--muted); font-size: 15px; }
.reveal { opacity: 0; transition: opacity 1.2s var(--ease-in); overflow: hidden; }
.reveal img { transform: scale(1.06); transition: transform 1.8s var(--ease-in); }
.reveal.in { opacity: 1; }
.reveal.in img { transform: none; }

/* 仕様 */
.spec { padding: 120px var(--gutter); }
.section-head { max-width: 640px; margin-bottom: 56px; }
.spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 64px; max-width: 1120px; }
.spec-block h3 { margin-bottom: 10px; }
.spec-block dl { margin: 0; }
.spec-block div { display: grid; grid-template-columns: 7.5em 1fr; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.spec-block dt { color: var(--muted); font-size: 14px; padding-top: 2px; }
.spec-block dd { margin: 0; }
.fineprint { margin-top: 36px; font-size: 14px; color: var(--muted); }

.site-footer { padding: 40px var(--gutter) 64px; color: var(--muted); font-size: 14px; line-height: 1.8; border-top: 1px solid var(--line-soft); overflow: hidden; }
.footer-giant { font: 100 clamp(90px, 20vw, 360px)/1 var(--latin); letter-spacing: .06em; color: var(--ink); margin: 0 0 24px -.05em; }
.making { margin-top: 12px; }
.making span { font: 400 14px/1 var(--latin); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); margin-right: 12px; }

/* ---------------------------------------------------------------- スマホ・縦長 */
@media (max-width: 860px) {
  :root { --gutter: 16px; }
  .site-nav { display: none; }
  .site-header { height: 64px; }
  .hero { height: 100svh; }
  .hero-copy { top: auto; bottom: 212px; transform: none; animation-name: rise-m; }
  h1 { font-size: clamp(28px, 8vw, 40px); }
  .meta { margin-bottom: 14px; letter-spacing: .12em; }
  .vertical { top: 84px; font-size: 15px; }
  .hero-now { left: var(--gutter); right: auto; bottom: 24px; text-align: left; }
  .light-hint, .scroll-cue { display: none; }
  .giant { bottom: auto; top: 58px; font-size: 26vw; }
  .count { height: 200vh; }
  .count-copy { bottom: 8vh; }
  .kanji { grid-template-columns: 1fr; min-height: auto; padding: 96px 16px; }
  .kanji-mark { font-size: 70vw; }
  .hscroll { height: auto; }
  .hscroll .sticky { position: relative; height: auto; overflow: visible; }
  .hs-head { position: relative; left: auto; top: auto; padding: 96px 16px 32px; }
  .track { position: relative; flex-direction: column; align-items: stretch; gap: 40px; padding: 0 16px; transform: none !important; }
  .panel, .panel.p-wide { width: 100%; }
  .panel img, .panel.p-wide img { width: 100%; height: auto; }
  .flip { height: 260vh; }
  .flip-kanji { right: 8px; top: 30%; }
  .flip-copy { bottom: 8vh; right: 16px; }
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .numbers div { padding-bottom: 20px; }
  .explore { padding: 96px 16px 80px; }
  .explore-stage { aspect-ratio: 4 / 5; height: auto; }
  .readout { left: 16px; right: auto; top: 14px; }
  .pair .value { font-size: 22px; }
  .finishing { grid-template-columns: 1fr; gap: 40px; padding: 96px 16px; }
  .fin-head, .fin-a, .fin-b, .fin-c, .fin-d { grid-column: 1 / -1; margin-top: 0; }
  .spec { padding: 88px 16px; }
  .spec-grid { grid-template-columns: 1fr; }
}
@keyframes rise-m { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; }
  .reveal img { transform: none; }
}
