/* HALVAINE — home */

/* ---------------------------------------------------------------- 1. stage */
.stage { position: relative; height: 100vh; height: 100svh; min-height: 640px; overflow: hidden; background: #000; isolation: isolate; }
.st-media { position: absolute; inset: 0; }
.st-video, .st-canvas, .st-gl, .st-world { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-video { object-fit: cover; transition: opacity .6s var(--ease); }
@media (min-width: 901px) { .st-video { transform: translateX(15%); } }
.st-canvas { opacity: 0; transition: opacity .5s var(--ease); }
.stage.is-canvas .st-canvas { opacity: 1; }
.stage.is-canvas .st-video { opacity: 0; }
.st-gl { opacity: 0; pointer-events: none; }
.stage.is-gl .st-gl { opacity: 1; }
.stage.is-gl .st-canvas { opacity: 0; transition: none; }
.st-world { opacity: 0; transition: opacity 1.2s var(--ease); }
.st-world > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s var(--ease); }
.st-world > .on { opacity: 1; }
.st-world canvas { object-fit: contain; }
.stage[data-state="exploring"] .st-world { opacity: 1; }
.st-vign { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 80% at 62% 50%, transparent 40%, rgba(0,0,0,.55) 100%), linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.25) 38%, transparent 60%); }
.stage[data-state="exploring"] .st-vign { background: linear-gradient(90deg, rgba(0,0,0,.8) 0%, rgba(0,0,0,.35) 42%, rgba(0,0,0,.1) 70%); }

