/* Vyom homepage. Builds on the tokens and base in styles.css. */

body.home { padding-bottom: 120px; overflow-x: clip; }
body.home main, .home-top, .home-foot { max-width: 560px; margin: 0 auto; padding-left: 18px; padding-right: 18px; }

.page-progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 30; pointer-events: none; }
.page-progress i { display: block; height: 100%; background: var(--glow); transform-origin: 0 50%; transform: scaleX(0); }

.home-top { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; }

/* ---------- 1. The hook ---------- */
.hero { min-height: calc(100svh - 130px); display: flex; flex-direction: column; justify-content: center; padding: 20px 0 8px; }
.hero h1 { font-size: clamp(34px, 9.6vw, 54px); line-height: 1; margin-bottom: 36px; }
.hint { font: 400 12px "Space Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); text-align: center; margin: 18px 0 0; }

.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 12px; }
.door { position: relative; aspect-ratio: 1 / 1.08; padding: 0; border: 0; background: none; cursor: pointer; perspective: 900px; text-align: left; }
.door-inner { position: absolute; inset: 0; display: block; }
.face { position: absolute; inset: 0; border-radius: 14px 14px 4px 4px; display: flex; flex-direction: column; padding: 16px 14px; }
/* behind the door */
/* text starts clear of the door left ajar on its hinge */
.back { background: var(--surface); border: 1px solid var(--line); justify-content: center; gap: 6px; padding-left: 34px; }
.back .kicker { margin: 0 0 6px; font-size: 10px; color: var(--accent); }
.back .job { font-weight: 500; font-size: 15px; line-height: 1.25; letter-spacing: -0.01em; opacity: 0; transform: translateY(6px); transition: opacity 0.4s, transform 0.4s; }
.door.open .back .job { opacity: 1; transform: none; }
.door.open .back .job:nth-of-type(2) { transition-delay: 0.25s; }
.door.open .back .job:nth-of-type(3) { transition-delay: 0.35s; }
.door.open .back .job:nth-of-type(4) { transition-delay: 0.45s; }
/* the door itself swings open on its left hinge */
.front {
  z-index: 2; justify-content: flex-end; transform-origin: 0 50%; transition: transform 0.8s cubic-bezier(.2, .7, .2, 1);
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--c, #e2593a) 30%, var(--night)) 0%, var(--night) 75%);
  color: var(--night-ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.front::before { /* panel lines, like a real door */
  content: ""; position: absolute; inset: 14px 14px 46px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px;
}
.door.open .front { transform: rotateY(-82deg); }
.door-name { position: relative; font-weight: 700; font-size: 22px; letter-spacing: -0.03em; }
.knob { position: absolute; right: 12px; top: 54%; width: 8px; height: 8px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 8px var(--glow); }
/* a character peeks over the top of each door */
.peek { position: absolute; z-index: 1; top: -30px; left: 50%; width: 58px; margin-left: -29px; transition: transform 0.5s cubic-bezier(.2, .7, .2, 1); }
.peek .char-art { width: 100%; height: auto; display: block; }
.door:nth-child(1) .front { --c: #5fb8b4; }
.door:nth-child(2) .front { --c: #f0843a; }
.door:nth-child(3) .front { --c: #e2593a; }
.door:nth-child(4) .front { --c: #5b86f0; }
.door:hover .peek { transform: translateY(-4px); }
.door.open .peek { transform: translateY(-8px) rotate(-6deg); }
.door:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 14px; }

/* ---------- chapters ---------- */
.chapter { padding: 72px 0; border-top: 1px solid var(--line); }
.chapter h2 { font-size: clamp(28px, 7.6vw, 40px); line-height: 1.05; margin-bottom: 14px; }
.src { margin: 0 0 8px; }
.src a { font: 400 11px "Space Mono", monospace; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.src a:hover { color: var(--ink); border-color: var(--accent); }
.chapter .say { margin-top: 28px; color: var(--muted); }
.say.more { color: var(--ink); margin-top: 22px; }

.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2, .7, .2, 1); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- 3,000 dots, 10 lit ---------- */
.dots { display: block; width: 100%; height: auto; margin: 0 0 24px; overflow: visible; }
.dots .faint { fill: none; stroke: var(--muted); stroke-width: 4.4; stroke-linecap: round; opacity: 0.28; }
.dots .lit { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); transform-box: fill-box; transform-origin: center; }

/* ---------- 1 in 3 ---------- */
.figures { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 0 24px; }
.figures .kid { fill: var(--line); }
.figures .kid.lit { fill: var(--accent); }
.figures .grown { fill: var(--muted); opacity: 0.55; }
.figures .link { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; }

/* ---------- the map that zooms ---------- */
/* square frame: the world sits in the middle band, India fills it after the zoom */
.zoom-map { position: relative; aspect-ratio: 1; margin: 22px 0 8px; overflow: hidden; }
.zoom-map svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transition: transform 1.4s cubic-bezier(.5, 0, .2, 1), opacity 1s; }
/* India is at 71.9% across and 46.7% down the frame on the world map */
.zoom-map .world { transform-origin: 71.9% 46.7%; }
.zoom-map .india { opacity: 0; transform: translate(21.9%, -3.3%) scale(0.089); pointer-events: none; }
.zoom-map.zoomed .world { transform: scale(11.25); opacity: 0; pointer-events: none; }
.zoom-map.zoomed .india { opacity: 1; transform: none; pointer-events: auto; }
.land { fill: none; stroke: var(--muted); stroke-linecap: round; opacity: 0.4; }
.world .land { stroke-width: 1.5; }
.india .land { stroke-width: 0.36; opacity: 0.6; }
.india .land.near { opacity: 0.14; }
.home-glow { fill: var(--glow); opacity: 0.25; }
.pin { cursor: pointer; }
.pin-dot { fill: var(--accent); }
.pin-halo { fill: var(--accent); opacity: 0.2; transform-box: fill-box; transform-origin: center; }
.pin.hot .pin-dot { fill: var(--glow); }
.pin.hot .pin-halo { fill: var(--glow); opacity: 0.5; animation: halo 1.3s ease-out infinite; }
.pin-label { display: grid; justify-items: center; gap: 2px; min-height: 52px; margin: 0; text-align: center; }
.pin-label b { font-weight: 500; font-size: 20px; letter-spacing: -0.01em; }
.pin-label span { font: 400 11px "Space Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
@keyframes halo { from { transform: scale(0.6); opacity: 0.6; } to { transform: scale(1.7); opacity: 0; } }
@keyframes pop-in { from { transform: scale(0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .dots .lit, .world .pin, .india .pin { opacity: 0; }
  .in .dots .lit, .in .world .pin, .zoomed .india .pin { animation: pop-in 0.5s ease-out forwards; }
  .in .figures .link { animation: draw 1s 0.6s ease-out forwards; }
  .figures .kid.lit { transition: fill 0.5s 0.3s; }
  .chapter:not(.in) .figures .kid.lit { fill: var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .figures .link { stroke-dashoffset: 0; }
}

/* ---------- crew ---------- */
.crew { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 8px; }
.crew li { display: grid; justify-items: center; gap: 8px; }
.crew .char-art { width: 68px; height: auto; }
.crew b { font: 400 11px "Space Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 80%, var(--ink)); }

/* ---------- how it works: three icons ---------- */
.icons { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.icons li { display: grid; justify-items: center; gap: 10px; text-align: center; }
.icons svg { width: 52px; height: 52px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icons .ripple { stroke: var(--accent); stroke-dasharray: 3 4; transform-box: fill-box; transform-origin: center; animation: halo 2s ease-out infinite; }
.icons span { font: 400 11px "Space Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- finale ---------- */
.finale { text-align: center; padding: 96px 0 72px; }
.finale h2 { font-size: clamp(30px, 8.4vw, 46px); }
.finale-line { font-size: 22px; color: var(--accent); margin-bottom: 28px; }
.finale .btn { max-width: 360px; margin: 0 auto; }
.promise-row { list-style: none; margin: 18px auto 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
.promise-row li { font: 400 11px "Space Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.promise-row li + li::before { content: "✦"; color: var(--glow); margin-right: 14px; }

.home-foot { border-top: 1px solid var(--line); padding-top: 24px; padding-bottom: 32px; color: var(--muted); font-size: 14px; text-align: center; }
.home-foot a { color: var(--ink); }

/* ---------- pinned start button ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; text-align: center;
  padding: 26px 18px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, transparent);
  transition: transform 0.35s ease, opacity 0.35s;
}
.sticky-cta .btn { max-width: 524px; margin: 0 auto; }
.sticky-cta p { margin: 6px 0 0; font: 400 11px "Space Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sticky-cta.away { transform: translateY(110%); opacity: 0; pointer-events: none; }

/* ---------- privacy ---------- */
.privacy { padding-bottom: 40px; }
.privacy .logo { text-decoration: none; }
.privacy .chapter.first { border-top: 0; padding-bottom: 32px; }
.privacy h3 { margin-top: 28px; }
.privacy p { color: var(--muted); }
.privacy p a { color: var(--ink); }
