/* GoWild storyboard landing page. Builds on ../styles.css (tokens, nav, buttons, signup, FAQ, footer). */

@property --sky-a { syntax: "<color>"; inherits: true; initial-value: #1f3315; }
@property --sky-b { syntax: "<color>"; inherits: true; initial-value: #0d160a; }
@property --glow  { syntax: "<color>"; inherits: true; initial-value: rgba(143, 174, 93, .28); }

body {
  --sky-a: #1f3315; --sky-b: #0d160a; --glow: rgba(143, 174, 93, .28);
  transition: --sky-a 1.2s ease, --sky-b 1.2s ease, --glow 1.2s ease;
  background: var(--forest-900);
}
body[data-sky="day"]     { --sky-a: #20361a; --sky-b: #0d170a; --glow: rgba(160, 190, 100, .30); }
body[data-sky="dusk"]    { --sky-a: #2a2238; --sky-b: #100c16; --glow: rgba(255, 128, 64, .26); }
body[data-sky="predawn"] { --sky-a: #142640; --sky-b: #080d16; --glow: rgba(110, 160, 255, .24); }
body[data-sky="sunrise"] { --sky-a: #3b2a12; --sky-b: #130e07; --glow: rgba(255, 170, 60, .32); }
body[data-sky="evening"] { --sky-a: #34160f; --sky-b: #110706; --glow: rgba(230, 60, 40, .26); }
body[data-sky="camp"]    { --sky-a: #232a1a; --sky-b: #0c100a; --glow: rgba(255, 140, 40, .26); }

.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 78% 18%, var(--glow), transparent 70%),
    linear-gradient(180deg, var(--sky-a), var(--sky-b));
}
.sky::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'%3E%3Cg fill='none' stroke='%23ece3cc' stroke-opacity='.05' stroke-width='1.2'%3E%3Cpath d='M-20 120c120-60 220 40 340-10s200-90 300-20'/%3E%3Cpath d='M-20 170c120-60 220 40 340-10s200-90 300-20'/%3E%3Cpath d='M-20 220c130-50 210 50 330 0s210-80 310-10'/%3E%3Cpath d='M-20 330c110-70 240 30 350-20s190-70 290 0'/%3E%3Cpath d='M-20 380c110-70 240 30 350-20s190-70 290 0'/%3E%3Cpath d='M-20 490c140-40 200 60 330 10s210-90 310-30'/%3E%3Cpath d='M-20 540c140-40 200 60 330 10s210-90 310-30'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Hero ---------- */
.s-hero { position: relative; min-height: calc(100vh - 64px); display: grid; align-items: center; padding: 48px 0 80px; overflow: hidden; }
.s-hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: center; }
.s-hero h1 { font-size: clamp(46px, 7vw, 92px); font-weight: 800; text-transform: uppercase; line-height: .92; }
.s-hero h1 span { color: var(--sage); display: block; }
.s-hero .lede { font-size: 19px; color: var(--bone-dim); max-width: 34em; margin: 22px 0 30px; }
.hero-wordmark { width: 210px; height: auto;margin: 0 0 18px -6px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.45)); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.trail-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 34px 0 0; padding: 0; list-style: none; }
.trail-steps li { font: 700 13px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--bone-dim);
  padding: 8px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }

.hero-stage { position: relative; height: min(76vh, 700px); perspective: 1700px; }
.hero-stage .device { position: absolute; left: 50%; top: 50%; }
.hero-stage .d-back-l { --w: min(230px, 22vw); transform: translate(-112%, -46%) rotateY(28deg) rotateZ(-4deg) translateZ(-120px); }
.hero-stage .d-back-r { --w: min(230px, 22vw); transform: translate(12%, -54%) rotateY(-30deg) rotateZ(4deg) translateZ(-120px); }
.hero-stage .d-front  { --w: min(280px, 27vw); transform: translate(-50%, -50%) rotateX(var(--hx, 8deg)) rotateY(var(--hy, -16deg)); z-index: 2; }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); font: 700 13px var(--font-display); letter-spacing: .2em;
  text-transform: uppercase; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.scroll-cue::after { content: ""; width: 2px; height: 34px; background: linear-gradient(var(--sage), transparent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: scaleY(.4); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } }

/* ---------- The phone ---------- */
.device {
  --w: min(320px, calc(62vh / var(--ar)), 78vw);
  --ar: 2.1667;
  position: relative; width: var(--w); aspect-ratio: 1 / var(--ar);
  transform-style: preserve-3d;
}
.device::before, .device::after {
  content: ""; position: absolute; inset: calc(var(--w) * -.04); border-radius: calc(var(--w) * .16);
}
.device::before {   /* bezel */
  background: linear-gradient(145deg, #3a3f37, #0b0d0a 55%, #1d211b);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.10), inset 0 0 0 5px #050605;
  transform: translateZ(-1px);
}
.device::after {    /* body thickness + ground shadow */
  background: #040504; transform: translateZ(-18px);
  box-shadow: 0 60px 110px -30px rgba(0,0,0,.85), 0 30px 50px -20px rgba(0,0,0,.6);
}
.screen { position: absolute; inset: 0; z-index: 1; border-radius: calc(var(--w) * .125); overflow: hidden; background: #000; }
.screen > img, .screen > video, .slice > img, .slice > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.screen::after { /* glass glare */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.14), rgba(255,255,255,0) 32%, rgba(255,255,255,0) 70%, rgba(255,255,255,.05));
}

/* A slice of the screen that lifts toward the viewer. --clip is inset(top right bottom left). */
.lift {
  --z: 80;
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  transform: translateZ(calc(var(--lift, 0) * var(--z) * 1px));
  filter: drop-shadow(0 calc(var(--lift, 0) * 26px) calc(var(--lift, 0) * 26px) rgba(0,0,0,.65));
}
.slice { position: absolute; inset: 0; clip-path: inset(var(--clip) round calc(var(--w) * .05)); }
.lift.glow .slice::after { content: ""; position: absolute; inset: 0; clip-path: inherit; box-shadow: inset 0 0 0 2px rgba(255,107,0,.55); }

/* Floating chips that drop onto the screen. */
.chip {
  --z: 120;
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 9px; white-space: nowrap;
  padding: 8px 12px 8px 9px; border-radius: 12px;
  background: rgba(14, 22, 10, .9); border: 1px solid rgba(236,227,204,.16);
  box-shadow: 0 18px 30px -12px rgba(0,0,0,.75);
  font: 600 13.5px/1.2 var(--font-body); color: var(--bone);
  opacity: 0; transform: translateZ(calc(var(--z) * 1px + 220px)) translateY(-36px) scale(.9);
  transition: opacity .45s ease, transform .7s cubic-bezier(.2, 1.4, .4, 1);
}
.chip.on { opacity: 1; transform: translateZ(calc(var(--z) * 1px)) translateY(0) scale(1); }
.chip small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.chip i { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-style: normal;
  background: var(--c, var(--orange)); color: #140a00; font: 800 13px/1 var(--font-display); }
.chip i svg { width: 16px; height: 16px; }

/* Line drawn above the map (scouting track). */
.trail-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none;
  transform: translateZ(calc(var(--lift, 0) * 46px)); }
.trail-svg path { fill: none; stroke: #ff6b00; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--draw, 0)); filter: drop-shadow(0 0 2px rgba(255,107,0,.9)); }
.trail-svg circle { fill: #fff; stroke: #ff6b00; stroke-width: 1; opacity: var(--draw-end, 0); }

/* ---------- Story chapters ---------- */
.chapter { position: relative; height: 260vh; }
.chapter.short { height: 210vh; }
.chapter .pin {
  position: sticky; top: 64px; height: calc(100vh - 64px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 40px;
  width: min(1160px, 100% - 32px); margin-inline: auto;
}
.chapter:nth-of-type(even) .pin .copy { order: 2; }
.copy { opacity: var(--in, 1); transform: translateY(calc((1 - var(--in, 1)) * 28px)); }
.step { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font: 700 14px/1 var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: var(--orange); }
.step b { font-size: 15px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #140a00; background: var(--orange); letter-spacing: 0; }
.step span { color: var(--muted); }
.copy h2 { font-size: clamp(38px, 5.2vw, 64px); }
.copy h2 em { font-style: normal; color: var(--sage); }
.copy > p { color: var(--bone-dim); font-size: 18px; max-width: 30em; margin: 18px 0 0; }
.copy ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.copy li { position: relative; padding-left: 26px; color: var(--bone); font-size: 16px; }
.copy li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 9px; height: 9px; border-radius: 3px; background: var(--sage); transform: rotate(45deg); }
.copy .more { display: inline-block; margin-top: 22px; font-weight: 600; text-decoration: none; }

.stage { position: relative; height: 100%; display: grid; place-items: center; perspective: 1800px; }
.stage .device { transform: rotateX(var(--rx, 8deg)) rotateY(var(--ry, -18deg)) rotateZ(var(--rz, 0deg)); }
.stage .float { transform-style: preserve-3d; animation: bob 6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(6px); } }
.stage .device.second { position: absolute; --w: min(250px, calc(56vh / var(--ar)), 52vw); opacity: var(--second, 0);
  left: -52%; top: 14%; transform: translateX(calc((1 - var(--second, 0)) * -60px)) rotateY(24deg) rotateX(6deg) translateZ(-100px); }
.stage .float { position: relative; }

/* Chapter rail (desktop) */
.rail { position: fixed; left: 22px; top: 50%; transform: translateY(-50%); z-index: 15; display: grid; gap: 4px;
  opacity: 0; transition: opacity .4s; pointer-events: none; }
.rail.show { opacity: 1; pointer-events: auto; }
.rail a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--muted); font: 700 12px/1 var(--font-display);
  letter-spacing: .14em; text-transform: uppercase; padding: 5px 0; }
.rail a::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--muted); transition: all .3s; }
.rail a span { opacity: 0; transform: translateX(-6px); transition: all .3s; }
.rail:hover a span, .rail a.on span { opacity: 1; transform: none; }
.rail a.on { color: var(--bone); }
.rail a.on::before { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255,107,0,.2); }
.progress { position: fixed; left: 0; top: 64px; height: 3px; width: 100%; z-index: 19; background: transparent; pointer-events: none; }
.progress i { display: block; height: 100%; width: calc(var(--prog, 0) * 100%); background: linear-gradient(90deg, var(--sage), var(--orange)); }

