/* ============================================================
   Ringo Spinner — design tokens
   ============================================================ */
:root {
  --void: #050a16;
  --deep: #081128;
  --panel: #0d1a33;
  --panel-2: #112441;
  --edge: #1c3559;
  --edge-soft: #16294a;

  --teal: #2ee6c5;
  --cyan: #4cc2ff;
  --mint: #a7f3d0;
  --violet: #b18cff;
  --rose: #ff8fab;

  --ink: #e8f3ff;
  --dim: #8ba4c6;
  --dimmer: #5d7398;

  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;

  --radius: 18px;
  --shell: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--void);
  overflow-x: hidden;
  background-image:
    radial-gradient(900px 620px at 78% -8%, rgba(46, 230, 197, 0.12), transparent 62%),
    radial-gradient(760px 520px at 6% 12%, rgba(76, 194, 255, 0.10), transparent 60%),
    radial-gradient(1100px 700px at 50% 108%, rgba(177, 140, 255, 0.09), transparent 65%);
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

a { color: var(--teal); }

::selection { background: rgba(46, 230, 197, 0.28); }

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

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.7rem;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.btn-go {
  color: #04211d;
  background: linear-gradient(135deg, var(--mint) 0%, var(--teal) 48%, var(--cyan) 100%);
  box-shadow: 0 10px 30px rgba(46, 230, 197, 0.22);
}
.btn-go:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(46, 230, 197, 0.32); }
.btn-go:active { transform: translateY(0); }

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--edge);
}
.btn-ghost:hover { background: rgba(76, 194, 255, 0.10); border-color: var(--cyan); }

.btn-small { font-size: 0.9rem; padding: 0.55rem 1.15rem; }
.btn-block { width: 100%; }

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 2.6rem);
  background: rgba(5, 10, 22, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--edge-soft);
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; animation: spin-slow 22s linear infinite; }
.brand-name {
  font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.03em;
}
.brand-name em { font-style: normal; color: var(--teal); }

.topnav { display: flex; align-items: center; gap: clamp(0.7rem, 2vw, 1.6rem); }
.topnav a:not(.btn) {
  color: var(--dim); text-decoration: none; font-size: 0.92rem; font-weight: 500;
  transition: color 0.15s ease;
}
.topnav a:not(.btn):hover { color: var(--ink); }

@media (max-width: 720px) {
  .topnav a:not(.btn) { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1.1rem, 4vw, 2.6rem) clamp(2rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--teal);
  background: rgba(46, 230, 197, 0.08);
  border: 1px solid rgba(46, 230, 197, 0.24);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1.4rem;
}
.dot-pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 0 0 rgba(46, 230, 197, 0.6);
  animation: pulse 2.2s ease-out infinite;
}

.hero h1 {
  font-size: clamp(2.4rem, 6.2vw, 4.2rem);
  margin-bottom: 1.2rem;
}
.hero h1 .hl {
  background: linear-gradient(100deg, var(--teal), var(--cyan) 55%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.hero-sub { font-size: clamp(1.02rem, 2vw, 1.18rem); color: var(--dim); max-width: 34rem; }

.hero-flat {
  margin-top: 1.1rem;
  font-size: 0.98rem;
  color: var(--dim);
  max-width: 34rem;
  border-left: 2px solid var(--teal);
  padding-left: 1rem;
}
.hero-flat strong { color: var(--ink); display: block; font-weight: 600; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.8rem 0 1.4rem; }

.hero-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hero-tags li {
  font-size: 0.78rem; font-weight: 500; color: var(--dim);
  border: 1px solid var(--edge); border-radius: 999px;
  padding: 0.28rem 0.75rem;
}
.hero-tags li::before { content: "✓ "; color: var(--teal); }

/* --- orbital art --- */
.hero-stage { display: flex; align-items: center; justify-content: center; }
.orbit-art {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1 / 1;
}
.orb-ring, .orb-spin, .orb-core {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  border-radius: 50%;
}
.orb-ring { border: 1px solid var(--edge); }
.orb-ring.r1 { width: 100%; height: 100%; border-color: rgba(76, 194, 255, 0.16); }
.orb-ring.r2 { width: 76%; height: 76%; border-color: rgba(46, 230, 197, 0.22); border-style: dashed; }
.orb-ring.r3 { width: 52%; height: 52%; border-color: rgba(177, 140, 255, 0.24); }
.orb-ring.r4 { width: 28%; height: 28%; border-color: rgba(167, 243, 208, 0.30); }

.orb-spin { width: 100%; height: 100%; }
.orb-spin i {
  position: absolute; top: -7px; left: 50%; margin-left: -7px;
  width: 14px; height: 14px; border-radius: 50%; display: block;
}
.pip-teal { background: var(--teal); box-shadow: 0 0 18px var(--teal); }
.pip-cyan { background: var(--cyan); box-shadow: 0 0 18px var(--cyan); }
.pip-violet { background: var(--violet); box-shadow: 0 0 18px var(--violet); }
.pip-rose { background: var(--rose); box-shadow: 0 0 18px var(--rose); }

.orb-spin.s1 { animation: spin-slow 14s linear infinite; }
.orb-spin.s2 { width: 76%; height: 76%; animation: spin-rev 10s linear infinite; }
.orb-spin.s3 { width: 52%; height: 52%; animation: spin-slow 7s linear infinite; }
.orb-spin.s4 { width: 28%; height: 28%; animation: spin-rev 4.5s linear infinite; }

.orb-core {
  width: 12%; height: 12%;
  background: radial-gradient(circle, var(--mint), var(--teal) 60%, transparent 72%);
  box-shadow: 0 0 50px rgba(46, 230, 197, 0.5);
}

@keyframes spin-slow { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes spin-rev { to { transform: translate(-50%, -50%) rotate(-360deg); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 230, 197, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(46, 230, 197, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 230, 197, 0); }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.2rem; }
  .hero-stage { order: -1; }
  .orbit-art { width: min(78%, 300px); }
}

/* ============================================================
   Section rule
   ============================================================ */
.rule {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 4vw, 2.6rem);
  display: flex; align-items: center; gap: 1rem;
  color: var(--edge);
}
.rule span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--edge), transparent); }
.rule svg { width: 22px; height: 22px; flex: none; }

