/* =========================================================================
   RummyKub — marketing site styles
   Brand tokens mirror the app's design system (apps/client/src/ui/theme.ts):
   royal-blue felt, deep-navy chrome, warm gold accents, ivory tile faces.
   Pure CSS, no build step, no external requests.
   ========================================================================= */

:root {
  /* Navy chrome */
  --navy-950: #0a1226;
  --navy-900: #0d1830;
  --navy-850: #0b1633;
  --navy-800: #101d44;
  --navy-700: #17295c;

  /* Royal-blue felt (the table) */
  --felt-1: #4064b6;
  --felt-2: #32519e;
  --felt-3: #274585;
  --felt-line: rgba(165, 195, 248, 0.14);

  /* Warm gold */
  --gold: #e9a23b;
  --gold-bright: #ffc766;
  --gold-deep: #b9791f;

  /* Ivory / text */
  --ivory: #f2ecdd;
  --ivory-dim: rgba(242, 236, 221, 0.62);
  --ivory-faint: rgba(242, 236, 221, 0.4);

  /* Tile faces + set colors */
  --tile-face: #fdfaf1;
  --tile-face-2: #f0e9d4;
  --tile-frame: #c6a35c;
  --tile-frame-dark: #9a7b3e;
  --set-red: #d8352a;
  --set-blue: #1f63c8;
  --set-black: #1d2126;
  --set-orange: #e89a16;

  /* Feedback */
  --info: #2f7fe0;
  --valid: #59d98c;

  --radius-card: 16px;
  --radius-tile: 7px;
  --radius-pill: 999px;
  --maxw: 1120px;
  --shadow-card: 0 18px 40px -18px rgba(0, 8, 30, 0.75);
  --shadow-tile: 0 6px 14px -6px rgba(0, 8, 30, 0.7);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto,
    Helvetica, Arial, sans-serif;
}

/* ---- Reset ------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ivory);
  background: var(--navy-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Clip (not hidden): clips any horizontal overflow from the rotated tile
     scene without turning <body> into a nested scroll container, which would
     break anchor links and programmatic scrolling. */
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

img { max-width: 100%; display: block; }
a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.12; margin: 0; font-weight: 900; letter-spacing: -0.02em; }
p { margin: 0; }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 200;
  background: var(--gold);
  color: #3a2404;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 800;
}
.skip-link:focus { left: 12px; }

/* ---- Layout ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(18px, 5vw, 40px);
}

section { padding-block: clamp(56px, 9vw, 104px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: rgba(233, 162, 59, 0.12);
  border: 1px solid rgba(233, 162, 59, 0.4);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}

.section-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 52px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: clamp(28px, 4.4vw, 44px); margin-top: 16px; }
.section-head p { color: var(--ivory-dim); font-size: clamp(15px, 2vw, 18px); margin-top: 14px; }

/* ---- Wordmark ---------------------------------------------------------- */
.wordmark {
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.03em;
  color: #fff;
}
.wordmark .kub { color: var(--gold-bright); }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-gold { background: var(--gold); color: #3a2404; box-shadow: 0 10px 24px -10px rgba(233, 162, 59, 0.8); }
.btn-gold:hover { background: var(--gold-bright); }

.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--ivory); border-color: rgba(255, 255, 255, 0.16); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

/* Store badges */
.store-row { display: flex; flex-wrap: wrap; gap: 14px; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px 11px 18px;
  border-radius: 13px;
  background: #05070f;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.store-badge:hover { text-decoration: none; transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.34); }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge .lbl { display: flex; flex-direction: column; line-height: 1.15; }
.store-badge .lbl small { font-size: 10.5px; font-weight: 600; color: rgba(255, 255, 255, 0.7); letter-spacing: 0.03em; }
.store-badge .lbl strong { font-size: 17px; font-weight: 800; }

/* ---- Header / nav ------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 18, 38, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 66px;
}
.nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  color: #fff;
}
.nav .brand:hover { text-decoration: none; }
.nav .brand img { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.nav-links { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav-links a { color: var(--ivory-dim); font-weight: 700; font-size: 14.5px; }
.nav-links a:hover { color: var(--ivory); text-decoration: none; }
.nav .btn { padding: 9px 18px; font-size: 14px; }

@media (max-width: 760px) {
  .nav-links .nav-only-wide { display: none; }
  .nav-links { gap: 14px; }
}

/* ---- Hero -------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 78% 8%, rgba(150, 190, 255, 0.16), transparent 60%),
    linear-gradient(168deg, var(--felt-1) 0%, var(--felt-2) 42%, var(--navy-900) 100%);
}
/* Faint felt grid, echoing the in-game play panel */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--felt-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--felt-line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 45%, transparent 85%);
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 45%, transparent 85%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding-block: clamp(48px, 8vw, 92px);
}
.hero h1 {
  font-size: clamp(38px, 6.4vw, 68px);
  margin-top: 20px;
  color: #fff;
  text-shadow: 0 3px 18px rgba(0, 10, 36, 0.4);
}
.hero h1 .hl { color: var(--gold-bright); font-style: italic; }
.hero-sub {
  margin-top: 20px;
  font-size: clamp(16px, 2.2vw, 20px);
  color: rgba(255, 255, 255, 0.86);
  max-width: 30ch;
}
.hero-cta { margin-top: 30px; display: flex; flex-direction: column; gap: 14px; }
.hero-note { font-size: 13px; color: rgba(255, 255, 255, 0.72); font-weight: 600; }
.hero-note strong { color: var(--gold-bright); }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-sub { margin-inline: auto; }
  .hero-cta { align-items: center; }
  .store-row { justify-content: center; }
  .hero .eyebrow { margin-inline: auto; }
}

