/* Loop Orbit landing page. Colors mirror src/styles/tokens.css in the app. */
:root {
  --c-bg: #070B2E;
  --c-surface: #0E1650;
  --c-surface-2: #16206A;
  --c-surface-3: #1E2A85;
  --c-border: #2A4BD8;
  --c-border-glow: #3D7BFF;
  --c-divider: rgba(120, 150, 255, 0.18);
  --c-text: #FFFFFF;
  --c-text-2: #C3CCFF;
  --c-text-3: #8592D6;
  --c-accent: #FFC93C;
  --c-on-light: #121A55;
  --c-primary: #1F6BFF;
  --c-primary-hi: #4D8DFF;
  --c-primary-lo: #1446C8;
  --c-success: #22C55E;
  --c-success-hi: #4BE37F;
  --c-success-lo: #119B42;
  --c-purple: #8B3DF0;
  --c-collect: #F5A90E;
  --c-danger-hi: #FF6680;
  --c-star: #FFC21A;
  --c-cyan: #3BE3FF;
  --c-tile: #2A3366;
  --c-tile-edge: #1A2150;

  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow-glow: 0 0 0 1px var(--c-border), 0 10px 40px rgba(31, 107, 255, 0.25);
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary-hi); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--c-surface); padding: 8px 14px; border-radius: var(--r-sm); }

:focus-visible { outline: 3px solid var(--c-cyan); outline-offset: 3px; border-radius: 6px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 11, 46, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-divider);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.nav-logo img { height: 44px; width: auto; }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--c-text-2); text-decoration: none; font-weight: 700; font-size: 15px; }
.nav-links a:hover { color: var(--c-text); }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  color: var(--c-text); text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-play {
  background: linear-gradient(180deg, var(--c-success-hi), var(--c-success-lo));
  color: var(--c-on-light);
  box-shadow: 0 6px 0 #0B6E2F, 0 12px 30px rgba(34, 197, 94, 0.35);
}
.btn-ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--c-border); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn svg { width: 22px; height: 22px; flex: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 110px);
  background:
    radial-gradient(ellipse at 70% 40%, rgba(31, 107, 255, 0.35), transparent 60%),
    linear-gradient(180deg, rgba(7, 11, 46, 0.35), var(--c-bg) 96%),
    url('assets/bg1-main.webp') center / cover no-repeat;
  overflow: hidden;
}
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 40px; }
.hero-logo { width: min(340px, 100%); margin: 0 0 4px -10px; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 14px; color: var(--c-accent);
}
.hero h1 { font-size: clamp(32px, 4.6vw, 52px); margin: 10px 0 16px; }
.hero h1 .hl { color: var(--c-cyan); }
.hero-sub { color: var(--c-text-2); font-size: clamp(17px, 2vw, 20px); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 26px; color: var(--c-text-3); font-size: 15px; font-weight: 700; }
.hero-meta span::before { content: '✦ '; color: var(--c-accent); }
.hero-robot { justify-self: center; width: min(340px, 80%); filter: drop-shadow(0 20px 50px rgba(59, 227, 255, 0.35)); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-14px); } }
@media (prefers-reduced-motion: reduce) { .hero-robot { animation: none; } }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero-logo { margin: 0 auto 8px; }
  .hero-sub { margin: 0 auto; }
  .hero-cta, .hero-meta { justify-content: center; }
  .hero-robot { display: none; }
  .hero-logo { width: min(280px, 85%); }
}

/* ---------- Sections ---------- */
section { padding: clamp(64px, 9vw, 110px) 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); margin: 8px 0 14px; }
.section-head p { color: var(--c-text-2); }
.alt { background: linear-gradient(180deg, var(--c-bg), var(--c-surface) 50%, var(--c-bg)); }

.card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-glow);
  padding: 28px;
}

/* ---------- Demo ---------- */
.demo { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .demo { grid-template-columns: 1fr; } }
.objective { display: flex; align-items: center; gap: 12px; color: var(--c-text-2); font-weight: 700; margin-bottom: 18px; }
.objective strong { color: var(--c-accent); }
.objective .star { color: var(--c-star); font-size: 22px; }

