:root {
  --fg: #fff;
  --ink: #000;
  --mid: #8a8a8a;
  --display: 'Syne', 'Zen Kaku Gothic New', system-ui, sans-serif;
  --jp: 'Zen Kaku Gothic New', system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;
  --stripes: repeating-linear-gradient(-45deg, #fff 0 6px, #000 6px 12px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--ink); color: var(--fg); scroll-behavior: smooth; }
body { font-family: var(--jp); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
::selection { background: #fff; color: #000; }

/* canvas を最背面に置き、本文を重ねる（main に重ね順を作らせず、本文の difference 合成を背景の3Dに効かせる） */
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: -1; }
main { position: relative; }
.grain {
  position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .35; mix-blend-mode: overlay;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 3px);
}

/* ---------- HUD ---------- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(16px, 3vw, 36px);
}
.logo {
  font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: .14em;
  color: #fff; text-decoration: none; display: flex; gap: 10px; align-items: baseline;
}
.logo small { font-family: var(--jp); font-size: 12px; letter-spacing: .3em; }

.sec-label { font-family: var(--mono); font-size: 12px; letter-spacing: .35em; margin-bottom: 18px; }
.sec-label::before {
  content: ''; display: inline-block; width: 28px; height: 10px; margin-right: 12px; vertical-align: -1px;
  background: var(--stripes); background-size: 8px 8px; animation: crawl .9s linear infinite;
}
@keyframes crawl { to { background-position: 8px 0; } }

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh; position: relative; text-align: center;
  padding: 120px 20px 80px; cursor: grab; touch-action: pan-y; user-select: none;
}
.hero:active { cursor: grabbing; }
.kicker {
  position: absolute; top: 96px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 12px; letter-spacing: .5em; white-space: nowrap; mix-blend-mode: difference;
}
.title {
  position: absolute; left: 50%; bottom: 11vh; transform: translateX(-50%);
  font-family: var(--display); font-weight: 800; line-height: .8;
  font-size: clamp(48px, 11vw, 200px); letter-spacing: -.02em; white-space: nowrap; pointer-events: none;
}
.title span { display: block; }
.t-main { position: relative; color: #fff; mix-blend-mode: difference; }
.t-ghost { position: absolute; inset: 0; color: transparent; -webkit-text-stroke: 1.5px #fff; mix-blend-mode: difference; }
.t-g1 { animation: echo 2.6s ease-out infinite; }
.t-g2 { animation: echo 2.6s ease-out infinite 1.3s; }
@keyframes echo {
  0% { transform: scale(1); opacity: .9; }
  100% { transform: scale(1.25, 1.8); opacity: 0; }
}
.jp-vert {
  position: absolute; right: clamp(16px, 5vw, 70px); top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl; font-weight: 900; font-size: clamp(28px, 4vw, 54px); letter-spacing: .4em;
  mix-blend-mode: difference;
}
.lead {
  position: absolute; left: clamp(16px, 5vw, 70px); top: 50%; transform: translateY(-50%);
  text-align: left; font-weight: 500; font-size: clamp(14px, 1.4vw, 18px); line-height: 2.1; letter-spacing: .12em;
  mix-blend-mode: difference;
}
.hint {
  position: absolute; bottom: 4vh; left: 0; right: 0; display: flex; justify-content: center; gap: 36px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .3em; mix-blend-mode: difference;
}

/* ---------- MARQUEE（白帯と黒帯がX字に交差） ---------- */
.bands { position: relative; height: 200px; margin: 4vh 0; }
.marquee { position: absolute; left: -5vw; right: -5vw; top: 50%; overflow: hidden; padding: 14px 0; }
.m1 { background: #fff; transform: translateY(-50%) rotate(-4deg); z-index: 2; }
.m2 { background: #000; border-block: 2px solid #fff; transform: translateY(-50%) rotate(3deg); }
.track { display: flex; width: max-content; animation: slide 24s linear infinite; }
.m2 .track { animation-direction: reverse; animation-duration: 30s; }
.track span { font-family: var(--display); font-weight: 800; font-size: clamp(22px, 3vw, 40px); white-space: nowrap; letter-spacing: .04em; }
.m1 .track span { color: #000; }
.m2 .track span { color: transparent; -webkit-text-stroke: 1.2px #fff; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- PROFILE ---------- */
.profile { min-height: 110vh; display: flex; align-items: center; justify-content: flex-end; padding: 10vh clamp(16px, 6vw, 90px); }
.panel { width: min(520px, 100%); padding: 40px 36px; background: #000; border: 1.5px solid #fff; box-shadow: 14px 14px 0 -1.5px #000, 14px 14px 0 0 #fff; }
.panel h2 { font-weight: 900; font-size: clamp(40px, 5vw, 64px); line-height: 1; margin-bottom: 28px; }
.panel h2 span { display: block; font-family: var(--mono); font-size: 13px; letter-spacing: .5em; margin-top: 12px; color: var(--mid); }
.panel dl > div { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 13px 0; border-top: 1px solid rgba(255,255,255,.25); }
.panel dt { font-family: var(--mono); font-size: 12px; letter-spacing: .15em; padding-top: 2px; color: var(--mid); }
.panel dd { font-size: 15px; line-height: 1.7; }
.panel dd.unk { font-family: var(--mono); letter-spacing: .3em; justify-self: start; padding: 0 4px; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { color: #000; background: #fff; } }

/* ---------- SECTION HEADS ---------- */
.gallery-head, .stage { padding: 16vh clamp(16px, 6vw, 90px) 6vh; }
.big {
  font-family: var(--display); font-weight: 800; font-size: clamp(64px, 13vw, 200px); line-height: .85;
  color: #fff; mix-blend-mode: difference;
}
.big span {
  display: block; font-family: var(--jp); font-weight: 500;
  font-size: clamp(14px, 1.3vw, 17px); letter-spacing: .14em; line-height: 1.8; margin-top: 18px; max-width: 30em;
}

/* ---------- CUTS ---------- */
.cut { min-height: 100vh; position: relative; display: flex; align-items: center; padding: 8vh clamp(16px, 6vw, 90px); }
.cut[data-side="right"] { justify-content: flex-end; }
.cut-text { width: min(440px, 40vw); }
.cut-text .no { mix-blend-mode: difference; }
.cut-text .en, .cut-text .jp, .cut-text .meta { width: fit-content; background: #000; padding: 4px 10px; }
.cut-text .jp { padding: 8px 12px; }
.no { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(110px, 16vw, 240px); line-height: .78; color: #fff; }
.en { font-family: var(--mono); font-weight: 700; font-size: 14px; letter-spacing: .45em; margin-top: 22px; }
.jp { font-size: clamp(17px, 1.6vw, 22px); font-weight: 500; line-height: 1.8; letter-spacing: .06em; margin-top: 12px; }
.meta { font-family: var(--mono); font-size: 11px; letter-spacing: .25em; margin-top: 22px; opacity: .7; }

/* ファインダー枠：ぬわしが立つ側に重なる */
.viewfinder { position: absolute; top: 14vh; bottom: 14vh; width: 42vw; pointer-events: none; }
.cut[data-side="left"] .viewfinder { right: 5vw; }
.cut[data-side="right"] .viewfinder { left: 5vw; }
.viewfinder i { position: absolute; width: 38px; height: 38px; border: 0 solid #fff; }
.viewfinder i:nth-child(1) { top: 0; left: 0; border-width: 2px 0 0 2px; }
.viewfinder i:nth-child(2) { top: 0; right: 0; border-width: 2px 2px 0 0; }
.viewfinder i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.viewfinder i:nth-child(4) { bottom: 0; right: 0; border-width: 0 2px 2px 0; }
.rec, .tc { position: absolute; top: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .25em; background: #000; padding: 3px 6px; }
.rec { left: 50px; }
.rec::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #fff; margin-right: 8px; animation: blinkdot 1s steps(2) infinite; }
@keyframes blinkdot { 50% { opacity: 0; } }
.tc { right: 50px; }

/* 出現アニメーション */
.reveal { opacity: 0; translate: 0 50px; transition: opacity 1s, translate 1s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; translate: 0 0; }

/* ---------- STAGE / FOOTER ---------- */
.stage { min-height: 120vh; cursor: grab; touch-action: pan-y; user-select: none; }
.stage:active { cursor: grabbing; }
footer { min-height: 70vh; display: grid; place-content: end center; text-align: center; padding: 0 20px 8vh; gap: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .3em; mix-blend-mode: difference; }
.f-title { font-family: var(--display); font-weight: 800; font-size: clamp(48px, 10vw, 150px); letter-spacing: 0; line-height: 1; }

/* ---------- MOBILE ---------- */
@media (max-width: 820px) {
  .hud { padding: 14px 12px; }
  .logo { font-size: 15px; }
  .logo small { display: none; }
    .lead { top: auto; bottom: 28vh; left: 0; right: 0; transform: none; text-align: center; font-size: 13px; }
  .jp-vert { top: 120px; transform: none; font-size: 22px; }
  .title { bottom: 14vh; }
  .hint { gap: 18px; }
  .profile { justify-content: center; align-items: flex-end; }
  .cut, .cut[data-side="right"] { justify-content: flex-start; align-items: flex-end; padding-bottom: 8vh; }
  .cut-text { width: 100%; }
  .no { font-size: 96px; }
  .cut[data-side] .viewfinder { left: 6vw; right: 6vw; width: auto; top: 10vh; bottom: 46vh; }
  .panel { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
