/* ================================================================
   STUDIO 129 — Radian骨格 × 黄×黒テックプロダクト
   tokens → 黒ベース / 生成り白 / 車体イエロー
================================================================ */
:root {
  --base: #0b0b0b;
  --base-2: #111110;
  --ink: #f5f2e8;
  --ink-dim: rgba(245, 242, 232, .55);
  --accent: #f2d21f;
  --accent-ink: #131200;      /* 黄面上の文字色 */
  --font-display: 'Anton', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --font-body: 'Zen Kaku Gothic New', sans-serif;
  --pad: clamp(20px, 5vw, 72px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--base);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); letter-spacing: .08em; }
.pc { display: none; }
@media (min-width: 768px) { .pc { display: inline; } }

/* ---- 出現アニメ（IntersectionObserverが .in を付与）---- */
.line, .usp__item, .works__item, .machine__table .row, .story__coords, .story__note, .sec-title, .sec-sub, .contact__cta, .contact__note {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .9s cubic-bezier(.2, .7, 0, 1), transform .9s cubic-bezier(.2, .7, 0, 1);
}
.in .line, .in .usp__item, .in .works__item, .in .machine__table .row, .in .story__coords, .in .story__note, .in .sec-title, .in .sec-sub, .in .contact__cta, .in .contact__note {
  opacity: 1;
  transform: none;
}
/* 順番に出す */
.in .line:nth-child(2),  .in .usp__item:nth-child(2), .in .machine__table .row:nth-child(2) { transition-delay: .12s; }
.in .usp__item:nth-child(3), .in .machine__table .row:nth-child(3) { transition-delay: .24s; }
.in .usp__item:nth-child(4), .in .machine__table .row:nth-child(4) { transition-delay: .36s; }
.in .machine__table .row:nth-child(5) { transition-delay: .48s; }
.in .machine__table .row:nth-child(6) { transition-delay: .60s; }
.in .machine__table .row:nth-child(7) { transition-delay: .72s; }

/* ?flat 検証モード & reduced-motion → 全部即時表示 */
html.flat .line, html.flat .usp__item, html.flat .works__item, html.flat .machine__table .row,
html.flat .story__coords, html.flat .story__note, html.flat .sec-title, html.flat .sec-sub,
html.flat .contact__cta, html.flat .contact__note {
  opacity: 1 !important; transform: none !important; transition: none !important;
}
html.flat .hero__media img { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  html:not(.force-motion) .line, html:not(.force-motion) .usp__item, html:not(.force-motion) .works__item,
  html:not(.force-motion) .machine__table .row, html:not(.force-motion) .story__coords, html:not(.force-motion) .story__note,
  html:not(.force-motion) .sec-title, html:not(.force-motion) .sec-sub, html:not(.force-motion) .contact__cta,
  html:not(.force-motion) .contact__note { opacity: 1; transform: none; transition: none; }
  html:not(.force-motion) .hero__media img { animation: none; }
  html:not(.force-motion) { scroll-behavior: auto; }
}

/* ================= NAV ================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--pad);
  mix-blend-mode: difference;   /* 黒面でも黄面でも読める */
}
.nav__mark { font-family: var(--font-display); font-size: 20px; letter-spacing: .04em; color: #fff; }
.nav__mark span { color: #fff; opacity: .55; margin-left: 2px; }
.nav__links { display: flex; gap: clamp(14px, 3vw, 34px); font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; color: #fff; }
.nav__links a { opacity: .75; transition: opacity .3s; }
.nav__links a:hover { opacity: 1; }
.nav__cta { border: 1px solid #fff; padding: 4px 12px; opacity: 1 !important; }
@media (max-width: 640px) {
  .nav__links a:not(.nav__cta) { display: none; }   /* モバイルはBOOKのみ */
  .nav__mark { font-size: 17px; }
  .hero__eyebrow { max-width: 260px; }
}

/* ================= S1 HERO ================= */
.hero { position: relative; height: 100svh; overflow: hidden; display: grid; place-items: end start; }
.hero__media { position: absolute; inset: 0; }
.hero__media img, .hero__media video {
  width: 100%; height: 100%; object-fit: cover;
  animation: heroZoom 24s ease-in-out infinite alternate;
}
@keyframes heroZoom { from { transform: scale(1); } to { transform: scale(1.09); } }
.hero__shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11,11,11,.92) 0%, rgba(11,11,11,.25) 45%, rgba(11,11,11,.35) 100%);
}
.hero__body { position: relative; z-index: 2; padding: 0 var(--pad) clamp(60px, 10vh, 110px); }
.hero__eyebrow { font-size: clamp(10px, 1.2vw, 12px); color: var(--accent); margin-bottom: 14px; }
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(72px, 17vw, 230px);
  line-height: .88;
  letter-spacing: .01em;
  color: var(--ink);
  text-transform: uppercase;
}
.hero__sub { margin-top: 22px; font-size: clamp(15px, 2vw, 20px); font-weight: 400; letter-spacing: .14em; }
.hero__cue {
  position: absolute; right: var(--pad); bottom: 24px; z-index: 2;
  font-size: 10px; letter-spacing: .3em; color: var(--ink-dim);
  display: flex; align-items: center; gap: 10px;
}
.hero__cueline { display: block; width: 54px; height: 1px; background: var(--accent); transform-origin: left;
  animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: scaleX(0); } 55% { transform: scaleX(1); } 100% { transform: scaleX(0); transform-origin: right; } }

