/* ==========================================================
   YourFirstSite hero section. Clean-tech palette: white, ink, blue, cyan.
   ========================================================== */
:root {
  --bg: #ffffff;
  --soft: #f5f7fa;
  --ink: #0b1220;
  --muted: #5b6577;
  --blue: #2563eb;
  --cyan: #06b6d4;
  --line: #e5e9f0;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, p, ul { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 24px; border-radius: 999px;
  font: 600 15px/1 var(--font); letter-spacing: -.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s;
}
.btn-sm { padding: 11px 20px; font-size: 14px; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 10px 24px -10px rgba(11, 18, 32, .55); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(37, 99, 235, .6); background: var(--blue); }
.btn-ghost { background: rgba(255, 255, 255, .7); border-color: var(--line); color: var(--ink); backdrop-filter: blur(8px); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--blue); color: var(--blue); }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; z-index: 50; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(1160px, calc(100% - 28px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 9px 10px 9px 20px; border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px -18px rgba(11, 18, 32, .35);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 6px 14px -4px rgba(37, 99, 235, .6);
}
.nav-links { display: flex; gap: 28px; }
.nav-links a { font-size: 14px; font-weight: 600; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--ink); }

/* ---------- Hero (pinned, scroll-driven) ---------- */
.hero { position: relative; height: 330vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px; opacity: .55;
  -webkit-mask-image: radial-gradient(ellipse 70% 62% at 66% 50%, #000 18%, transparent 76%);
  mask-image: radial-gradient(ellipse 70% 62% at 66% 50%, #000 18%, transparent 76%);
}
.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .38; pointer-events: none; }
.g1 { width: 520px; height: 520px; background: #bfdbfe; right: 6%; top: 8%; }
.g2 { width: 380px; height: 380px; background: #a5f3fc; right: 32%; bottom: -8%; }

/* 3D scene */
.scene {
  position: absolute; top: 0; right: 0; bottom: 0; width: 60%;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0; transition: opacity 1.1s ease .15s;
}
.ready .scene { opacity: 1; }
.rig { position: relative; flex: none; width: 860px; height: 620px; transform: scale(var(--s, .8)); transform-origin: center; }
.world { position: absolute; inset: 0; transform-style: preserve-3d; }

.panel {
  position: absolute; left: 50%; top: 50%;
  border: 2px solid transparent; transform-style: preserve-3d;
  box-shadow: 0 14px 30px -14px rgba(15, 23, 42, var(--sh, .3));
}
.panel-img { position: absolute; inset: -2px; border-radius: inherit; overflow: hidden; opacity: 0;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%); transform: translateZ(1px); }
.panel-img::before { content: ""; position: absolute; width: 34%; aspect-ratio: 1; border-radius: 50%; right: 12%; top: 14%;
  background: rgba(255, 255, 255, .88); box-shadow: 0 0 40px 10px rgba(255, 255, 255, .35); }
.panel-img::after { content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 45% at 18% 118%, rgba(255, 255, 255, .38) 60%, transparent 61%),
    radial-gradient(ellipse 70% 55% at 82% 126%, rgba(255, 255, 255, .26) 60%, transparent 61%); }
.det { position: absolute; left: 50%; top: 50%; border-radius: 99px; transform-origin: 0 50%; opacity: 0; }
.det.round { transform-origin: 50% 50%; border-radius: 50%; }

.biz {
  position: absolute; left: 50%; top: 50%; width: 300px; height: 180px; margin: -90px 0 0 -150px;
  border-radius: 16px; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 34px 60px -26px rgba(37, 99, 235, .45), 0 10px 24px -12px rgba(15, 23, 42, .25);
  transform-style: preserve-3d;
}
.biz > *{ position: absolute; }
.biz .logo { left: 22px; top: 22px; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--blue), var(--cyan)); }
.biz .l { height: 8px; border-radius: 99px; background: #dbe3ee; }
.biz .l.dark { background: var(--ink); height: 12px; }
.biz .stripe { right: 0; top: 0; bottom: 0; width: 16px; border-radius: 0 15px 15px 0; background: linear-gradient(180deg, var(--cyan), var(--blue)); }
.biz .beam { left: 0; right: 0; top: 0; height: 2px; background: var(--cyan);
  box-shadow: 0 0 18px 6px rgba(6, 182, 212, .45); transform: translateZ(8px); }
.mag { left: 0; top: 0; width: 120px; height: 120px; margin: -50px 0 0 -50px; overflow: visible; transform: translateZ(60px); filter: drop-shadow(0 18px 18px rgba(11, 18, 32, .22)); }

.frame {
  position: absolute; left: 50%; top: 50%; width: 650px; height: 455px; margin: -227px 0 0 -325px;
  border-radius: 20px; background: #fff; border: 1px solid #d6deea; opacity: 0;
  box-shadow: 0 50px 80px -40px rgba(37, 99, 235, .35), 0 20px 40px -24px rgba(15, 23, 42, .35);
  transform-style: preserve-3d;
}
.frame .dot { position: absolute; top: 14px; width: 11px; height: 11px; border-radius: 50%; }

/* Copy column */
.copy {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; justify-content: center;
  padding: 70px clamp(20px, 6vw, 96px) 0; pointer-events: none;
}
.copy > * { max-width: min(580px, 46vw); }
.copy a { pointer-events: auto; }

.pill {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; margin-bottom: 26px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  background: rgba(255, 255, 255, .8); border: 1px solid var(--line); backdrop-filter: blur(8px);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 0 rgba(6, 182, 212, .6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(6, 182, 212, 0); } 100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); } }