/* ============================================================
   Play section
   ============================================================ */
.play {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(2.6rem, 6vw, 4.5rem) clamp(1.1rem, 4vw, 2.6rem);
  scroll-margin-top: 70px;
}

.play-head { max-width: 40rem; margin-bottom: 1.8rem; }
.play-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 0.7rem; }
.play-head p { color: var(--dim); }

/* --- tabs --- */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}
.tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem;
  font-family: var(--body);
  text-align: left;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--edge-soft);
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.tab:hover { border-color: var(--edge); transform: translateY(-2px); color: var(--ink); }
.tab-num { font-family: var(--display); font-size: 0.7rem; letter-spacing: 0.12em; color: var(--dimmer); }
.tab-name { font-family: var(--display); font-weight: 600; font-size: 1rem; color: inherit; line-height: 1.25; }
.tab-hint { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--dimmer); }

.tab.is-active {
  color: var(--ink);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border-color: var(--teal);
  box-shadow: 0 0 0 1px rgba(46, 230, 197, 0.25), 0 10px 30px rgba(46, 230, 197, 0.10);
}
.tab.is-active .tab-num { color: var(--teal); }
.tab.is-active .tab-hint { color: var(--dim); }

@media (max-width: 720px) {
  .tabs { grid-template-columns: repeat(2, 1fr); }
}

/* --- board --- */
.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1rem;
  align-items: start;
}

.board-canvas {
  background: linear-gradient(170deg, var(--panel-2), var(--deep));
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 0.7rem;
  box-shadow: inset 0 0 80px rgba(76, 194, 255, 0.05);
}
#stage {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 12px;
  background: #060d1e;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}
#stage:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }

.board-side {
  display: flex; flex-direction: column; gap: 0.8rem;
  background: var(--panel);
  border: 1px solid var(--edge-soft);
  border-radius: var(--radius);
  padding: 1.1rem;
}
.side-title h3 { font-size: 1.3rem; margin-bottom: 0.35rem; }
.side-title p { font-size: 0.9rem; color: var(--dim); line-height: 1.5; }

.hud { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.hud-cell {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--edge-soft);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
}
.hud-label {
  display: block; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dimmer); margin-bottom: 0.15rem;
}
.hud-value { font-family: var(--display); font-weight: 700; font-size: 1.55rem; line-height: 1; }
.hud-best .hud-value { color: var(--teal); }

.controls {
  border-top: 1px dashed var(--edge-soft);
  border-bottom: 1px dashed var(--edge-soft);
  padding: 0.75rem 0;
}
.controls-label {
  display: block; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dimmer); margin-bottom: 0.35rem;
}
.controls p { font-size: 0.88rem; color: var(--dim); line-height: 1.7; }
kbd {
  font-family: var(--display); font-size: 0.8rem; font-weight: 600;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--edge);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

.side-note { font-size: 0.78rem; color: var(--dimmer); line-height: 1.5; }

