/* =========================================================
   +3−1 — shared stylesheet
   Palette and type mirror the app (constants/theme.ts) and the
   shipped invite page (app/room-invite.web.tsx).
   ========================================================= */

@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/SpaceGrotesk-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/SpaceGrotesk-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/SpaceGrotesk-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/SpaceGrotesk-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg-page: radial-gradient(120% 120% at 50% 0%, #1b1e28 0%, #101218 45%, #0a0b0f 100%);
  --surface: #16181f;
  --surface-soft: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #ebeae4;
  --text-muted: #9ba1ac;
  --text-dim: #7e838c;
  --plus: #10b981;
  --minus: #f59e0b;
  --glow: rgba(99, 138, 185, 0.2);
  --radius: 24px;
  --radius-sm: 14px;
  --font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --maxw: 1040px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: #0a0b0f;
  background-image: var(--bg-page);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------
   Logo mark — drawn in CSS, no image needed
   --------------------------------------------------------- */
.logo-tile {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #23262f 0%, #0e0f13 100%);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}
.logo-tile.sm {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}
.logo-mark {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}
.logo-tile.sm .logo-mark {
  font-size: 15px;
}
.logo-mark .plus {
  color: #ffffff;
}
.logo-mark .minus {
  color: #8a8f98;
}

/* ---------------------------------------------------------
   Site chrome
   --------------------------------------------------------- */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.site-header .brand:hover {
  text-decoration: none;
}
.site-header nav {
  display: flex;
  gap: 22px;
  font-size: 15px;
  color: var(--text-muted);
}
.site-header nav a {
  color: var(--text-muted);
}
.site-header nav a:hover {
  color: var(--text);
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 96px;
}
.site-footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 36px 24px 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  justify-content: space-between;
  align-items: flex-start;
  color: var(--text-dim);
  font-size: 14px;
}
.site-footer a {
  color: var(--text-muted);
}
.site-footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.site-footer .legal {
  max-width: 420px;
  line-height: 1.7;
}

/* ---------------------------------------------------------
   Layout primitives
   --------------------------------------------------------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
section {
  margin-top: 96px;
}
.eyebrow {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 12px;
}
h1,
h2,
h3 {
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin: 0 0 16px;
}
h1 {
  font-size: clamp(38px, 7vw, 64px);
  font-weight: 700;
}
h2 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
}
h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
p {
  margin: 0 0 16px;
}
.lead {
  color: var(--text-muted);
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.55;
  max-width: 620px;
}
.muted {
  color: var(--text-muted);
}
.dim {
  color: var(--text-dim);
  font-size: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */
.hero {
  padding: 56px 0 8px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero .logo-tile {
  margin-bottom: 28px;
}
.hero h1 {
  margin-bottom: 20px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font);
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: #ffffff;
  color: #12110f;
}
.btn-primary:hover {
  background: #e8e8e8;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}
.btn-disabled {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
  cursor: default;
}
.btn-disabled:hover {
  text-decoration: none;
}

/* ---------------------------------------------------------
   Score demo (tutorial worked example: 4271 vs 4812 -> +1 -2)
   --------------------------------------------------------- */
.demo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.demo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.demo-row:last-of-type {
  margin-bottom: 0;
}
.demo-label {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.digits {
  display: flex;
  gap: 8px;
}
.digit {
  width: 46px;
  height: 56px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
}
.digit.hidden-code {
  color: var(--text-dim);
}
.digit.exact {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.12);
  color: #34d3a0;
}
.digit.present {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
  color: #f7b955;
}
.score {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.pill .n {
  font-size: 17px;
  font-weight: 700;
}
.pill.plus .n {
  color: var(--plus);
}
.pill.minus .n {
  color: var(--minus);
}
.pill .t {
  color: var(--text-muted);
  font-weight: 400;
}

/* ---------------------------------------------------------
   Feature / rule grids
   --------------------------------------------------------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.feature .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--glow);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.feature p {
  color: var(--text-muted);
  margin: 0;
  font-size: 15px;
}

.rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.rules li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  color: var(--text-muted);
}
.rules li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text-dim);
  margin-top: 11px;
  flex-shrink: 0;
}
.rules strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------------------------------------------------------
   Prose (privacy / support)
   --------------------------------------------------------- */
.prose {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 40px;
}
.prose h1 {
  font-size: clamp(32px, 5vw, 44px);
}
.prose h2 {
  font-size: 22px;
  margin-top: 44px;
  margin-bottom: 12px;
}
.prose h3 {
  margin-top: 28px;
  margin-bottom: 8px;
}
.prose p,
.prose li {
  color: var(--text-muted);
}
.prose ul {
  padding-left: 20px;
  margin: 0 0 16px;
}
.prose li {
  margin-bottom: 8px;
}
.prose strong {
  color: var(--text);
  font-weight: 600;
}
.prose a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 15px;
}
.prose th,
.prose td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
}
.prose th {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.updated {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 40px;
}

.faq {
  display: grid;
  gap: 14px;
  margin-top: 32px;
}
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
}
.faq details[open] {
  border-color: var(--border-strong);
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  color: var(--text-dim);
  font-size: 20px;
  font-weight: 400;
  flex-shrink: 0;
}
.faq details[open] summary::after {
  content: '−';
}
.faq details > *:not(summary) {
  color: var(--text-muted);
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 15px;
}

.contact-card {
  margin-top: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.contact-card p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------
   Centered single-card pages (room-invite, 404)
   --------------------------------------------------------- */
.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.center-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  max-width: 420px;
  width: 100%;
  padding: 44px 32px;
  text-align: center;
}
.center-card .logo-tile {
  margin: 0 auto 20px;
}
.tagline {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 30px;
  line-height: 1.5;
}
.room-info {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 28px;
}
.room-label {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.room-code {
  font-size: 34px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 8px;
  margin-top: 10px;
}
.open-button {
  width: 100%;
  background: #ffffff;
  color: #12110f;
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 30px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 20px;
  font-family: var(--font);
}
.store-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.store-button {
  flex: 1;
  min-width: 140px;
  display: inline-block;
  padding: 13px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.store-button.soon {
  color: var(--text-dim);
}
.info-text {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
  margin: 4px 0 0;
}
.center-card .back-link {
  display: inline-block;
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 24px;
  }
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  section {
    margin-top: 72px;
  }
  .site-header {
    padding: 22px 20px;
  }
  .site-header nav {
    gap: 16px;
    font-size: 14px;
  }
  main {
    padding: 0 20px;
  }
}

@media (max-width: 420px) {
  .digit {
    width: 40px;
    height: 50px;
    font-size: 21px;
  }
  .score {
    flex-wrap: wrap;
  }
  .center-card {
    padding: 36px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
