/* Athanix — Hubtown-inspired build.
   Dark navy bg + off-blue ink + bold uppercase headlines + beveled chrome.
   All atmospheric depth drawn into a single <canvas>; HTML is just chrome + text. */

:root {
  --dark-blue:  #020a19;
  --bg-soft:    #07112a;
  --off-blue:   #d5e0ff;
  --off-blue-dim: rgba(213, 224, 255, 0.55);
  --off-blue-faint: rgba(213, 224, 255, 0.28);
  --off-blue-border: rgba(213, 224, 255, 0.12);
  --off-blue-glass: rgba(213, 224, 255, 0.05);

  --font-display:  'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-headline: 'Cormorant Garamond', 'Cormorant', Georgia, serif;
  --font-body:     'Inter', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, monospace;

  --frame-pad: 40px;
  --pip: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--dark-blue); color: var(--off-blue); }
html { scroll-behavior: auto; }
body {
  font-family: var(--font-body);
  font-weight: 300;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ════════ Canvas background ════════ */
#bg {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  display: block;
  background: linear-gradient(180deg, #020817 0%, #050d23 60%, #02050f 100%);
}
/* Lion video — rendered directly by the browser at full hardware-accelerated
   video scaling quality. The stage wrapper is centred over the viewport and
   driven by CSS vars from JS for zoom/pan. */
.lion-stage {
  position: fixed;
  top: 36%; left: 50%;       /* anchored to upper portion of the viewport */
  width: 70vmin;
  height: 70vmin;
  z-index: 5;
  pointer-events: none;
  transform:
    translate(-50%, -50%)
    translate3d(var(--lion-pan-x, 0px), var(--lion-pan-y, 0px), 0)
    scale(var(--lion-zoom, 1));
  transform-origin: 50% 50%;
  will-change: transform;
  /* Black bg of the video drops out — stars and halo behind show through */
  mix-blend-mode: screen;
}
.lion-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Improve scaling quality hint */
  image-rendering: auto;
}

/* ════════ Beveled frame around viewport ════════ */
.frame {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 40;
}
.frame-border {
  position: absolute;
  inset: var(--frame-pad);
  border: 1px solid var(--off-blue-border);
}

/* ════════ HUD ════════ */
.hud {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 50;
}
.hud > * { pointer-events: auto; }

.mark {
  position: absolute;
  top: calc(var(--frame-pad) + 16px);
  left: calc(var(--frame-pad) + 16px);
  display: block;
  text-decoration: none;
}
.mark img {
  width: 200px; height: 200px;
  object-fit: contain;
  display: block;
  /* Transparent PNG — no blend mode or filter needed */
}

