/* koonk_homepage_3d — the words float over the world.
   Palette = the app's: ink, dusk, rose, rose-soft, gold, moss. */

:root {
  --ink: #1a1420;
  --dusk: #2e2140;
  --rose: #ff6f91;
  --rose-soft: #ffa5ba;
  --gold: #ffd27d;
  --moss: #9ec49a;
  --txt: rgba(255, 255, 255, 0.95);
  --mut: rgba(255, 255, 255, 0.76);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: auto; }

body {
  /* The twilight the whole brand lives in — the canvas renders transparent over it. */
  background:
    radial-gradient(120% 90% at 50% 0%, var(--dusk) 0%, #241a2e 45%, var(--ink) 100%);
  background-attachment: fixed;
  color: var(--txt);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

/* ── The world ─────────────────────────────────────────────────────────────── */
#world {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* After Dark dims the whole room; tweened by the master timeline. */
.dark-veil {
  position: fixed;
  inset: 0;
  background: #0a060f;
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.top {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 48px);
  z-index: 20;
}

.wordmark {
  font-family: 'Pacifico', cursive;
  font-size: 30px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  text-shadow: 0 2px 24px rgba(255, 111, 145, 0.35);
}
.wordmark.small { font-size: 24px; justify-content: center; width: 100%; }
.wm-hearts {
  display: inline-flex;
  align-items: center;
  margin: 0.25em 0.05em 0 0.1em;
}
.wm-heart { width: 0.72em; height: 0.72em; display: block; }
.wm-heart.second { margin-left: -0.28em; }

.top-cta {
  color: var(--txt);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  transition: background 0.25s, transform 0.25s;
}
.top-cta:hover { background: rgba(255, 111, 145, 0.2); transform: translateY(-1px); }

/* ── Beats ────────────────────────────────────────────────────────────────── */
main { position: relative; z-index: 10; }

.beat {
  min-height: 135vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(20px, 6vw, 72px);
  pointer-events: none; /* scroll passes through; links re-enable below */
}
.beat.hero { min-height: 100vh; }

.copy {
  max-width: 640px;
  text-align: center;
  position: relative;
}
.copy a, .copy details { pointer-events: auto; }

/* Readability scrim: a soft pool of night behind every block of words,
   so the copy stays legible no matter what the world is doing behind it. */
.copy::before {
  content: '';
  position: absolute;
  inset: -14% -22%;
  background: radial-gradient(ellipse at center,
    rgba(14, 10, 18, 0.82) 0%,
    rgba(14, 10, 18, 0.55) 52%,
    rgba(14, 10, 18, 0) 76%);
  z-index: -1;
  pointer-events: none;
}

h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 700;
  line-height: 1.06;
  text-wrap: balance;
  text-shadow: 0 2px 14px rgba(14, 10, 18, 0.95), 0 6px 48px rgba(14, 10, 18, 0.85);
}

h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(32px, 5.2vw, 56px);
  font-weight: 600;
  line-height: 1.12;
  text-wrap: balance;
  text-shadow: 0 2px 14px rgba(14, 10, 18, 0.95), 0 6px 48px rgba(14, 10, 18, 0.85);
}

.copy p {
  margin-top: 18px;
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.7;
  color: var(--mut);
  text-shadow: 0 1px 10px rgba(14, 10, 18, 0.95), 0 3px 26px rgba(14, 10, 18, 0.9);
}
.copy p em { color: var(--rose-soft); font-style: normal; }
.copy .sub { color: rgba(255, 255, 255, 0.85); }

.cta {
  display: inline-block;
  margin-top: 30px;
  padding: 16px 34px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--rose-soft), var(--rose) 55%, #ff8c69);
  color: var(--ink);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  box-shadow: 0 8px 40px rgba(255, 111, 145, 0.45);
  transition: transform 0.25s, box-shadow 0.25s;
}
.cta:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 12px 56px rgba(255, 111, 145, 0.6); }
.cta.big { font-size: 19px; padding: 18px 42px; }

.scroll-hint {
  margin-top: 56px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}
.scroll-hint span {
  display: block;
  width: 1px; height: 44px;
  margin: 0 auto 12px;
  background: linear-gradient(to bottom, transparent, var(--rose-soft));
  animation: hint 2.2s ease-in-out infinite;
}
@keyframes hint { 0%, 100% { transform: scaleY(0.4); opacity: 0.3; } 50% { transform: scaleY(1); opacity: 1; } }

/* ── AI-video slots: masked + screen-blended so the rectangle never shows.
     Hidden until JS confirms the file exists; the 3D scene stands in otherwise. */
