/* LOOP site. Tokens follow DESIGN.md (D-120: deep green primary, lagoon route). */
:root {
  --page: #EEF2EC;
  --surface: #FCFDFB;
  --surface-2: #EDF2ED;
  --ink: #162E28;
  --muted: #4F645A;
  --line: #D4DED5;
  --accent: #1F6A52;
  --energy: #164E40;
  --energy-ink: #FFFFFF;
  --deep: #173E31;
  --deep-2: #0F2C22;
  --on-deep: #F1F6EB;
  --on-deep-muted: #B6CDBF;
  --mint: #8ED1B0;
  --route: #3E8CA3;
  --lagoon: #72ADC0;
  --lagoon-soft: #9FCBDA;
  --warm: #ED9C76;
  --danger: #A62B3C;
  --focus: #1F6A52;
  --radius: 24px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #111C17;
    --surface: #1A2C24;
    --surface-2: #263B2F;
    --ink: #F1F6EB;
    --muted: #B1C4B3;
    --line: #425A48;
    --accent: #9AD9BC;
    --energy: #8ED1B0;
    --energy-ink: #10261F;
    --deep: #0F2219;
    --deep-2: #0A1812;
    --danger: #FFACB7;
    --focus: #9AD9BC;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 17px/1.5 var(--font); overflow-x: hidden; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Header */
.top { position: absolute; inset: 0 0 auto; z-index: 5; padding-block: 18px; }
.top.static { position: static; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; letter-spacing: .06em; font-size: 20px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.top nav { display: flex; gap: 8px; }
.top nav a { color: inherit; opacity: .8; text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 999px; transition: background .2s, opacity .2s; }
.top nav a:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }

/* Buttons */
.button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 26px; border-radius: 999px; border: 0;
  font: 650 16px/1 var(--font); text-decoration: none; cursor: pointer;
  background: var(--mint); color: #10261F;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--mint) 80%, transparent);
}
.button:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -14px color-mix(in srgb, var(--mint) 90%, transparent); }
.button:active { transform: translateY(0) scale(.98); }
.button.solid { background: var(--energy); color: var(--energy-ink); box-shadow: none; }
.button:disabled { opacity: .6; cursor: progress; transform: none; }
.button .arrow { transition: transform .25s var(--ease); }
.button:hover .arrow { transform: translateX(4px); }