/* all chapters share one grid cell, so the block is always as tall as the tallest chapter */
.chapters { display: grid; align-items: start; }
.chapter { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s linear .5s; }
.chapter.is-active { opacity: 1; visibility: visible; transition: opacity .5s ease .1s, visibility 0s; }

.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin-bottom: 18px; }
.chapter h1, .chapter h2 { font-size: clamp(2.6rem, 5.6vw, 5.2rem); line-height: 1.02; letter-spacing: -.045em; font-weight: 800; white-space: nowrap; }
.chapter h1 em, .chapter h2 em { font-style: normal; color: var(--blue); }

/* word-by-word reveal */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.wi { display: inline-block; transform: translateY(112%); transition: transform .45s var(--ease); }
.chapter.is-active .wi { transform: none; transition: transform .9s var(--ease) calc(var(--i) * 55ms + 120ms); }
.chapter.is-past .wi { transform: translateY(-112%); }
.chapter.is-next .wi { transform: translateY(112%); }

.lede, .cta-row { opacity: 0; transform: translateY(14px); transition: opacity .3s, transform .3s; }
.chapter.is-active .lede { opacity: 1; transform: none; transition: opacity .8s ease .55s, transform .8s var(--ease) .55s; }
.chapter.is-active .cta-row { opacity: 1; transform: none; transition: opacity .8s ease .75s, transform .8s var(--ease) .75s; }
.lede { margin-top: 22px; max-width: 460px; font-size: clamp(1rem, 1.25vw, 1.15rem); line-height: 1.6; color: var(--muted); font-weight: 500; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* progress rail */
.rail { display: flex; gap: 12px; margin-top: 34px; max-width: 420px; }
.rail-item { flex: 1; }
.rail-label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 600; color: #9aa5b8; transition: color .3s; }
.rail-label b { font-weight: 800; margin-right: 4px; }
.rail-item.on .rail-label { color: var(--ink); }
.bar { display: block; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); transform-origin: left; transform: scaleX(var(--f, 0)); }

.scroll-hint {
  position: absolute; z-index: 3; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  transition: opacity .4s;
}
.scroll-hint i { width: 1px; height: 38px; background: linear-gradient(var(--ink), transparent); transform-origin: top; animation: drip 1.8s ease-in-out infinite; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.scroll-hint.gone { opacity: 0; }

/* ---------- Next section (bridge) ---------- */
.next { position: relative; z-index: 2; padding: 14vh clamp(20px, 6vw, 96px) 16vh; background: var(--soft); border-top: 1px solid var(--line); }
.next h2 { font-size: clamp(2rem, 4.4vw, 3.6rem); letter-spacing: -.04em; line-height: 1.05; font-weight: 800; max-width: 12ch; }
.next .lede { opacity: 1; transform: none; max-width: 520px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.chips li { padding: 11px 18px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
}
@media (max-width: 800px) {
  /* Phone: one big portrait (about 4:5) animation with a one-line headline sitting right on top of it. */
  .scene { top: 76px; bottom: auto; left: 0; right: 0; width: auto; height: 60%; }
  .copy {
    justify-content: flex-start; align-items: center; text-align: center;
    padding: 62vh 16px 0; padding-top: 62svh;
  }
  .copy > * { max-width: 100%; }
  .chapters { width: 100%; }
  .pill, .eyebrow, .lede { display: none; }
  .chapter h1, .chapter h2 {
    font-size: clamp(2.4rem, 12.4vw, 3.6rem); line-height: 1; letter-spacing: -.05em;
    text-shadow: 0 0 28px rgba(255, 255, 255, .95), 0 0 10px rgba(255, 255, 255, .95), 0 0 2px rgba(255, 255, 255, .9);
  }
  .cta-row { justify-content: center; margin-top: 18px; }
  .cta-row .btn-ghost { display: none; }
  .btn { padding: 13px 24px; }
  .rail {
    position: absolute; left: 24px; right: 24px; bottom: calc(22px + env(safe-area-inset-bottom));
    margin: 0; max-width: none; text-align: left;
  }
  .scroll-hint { display: flex; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .scroll-hint i { height: 28px; }
  .g1 { right: -25%; top: 4%; width: 420px; height: 420px; }
  .g2 { right: auto; left: -20%; bottom: 20%; width: 320px; height: 320px; }
  .bg-grid { -webkit-mask-image: radial-gradient(ellipse 95% 38% at 50% 30%, #000 18%, transparent 80%); mask-image: radial-gradient(ellipse 95% 38% at 50% 30%, #000 18%, transparent 80%); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pill-dot, .scroll-hint i { animation: none; }
}