.video-slot { position: absolute; pointer-events: none; display: none; }
.video-slot.on { display: block; }
.ai-video {
  width: 100%; height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 62% 62% at 50% 50%, #000 42%, transparent 72%);
  mask-image: radial-gradient(ellipse 62% 62% at 50% 50%, #000 42%, transparent 72%);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.ai-video.ready { opacity: 0.9; }
.hero-video   { width: min(78vw, 620px); aspect-ratio: 1; left: 50%; top: -46%; transform: translateX(-50%); }
.garden-video { width: min(60vw, 460px); aspect-ratio: 1; right: -34%; top: 50%; transform: translateY(-50%); }
.cta-video    { width: min(80vw, 640px); aspect-ratio: 1; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: -1; }

/* Beats where the 3D subject owns one side: the words step aside on desktop. */
@media (min-width: 900px) {
  #spark .copy { transform: translateX(21vw); text-align: left; max-width: 540px; }
  #songs .copy { transform: translateX(-19vw); text-align: left; max-width: 540px; }
}

/* ── Plain closing section (FAQ + footer) ─────────────────────────────────── */
.plain {
  position: relative;
  z-index: 10;
  max-width: 680px;
  margin: 0 auto;
  padding: 8vh clamp(20px, 5vw, 40px) 12vh;
}
.plain h2 {
  font-size: clamp(26px, 3.6vw, 36px);
  text-align: center;
  margin-bottom: 34px;
}
.plain details {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 18px 22px;
  margin-bottom: 12px;
  backdrop-filter: blur(6px);
}
.plain summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16.5px;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.plain summary::-webkit-details-marker { display: none; }
.plain summary::after {
  content: '＋';
  position: absolute; right: 0; top: 0;
  color: var(--rose-soft);
  transition: transform 0.25s;
}
.plain details[open] summary::after { transform: rotate(45deg); }
.plain details p { margin-top: 12px; color: var(--mut); line-height: 1.65; font-size: 15.5px; }

footer { text-align: center; margin-top: 9vh; }
footer p { color: rgba(255, 255, 255, 0.35); font-size: 14px; margin-top: 10px; }
footer a { color: var(--rose-soft); text-decoration: none; }

/* ── CSS firefly fallback (no WebGL) ──────────────────────────────────────── */
.css-fireflies { display: none; }
body.no-webgl .css-fireflies { display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none; }
body.no-webgl .css-fireflies i {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px 3px rgba(255, 210, 125, 0.55);
  animation: drift 11s ease-in-out infinite;
  opacity: 0.7;
}
body.no-webgl .css-fireflies i:nth-child(odd) { background: var(--rose-soft); box-shadow: 0 0 14px 3px rgba(255, 165, 186, 0.5); }
body.no-webgl .css-fireflies i:nth-child(1)  { left: 8%;  top: 22%; animation-delay: -1s; }
body.no-webgl .css-fireflies i:nth-child(2)  { left: 22%; top: 64%; animation-delay: -2.5s; }
body.no-webgl .css-fireflies i:nth-child(3)  { left: 33%; top: 30%; animation-delay: -4s; }
body.no-webgl .css-fireflies i:nth-child(4)  { left: 44%; top: 78%; animation-delay: -6s; }
body.no-webgl .css-fireflies i:nth-child(5)  { left: 56%; top: 18%; animation-delay: -3s; }
body.no-webgl .css-fireflies i:nth-child(6)  { left: 64%; top: 58%; animation-delay: -7.5s; }
body.no-webgl .css-fireflies i:nth-child(7)  { left: 75%; top: 36%; animation-delay: -5s; }
body.no-webgl .css-fireflies i:nth-child(8)  { left: 86%; top: 70%; animation-delay: -8.5s; }
body.no-webgl .css-fireflies i:nth-child(9)  { left: 14%; top: 86%; animation-delay: -9s; }
body.no-webgl .css-fireflies i:nth-child(10) { left: 50%; top: 46%; animation-delay: -0.5s; }
body.no-webgl .css-fireflies i:nth-child(11) { left: 92%; top: 14%; animation-delay: -6.8s; }
body.no-webgl .css-fireflies i:nth-child(12) { left: 40%; top: 10%; animation-delay: -3.7s; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0); opacity: 0.35; }
  25% { transform: translate(24px, -30px); opacity: 0.9; }
  50% { transform: translate(-16px, -52px); opacity: 0.5; }
  75% { transform: translate(-30px, -18px); opacity: 0.85; }
}

/* ── Reduced motion: the world holds still; the words still work ─────────── */
@media (prefers-reduced-motion: reduce) {
  .scroll-hint span { animation: none; }
  .css-fireflies i { animation: none; }
  .ai-video { display: none; }
  .beat { min-height: 92vh; }
}

/* ── Small screens ────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .beat { min-height: 118vh; }
  .copy p br { display: none; }
  .garden-video { display: none !important; }
}
