/* ============================================================
   LUMORA — Design tokens
   ============================================================ */
:root {
  /* Color */
  --bg:              #14102B;
  --surface:         #1F1A40;
  --surface-hi:      #2C2459;
  --line:            #352C66;

  --text-primary:    #F5F3FF;
  --text-secondary:  #A79FC9;
  --text-muted:      #756C99;

  --gem-violet:      #9B7CFF;
  --gem-coral:       #FF6B5E;
  --gem-citrine:     #FFC857;
  --gem-teal:        #36D6C4;

  --gem-violet-dim:  #4C3F94;
  --gem-coral-dim:   #7A3530;
  --gem-citrine-dim: #7A6228;
  --gem-teal-dim:    #1B6B61;

  /* Type */
  --font-display: "Unbounded", "Segoe UI", sans-serif;
  --font-body:    "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", monospace;

  /* Layout */
  --max-w: 1120px;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 18% 10%, rgba(155,124,255,0.16), transparent 45%),
    radial-gradient(circle at 85% 30%, rgba(54,214,196,0.10), transparent 40%);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

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

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(20, 16, 43, 0.78);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gem-violet), var(--gem-teal));
  display: inline-block;
  transform: rotate(8deg);
}

.site-nav {
  display: flex;
  gap: 28px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.site-nav a:hover { color: var(--text-primary); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  margin-right: 4px;
}

.lang-switch a {
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.lang-switch a.active {
  color: var(--bg);
  background: var(--gem-teal);
  font-weight: 600;
}

.lang-switch a:hover:not(.active) { color: var(--text-primary); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-lang {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-lang a { color: var(--text-secondary); }
.footer-lang a.active { color: var(--gem-teal); }
.footer-lang a:hover:not(.active) { color: var(--text-primary); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 11px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gem-violet), #7C5CFF);
  color: var(--text-primary);
  box-shadow: 0 8px 24px -8px rgba(155,124,255,0.65);
}
.btn-primary:hover { transform: translateY(-1px); }

.btn-ghost {
  background: var(--surface-hi);
  color: var(--text-primary);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--line); }

.btn-disabled {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px dashed var(--line);
  cursor: default;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 88px 0 64px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gem-teal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--gem-teal);
  transform: rotate(45deg);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  line-height: 1.06;
  margin: 0 0 22px;
  letter-spacing: -0.01em;
}

.hero h1 .accent { color: var(--gem-citrine); }

.hero p.lead {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Gem board — signature element */
.board-stage {
  position: relative;
  display: flex;
  justify-content: center;
}

.board-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 30px 60px -24px rgba(0,0,0,0.55);
}

.board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 8px;
  width: min(360px, 80vw);
  height: min(360px, 80vw);
}

.gem {
  border-radius: 10px;
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), opacity 0.35s ease, background 0.35s ease;
  will-change: transform, opacity;
}

.gem.swap-a { transform: translateX(var(--dx, 0)) translateY(var(--dy, 0)); z-index: 2; }
.gem.swap-b { transform: translateX(calc(var(--dx, 0) * -1)) translateY(calc(var(--dy, 0) * -1)); z-index: 2; }
.gem.matched { transform: scale(0.15); opacity: 0; }

.board-caption {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 12px;
  letter-spacing: 0.06em;
}

@media (prefers-reduced-motion: reduce) {
  .gem { transition: none !important; }
}

/* ============================================================
   Modes
   ============================================================ */
.section { padding: 88px 0; }
.section-head { max-width: 620px; margin-bottom: 48px; }

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gem-coral);
  margin-bottom: 12px;
  display: block;
}

.section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.section-head p {
  color: var(--text-secondary);
  font-size: 1.02rem;
  margin: 0;
}

.modes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.mode-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.mode-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.35;
}

.mode-card.mode-classic::before { background: var(--gem-violet); }
.mode-card.mode-time::before { background: var(--gem-coral); }

.mode-stat {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 18px;
  position: relative;
}

.mode-stat strong {
  font-size: 1.6rem;
  color: var(--text-primary);
  font-weight: 700;
  display: block;
  font-family: var(--font-display);
  margin-bottom: 2px;
}

.mode-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 10px;
  font-weight: 600;
  position: relative;
}

.mode-card p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.96rem;
  position: relative;
}

/* ============================================================
   Features — gem tiles encode content
   ============================================================ */
.features-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.feature-tile {
  border-radius: var(--radius-md);
  padding: 26px 22px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
}

.feature-tile .gem-dot {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  margin-bottom: auto;
}

.feature-tile h4 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  margin: 14px 0 6px;
  font-weight: 600;
  color: var(--text-primary);
}

.feature-tile p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
}

.feature-tile.tile-violet { background: linear-gradient(160deg, rgba(155,124,255,0.14), var(--surface)); }
.feature-tile.tile-violet .gem-dot { background: var(--gem-violet); }

.feature-tile.tile-coral { background: linear-gradient(160deg, rgba(255,107,94,0.14), var(--surface)); }
.feature-tile.tile-coral .gem-dot { background: var(--gem-coral); }

.feature-tile.tile-citrine { background: linear-gradient(160deg, rgba(255,200,87,0.14), var(--surface)); }
.feature-tile.tile-citrine .gem-dot { background: var(--gem-citrine); }

.feature-tile.tile-teal { background: linear-gradient(160deg, rgba(54,214,196,0.14), var(--surface)); }
.feature-tile.tile-teal .gem-dot { background: var(--gem-teal); }

/* ============================================================
   CTA / Download
   ============================================================ */
.cta {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 64px 48px;
  text-align: center;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(155,124,255,0.18), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(54,214,196,0.14), transparent 45%);
}

.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin: 0 0 14px;
  position: relative;
  font-weight: 600;
}

.cta p {
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 30px;
  position: relative;
  font-size: 1rem;
}

.cta .hero-actions { justify-content: center; position: relative; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 48px 0 36px;
  margin-top: 40px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p {
  color: var(--text-muted);
  font-size: 0.86rem;
  max-width: 280px;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 10px;
}
.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.8rem;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================================
   Legal pages
   ============================================================ */
.legal-main {
  padding: 56px 0 96px;
}

.legal-main .wrap { max-width: 760px; }

.legal-header {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.legal-header .section-tag { margin-bottom: 14px; }

.legal-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  margin: 0 0 10px;
  font-weight: 600;
}

.legal-updated {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legal-body h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 40px 0 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.legal-body h2:first-child { margin-top: 0; }

.legal-body p, .legal-body li {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.7;
}

.legal-body ul { padding-left: 20px; }
.legal-body li { margin-bottom: 8px; }

.legal-body a { color: var(--gem-teal); text-decoration: underline; }

.legal-note {
  margin-top: 48px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 880px) {
  .site-nav { display: none; }
  .hero .wrap { grid-template-columns: 1fr; }
  .board-stage { order: -1; }
  .modes-grid { grid-template-columns: 1fr; }
  .features-row { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { flex-direction: column; }
}

@media (max-width: 480px) {
  .features-row { grid-template-columns: 1fr; }
  .cta { padding: 48px 24px; }
  .footer-bottom { flex-direction: column; }
}