/* Top-right action cluster (Contact + Sound) — beveled buttons */
.hud-actions {
  position: absolute;
  top: calc(var(--frame-pad) + 16px);
  right: calc(var(--frame-pad) + 16px);
  display: flex;
  gap: 12px;
}
.bevel-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  background: transparent;
  border: 1px solid var(--off-blue-border);
  color: var(--off-blue);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
  /* Bevelled corners via clip-path */
  clip-path: polygon(
    8px 0, calc(100% - 8px) 0, 100% 8px,
    100% calc(100% - 8px), calc(100% - 8px) 100%,
    8px 100%, 0 calc(100% - 8px), 0 8px
  );
}
.bevel-btn:hover { background: var(--off-blue-glass); border-color: var(--off-blue-faint); }
.bevel-btn .bevel-pip {
  width: var(--pip); height: var(--pip);
  background: var(--off-blue);
  flex-shrink: 0;
}
.bevel-btn .bevel-pip.dark { background: var(--dark-blue); }
.bevel-btn.solid {
  background: var(--off-blue);
  color: var(--dark-blue);
  border-color: var(--off-blue);
}
.bevel-btn.solid:hover { background: #c2cff5; border-color: #c2cff5; }
.bevel-btn[data-on="1"] {
  background: var(--off-blue);
  color: var(--dark-blue);
  border-color: var(--off-blue);
}
.bevel-btn[data-on="1"] .bevel-pip { background: var(--dark-blue); }

/* Left vertical section nav */
.nav {
  position: absolute;
  top: 50%;
  left: calc(var(--frame-pad) + 16px);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.nav button {
  background: transparent;
  border: 0;
  padding: 14px 0 14px 24px;
  color: var(--off-blue);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  text-align: left;
  display: inline-flex; align-items: center; gap: 14px;
  opacity: 0.55;
  transition: opacity 0.25s;
  white-space: nowrap;
}
.nav button .pip {
  width: var(--pip); height: var(--pip);
  background: var(--off-blue);
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.25s, transform 0.25s;
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
}
.nav button:hover { opacity: 0.85; }
.nav button.is-active { opacity: 1; }
.nav button.is-active .pip { opacity: 1; transform: translateY(-50%) scale(1.2); }

/* ════════ Stage ════════ */
.stage {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}
.section {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0 var(--frame-pad) calc(var(--frame-pad) + 56px);
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  will-change: opacity, transform;
}
.section.is-active { pointer-events: auto; }
.section .container { max-width: 880px; }
/* Only the active section's container captures clicks.
   Without this, the contact mailto link still intercepts clicks on every
   other section because .container previously had pointer-events: auto. */
.section.is-active .container { pointer-events: auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  color: var(--off-blue);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.eyebrow .pip {
  width: var(--pip); height: var(--pip);
  background: var(--off-blue);
}

.display {
  font-family: var(--font-headline);
  font-weight: 500;
  font-size: clamp(38px, 6.2vmin, 88px);
  line-height: 1.08;
  letter-spacing: 0;
  color: var(--off-blue);
  margin-bottom: 26px;
  text-wrap: balance;
}
.display em {
  /* Cormorant Garamond italic — keep the slant, brighten the colour */
  font-style: italic;
  font-weight: 500;
  color: #ffffff;
  text-shadow: 0 0 18px rgba(213, 224, 255, 0.45);
}

/* When a headline is also a mailto link (contact section), make it look clickable
   on hover without changing the default rendered weight. */
.display-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  cursor: pointer;
  transition: filter 0.3s;
}
.display-link:hover { filter: brightness(1.15); }
.display-link:hover .display em {
  text-shadow: 0 0 24px rgba(213, 224, 255, 0.75), 0 0 48px rgba(213, 224, 255, 0.35);
}
.display .light { font-weight: 400; }

.body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(14px, 1.7vmin, 17px);
  line-height: 1.65;
  letter-spacing: -0.005em;
  color: var(--off-blue);
  opacity: 0.6;
  max-width: 540px;
  margin: 0 auto;
  text-wrap: pretty;
}

/* CTA — beveled, mirrors Hubtown's bordered button */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 18px 28px;
  background: transparent;
  border: 1px solid var(--off-blue);
  color: var(--off-blue);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
  clip-path: polygon(
    10px 0, calc(100% - 10px) 0, 100% 10px,
    100% calc(100% - 10px), calc(100% - 10px) 100%,
    10px 100%, 0 calc(100% - 10px), 0 10px
  );
}
.cta:hover {
  background: var(--off-blue);
  color: var(--dark-blue);
}
.cta-pip {
  width: var(--pip); height: var(--pip);
  background: var(--off-blue);
  flex-shrink: 0;
  transition: background 0.25s;
}
.cta:hover .cta-pip { background: var(--dark-blue); }

/* ════════ Small sound icon (top-right) ════════ */
.sound-icon {
  position: absolute;
  top: calc(var(--frame-pad) + 24px);
  right: calc(var(--frame-pad) + 24px);
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--off-blue-border);
  color: var(--off-blue);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.sound-icon:hover { background: var(--off-blue-glass); border-color: var(--off-blue-faint); }
.sound-icon[data-on="1"] {
  background: var(--off-blue);
  color: var(--dark-blue);
  border-color: var(--off-blue);
}
/* Default state (data-on="1" by default): show ON waves, hide X */
.sound-icon .snd-on  { opacity: 1; }
.sound-icon .snd-off { opacity: 0; }
.sound-icon[data-on="0"] .snd-on  { opacity: 0; }
.sound-icon[data-on="0"] .snd-off { opacity: 1; }

/* ════════ Scroll spacer — 400vh per section ════════ */
.scroll-spacer {
  position: relative;
  width: 1px;
  /* 7 sections × 400vh each = 2800vh total */
}
.spacer-step {
  height: 400vh;
}

/* ════════ Responsive ════════ */
@media (max-width: 720px) {
  :root { --frame-pad: 16px; }
  .mark img { width: 96px; height: 96px; }
  .nav { display: none; }
  .sound-icon { width: 36px; height: 36px; top: calc(var(--frame-pad) + 16px); right: calc(var(--frame-pad) + 16px); }
  .section { padding: 0 24px calc(var(--frame-pad) + 40px); }
}

@media (prefers-reduced-motion: reduce) {
  #bg { display: none; }
}

/* GPU hygiene */
.frame, .hud, .stage { contain: layout style; }
