/* ============================================================
   Fluff — design language: "Aurora Glass"
   Ink ground, aurora light, glass panels with live sheen.
   Type: old-style serif display / system sans / mono meta.
   ============================================================ */

:root {
  --ink:        #0b0c10;
  --ink-2:      #10121a;
  --paper:      #f2efe8;
  --paper-dim:  #b9b5ab;
  --paper-faint:#7d7a72;
  --signal:     #e8b44a;
  --signal-2:   #9b8cf7;
  --good:       #7ecb8f;

  --line:        rgba(242, 239, 232, 0.10);
  --line-strong: rgba(242, 239, 232, 0.20);
  --glass-bg:    linear-gradient(150deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03) 42%, rgba(255,255,255,0.06));
  --glass-blur:  22px;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --pad: clamp(18px, 5vw, 56px);
  --radius: 20px;

  /* live cursor position, written by JS */
  --mx: 0.5;
  --my: 0.5;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  background-image:
    radial-gradient(1100px 700px at calc(12% + var(--mx) * 8%) calc(6% + var(--my) * 8%), rgba(232,180,74,0.10), transparent 62%),
    radial-gradient(900px 700px at calc(88% - var(--mx) * 8%) calc(22% - var(--my) * 8%), rgba(155,140,247,0.10), transparent 58%),
    radial-gradient(1200px 900px at 50% 120%, rgba(126,203,143,0.06), transparent 60%);
  background-attachment: fixed;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -0.015em; margin: 0; }

a { color: var(--signal); text-decoration: none; border-bottom: 1px solid rgba(232,180,74,0.35); }
a:hover { color: #f6d089; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

code { font-family: var(--font-mono); font-size: 0.88em; background: rgba(255,255,255,0.07); padding: 0.12em 0.4em; border-radius: 5px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 60; background: var(--signal); color: #14100a; padding: 9px 15px; font-weight: 700; border-radius: 8px; }
.skip:focus { left: 12px; }

/* film grain over everything (pure CSS, zero requests) */
.grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================ stage */
.stage {
  position: fixed; inset: 0; z-index: 0;
  display: grid; place-items: center;
  perspective: 1200px;
  perspective-origin: calc(50% + var(--mx) * 14%) calc(46% + var(--my) * 10%);
}
.stage-inner {
  position: relative;
  width: min(76vmin, 640px); aspect-ratio: 1;
  transform-style: preserve-3d;
  transform: rotateY(var(--tilt-x)) rotateX(var(--tilt-y));
  transition: transform 220ms cubic-bezier(.2,.7,.2,1);
  will-change: transform;
}
.stage-floor {
  position: absolute; left: 50%; bottom: 8%; width: 46%; aspect-ratio: 3/1;
  transform: translateX(-50%) translateZ(-40px);
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.55), transparent 70%);
  filter: blur(6px);
}
.surface { position: absolute; inset: 0; width: 100%; height: 100%; }
.surface-canvas { display: block; }
.surface-video {
  object-fit: contain; display: none;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.55));
}
/* when a real video file is present JS adds .has-video to the stage */
.stage.has-video .surface-video.is-active { display: block; }
.stage.has-video .surface-video.is-active ~ .surface-canvas,
.stage.has-video .surface-canvas { opacity: 1; }
.stage-veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(11,12,16,0.72) 0%, rgba(11,12,16,0.18) 26%, rgba(11,12,16,0.18) 62%, rgba(11,12,16,0.82) 100%);
}

/* ============================================================ topbar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px var(--pad);
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(11,12,16,0.55), transparent);
}
.brand { display: inline-flex; align-items: center; gap: 10px; border: 0; color: var(--paper); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f6d089, var(--signal) 60%, #b3801f);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 6px 18px rgba(232,180,74,0.35);
}
.brand-text { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: -0.01em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.state-chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--paper-dim); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 5px 12px; background: rgba(16,18,26,0.55); backdrop-filter: blur(8px);
}
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 10px var(--signal); }

.mic {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  color: var(--paper); background: rgba(16,18,26,0.6); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 7px 14px; backdrop-filter: blur(8px);
}
.mic:hover { border-color: var(--signal); }
.mic[aria-pressed="true"] { background: var(--signal); border-color: var(--signal); color: #14100a; }
.mic[aria-pressed="true"] .mic-icon { animation: pulse 1.1s ease-in-out infinite; }
.mic-icon { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.55; } }

/* ============================================================ rail */
.rail { position: fixed; right: clamp(12px, 2.4vw, 28px); top: 50%; transform: translateY(-50%); z-index: 20; }
.rail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; align-items: flex-end; }
.rail-item { display: flex; align-items: center; gap: 10px; }
.rail-label {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--paper-faint); opacity: 0; transform: translateX(6px); transition: opacity .2s, transform .2s, color .2s;
}
.rail-dot {
  width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: transparent; padding: 0; cursor: pointer; transition: transform .2s, background .2s, border-color .2s;
}
.rail-item:hover .rail-label, .rail-item.is-active .rail-label { opacity: 1; transform: none; }
.rail-item.is-active .rail-label { color: var(--signal); }
.rail-item.is-active .rail-dot { background: var(--signal); border-color: var(--signal); transform: scale(1.35); box-shadow: 0 0 12px rgba(232,180,74,0.6); }

