/* Layout: one column, a dark "board" hero where tiles re-form into the R, then quiet light sections. */
:root {
  --ink: #1C1830;          /* logo ink */
  --ink-2: #2A2445;
  --violet: #8A5CFF;       /* "Re" */
  --violet-soft: #B49BFF;  /* "Re" on dark */
  --blue: #3D8BFF;
  --spark: #FFD23F;        /* sparkle */
  --bg: #FBFAFF;
  --surface: #F1EEFB;
  --fg: #1C1830;
  --muted: #5E5878;
  --line: #E2DDF3;
  --accent: #6E3FF0;
  --logo-light: block;
  --logo-dark: none;
  --font-display: "Fredoka", "Baloo 2", ui-rounded, system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.75rem;
  --step-3: clamp(2.4rem, 6vw, 4.25rem);
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14111F; --surface: #1E1A2E; --fg: #F3F0FF; --muted: #A9A2C4;
    --line: #2E2844; --accent: #B49BFF; --logo-light: none; --logo-dark: block;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14111F; --surface: #1E1A2E; --fg: #F3F0FF; --muted: #A9A2C4;
  --line: #2E2844; --accent: #B49BFF; --logo-light: none; --logo-dark: block;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--step-0)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--spark); outline-offset: 3px; border-radius: 6px; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; text-wrap: balance; margin: 0; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0; }
.eyebrow {
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Hero (always dark, brand ink) ---------- */
.hero {
  background:
    radial-gradient(60% 80% at 85% 10%, rgba(138, 92, 255, .35), transparent 70%),
    radial-gradient(50% 60% at 0% 100%, rgba(61, 139, 255, .22), transparent 70%),
    var(--ink);
  color: #F3F0FF;
  margin-top: calc(-1 * env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; }
.nav img { height: 40px; width: auto; }
.nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.nav a { color: #D9D2F5; text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:hover { color: #fff; }

.hero-grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
  padding-block: 40px 88px;
}
.hero h1 { font-size: var(--step-3); font-weight: 700; letter-spacing: -.01em; }
.hero h1 .re { color: var(--violet-soft); }
.hero h1 .spark { color: var(--spark); }
.hero .lede { margin-top: 22px; font-size: 1.15rem; color: #C9C1E8; max-width: 34ch; }
.hero .cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 1rem var(--font-display); text-decoration: none; cursor: pointer;
  padding: 13px 22px; border-radius: 999px; border: 0;
}
.btn-primary { background: var(--spark); color: var(--ink); box-shadow: 0 4px 0 #C99E14; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: #F3F0FF; border: 2px solid #4A4170; }
.btn-ghost:hover { border-color: var(--violet-soft); }

/* Tile board: 25 tiles that start scrambled and slide into the R */
.board-wrap { justify-self: center; width: 100%; max-width: 340px; }
.board {
  position: relative; width: 100%; aspect-ratio: 1; max-width: 100%;
  background: #241F3B; border-radius: 26px; padding: 4%;
  box-shadow: inset 0 0 0 2px #342D55, 0 10px 0 #0E0C18;
}
.tile {
  position: absolute; width: 17.2%; height: 17.2%; border-radius: 22%;
  transition: transform .7s cubic-bezier(.34, 1.4, .5, 1);
  will-change: transform;
}
.tile.on  { background: linear-gradient(160deg, #A07BFF, #5B8BFF); box-shadow: inset 0 -4px 0 rgba(20, 10, 60, .35), inset 0 2px 0 rgba(255,255,255,.35); }
.tile.off { background: #2F2950; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.tile.star { background: var(--spark); box-shadow: inset 0 -4px 0 #C99E14, inset 0 2px 0 rgba(255,255,255,.5); }
.board-caption { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .85rem; color: #A9A2C4; }
.board-caption button { background: none; border: 0; color: var(--spark); font: 600 .9rem var(--font-display); cursor: pointer; padding: 4px 0; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }

/* ---------- Sections ---------- */
section { padding-block: 88px; }
section + section { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 12px; max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.about-grid .big { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.3; font-weight: 500; text-wrap: balance; }
.about-grid .big em { font-style: normal; color: var(--accent); }
.about-copy { display: grid; gap: 16px; color: var(--muted); }

.principles { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.principles li { display: grid; gap: 8px; padding-top: 18px; border-top: 3px solid var(--fg); min-width: 0; }
.principles li:nth-child(2) { border-top-color: var(--violet); }
.principles li:nth-child(3) { border-top-color: var(--spark); }
.principles p { color: var(--muted); }

.games-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.slot {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 22px; display: grid; gap: 14px; align-content: start; min-width: 0;
}
.slot .art { width: 96px; aspect-ratio: 1; max-width: 100%; border-radius: 22%; background: var(--surface); display: grid; place-items: center; }
.slot .art span { font-family: var(--font-display); font-size: 2.2rem; color: var(--muted); opacity: .5; }
.slot .meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pill { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); white-space: nowrap; }
.slot p { color: var(--muted); font-size: .95rem; }

.contact-card {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center;
  background: var(--surface); border-radius: 28px; padding: 44px;
}
.contact-card p { color: var(--muted); margin-top: 12px; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.email {
  font: 600 clamp(1.2rem, 3vw, 1.6rem) var(--font-display); color: var(--fg);
  user-select: all; overflow-wrap: anywhere;
}
.copy { background: var(--fg); color: var(--bg); border: 0; border-radius: 999px; padding: 9px 16px; font: 600 .9rem var(--font-display); cursor: pointer; }
.contact-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 6px; color: var(--muted); font-size: .95rem; }

footer { padding-block: 36px 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.foot .brand { display: flex; align-items: center; gap: 10px; }
.foot .brand img { width: 28px; height: 28px; }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--muted); }

.logo-light { display: var(--logo-light); }
.logo-dark { display: var(--logo-dark); }

/* ---------- Legal page ---------- */
.legal-top { background: var(--ink); color: #F3F0FF; margin-top: calc(-1 * env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); }
.legal-top .nav img { height: 34px; }
.legal { max-width: 720px; padding-block: 56px 80px; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.legal .updated { color: var(--muted); margin-top: 10px; }
.legal h2 { font-size: 1.35rem; margin-top: 40px; margin-bottom: 10px; }
.legal p, .legal li { color: var(--fg); opacity: .9; }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 1.2em; display: grid; gap: 6px; margin: 10px 0 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal .table-scroll { overflow-x: auto; margin-top: 12px; }
.note { background: var(--surface); border-left: 4px solid var(--spark); padding: 14px 18px; border-radius: 10px; margin-top: 24px; font-size: .95rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; padding-block: 24px 64px; }
  .board-wrap { max-width: 300px; }
  .about-grid, .contact-card { grid-template-columns: 1fr; gap: 28px; }
  .principles, .games-grid { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .games-grid .slot:nth-child(3) { display: none; }
  section { padding-block: 64px; }
}
@media (max-width: 560px) {
  .nav ul { gap: 14px; }
  .nav ul li.hide-sm { display: none; }
  .nav img { height: 34px; }
  .games-grid { grid-template-columns: 1fr; }
  .contact-card { padding: 28px 22px; }
}