.board {
  --cell: min(76px, calc((100vw - 2 * var(--gutter) - 90px) / 5));
  position: relative;
  display: grid; grid-template-columns: repeat(5, var(--cell)); grid-auto-rows: var(--cell);
  gap: 6px; padding: 12px; width: max-content; margin: 0 auto;
  background: #3A3470; border-radius: var(--r-md);
}
.tile { background: var(--c-tile); border-radius: 10px; box-shadow: inset 0 -4px 0 var(--c-tile-edge); display: grid; place-items: center; font-size: calc(var(--cell) * 0.42); }
.tile.start { box-shadow: inset 0 0 0 3px var(--c-cyan), inset 0 -4px 0 var(--c-tile-edge); }
.tile.goal { background: #1B5E3A; box-shadow: inset 0 0 0 3px var(--c-success-hi), 0 0 18px rgba(75, 227, 127, 0.45); }
.tile.rock { background: #241B4F; }
.crystal { width: 46%; height: 62%; background: linear-gradient(160deg, #9FF3FF, var(--c-cyan) 45%, #1F6BFF); clip-path: polygon(50% 0, 100% 35%, 50% 100%, 0 35%); filter: drop-shadow(0 0 6px var(--c-cyan)); transition: transform 0.3s, opacity 0.3s; }
.crystal.taken { transform: scale(0) translateY(-20px); opacity: 0; }

.probe {
  position: absolute; left: 12px; top: 12px;
  width: var(--cell); height: var(--cell);
  display: grid; place-items: center;
  transition: transform 0.38s ease-in-out;
  pointer-events: none;
}
.probe img { width: 82%; }
.probe .dir {
  position: absolute; inset: 0; transition: transform 0.3s ease;
}
.probe .dir::after {
  content: ''; position: absolute; right: -4px; top: 50%; margin-top: -8px;
  border: 8px solid transparent; border-left: 11px solid var(--c-accent);
  filter: drop-shadow(0 0 3px rgba(255, 201, 60, 0.8));
}
.probe.bump { animation: bump 0.3s; }
@keyframes bump { 30% { opacity: 0.4; } }

.status { min-height: 52px; margin-top: 16px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--c-surface-2); color: var(--c-text-2); font-weight: 700; text-align: center; }
.status.ok { background: rgba(34, 197, 94, 0.18); color: var(--c-success-hi); }
.status.fail { background: rgba(233, 20, 58, 0.18); color: var(--c-danger-hi); }
.stars { color: var(--c-star); letter-spacing: 2px; }

.panel h3 { font-size: 18px; color: var(--c-text-2); margin-bottom: 12px; }
.palette { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.block {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 14px;
  border: 0; border-radius: 12px;
  font: 600 16px var(--font-display); color: #fff; text-align: left;
  cursor: pointer; transition: transform 0.12s ease, opacity 0.2s;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25);
}
.block:hover { transform: translateY(-1px); }
.block svg { width: 20px; height: 20px; flex: none; }
.b-move { background: var(--c-primary); }
.b-left, .b-right { background: var(--c-purple); }
.b-collect { background: var(--c-collect); color: var(--c-on-light); }
.b-repeat { background: var(--c-success); color: var(--c-on-light); }

.program {
  min-height: 160px; padding: 10px; border-radius: var(--r-md);
  background: var(--c-bg); box-shadow: inset 0 0 0 2px var(--c-divider);
  display: flex; flex-direction: column; gap: 6px; list-style: none; margin: 0;
}
.program .block { width: 100%; min-height: 40px; font-size: 15px; }
.program .block.active { outline: 3px solid var(--c-cyan); outline-offset: 1px; }
.program .block.error { outline: 3px solid var(--c-danger-hi); outline-offset: 1px; }
.program .num { opacity: 0.7; font-size: 13px; width: 18px; }
.program .x { margin-left: auto; opacity: 0.7; font-size: 18px; }
.program-empty { color: var(--c-text-3); text-align: center; margin: auto; font-size: 15px; padding: 20px; }
.prog-head { display: flex; justify-content: space-between; align-items: baseline; }
.prog-head small { color: var(--c-text-3); font-weight: 700; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.controls .btn-play { flex: 1; box-shadow: 0 5px 0 #0B6E2F; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: s; list-style: none; padding: 0; margin: 0; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.steps li { padding: 24px 22px; }
.steps li::before {
  counter-increment: s; content: counter(s);
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(180deg, var(--c-primary-hi), var(--c-primary-lo));
  font: 600 19px var(--font-display); margin-bottom: 14px;
}
.steps h3 { font-size: 20px; margin-bottom: 6px; }
.steps p { color: var(--c-text-2); font-size: 15px; }

/* ---------- Blocks showcase ---------- */
.blocks-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.blocks-row .block { cursor: default; min-height: 56px; font-size: 18px; padding: 0 20px; }
.blocks-row .block:hover { transform: none; }
.blocks-note { text-align: center; color: var(--c-text-3); margin-top: 22px; font-size: 15px; }

/* ---------- Worlds ---------- */
.worlds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .worlds { grid-template-columns: 1fr; } }
.world { position: relative; overflow: hidden; padding: 30px; display: flex; flex-direction: column; gap: 10px; }
.world .badge { align-self: flex-start; font: 600 13px var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; }
.world h3 { font-size: 26px; }
.world p { color: var(--c-text-2); }
.world ul { margin: 6px 0 0; padding-left: 20px; color: var(--c-text-2); font-size: 15px; }
.world .levels { margin-top: auto; padding-top: 14px; font-weight: 800; color: var(--c-text-3); font-size: 14px; }
.w1 .badge { background: var(--c-success); color: var(--c-on-light); }
.w2 .badge { background: var(--c-primary); }
.w1 { box-shadow: 0 0 0 1px var(--c-success), 0 10px 40px rgba(34, 197, 94, 0.18); }
.wsoon { background: var(--c-surface) url('assets/bg2-planet.webp') center / cover; box-shadow: 0 0 0 1px var(--c-divider); }
.wsoon::before { content: ''; position: absolute; inset: 0; background: rgba(7, 11, 46, 0.78); }
.wsoon > * { position: relative; }
.wsoon .badge { background: var(--c-surface-3); color: var(--c-text-2); }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 26px; }
.feature .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--c-surface-3); color: var(--c-cyan); margin-bottom: 14px; }
.feature .ic svg { width: 24px; height: 24px; }
.feature h3 { font-size: 20px; margin-bottom: 6px; }
.feature p { color: var(--c-text-2); font-size: 15px; }

/* ---------- Privacy band ---------- */
.band { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; padding: 40px; }
.band img { width: 180px; }
.band h2 { font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 12px; }
.band p { color: var(--c-text-2); margin-bottom: 10px; }
@media (max-width: 700px) { .band { grid-template-columns: 1fr; text-align: center; padding: 28px 22px; } .band img { margin: 0 auto; width: 130px; } }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq details { background: var(--c-surface); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--c-divider); }
.faq summary { cursor: pointer; padding: 18px 22px; font: 600 18px var(--font-display); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--c-accent); font-size: 24px; line-height: 1; transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 22px 20px; color: var(--c-text-2); }

