@font-face {
  font-family: 'Bonfire';
  src: url('BonfireRegular.otf') format('opentype');
}

/* ─── Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #080808;
  --glass-bg: rgba(0, 0, 0, 0.42);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --muted: rgba(255,255,255,0.4);
}

html { scroll-behavior: smooth; }

/* Screen-reader / crawler-only content (invisible to users, visible to Google) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  background: var(--bg);
  color: #f0ece6;
  font-family: system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  cursor: none;
}

/* Interactive elements show a pointer — the submarine fades out
   on hover (via JS) so you see this pointer through it. */
a, button, .logo-stack, .ambient-btn {
  cursor: pointer !important;
}

/* ─── Flashlight Mode (press F to toggle) ────────────────── */
#flashlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: radial-gradient(
    circle 200px at var(--fx, 50%) var(--fy, 50%),
    transparent 0%,
    rgba(0, 0, 0, 0.15) 25%,
    rgba(0, 0, 0, 0.75) 55%,
    rgba(0, 0, 0, 0.98) 80%,
    #000 100%
  );
}
body.flashlight-on #flashlight {
  opacity: 1;
}
/* Soft warm tint at the cone's edge */
body.flashlight-on #flashlight::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle 220px at var(--fx, 50%) var(--fy, 50%),
    rgba(255, 220, 160, 0.12) 0%,
    transparent 60%
  );
  mix-blend-mode: screen;
}

/* ─── Custom Cursor ─────────────────────────────────────── */
#cursor {
  position: fixed;
  top: 0; left: 0;
  width: 68px;
  height: 32px;
  pointer-events: none;
  z-index: 99999;
  will-change: transform;
  filter:
    drop-shadow(0 0 6px rgba(255, 255, 255, 0.55))
    drop-shadow(0 0 14px rgba(180, 220, 255, 0.35))
    drop-shadow(0 0 22px rgba(120, 180, 255, 0.18));
}

#cursor svg, #cursor img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ─── Ambient Button ────────────────────────────────────── */
.ambient-btn {
  position: fixed;
  top: 1.2rem;
  right: 1.5rem;
  z-index: 1000;
  opacity: 0;
  animation: btn-in 0.7s ease 1.1s both;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.ambient-btn svg { width: 17px; height: 17px; }
.ambient-btn .icon-on  { display: none; }
.ambient-btn.playing .icon-muted { display: none; }
.ambient-btn.playing .icon-on    { display: block; }

.ambient-btn:hover {
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.35);
}

.ambient-btn.playing {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
}

/* ─── Handwritten "listen to the fire →" hint ──────────── */
.ambient-hint {
  position: fixed;
  top: 2.3rem;
  right: 4.5rem;
  width: 160px;
  height: auto;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transform: translate(6px, -2px);
  animation: hint-in 0.9s ease 1.4s forwards;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
  user-select: none;
}

@keyframes hint-in {
  to { opacity: 0.85; transform: translate(0, 0); }
}

/* ─── Particles canvas ──────────────────────────────────── */
#particles {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ─── Hero ──────────────────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transform: scale(1.06);
  will-change: transform;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.22) 0%,
    rgba(0,0,0,0.12) 40%,
    rgba(8,8,8,0.92) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

/* ─── Glass Logo (text IS the glass — no box) ───────────── */
.logo-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.9;
  user-select: none;
  cursor: default;
}

.logo-line {
  font-family: 'Bonfire', serif;
  font-size: clamp(2.8rem, 7vw, 6rem);
  letter-spacing: 0.04em;
  display: block;

  /* Glass gradient clipped to text */
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.55) 42%,
    rgba(200, 200, 200, 0.35) 55%,
    rgba(255, 255, 255, 0.9) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;

  /* Frosted glass edge + subtle depth */
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.35);
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.4))
    drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 18px rgba(255, 255, 255, 0.08));
}

/* ─── Letter animation (random directions set via JS) ───── */
.letter {
  display: inline-block;
  animation: letter-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 0.055s + 0.25s);
}

@keyframes letter-in {
  from {
    opacity: 0;
    transform: translate(var(--fx, 0px), var(--fy, -40px));
  }
  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

/* ─── Page glitch (logo Easter egg) ────────────────────── */
@keyframes page-glitch {
  0%   { filter: none; }
  15%  { filter: hue-rotate(80deg) saturate(3) brightness(1.3); }
  30%  { filter: invert(0.25) hue-rotate(180deg); }
  50%  { filter: hue-rotate(-60deg) saturate(2); }
  70%  { filter: brightness(1.8) saturate(0.5); }
  85%  { filter: hue-rotate(120deg); }
  100% { filter: none; }
}

body.glitching {
  animation: page-glitch 0.9s ease forwards;
}

/* ─── Linktree Buttons ──────────────────────────────────── */
.links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(360px, 90vw);
  padding: 0.85rem 1.6rem;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s, transform 0.18s;

  /* Staggered fade-in — each button drifts up into place */
  opacity: 0;
  transform: translateY(14px);
  animation: btn-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.link-btn:nth-child(1) { animation-delay: 1.25s; }
.link-btn:nth-child(2) { animation-delay: 1.40s; }
.link-btn:nth-child(3) { animation-delay: 1.55s; }
.link-btn:nth-child(4) { animation-delay: 1.70s; }
.link-btn:nth-child(5) { animation-delay: 1.85s; }

@keyframes btn-in {
  to { opacity: 1; transform: translateY(0); }
}

.link-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.75;
}