/* Hero */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(100svh, 860px);
  display: grid; align-items: center;
  padding-block: 96px 64px;
  background: radial-gradient(120% 90% at 80% 20%, #1F5A47 0%, var(--deep) 45%, var(--deep-2) 100%);
  color: var(--on-deep);
}
.hero::before {
  content: ""; position: absolute; inset: -40px; z-index: -2;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 70% at 60% 40%, #000 30%, transparent 80%);
  animation: grid-drift 24s linear infinite;
}
.cells-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.cells-bg span {
  position: absolute; width: 43px; height: 43px; border-radius: 6px;
  background: var(--lagoon); opacity: 0;
  animation: cell-blink 6s var(--ease) infinite;
}
.hero .wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  font-size: 14px; font-weight: 650; color: var(--on-deep);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); animation: pulse 2s ease-in-out infinite; }
h1 {
  margin: 20px 0 18px;
  font-size: clamp(44px, 7.4vw, 88px); line-height: .98; letter-spacing: -.045em; font-weight: 850;
  text-wrap: balance;
}
h1 .hl { color: var(--lagoon-soft); position: relative; white-space: nowrap; }
h1 .hl svg { position: absolute; left: -4%; right: -4%; bottom: -.18em; width: 108%; height: .5em; overflow: visible; }
h1 .hl path { fill: none; stroke: var(--mint); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.4s .6s var(--ease) forwards; }
.lead { margin: 0 0 32px; font-size: clamp(18px, 2.2vw, 22px); color: var(--on-deep-muted); max-width: 26ch; }
.hero-scene { position: relative; perspective: 1200px; }
.hero-scene .card3d {
  aspect-ratio: 400 / 280;
  border-radius: 32px; padding: 14px;
  background: rgba(252,253,251,.96);
  box-shadow: 0 50px 100px -40px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.2);
  transform: rotateX(8deg) rotateY(-10deg) rotateZ(1deg);
  transform-style: preserve-3d;
  animation: float 7s ease-in-out infinite;
  transition: transform .4s var(--ease);
}
@media (prefers-color-scheme: dark) {
  .hero-scene .card3d { background: rgba(26,44,36,.96); }
  .season, .beta { box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
  .beta { background: radial-gradient(100% 120% at 0% 0%, #1F5A47, #15352A 60%); }
  .season { background: #15352A; }
}
.hero-scene::after {
  content: ""; position: absolute; inset: 20% 10% -10%; z-index: -1;
  background: radial-gradient(closest-side, rgba(114,173,192,.45), transparent);
  filter: blur(30px);
}
.tag {
  position: absolute; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 16px;
  background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 700;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.5);
  animation: float 6s ease-in-out infinite;
}
.tag i { width: 12px; height: 12px; border-radius: 4px; background: var(--lagoon); }
.tag.one { left: -6%; bottom: 14%; animation-delay: -2s; }
.tag.two { right: -2%; top: -4%; animation-delay: -4s; }
.tag.two i { background: var(--warm); border-radius: 50%; }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; width: 26px; height: 42px; margin-left: -13px; border: 2px solid rgba(255,255,255,.35); border-radius: 14px; }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--on-deep); animation: cue 1.8s ease-in-out infinite; }

/* Ticker */
.ticker { overflow: hidden; background: var(--mint); color: #10261F; padding-block: 14px; }
.ticker .track { display: flex; width: max-content; gap: 36px; animation: marquee 26s linear infinite; font-weight: 800; font-size: clamp(18px, 2.4vw, 24px); letter-spacing: -.01em; white-space: nowrap; }
.ticker .track span::after { content: "●"; margin-left: 36px; font-size: .5em; vertical-align: middle; opacity: .5; }

/* Sections */
section { padding-block: clamp(64px, 10vw, 120px); }
h2 { font-size: clamp(34px, 5vw, 56px); line-height: 1.02; letter-spacing: -.04em; margin: 0 0 40px; font-weight: 850; text-wrap: balance; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 0; margin: 0; list-style: none; }
.step {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; min-height: 280px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.step:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -36px rgba(22,46,40,.45); }
.step .num { font-size: 15px; font-weight: 800; color: var(--muted); letter-spacing: .08em; }
.step svg { width: 100%; height: 130px; margin-block: 8px; }
.step h3 { margin: 0; font-size: 24px; letter-spacing: -.025em; line-height: 1.15; }

/* Step illustrations */
.ill-start .ring { fill: none; stroke: var(--lagoon); stroke-width: 3; transform-origin: 100px 65px; animation: ripple 2.4s ease-out infinite; }
.ill-start .ring.b { animation-delay: 1.2s; }
.ill-start .btn { fill: var(--energy); }
.ill-start .tri { fill: var(--energy-ink); }
.ill-loop .street { stroke: var(--line); stroke-width: 10; stroke-linecap: round; fill: none; }
.ill-loop .path { fill: none; stroke: var(--route); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 420; stroke-dashoffset: 420; animation: loop-draw 4s var(--ease) infinite; }
.ill-loop .fill { fill: var(--lagoon); opacity: 0; animation: loop-fill 4s var(--ease) infinite; }
.ill-swap rect { rx: 5; animation: swap 4s var(--ease) infinite; }

/* Season */
.season { background: var(--deep); color: var(--on-deep); border-radius: 36px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 32px; padding: clamp(28px, 5vw, 56px); }
.season h2 { margin-bottom: 18px; }
.season p { color: var(--on-deep-muted); margin: 0; font-size: 19px; max-width: 30ch; }
.month-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.month-grid i { aspect-ratio: 1; border-radius: 6px; background: rgba(255,255,255,.08); animation: month 7s var(--ease) infinite; }
.features { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.feature:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -34px rgba(22,46,40,.45); }
.feature .icon {
  display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px;
  border-radius: 14px; background: color-mix(in srgb, var(--lagoon) 18%, transparent); color: var(--route);
}
.feature .icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.02em; line-height: 1.2; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }
@media (prefers-color-scheme: dark) { .feature .icon { color: var(--lagoon-soft); } }