/* Act dividers */
.act { padding: 120px 0 40px; text-align: center; }
.act p { font: 700 14px var(--font-display); letter-spacing: .3em; text-transform: uppercase; color: var(--orange); margin: 0 0 10px; }
.act h2 { font-size: clamp(44px, 7vw, 88px); }
.act span { display: block; color: var(--bone-dim); font: 400 18px/1.5 var(--font-body); margin-top: 14px; }

.finale { text-align: center; padding: 140px 0 90px; }
.finale h2 { font-size: clamp(44px, 7vw, 86px); }
.finale p { color: var(--bone-dim); font-size: 19px; max-width: 36em; margin: 18px auto 30px; }
.signup-section, #faq { background: transparent; }

/* ---------- Small screens ---------- */
@media (max-width: 1180px) { .rail { display: none; } }
@media (max-width: 860px) {
  .s-hero .wrap { grid-template-columns: 1fr; }
  .hero-stage { height: 520px; order: -1; margin-top: 8px; }
  .hero-stage .d-front { --w: min(220px, 52vw); }
  .hero-stage .d-back-l, .hero-stage .d-back-r { --w: min(180px, 40vw); }
  .s-hero { padding-top: 12px; }
  .scroll-cue { display: none; }

  .chapter { height: 230vh; }
  .chapter .pin { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; align-items: stretch; padding-bottom: 18px; }
  .chapter:nth-of-type(even) .pin .copy { order: 0; }
  .stage { order: -1; min-height: 0; }
  .device { --w: min(250px, calc(50vh / var(--ar)), 62vw); }
  .stage .device.second { --w: min(170px, calc(36vh / var(--ar)), 40vw); }
  .copy h2 { font-size: 32px; }
  .copy > p { font-size: 15.5px; margin-top: 10px; }
  .copy ul, .copy .more { display: none; }
  .step { margin-bottom: 10px; }
  .chip { font-size: 12px; padding: 6px 9px 6px 7px; }
  .chip i { width: 22px; height: 22px; }
  .chip small { display: none; }
  .hero-wordmark { display: none; }
  .chip[style*="left:-"] { left: -4% !important; }
  .chip[style*="right:-"] { right: -4% !important; }
}

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
  .stage .float, .scroll-cue::after { animation: none; }
  .chip { transition: none; }
}
.hero-stage .d-back-l .screen, .hero-stage .d-back-r .screen { filter: brightness(.8); }