.link-btn:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateX(6px);
}

/* ─── Scroll hint ───────────────────────────────────────── */
.scroll-hint {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: bob 2.4s ease-in-out infinite;
  pointer-events: none;
}

.scroll-hint svg { width: 20px; height: 20px; margin-top: -4px; }

@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ─── Boot Sequence ─────────────────────────────────────── */
/* Hide everything except the logo initially, then reveal in stages */
body.booting .hero-video,
body.booting .hero-overlay {
  opacity: 0;
  transition: opacity 1.6s ease;
}
body.booting.boot-bg .hero-video,
body.booting.boot-bg .hero-overlay {
  opacity: 1;
}

body.booting #particles {
  opacity: 0;
  transition: opacity 0.8s ease;
}
body.booting.boot-particles #particles { opacity: 1; }

/* Wipe existing button stagger during boot, apply new one at stage-3 */
body.booting .link-btn {
  animation: none;
  opacity: 0;
  transform: translateY(14px);
}
body.booting.boot-buttons .link-btn {
  animation: btn-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
body.booting.boot-buttons .link-btn:nth-child(1) { animation-delay: 0.00s; }
body.booting.boot-buttons .link-btn:nth-child(2) { animation-delay: 0.14s; }
body.booting.boot-buttons .link-btn:nth-child(3) { animation-delay: 0.28s; }
body.booting.boot-buttons .link-btn:nth-child(4) { animation-delay: 0.42s; }
body.booting.boot-buttons .link-btn:nth-child(5) { animation-delay: 0.56s; }

/* Hide the ambient controls, scroll hint, camper ID until late */
body.booting .ambient-btn,
body.booting .ambient-hint,
body.booting .scroll-hint,
body.booting .camper-id {
  opacity: 0;
  transition: opacity 0.8s ease;
}
body.booting.boot-buttons .ambient-btn,
body.booting.boot-buttons .scroll-hint,
body.booting.boot-buttons .camper-id {
  opacity: 1;
}

/* Submarine cursor: hidden until stage-4, JS positions and animates it */
body.booting #cursor {
  opacity: 0;
  transition: opacity 0.4s ease;
}
body.booting.boot-sub #cursor { opacity: 1; }


/* ─── Videos ────────────────────────────────────────────── */
.videos-section {
  background: var(--bg);
  padding: 3rem 0 4rem;
  overflow: hidden;
}

.videos-track-wrap {
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.videos-track-wrap:hover .videos-track {
  animation-play-state: paused;
}

.videos-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  animation: scroll-left 55s linear infinite;
}

@keyframes scroll-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── Camper ID (bottom corner) ─────────────────────────── */
.camper-id {
  position: fixed;
  bottom: 0.9rem;
  left: 1rem;
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.28);
  pointer-events: none;
  z-index: 5;
  text-transform: lowercase;
}
@media (max-width: 768px) {
  .camper-id { font-size: 0.62rem; bottom: 0.6rem; left: 0.7rem; }
}

.video-card {
  flex-shrink: 0;
  width: 300px;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.07);
  transition: transform 0.25s, border-color 0.25s;
  display: block;
}

.video-card:hover {
  transform: scale(1.04);
  border-color: rgba(255,255,255,0.25);
}

.video-card img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* ─── Mobile ────────────────────────────────────────────── */
@media (max-width: 768px) {
  body { cursor: auto; }
  #cursor { display: none; }
  .ambient-btn, .ambient-hint { display: none; }

  /* Keep the hero video on mobile — it's the whole vibe */
  .hero-video { display: block; transform: scale(1.1) translateX(-6%); }

  /* Shrink hero so the video carousel peeks at the bottom */
  .hero { height: auto; min-height: 82vh; padding: 3.5rem 0 2rem; }

  /* Strengthen the overlay so text stays legible over video */
  .hero-overlay {
    background: linear-gradient(
      to bottom,
      rgba(0,0,0,0.45) 0%,
      rgba(0,0,0,0.35) 40%,
      rgba(8,8,8,0.95) 100%
    );
  }

  /* Properly center everything vertically, tighten spacing */
  .hero-content {
    gap: 1.6rem;
    padding: 0 1.2rem;
    width: 100%;
  }

  .logo-stack { line-height: 0.95; }
  .logo-line { font-size: clamp(3.2rem, 14vw, 5rem); }

  .links { gap: 0.55rem; }
  .link-btn {
    font-size: 0.78rem;
    padding: 0.75rem 1.3rem;
    width: min(340px, 88vw);
  }

  /* Kill the hover-only translate on touch (it sticks without a mouseleave) */
  .link-btn:hover { transform: none; }

  .scroll-hint { bottom: 1rem; font-size: 0.65rem; }

  /* ── Video carousel: touchable auto-scroll on mobile ── */
  .videos-section { padding: 1.5rem 0 2.5rem; }
  .videos-track-wrap.mobile-carousel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .videos-track-wrap.mobile-carousel::-webkit-scrollbar { display: none; }
  .video-card { width: 240px; }
  .video-card:hover {
    transform: none;
    border-color: rgba(255,255,255,0.07);
  }
}

/* Very small phones (iPhone SE etc.) */
@media (max-width: 380px) {
  .logo-line { font-size: clamp(2.6rem, 13vw, 3.8rem); }
  .link-btn { font-size: 0.74rem; padding: 0.7rem 1.1rem; }
  .hero-content { gap: 1.2rem; }
}
