/* Fehu: story stage, listing card, tour, player. */
/* ---------- header ---------- */
header { position: fixed; inset: 0 0 auto 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--gutter); transition: background .3s; }
.brand .sub { color: var(--muted); font-weight: 400; }
/* ---------- stage ---------- */
.stage { position: relative; height: 100vh; height: 100svh; min-height: 600px; overflow: hidden; user-select: none; -webkit-user-select: none; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.vignette { position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse 80% 75% at 50% 50%, transparent 60%, rgba(0,0,0,.55) 100%); }
.scrim { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .8s;
  background: linear-gradient(rgba(5,5,6,.9), rgba(5,5,6,.35) 30%, rgba(5,5,6,0) 45%, rgba(5,5,6,0) 72%, rgba(5,5,6,.75)); }
.scrim.on { opacity: 1; }
.cap { position: absolute; left: var(--gutter); top: 104px; max-width: 460px; z-index: 5; pointer-events: none; }
.cap .eyebrow { font: 500 12px/1 "JetBrains Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--ember); }
.cap h1 { margin-top: 16px; font-size: clamp(38px, 5.2vw, 76px); font-weight: 500; letter-spacing: -.035em; line-height: 1; }
.cap p { margin-top: 14px; color: var(--muted); font-size: clamp(15px, 1.3vw, 18px); max-width: 34ch; }
.cap.swap > * { animation: capIn .8s cubic-bezier(.2,.7,.2,1) both; }
.cap.swap > :nth-child(2) { animation-delay: .06s; }
.cap.swap > :nth-child(3) { animation-delay: .14s; }
@keyframes capIn { from { opacity: 0; transform: translateY(12px); } }
.hud { position: absolute; right: var(--gutter); top: 104px; z-index: 5; width: 260px; padding: 14px 16px;
  font: 500 12px/1.5 "JetBrains Mono", monospace; color: var(--muted);
  background: rgba(12,12,14,.72); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .4s; pointer-events: none; }
.hud.on { opacity: 1; }
.hud .h { color: var(--ink); display: flex; align-items: center; gap: 8px; letter-spacing: .08em; margin-bottom: 4px; }
.hud .rec { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 10px var(--ember); animation: pulse 1.2s ease-in-out infinite; }
.hud .kv, .hud li { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
.hud b { color: var(--ink); font-weight: 500; }
.hud .bar { height: 3px; background: rgba(255,255,255,.1); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.hud .bar i { display: block; height: 100%; width: 0; background: var(--ember); }
.hud ul { list-style: none; }
.hud li { opacity: .25; transition: opacity .3s, color .3s; }
.hud li.on { opacity: 1; }
.hud li.on b { color: var(--ember); }
@keyframes pulse { 50% { opacity: .35; } }
.labels { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.lbl { position: absolute; left: 0; top: 0; text-align: center; font-size: 13px; line-height: 1.3; color: var(--ink); white-space: nowrap;
  text-shadow: 0 1px 10px rgba(0,0,0,.9); will-change: transform, opacity; }
.lbl b { display: block; font: 500 11px/1.4 "JetBrains Mono", monospace; color: var(--ember); }
.lbl.dim { font: 500 11px/1 "JetBrains Mono", monospace; color: var(--muted); }
/* listing card: the 3D view is drawn into the transparent .img window */
.ad { position: absolute; left: 50%; top: 52%; width: min(400px, calc(100% - 32px)); transform: translate(-50%, -50%); z-index: 6;
  opacity: 0; pointer-events: none; font-size: 14px; }
.ad.on { pointer-events: auto; }
.ad .img { position: relative; margin: 10px 10px 0; aspect-ratio: 16 / 10; border-radius: 12px; box-shadow: 0 0 0 10px var(--card); }
.ad .pill { position: absolute; top: 10px; left: 10px; font: 500 11px/1 "JetBrains Mono", monospace; letter-spacing: .06em;
  background: rgba(5,5,6,.72); padding: 6px 9px; border-radius: 999px; display: flex; align-items: center; gap: 6px; }
.ad .pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 8px var(--ember); }
.ad .pill.ex { left: auto; right: 10px; color: var(--muted); }
.ad .body { background: var(--card); border-radius: 0 0 22px 22px; padding: 18px 20px 20px; box-shadow: 0 40px 90px rgba(0,0,0,.55); }
.ad .meta { font: 500 11px/1 "JetBrains Mono", monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ad h3 { margin-top: 10px; font-size: 21px; font-weight: 500; letter-spacing: -.02em; }
.ad .price { margin-top: 2px; font-size: 15px; color: var(--ink); }
.ad .price span { color: var(--muted); }
.ad .facts { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13px; }
.ad .facts b { color: var(--ink); font-weight: 500; }
.ad .actions { margin-top: 18px; display: flex; align-items: center; gap: 12px; }
.ad .actions small { color: var(--faint); font-size: 12px; }
.cursor { position: absolute; left: 0; top: 0; z-index: 9; width: 22px; height: 22px; pointer-events: none; opacity: 0; will-change: transform; }
.cursor svg { width: 22px; height: 22px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.cursor i { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ember); opacity: 0; }
.tour { position: absolute; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 7; display: flex; gap: 4px;
  max-width: calc(100% - 32px); overflow-x: auto; scrollbar-width: none; padding: 5px;
  background: rgba(12,12,14,.76); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none; transition: opacity .6s; }
.tour::-webkit-scrollbar { display: none; }
.tour.on { opacity: 1; pointer-events: auto; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.chip:hover { color: var(--ink); }
.chip.on { background: var(--ink); color: #0b0b0c; }
.chip.toggle.on { background: var(--ember); color: #160401; }
.tour .sep { flex: none; width: 1px; background: var(--line); margin: 6px 4px; }
.hint { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%); z-index: 7; font-size: 12px; color: var(--muted);
  opacity: 0; transition: opacity .6s; pointer-events: none; white-space: nowrap; }
.hint.on { opacity: 1; }
.player { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 22px; z-index: 7; display: flex; align-items: center; gap: 14px; }
.pbtn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(12,12,14,.6);
  display: grid; place-items: center; cursor: pointer; transition: border-color .2s; }
.pbtn:hover { border-color: rgba(255,255,255,.25); }
.pbtn svg { width: 14px; height: 14px; fill: currentColor; }
.segs { flex: 1; display: flex; gap: 6px; min-width: 0; }
.seg { flex: var(--d) 1 0; min-width: 0; background: none; border: 0; cursor: pointer; text-align: left; padding: 8px 0; }
.seg .tr { display: block; height: 3px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
.seg .tr i { display: block; height: 100%; width: 0; background: var(--ember); }
.seg > span:last-child { display: block; margin-top: 8px; font: 500 11px/1 "JetBrains Mono", monospace; letter-spacing: .08em; color: var(--faint);
  text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .3s; }
.seg.cur > span:last-child, .seg:hover > span:last-child { color: var(--ink); }
.seg em { font-style: normal; }
.skip { flex: none; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(12,12,14,.6);
  font-size: 13px; color: var(--muted); cursor: pointer; transition: color .2s, border-color .2s; }
.skip:hover { color: var(--ink); border-color: rgba(255,255,255,.25); }
/* ---------- sections ---------- */
.cells { margin-top: 64px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.cells.two { grid-template-columns: repeat(2, 1fr); }
.cell { background: var(--bg); padding: 40px 32px 44px; position: relative; transition: background .4s; }
.cell:hover { background: #0b0b0d; }
.cell .n { font: 500 12px/1 "JetBrains Mono", monospace; color: var(--ember); letter-spacing: .1em; }
.cell h3 { margin-top: 22px; font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.cell p { margin-top: 10px; color: var(--muted); font-size: 15px; max-width: 40ch; }
@media (max-width: 820px) {
  nav { display: none; }
  .stage { height: 90svh; }
  .cap { top: 80px; right: var(--gutter); }
  .cap h1 { margin-top: 12px; }
  .cap p { margin-top: 8px; font-size: 14px; }
  .hud { top: auto; bottom: 84px; right: auto; left: var(--gutter); width: 220px; font-size: 11px; padding: 10px 12px; }
  .seg em { display: none; }
  .hud.build { display: none; }
  .seg em, .seg span em { font-style: normal; }
  .skip { padding: 0 12px; }
  .cells, .cells.two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .cap.swap > * { transition: none; animation: none; }
}