/* ================= 黄テーマ共通 ================= */
.theme-yellow { background: var(--accent); color: var(--accent-ink); }

/* ================= S2 USP ================= */
.usp { padding: clamp(90px, 16vh, 170px) var(--pad); }
.usp__lead {
  font-family: var(--font-display);
  font-size: clamp(44px, 9vw, 120px);
  line-height: 1.02; letter-spacing: .01em;
  margin-bottom: clamp(50px, 8vh, 90px);
}
.usp__lead .line { display: block; }
.usp__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 36px 48px;
  border-top: 2px solid var(--accent-ink); padding-top: 40px; }
.usp__label { font-size: 12px; font-weight: 700; letter-spacing: .2em; margin-bottom: 10px; }
.usp__text { font-size: clamp(16px, 1.8vw, 20px); font-weight: 500; line-height: 1.7; }

/* ================= S3 STORY ================= */
.story { padding: clamp(110px, 20vh, 210px) var(--pad); background: var(--base); }
.story__coords { font-size: clamp(10px, 1.2vw, 13px); color: var(--accent); margin-bottom: 30px; }
.story__manifesto { font-size: clamp(30px, 5.6vw, 66px); font-weight: 700; line-height: 1.35; font-family: var(--font-body); }
.story__manifesto .line { display: block; }
.story__manifesto em { font-style: normal; color: var(--accent); }
.story__note { margin-top: 36px; max-width: 640px; color: var(--ink-dim); font-size: clamp(14px, 1.6vw, 16px); }

/* ================= S4 WORKS ================= */
.works { padding: clamp(80px, 14vh, 150px) var(--pad); background: var(--base-2); }
.works__head, .machine__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: clamp(36px, 6vh, 64px); flex-wrap: wrap; gap: 8px; }
.sec-title { font-family: var(--font-display); font-size: clamp(38px, 6vw, 76px); letter-spacing: .02em; }
.sec-sub { font-size: 11px; color: var(--ink-dim); }
.works__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2.5vw, 28px); }
.works__item { position: relative; overflow: hidden; }
.works__item.w-wide { grid-column: span 2; }
.works__item img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; filter: contrast(1.05);
  transition: transform 1.2s cubic-bezier(.2, .7, 0, 1); }
.works__item.w-tall img { aspect-ratio: 4 / 5; }   /* 縦写真ペアの段 */
.works__item:hover img { transform: scale(1.03); }
.works__item figcaption { position: absolute; left: 14px; bottom: 12px; font-size: 10px; letter-spacing: .18em;
  color: var(--ink); background: rgba(11,11,11,.55); padding: 4px 10px; }
@media (max-width: 640px) {
  .works__grid { grid-template-columns: 1fr; }
  .works__item.w-wide { grid-column: span 1; }
}

/* ================= S5 MACHINE ================= */
.machine { padding: clamp(80px, 14vh, 150px) var(--pad); background: var(--base); }
.machine__table { border-top: 1px solid rgba(245,242,232,.2); max-width: 860px; }
.machine__table .row { display: grid; grid-template-columns: minmax(110px, 220px) 1fr; gap: 16px;
  padding: 18px 0; border-bottom: 1px solid rgba(245,242,232,.2); font-size: clamp(12px, 1.5vw, 15px); }