.st-hud { position: absolute; inset: 0; pointer-events: none; color: rgba(236,232,223,.62); z-index: 3; }
.st-hud > span { position: absolute; }
.hud-tl { left: var(--gut); top: 88px; }
.hud-tr { right: var(--gut); top: 88px; display: flex; gap: 8px; align-items: center; }
.hud-bl { left: var(--gut); bottom: 26px; font-variant-numeric: tabular-nums; }
.hud-br { right: var(--gut); bottom: 26px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #6b717b; display: inline-block; }
.is-linked .dot, .dot.on { background: var(--lume); box-shadow: 0 0 10px var(--lume); }
.hud-tr b, .ph-link b { font-weight: 400; }

.st-panel { position: absolute; z-index: 4; left: var(--gut); bottom: clamp(70px, 11vh, 120px); width: min(560px, calc(100% - 2 * var(--gut))); }
.st-panel .d1 { font-size: clamp(44px, 5.8vw, 98px); }
.st-ask .d1 em { display: block; }
.st-pair { display: flex; gap: 26px; align-items: center; margin-top: 34px; }
.qr-box { position: relative; flex: none; width: 148px; height: 148px; padding: 10px; background: var(--bone); border-radius: 4px; }
.qr-box canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.qr-corner { position: absolute; inset: -9px; border: 1px solid rgba(226,98,42,.75); border-radius: 8px; animation: qrBreath 2.8s ease-in-out infinite; pointer-events: none; }
@keyframes qrBreath { 50% { inset: -14px; opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .qr-corner { animation: none; } }
.pair-side { display: grid; gap: 10px; justify-items: start; }
.pair-side .btn { min-height: 44px; font-size: 14px; }
.pair-status { color: var(--lume); margin: 0 0 4px; }
.pair-status.warn { color: #b9b2a7; }
.pair-note { font-size: 12.5px; color: var(--mute); margin: 4px 0 0; max-width: 30em; }
.st-notice { position: absolute; z-index: 5; left: 50%; top: 92px; transform: translateX(-50%); background: rgba(12,18,28,.85); border: 1px solid var(--line2); padding: 10px 16px; border-radius: 999px; color: var(--bone); margin: 0; white-space: nowrap; }
.mute { position: absolute; z-index: 5; right: var(--gut); bottom: 52px; background: none; border: 1px solid var(--line2); border-radius: 999px; color: var(--steel); padding: 7px 12px; }
.mute:hover { color: var(--bone); border-color: var(--bone); }

@media (max-width: 760px) {
  .stage { min-height: 760px; }
  .st-video { height: 60%; top: 1%; }
  .st-vign { background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,.82) 50%, #000 66%); }
  .st-panel { bottom: 58px; }
  .st-pair { flex-direction: column; align-items: flex-start; gap: 18px; margin-top: 24px; }
  .qr-box { display: none; }
  .hud-tl, .hud-br, .hud-tr { display: none; }
  .mute { bottom: 18px; }
  .hud-bl { bottom: 22px; }
}

/* ---------------------------------------------------------------- 3. story (one screen)
   Default (no JS, reduced motion, small screens): a static layout with every chapter readable.
   .is-film (added by story.js on large screens with motion) pins it and plays it with the scroll. */
.story { position: relative; background: #000; border-top: 1px solid var(--line); }
.story-pin { position: relative; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.story-desk { position: relative; overflow: hidden; min-height: 70vh; }
.story-desk canvas, .sd-world, .sd-world > * { position: absolute; inset: 0; width: 100%; height: 100%; }
#sdGl { opacity: 0; }
.story-desk.is-gl #sdGl { opacity: 1; }
.story-desk.is-gl #sdCanvas { opacity: 0; }
.sd-world { opacity: 0; transition: opacity .9s var(--ease); }
.sd-world.on { opacity: 1; }
.sd-world > * { object-fit: cover; opacity: 0; transition: opacity .8s var(--ease); }
.sd-world > .on { opacity: 1; }
.sd-world canvas { object-fit: contain; }
.sd-tag { position: absolute; right: 22px; top: 92px; color: rgba(236,232,223,.55); }
.story-phone { margin: 0; display: grid; place-items: center; align-content: center; gap: 14px; background: linear-gradient(180deg, #07090d, #0b1018); border-left: 1px solid var(--line); padding: 60px 0 30px; }
.story-phone figcaption { color: rgba(236,232,223,.55); }
.device { width: 236px; aspect-ratio: 9 / 19.5; border-radius: 38px; padding: 9px; background: linear-gradient(145deg, #3a3e45, #15171b 40%, #2a2d33); box-shadow: 0 30px 80px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.12); }
.device-in { position: relative; width: 100%; height: 100%; border-radius: 30px; overflow: hidden; background: #000; }
.story-copy { position: absolute; left: var(--gut); bottom: 6vh; width: min(520px, 50%); z-index: 3; }
.story-copy .k { color: var(--steel); }
.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.chapters b { display: block; font: 400 26px/1 var(--f-d); margin-bottom: 8px; }
.chapters p { color: #d9d6cf; font-size: 15px; max-width: 30em; margin: 0; text-shadow: 0 1px 18px rgba(0,0,0,.9); }
.story-desk::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,.82), rgba(0,0,0,.1) 60%); }
.story.is-film { height: 640vh; }
.story.is-film .story-pin { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 0; overflow: hidden; }
.story.is-film .story-copy { pointer-events: none; bottom: 8vh; width: min(460px, 46%); }
.story.is-film .chapters { display: grid; gap: 4px; }
.story.is-film .chapters li { transition: opacity .5s var(--ease); }
.story.is-film .chapters b { font-size: 22px; margin: 0; color: rgba(236,232,223,.42); transition: font-size .6s var(--ease), color .5s; }
.story.is-film .chapters p { max-height: 0; overflow: hidden; margin: 0; font-size: 17px; max-width: 26em; transition: max-height .6s var(--ease), margin .6s var(--ease); }
.story.is-film .chapters li.on b { font-size: clamp(34px, 3.4vw, 54px); color: var(--bone); margin: 10px 0 12px; }
.story.is-film .chapters li.on p { max-height: 140px; margin: 0 0 14px; }
/* Stacked: narrow screens without JS, and whatever story.js chose as static (.is-static: phones in either
   orientation). The class, not a height query, so an address bar showing or hiding never swaps the layout. */
@media (max-width: 860px) {
  .story-pin { display: block; }
  .story-desk { height: 62vh; min-height: 380px; }
  .story-phone { padding: 40px 0; border-left: 0; border-top: 1px solid var(--line); }
  .story-copy { position: relative; left: auto; bottom: auto; width: auto; padding: 36px var(--gut) 60px; }
  .chapters b { font-size: 30px; }
}
.story.is-static .story-pin { display: block; }
.story.is-static .story-desk { height: 62vh; min-height: 380px; }
.story.is-static .story-phone { padding: 40px 0; border-left: 0; border-top: 1px solid var(--line); }
.story.is-static .story-copy { position: relative; left: auto; bottom: auto; width: auto; padding: 36px var(--gut) 60px; }
.story.is-static .chapters b { font-size: 30px; }

/* ---------------------------------------------------------------- 4. two times */
.times { position: relative; display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; background: #000; }
.tm-half { position: relative; overflow: hidden; }
.tm-half video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tm-half::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,0) 30%, rgba(0,0,0,.55)); }
.tm-copy { position: absolute; z-index: 2; left: var(--gut); top: 110px; display: grid; gap: 8px; }
.tm-tyo .tm-copy { left: auto; right: var(--gut); text-align: right; }
.tm-copy .mono { color: var(--steel); }
.tm-clock { font: 400 clamp(60px, 8vw, 140px)/.9 var(--f-d); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tm-tyo .tm-clock { color: var(--ember2); }
.tm-mid { position: absolute; z-index: 3; left: 50%; bottom: 9vh; transform: translateX(-50%); width: min(780px, 90%); text-align: center; }
.tm-mid p { color: #e3e0d9; max-width: 34em; margin: 22px auto 0; text-shadow: 0 1px 20px rgba(0,0,0,.8); }
.tm-mid::before { content: ''; display: block; width: 1px; height: 80px; margin: 0 auto 26px; background: linear-gradient(var(--ember), transparent); }
@media (max-width: 760px) {
  .times { grid-template-columns: 1fr; grid-template-rows: 50vh 50vh auto; }
  .tm-mid { position: relative; left: auto; bottom: auto; transform: none; width: auto; padding: 50px var(--gut) 70px; }
  .tm-copy { top: 80px; }
}

/* ---------------------------------------------------------------- 5. atelier */
.atelier { position: relative; min-height: 100vh; display: flex; align-items: flex-end; overflow: hidden; padding: 0 0 12vh; }
.atelier video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.atelier::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,0) 70%), linear-gradient(0deg, rgba(0,0,0,.5), transparent 40%); }
.at-copy { position: relative; z-index: 2; }
.at-copy .d2 { max-width: 9em; }

/* ---------------------------------------------------------------- 6. close-up */
.close { display: grid; grid-template-columns: 1.35fr 1fr; min-height: 100vh; background: #000; }
.cl-media { position: relative; overflow: hidden; }
.cl-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cl-copy { padding: clamp(60px, 8vw, 120px) var(--gut); display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--line); background: radial-gradient(ellipse at 0% 50%, #0d1420, #050608 70%); }
.cl-facts { margin: 38px 0 0; display: grid; }
.cl-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.cl-facts dt { font: 400 11px/1.8 var(--f-c); letter-spacing: .22em; text-transform: uppercase; color: var(--steel); }
.cl-facts dd { margin: 0; }
@media (max-width: 860px) { .close { grid-template-columns: 1fr; } .cl-media { min-height: 62vh; } .cl-copy { border-left: 0; } }

/* ---------------------------------------------------------------- 7. materials */
.mats { padding: clamp(80px, 10vw, 150px) 0; background: var(--void); }
.mt-head { margin-bottom: 44px; }
.mt-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; padding: 0 var(--gut); max-width: var(--max); margin: 0 auto; }
.mt-grid figure { margin: 0; position: relative; overflow: hidden; min-height: 560px; background: #000; }
.mt-grid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.mt-grid figure:hover img { transform: scale(1.04); }
.mt-grid figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 26px 24px; background: linear-gradient(transparent, rgba(0,0,0,.88)); display: grid; gap: 6px; }
.mt-grid b { font: 400 30px/1 var(--f-d); }
.mt-grid span { color: #cfccc5; font-size: 14.5px; max-width: 26em; }
@media (max-width: 900px) { .mt-grid { grid-template-columns: 1fr; } .mt-grid figure { min-height: 420px; } }

/* ---------------------------------------------------------------- 8. launch */
.launch { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; }
.launch video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.launch::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.4) 50%, rgba(0,0,0,.15)); }
.ln-copy { position: relative; z-index: 2; }
.ln-copy .d1 { max-width: 8em; }