/* ---- Tiles (CSS-rendered game pieces) ---------------------------------- */
.tile-scene {
  position: relative;
  padding: clamp(20px, 4vw, 34px);
  border-radius: 22px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(150, 190, 255, 0.12), transparent 60%),
    linear-gradient(160deg, var(--felt-1), var(--felt-3));
  border: 1px solid rgba(170, 200, 250, 0.28);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: rotate(-1.4deg);
}
.tile-scene .rack {
  background: linear-gradient(#b98a4e, #8c5f31 55%, #5c3c1e);
  border-radius: 12px;
  padding: 12px 12px 16px;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.25), 0 6px 14px -6px rgba(0, 0, 0, 0.6);
}
.tile-row { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }

.tile {
  --c: var(--set-black);
  width: 42px;
  height: 56px;
  border-radius: var(--radius-tile);
  background: linear-gradient(var(--tile-face), var(--tile-face-2));
  border: 1.5px solid var(--tile-frame);
  box-shadow: var(--shadow-tile), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 24px;
  color: var(--c);
  position: relative;
  font-variant-numeric: tabular-nums;
}
.tile small { position: absolute; bottom: 4px; font-size: 9px; opacity: 0.35; }
.tile.red { --c: var(--set-red); }
.tile.blue { --c: var(--set-blue); }
.tile.black { --c: var(--set-black); }
.tile.orange { --c: var(--set-orange); }
.tile.joker { --c: #c8397e; font-size: 22px; }
.tile.sm { width: 34px; height: 46px; font-size: 19px; }

.tile-caption {
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.02em;
}

.voice-chip {
  position: absolute;
  top: -14px;
  right: -10px;
  transform: rotate(3deg);
  background: var(--navy-950);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

/* ---- Marquee strip ----------------------------------------------------- */
.strip {
  background: var(--navy-950);
  border-block: 1px solid rgba(255, 255, 255, 0.07);
}
.strip .container { display: flex; flex-wrap: wrap; gap: 12px 34px; justify-content: center; padding-block: 22px; }
.strip span { color: var(--ivory-dim); font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; gap: 9px; }
.strip b { color: var(--gold-bright); }

/* ---- Feature grid ------------------------------------------------------ */
.features { background: var(--navy-900); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 18px;
}
.feature {
  background: linear-gradient(180deg, var(--navy-800), var(--navy-850));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-card);
  padding: 26px 24px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.feature:hover { transform: translateY(-4px); border-color: rgba(233, 162, 59, 0.5); }
.feature .ic {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 27px;
  background: rgba(233, 162, 59, 0.14);
  border: 1px solid rgba(233, 162, 59, 0.32);
  margin-bottom: 16px;
}
.feature h3 { font-size: 19px; }
.feature p { margin-top: 9px; color: var(--ivory-dim); font-size: 14.5px; }
.feature.gold { border-color: rgba(233, 162, 59, 0.5); background: linear-gradient(180deg, rgba(233,162,59,0.12), var(--navy-850)); }

/* ---- How to play ------------------------------------------------------- */
.rules { background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.rule {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rule .step {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  background: rgba(233, 162, 59, 0.14);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
}
.rule h3 { font-size: 18px; display: flex; align-items: center; gap: 9px; }
.rule p { color: var(--ivory-dim); font-size: 14.5px; }
.rule .mini { margin-top: auto; }

/* ---- Club / pricing ---------------------------------------------------- */
.club { background: var(--navy-900); }
.club-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: center; }
@media (max-width: 860px) { .club-wrap { grid-template-columns: 1fr; } }

.price-card {
  position: relative;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(233, 162, 59, 0.16), transparent 60%),
    linear-gradient(180deg, var(--navy-800), var(--navy-850));
  border: 1.5px solid var(--gold);
  border-radius: 22px;
  padding: 34px 30px;
  box-shadow: var(--shadow-card);
}
.price-card .badge {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #3a2404;
  background: var(--gold);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}
.price-card .club-name { font-size: 14px; font-weight: 800; letter-spacing: 0.06em; color: var(--gold-bright); text-transform: uppercase; }
.price { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.price .amt { font-size: 52px; font-weight: 900; color: #fff; letter-spacing: -0.03em; }
.price .per { color: var(--ivory-dim); font-weight: 700; }
.perk-list { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.perk-list li { display: flex; gap: 11px; align-items: flex-start; font-size: 15px; color: var(--ivory); }
.perk-list .tick { color: var(--valid); font-weight: 900; flex: none; }
.price-card .fine { margin-top: 22px; font-size: 12px; color: var(--ivory-faint); }

.club-copy h2 { font-size: clamp(26px, 4vw, 40px); }
.club-copy p { color: var(--ivory-dim); margin-top: 16px; font-size: 16px; }
.club-copy .byok {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(47, 127, 224, 0.1);
  border: 1px solid rgba(47, 127, 224, 0.34);
  font-size: 14px;
  color: rgba(242, 236, 221, 0.82);
}
.club-copy .byok b { color: #8fc0ff; }

/* ---- Final CTA --------------------------------------------------------- */
.cta {
  text-align: center;
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(150, 190, 255, 0.16), transparent 62%),
    linear-gradient(160deg, var(--felt-2), var(--navy-900));
  border-top: 1px solid rgba(170, 200, 250, 0.2);
}
.cta h2 { font-size: clamp(30px, 5vw, 50px); color: #fff; }
.cta p { color: rgba(255, 255, 255, 0.82); font-size: 18px; margin-top: 14px; }
.cta .store-row { justify-content: center; margin-top: 30px; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer { background: var(--navy-950); border-top: 1px solid rgba(255, 255, 255, 0.08); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 30px;
  padding-block: 52px;
}
.footer-grid .brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; color: #fff; }
.footer-grid .brand img { width: 30px; height: 30px; border-radius: 8px; }
.footer-blurb { color: var(--ivory-dim); font-size: 14px; margin-top: 14px; max-width: 34ch; }
.foot-col h4 { font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ivory-faint); margin: 0 0 14px; font-weight: 800; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.foot-col a { color: var(--ivory-dim); font-weight: 600; font-size: 14.5px; }
.foot-col a:hover { color: var(--ivory); text-decoration: none; }
.footer-base {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-block: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  align-items: center;
}
.footer-base p { color: var(--ivory-faint); font-size: 13px; }
.trademark { color: var(--ivory-faint); font-size: 12px; max-width: 70ch; line-height: 1.5; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid .brand-col { grid-column: 1 / -1; } }

/* ---- Legal (privacy / terms) pages ------------------------------------- */
.legal { padding-block: clamp(40px, 6vw, 72px); }
.legal .container { max-width: 800px; }
.legal-head { border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 26px; margin-bottom: 8px; }
.legal-head h1 { font-size: clamp(30px, 5vw, 46px); color: #fff; }
.legal-head .updated { margin-top: 12px; color: var(--ivory-dim); font-size: 14px; }
.legal-body { font-size: 15.5px; color: rgba(242, 236, 221, 0.86); }
.legal-body h2 {
  font-size: 22px;
  color: #fff;
  margin-top: 42px;
  margin-bottom: 12px;
  scroll-margin-top: 84px;
}
.legal-body h3 { font-size: 17px; color: var(--gold-bright); margin-top: 26px; margin-bottom: 8px; }
.legal-body p { margin-top: 12px; }
.legal-body ul { margin-top: 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.legal-body li { padding-left: 4px; }
.legal-body strong { color: #fff; }
.legal-body a { text-decoration: underline; }
.legal-toc {
  background: var(--navy-800);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  margin-top: 26px;
}
.legal-toc h2 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ivory-faint); margin: 0 0 12px; }
.legal-toc ol { margin: 0; padding-left: 20px; color: var(--ivory-dim); columns: 2; column-gap: 30px; }
.legal-toc li { margin-bottom: 7px; }
.legal-toc a { color: var(--ivory-dim); text-decoration: none; }
.legal-toc a:hover { color: var(--gold-bright); }
.callout {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(47, 127, 224, 0.1);
  border: 1px solid rgba(47, 127, 224, 0.3);
  font-size: 14.5px;
}
@media (max-width: 620px) { .legal-toc ol { columns: 1; } }

/* Back-to-home link on legal pages */
.legal-back { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; color: var(--ivory-dim); margin-bottom: 22px; }
.legal-back:hover { color: var(--ivory); text-decoration: none; }