.board-foot {
  margin-top: 1.1rem;
  font-size: 0.9rem;
  color: var(--dimmer);
  max-width: 44rem;
}

@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
  .hud { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   How it works
   ============================================================ */
.how {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(2.2rem, 5vw, 4rem) clamp(1.1rem, 4vw, 2.6rem);
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(1.6rem, 5vw, 4rem);
  scroll-margin-top: 70px;
}
.how-intro { position: sticky; top: 90px; align-self: start; }
.how-intro h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 0.6rem; }
.how-intro p { color: var(--dim); }

.how-rail { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.how-rail li {
  display: grid; grid-template-columns: 46px 1fr; gap: 1rem; align-items: start;
  background: linear-gradient(150deg, var(--panel), rgba(13, 26, 51, 0.4));
  border: 1px solid var(--edge-soft);
  border-radius: var(--radius);
  padding: 1.2rem;
}
.how-num {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  font-family: var(--display); font-weight: 700; font-size: 1.1rem;
  color: var(--teal);
  border: 1px solid rgba(46, 230, 197, 0.4);
  background: rgba(46, 230, 197, 0.06);
}
.how-rail h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.how-rail p { font-size: 0.93rem; color: var(--dim); }

@media (max-width: 860px) {
  .how { grid-template-columns: 1fr; }
  .how-intro { position: static; }
}

/* ============================================================
   Features
   ============================================================ */
.features {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 4vw, 2.6rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
}
.feat {
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--edge-soft);
  border-radius: 14px;
  padding: 1.2rem 0.7rem;
}
.feat strong {
  display: block;
  font-family: var(--display); font-weight: 700; font-size: 2.1rem; line-height: 1;
  background: linear-gradient(140deg, var(--teal), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 0.35rem;
}
.feat span { font-size: 0.82rem; color: var(--dim); }

@media (max-width: 700px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   FAQ
   ============================================================ */
.faq {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(2.6rem, 6vw, 4.5rem) clamp(1.1rem, 4vw, 2.6rem);
  scroll-margin-top: 70px;
}
.faq h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 1.4rem; }
.faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }

.faq details {
  background: var(--panel);
  border: 1px solid var(--edge-soft);
  border-radius: 14px;
  padding: 0.95rem 1.2rem;
  transition: border-color 0.15s ease;
}
.faq details[open] { border-color: var(--edge); }
.faq summary {
  font-family: var(--display); font-weight: 600; font-size: 1.02rem;
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--teal);
  transition: box-shadow 0.2s ease;
}
.faq details[open] summary::after { box-shadow: inset 0 0 0 5px var(--teal); }
.faq details p { margin-top: 0.6rem; font-size: 0.93rem; color: var(--dim); }

@media (max-width: 780px) {
  .faq-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Legal pages
   ============================================================ */
.legal {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(2.2rem, 6vw, 4rem) clamp(1.1rem, 4vw, 2.6rem) 3rem;
}
.legal h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin-bottom: 0.4rem; }
.legal-updated {
  font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dimmer); margin-bottom: 2rem;
}
.legal h2 {
  font-size: 1.2rem;
  margin: 2.1rem 0 0.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--edge-soft);
  color: var(--ink);
}
.legal h2:first-of-type { border-top: 0; padding-top: 0; }
.legal p, .legal li { color: var(--dim); }
.legal p + p { margin-top: 0.8rem; }
.legal ul { margin: 0.7rem 0 0 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  color: var(--mint);
  background: rgba(46, 230, 197, 0.07);
  border: 1px solid var(--edge-soft);
  border-radius: 5px;
  padding: 0.05em 0.35em;
  white-space: nowrap;
}
.legal .lede {
  font-size: 1.05rem;
  border-left: 2px solid var(--teal);
  padding-left: 1rem;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--edge-soft);
  background: rgba(5, 10, 22, 0.6);
  text-align: center;
  padding: 2.5rem clamp(1.1rem, 4vw, 2.6rem) 2.2rem;
}
.footer-brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--display); font-weight: 700; font-size: 1.1rem;
  margin-bottom: 0.8rem;
}
.footer-brand em { font-style: normal; color: var(--teal); }
.footer > p { max-width: 40rem; margin: 0 auto; font-size: 0.9rem; color: var(--dim); }
.footer-links { margin: 1.2rem 0 0.9rem; font-size: 0.9rem; color: var(--dimmer); }
.footer-links a { color: var(--dim); text-decoration: none; }
.footer-links a:hover { color: var(--teal); text-decoration: underline; }
.footer-copy { font-size: 0.78rem; color: var(--dimmer); }

/* ============================================================
   Motion preferences
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .brand-mark, .orb-spin, .dot-pulse { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}