/* ============================================================ content */
main { position: relative; z-index: 10; }
.hero { min-height: 100svh; display: grid; place-items: center; padding: 120px var(--pad) 80px; }
.hero-inner { max-width: 880px; text-align: center; }
.kicker {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--signal); margin: 0 0 18px;
}
.hero-title { font-size: clamp(2.6rem, 8.4vw, 5.4rem); margin: 0 0 22px; text-shadow: 0 22px 60px rgba(0,0,0,0.6); }
.hero-title em { font-style: italic; color: var(--signal); }
.hero-sub { color: var(--paper-dim); font-size: clamp(1rem, 2.2vw, 1.2rem); max-width: 60ch; margin: 0 auto 34px; }
.hero-hint {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--paper-faint);
}
.hint-arrow { width: 1px; height: 26px; background: linear-gradient(180deg, var(--paper-faint), transparent); animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0%,100% { transform: scaleY(0.4); transform-origin: top; opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }

.panel { min-height: 150svh; display: grid; place-items: center; padding: 12svh var(--pad); }

/* ---------------- glassmorphism ---------------- */
.glass {
  position: relative;
  width: min(680px, 100%);
  padding: clamp(26px, 4vw, 44px);
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
  transform: translate3d(calc((var(--mx) - 0.5) * -10px), calc((var(--my) - 0.5) * -8px), 0);
  transition: transform 260ms cubic-bezier(.2,.7,.2,1);
}
/* specular sheen that follows the cursor */
.glass::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(340px circle at calc(var(--mx) * 100%) calc(var(--my) * 100%), rgba(255,255,255,0.16), transparent 62%);
  opacity: 0; transition: opacity .35s;
}
.glass:hover::before { opacity: 1; }
/* top edge highlight */
.glass::after {
  content: ""; position: absolute; left: 8%; right: 8%; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
}

.glass h2 { font-size: clamp(1.7rem, 4.4vw, 2.6rem); margin: 0 0 14px; }
.glass > p { color: var(--paper-dim); margin: 0 0 20px; max-width: 56ch; }
.specs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.specs li {
  display: flex; gap: 12px; align-items: baseline;
  font-size: 0.94rem; color: var(--paper-dim);
  border-top: 1px solid var(--line); padding-top: 8px;
}
.specs b {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--signal); flex: none; min-width: 74px;
}

.panel-outro { min-height: 120svh; }
.outro-cta { margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; cursor: pointer;
  border-radius: 999px; padding: 12px 22px; border: 1px solid var(--line-strong); color: var(--paper);
  background: rgba(255,255,255,0.06); text-decoration: none;
}
.btn-solid { background: var(--signal); border-color: var(--signal); color: #14100a; }
.btn-solid:hover { background: #f6d089; color: #14100a; }
.footer {
  width: min(680px, 100%); margin: 22px auto 0; padding: 0 var(--pad);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--paper-faint); font-size: 0.85rem;
}
.footer p { margin: 0; }
.footer-mono { font-family: var(--font-mono); font-size: 0.78rem; }

/* ============================================================ hud */
.hud {
  position: fixed; left: var(--pad); bottom: 22px; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--paper-faint);
}
.hud-bar { width: 120px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.hud-fill { display: block; height: 100%; width: 0%; background: var(--signal); transition: width 120ms linear; }

/* ============================================================ responsive */
@media (max-width: 640px) {
  .rail { display: none; }
  .panel { min-height: 130svh; }
  .stage-inner { width: 92vmin; }
  .hud { left: 50%; transform: translateX(-50%); bottom: 14px; }
}

/* ============================================================ a11y */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .glass { transform: none; }
  .stage-inner { transform: none; }
}