/* Beta form */
.beta {
  position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(100% 120% at 0% 0%, #1F5A47, var(--deep) 60%);
  color: var(--on-deep); border-radius: 36px;
  padding: clamp(28px, 6vw, 72px);
}
.beta::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; z-index: -1;
  border: 18px solid rgba(142,209,176,.18); border-radius: 46% 54% 42% 58%;
  animation: spin 18s linear infinite;
}
.beta h2 { margin-bottom: 10px; }
.beta .sub { color: var(--on-deep-muted); margin: 0 0 28px; font-size: 19px; }
form { display: grid; gap: 16px; max-width: 720px; }
.row { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
input[type=email], select {
  width: 100%; min-height: 56px; padding: 0 18px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  background: rgba(255,255,255,.08); color: var(--on-deep);
  font: 400 17px var(--font);
  transition: border-color .2s, background .2s;
}
input[type=email]::placeholder { color: var(--on-deep-muted); }
input[type=email]:focus, select:focus { background: rgba(255,255,255,.14); border-color: var(--mint); outline: none; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--on-deep-muted) 50%), linear-gradient(135deg, var(--on-deep-muted) 50%, transparent 50%); background-position: right 22px center, right 16px center; background-size: 6px 6px; background-repeat: no-repeat; }
select option { color: #162E28; }
.platform { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.platform legend { padding: 0; margin-bottom: 10px; font-size: 15px; color: var(--on-deep-muted); }
.platform .seg { display: flex; flex-wrap: wrap; gap: 10px; }
.platform label { position: relative; }
.platform input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.platform span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: var(--on-deep);
  font-weight: 650; transition: background .2s, border-color .2s, color .2s;
}
.platform input:checked + span { background: var(--mint); border-color: var(--mint); color: #102B22; }
.platform input:focus-visible + span { outline: 2px solid var(--mint); outline-offset: 3px; }
.platform small { font-size: 14px; color: var(--on-deep-muted); }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 15px; color: var(--on-deep-muted); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--mint); }
.check a { color: var(--on-deep); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: #FFC2CB; font-weight: 650; margin: 0; }
.done { display: none; }
.done h3 { font-size: 28px; letter-spacing: -.03em; margin: 0 0 6px; }
.done p { margin: 0; color: var(--on-deep-muted); }
.done a { color: var(--on-deep); }
form[data-state=sent] > :not(.done) { display: none; }
form[data-state=sent] .done { display: block; animation: pop .6s var(--ease) both; }

/* Support & simple pages */
.page-head { padding-block: 24px 8px; }
.page-head h1 { font-size: clamp(40px, 6vw, 64px); }
.page-head .lead { color: var(--muted); max-width: 46ch; }
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 0 22px; transition: box-shadow .25s; }
.faq details[open] { box-shadow: 0 20px 40px -30px rgba(22,46,40,.4); }
.faq summary { cursor: pointer; padding: 20px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 24px; line-height: 1; transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 20px; color: var(--muted); }

/* Footer */
footer { padding-block: 32px 48px; color: var(--muted); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
footer a { color: var(--muted); }

/* Scroll motion (only when JS is on) */
.js [data-reveal] {
  opacity: 0; transform: translateY(48px) scale(.97); filter: blur(8px);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease), filter 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].in { opacity: 1; transform: none; filter: none; }