.machine__table dt { color: var(--accent); letter-spacing: .18em; }
.machine__table dd { color: var(--ink); }

/* ================= S6 CONTACT ================= */
.contact { padding: clamp(110px, 20vh, 210px) var(--pad); text-align: left; }
.contact__title { font-family: var(--font-display); font-size: clamp(52px, 11vw, 150px); line-height: .98; margin-bottom: 40px; }
.contact__title .line { display: block; }
.contact__cta {
  display: inline-block; font-family: var(--font-mono); font-size: clamp(16px, 2.6vw, 26px); font-weight: 700;
  border: 2px solid var(--accent-ink); padding: 16px 30px; letter-spacing: .04em;
  transition: background .3s, color .3s;
}
.contact__cta:hover { background: var(--accent-ink); color: var(--accent); }
.contact__note { margin-top: 18px; font-size: 11px; letter-spacing: .2em; opacity: .7; }

/* ================= FOOTER ================= */
.foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 26px var(--pad); font-size: 10px; letter-spacing: .16em; color: var(--ink-dim);
  border-top: 1px solid rgba(245,242,232,.12); background: var(--base); }
.foot__link { color: var(--accent); transition: opacity .3s; }
.foot__link:hover { opacity: .7; }

/* ---- モバイル上書き（本体ルールより後に置くこと）---- */
@media (max-width: 640px) {
  .machine__table .row { grid-template-columns: 96px 1fr; }
}

/* ================================================================
   没入モーション層（スクロールテリングレシピ Lv3）
   ・ヒーロー: sticky + スクロール連動ズーム
   ・[data-scrub]: 左からのワイプ出現（JSがclip-pathを進捗で制御）
   ・[data-speed]: パララックス（JSがtranslateYを制御）
================================================================ */
.hero-track { height: 230vh; position: relative; }
.hero { position: sticky; top: 0; }
.hero__media img, .hero__media video { animation: none; will-change: transform; transform-origin: 62% 55%; }
.hero__body, .hero__cue { will-change: transform, opacity; }

[data-scrub] { clip-path: inset(-5% 103% -5% -3%); }
[data-speed] { will-change: transform; }

.grain {
  position: fixed; inset: -50px; z-index: 90; pointer-events: none;
  opacity: .06; mix-blend-mode: overlay;
  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='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- 固定背景ステージ（全ページ追従の絵）---- */
.bgstage { position: fixed; inset: 0; z-index: 0; background: var(--base); }
.bgstage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; will-change: transform, opacity; filter: brightness(.85) contrast(1.05); }
/* コンテンツはステージの上へ */
.nav, .hero-track, .usp, .story, .works, .machine, .contact, .foot { position: relative; z-index: 1; }
/* 「窓」セクション: 半透明にして奥の車を透かす（黄・WORKSは不透明でリズム維持） */
.story   { background: rgba(11, 11, 11, .78); }
.machine { background: rgba(11, 11, 11, .82); }
.foot    { background: rgba(11, 11, 11, .55); }

/* ---- ODOメーター（左下常駐・スクロール=走行距離）---- */
.odo { position: fixed; left: var(--pad); bottom: 20px; z-index: 91; pointer-events: none;
  font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--accent);
  text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.odo__sub { display: block; font-size: 8px; font-weight: 400; letter-spacing: .3em; opacity: .65; margin-top: 2px; }

/* flat検証・reduced-motionでは没入層を全停止 */
html.flat [data-scrub], html.flat .line { clip-path: none !important; }
html.flat .hero-track { height: 100svh; }
html.flat [data-speed], html.flat .hero__media img, html.flat .hero__body { transform: none !important; }
html.flat .bgstage, html.flat .odo { display: none; }
html.flat .story, html.flat .machine, html.flat .foot { background: var(--base); }
@media (prefers-reduced-motion: reduce) {
  html:not(.force-motion) [data-scrub] { clip-path: none !important; }
  html:not(.force-motion) .hero-track { height: 100svh; }
  html:not(.force-motion) .grain { display: none; }
  html:not(.force-motion) .bgstage, html:not(.force-motion) .odo { display: none; }
  html:not(.force-motion) .story, html:not(.force-motion) .machine { background: var(--base); }
}