/* ---------- CTA ---------- */
.final { text-align: center; }
.final img { width: 200px; margin: 0 auto 20px; }
.final h2 { font-size: clamp(30px, 4.6vw, 48px); margin-bottom: 14px; }
.final p { color: var(--c-text-2); margin-bottom: 28px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--c-divider); padding: 36px 0 calc(36px + env(safe-area-inset-bottom)); color: var(--c-text-3); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
footer a { color: var(--c-text-2); text-decoration: none; }
footer a:hover { color: var(--c-text); text-decoration: underline; }

/* ---------- Legal pages ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 56px var(--gutter) 80px; }
.legal h1 { font-size: clamp(30px, 4vw, 40px); margin-bottom: 18px; }
.legal h2 { font-size: 24px; margin: 38px 0 12px; }
.legal h3 { font-size: 19px; margin: 26px 0 10px; color: var(--c-text-2); }
.legal p, .legal li { color: var(--c-text-2); }
.legal p { margin-bottom: 14px; }
.legal ul { padding-left: 22px; margin: 0 0 14px; }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--c-text); }
.legal code { background: var(--c-surface-2); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }
.back { display: inline-block; margin-bottom: 24px; font-weight: 700; text-decoration: none; }
.rockball { width: 62%; height: 56%; border-radius: 46% 54% 50% 50%; background: radial-gradient(circle at 35% 30%, #7A6CC4, #3A3070 70%); box-shadow: inset -4px -5px 0 rgba(0, 0, 0, 0.25); }
.legal mark { background: rgba(255, 201, 60, 0.2); color: var(--c-accent); padding: 0 4px; border-radius: 4px; }