/* Headings rise word by word. */
.js [data-split] .w { display: inline-block; opacity: 0; transform: translateY(.45em) rotate(2deg); filter: blur(6px); transition: opacity .8s var(--ease), transform .9s var(--ease), filter .8s var(--ease); transition-delay: calc(var(--i) * 70ms); }
.js [data-split].in .w { opacity: 1; transform: none; filter: none; }
/* Hero leaves the screen: text lifts, map card flattens and grows (driven by --hp, 0…1). */
.js .hero .hero-copy { transform: translateY(calc(var(--hp, 0) * -80px)); opacity: calc(1 - var(--hp, 0) * 1.4); }
.js .hero-scene .card3d {
  transform: rotateX(calc(8deg * (1 - var(--hp, 0) * 1.6))) rotateY(calc(-10deg * (1 - var(--hp, 0) * 1.6))) rotateZ(calc(1deg * (1 - var(--hp, 0)))) scale(calc(1 + var(--hp, 0) * .12));
  transition: none;
}
/* Season title fills with light as it scrolls through (--fill, 0…100%). */
.js .fill-text {
  color: transparent;
  background: linear-gradient(90deg, var(--on-deep) var(--fill, 0%), rgba(241,246,235,.22) calc(var(--fill, 0%) + 8%));
  -webkit-background-clip: text; background-clip: text;
}
/* Sections drift at a slightly different speed (--py set per element). */
.js [data-parallax] { translate: 0 var(--py, 0px); }

@keyframes grid-drift { to { transform: translate(44px, 44px); } }
@keyframes cell-blink { 0%, 100% { opacity: 0; transform: scale(.8); } 20%, 45% { opacity: .35; transform: scale(1); } 70% { opacity: 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(142,209,176,.6); } 50% { box-shadow: 0 0 0 7px rgba(142,209,176,0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes ripple { from { opacity: .9; transform: scale(.6); } to { opacity: 0; transform: scale(1.5); } }
@keyframes loop-draw { 0% { stroke-dashoffset: 420; } 55%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes loop-fill { 0%, 50% { opacity: 0; } 62%, 85% { opacity: .45; } 100% { opacity: 0; } }
@keyframes swap { 0%, 40% { fill: var(--warm); } 50%, 90% { fill: var(--lagoon); } 100% { fill: var(--warm); } }
@keyframes month { 0% { background: rgba(255,255,255,.08); } 12% { background: rgba(255,255,255,.08); } 22%, 72% { background: var(--lagoon); } 82%, 100% { background: rgba(255,255,255,.08); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); } }

@media (max-width: 860px) {
  .hero { padding-top: 88px; min-height: auto; }
  .hero .wrap, .season { grid-template-columns: 1fr; }
  .hero-scene { margin-top: 8px; }
  .tag.one { left: 0; }
  .tag.two { right: 0; }
  .steps { grid-template-columns: 1fr; }
  .features { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .feature { padding: 18px 16px; }
  .feature h3 { font-size: 17px; }
  .step { min-height: 0; }
  .row { grid-template-columns: 1fr; }
  .top nav a:not(.keep) { display: none; }
  .scroll-cue { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  h1 .hl path { stroke-dashoffset: 0; }
  .ill-loop .path { stroke-dashoffset: 0; }
  .ill-loop .fill { opacity: .45; }
  .ill-swap rect:nth-child(odd) { fill: var(--lagoon); }
  .ill-swap rect:nth-child(even) { fill: var(--warm); }
  .month-grid i:nth-child(-n+20) { background: var(--lagoon); }
  .js [data-reveal], .js [data-split] .w { opacity: 1; transform: none; filter: none; }
  .js .hero .hero-copy { transform: none; opacity: 1; }
  .hero-scene .card3d, .js .hero-scene .card3d { transform: none; }
  .js .fill-text { color: inherit; background: none; }
  .js [data-parallax] { translate: none; }
}
