/* ==========================================================================
   Krignal — v3, "The Meeting"
   One frame, one long scroll, rendered as a real WebGL scene (see
   v3-scene.js): a gold frame around the viewport itself, a vine that
   climbs it and blooms, and two hands that close the last of the gap
   between them. This stylesheet only owns the DOM layer on top of the
   canvas — text, the CTA, chrome — nothing here draws the scene itself.
   ========================================================================== */

:root {
  --sky-a: #1668b0;
  --sky-b: #3d8dd4;
  --sky-c: #7fc4f2;
  --gold: #dfbf73;
  --gold-lt: #f0dcab;
  --gold-dk: #9c7a26;
  --ink: #0d2136;
  --cream: #eef6fc;
  --leaf: #4f8f5b;
  --leaf-dk: #2f6b3b;
  --petal: #f3aac9;
  --petal-dk: #d8709c;
  --serif: "Bodoni Moda", "Didot", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0; font-family: var(--sans); color: var(--cream); background: var(--sky-a);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.skip {
  position: absolute; left: 50%; top: -100px; transform: translateX(-50%);
  z-index: 200; background: var(--ink); color: #fff;
  padding: 12px 22px; border-radius: 0 0 6px 6px; transition: top .2s var(--ease);
}
.skip:focus { top: 0; }
.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Minimal chrome ------------------------------------------------ */
.v3-chrome {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 48px);
  pointer-events: none;
}
.v3-chrome a { pointer-events: auto; }
.v3-logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-weight: 600; font-size: .95rem; letter-spacing: .26em; text-transform: uppercase;
  color: #fff; text-shadow: 0 2px 12px rgba(10, 30, 50, .5);
}
.v3-logo img { width: 20px; height: 22px; object-fit: contain; }
.v3-back {
  font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, .85); border: 1.5px solid rgba(255, 255, 255, .4); border-radius: 999px;
  padding: 7px 14px; transition: border-color .25s, color .25s;
}
.v3-back:hover { border-color: var(--gold-lt); color: var(--gold-lt); }

/* ---------- The scroll rig ------------------------------------------------
   .v3-spacer is tall; .v3-stage pins to the viewport while it scrolls
   past underneath, giving v3-scene.js a long, smooth range to drive from. */
.v3-spacer { height: 650vh; position: relative; }
.v3-stage {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  isolation: isolate; background: var(--sky-a);
}
#v3-canvas { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; }

/* ---------- Text ------------------------------------------------------------ */
.v3-text {
  position: absolute; left: 0; right: 0; bottom: clamp(122px, 20vh, 180px); z-index: 5;
  height: 116px; text-align: center; padding-inline: 24px; pointer-events: none;
}
.v3-line {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  margin: 0 auto; max-width: 660px;
  opacity: 0; transform: translateY(10px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.v3-line.is-on { opacity: 1; transform: none; }
.v3-main {
  font-family: var(--serif); font-weight: 500; font-style: italic;
  font-size: clamp(1.2rem, 2.6vw, 1.75rem); line-height: 1.3; color: #fff;
  text-shadow: 0 2px 20px rgba(6, 20, 36, .6), 0 1px 3px rgba(6, 20, 36, .4);
  text-wrap: balance;
}
.v3-sub {
  font-family: var(--sans); font-weight: 500;
  font-size: clamp(.78rem, 1.25vw, .92rem); line-height: 1.5; letter-spacing: .03em;
  color: rgba(255, 255, 255, .88);
  text-shadow: 0 1px 12px rgba(6, 20, 36, .7), 0 1px 3px rgba(6, 20, 36, .5);
  max-width: 48ch; text-wrap: balance;
}

/* ---------- Closing CTA ------------------------------------------------------ */
.v3-cta {
  position: absolute; left: 0; right: 0; bottom: clamp(30px, 6vh, 56px); z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease);
  pointer-events: none;
}
.v3-cta.is-on { opacity: 1; transform: none; pointer-events: auto; }
.v3-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px; border-radius: 999px; background: var(--gold); color: #2a1c05;
  font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .5); transition: transform .25s var(--ease);
}
.v3-btn:hover { transform: translateY(-2px); }
.v3-meta {
  margin: 0; font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, .82); text-shadow: 0 1px 10px rgba(6, 20, 36, .7);
}

/* ---------- Scroll hint + progress -------------------------------------------- */
.v3-hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: .62rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .7);
  animation: hint-bob 2.2s ease-in-out infinite; will-change: opacity;
}
.v3-hint svg { width: 15px; height: 15px; }
@keyframes hint-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

.v3-progress {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: 3px;
  background: rgba(255, 255, 255, .15);
}
.v3-progress__bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), var(--gold-lt)); will-change: width; }

/* ---------- Responsive -------------------------------------------------------- */
@media (max-width: 640px) {
  .v3-line { font-size: clamp(1.05rem, 4.4vw, 1.3rem); }
}

@media (prefers-reduced-motion: reduce) {
  .v3-hint { animation: none; }
}
