/* ===============================================================
   Onside — website design tokens
   Mirrors src/lib/theme.ts from the app. Dark is the default,
   matching the app's splash (#15241c) and the store screenshots.
   =============================================================== */
:root {
  /* darkTheme */
  --bg: #0F0F13;
  --surface: #1A1A24;
  --surface-elevated: #22222E;
  --border: #2A2A38;

  --primary: #4ADE80;
  --primary-dim: rgba(74, 222, 128, .12);
  --on-primary: #000000;
  --gold: #FBBF24;
  --live: #EF4444;

  --text: #F8F8FF;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;

  /* radius scale from theme.ts */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-full: 999px;

  /* spacing scale from theme.ts */
  --s-xs: 4px;  --s-sm: 8px;  --s-md: 12px;
  --s-lg: 16px; --s-xl: 20px; --s-xxl: 24px;

  --container: 1120px;
  --grass: #2C6E16; /* notification accent, used for the pitch wedge */
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F2F2F7;
    --surface: #FFFFFF;
    --surface-elevated: #F2F2F7;
    --border: #D1D1D6;

    --primary: #16A34A;
    --primary-dim: rgba(22, 163, 74, .12);
    --on-primary: #FFFFFF;
    --gold: #D97706;
    --live: #DC2626;

    --text: #111827;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
  }
}

/* ---------------------------------------------------------------
   Base
   --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
p  { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s-xl); }
.muted { color: var(--text-secondary); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------
   Header
   --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-lg); min-height: 68px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand svg, .brand img { height: 30px; width: auto; }

.header-right { display: flex; align-items: center; gap: var(--s-lg); }

.lang-switch { display: flex; gap: var(--s-xs); font-size: .85rem; }
.lang-switch a {
  padding: 5px 11px; border-radius: var(--r-full);
  color: var(--text-secondary); text-decoration: none; transition: color .15s;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="page"] {
  background: var(--surface-elevated); color: var(--text); font-weight: 600;
}

/* ---------------------------------------------------------------
   Hero — with the diagonal pitch wedge from the store screenshots
   --------------------------------------------------------------- */
.hero { position: relative; padding: clamp(56px, 9vw, 104px) 0; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(108deg, transparent 62%, var(--grass) 62.4%);
  opacity: .16;
}
.hero > .container { position: relative; z-index: 1; }

.hero-grid { display: grid; gap: clamp(36px, 6vw, 64px); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr .95fr; } }

.eyebrow {
  display: inline-block; margin-bottom: var(--s-lg);
  padding: 6px 14px; border-radius: var(--r-full);
  background: var(--primary-dim); color: var(--primary);
  font-size: .8rem; font-weight: 650; letter-spacing: .02em;
}

.hero .lead { font-size: 1.2rem; color: var(--text-secondary); max-width: 48ch; margin-bottom: var(--s-xxl); }

/* ---------------------------------------------------------------
   Floating phones
   Cut-out PNGs with transparent rounded corners. Some are
   deliberately truncated; those sit flush against a section edge so
   they read as continuing behind the next block.
   --------------------------------------------------------------- */
.phone-stage {
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(12px, 3vw, 28px);
}

.phone {
  width: min(78%, 320px);
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .55));
}
@media (prefers-color-scheme: light) {
  .phone { filter: drop-shadow(0 26px 44px rgba(17, 24, 39, .22)); }
}

.phone-sm { width: min(58%, 240px); }

/* Two phones, the back one stepped down and slightly rotated */
.phone-pair .phone:first-child { transform: rotate(-3deg) translateY(18px); z-index: 1; }
.phone-pair .phone:last-child  { transform: rotate(3deg); margin-left: -14%; }

/* A phone whose bottom is cut: park it on the section's bottom edge. */
.bleed-bottom { padding-bottom: 0 !important; overflow: hidden; }
.bleed-bottom .phone-stage { align-items: flex-end; margin-bottom: 0; }
.bleed-bottom .phone { margin-bottom: -2px; }

/* A phone whose top is cut: hang it from the section's top edge. */
.bleed-top { padding-top: 0 !important; overflow: hidden; }
.bleed-top .phone-stage { align-items: flex-start; }
.bleed-top .phone { margin-top: -2px; }

@media (max-width: 899px) {
  .phone { width: min(64%, 280px); }
  .phone-pair .phone:last-child { margin-left: -18%; }
}

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.store-buttons { display: flex; flex-wrap: wrap; gap: var(--s-md); }

.store-btn {
  display: inline-flex; align-items: center; gap: var(--s-md);
  padding: 12px 22px; border-radius: var(--r-md);
  background: var(--text); color: var(--bg);
  text-decoration: none; font-weight: 650; font-size: .95rem;
  transition: transform .12s ease, opacity .12s ease;
}
.store-btn:hover { transform: translateY(-2px); opacity: .92; }
.store-btn svg { width: 22px; height: 22px; flex: none; fill: currentColor; }
.store-btn span { display: flex; flex-direction: column; line-height: 1.15; }
.store-btn small { font-size: .68rem; font-weight: 500; opacity: .7; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-sm);
  padding: 14px 28px; border-radius: var(--r-md);
  background: var(--primary); color: var(--on-primary);
  font-weight: 700; text-decoration: none; border: 0; cursor: pointer;
  transition: filter .15s ease, transform .12s ease;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: transparent;
  color: var(--text); font-weight: 600; text-decoration: none;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---------------------------------------------------------------
   Sections
   --------------------------------------------------------------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-subtle { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { max-width: 56ch; margin-bottom: 44px; }
.section-head p { color: var(--text-secondary); margin: 0; font-size: 1.05rem; }

.feature-grid { display: grid; gap: var(--s-xl); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.feature {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
}
.feature h3 { margin-bottom: .4em; }
.feature p { color: var(--text-secondary); margin: 0; font-size: .95rem; }
.feature-icon {
  width: 42px; height: 42px; border-radius: var(--r-md);
  background: var(--primary-dim); color: var(--primary);
  display: grid; place-items: center; margin-bottom: var(--s-lg);
}
.feature-icon svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Screenshot strip */
.shot-strip {
  display: grid; gap: var(--s-xl);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.shot-strip img { border-radius: var(--r-lg); border: 1px solid var(--border); }

/* ---------------------------------------------------------------
   CTA band
   --------------------------------------------------------------- */
.cta {
  background: var(--primary); color: var(--on-primary);
  border-radius: 24px; padding: clamp(36px, 6vw, 64px); text-align: center;
}
.cta h2 { margin-bottom: .3em; }
.cta p { opacity: .85; max-width: 52ch; margin-inline: auto; margin-bottom: 1.75em; }
.cta .store-buttons { justify-content: center; }
.cta .store-btn { background: var(--on-primary); color: var(--primary); }

/* ---------------------------------------------------------------
   Join page
   --------------------------------------------------------------- */
.join-card {
  max-width: 480px; margin: clamp(40px, 8vw, 80px) auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: clamp(28px, 5vw, 44px); text-align: center;
}
.join-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: clamp(1.9rem, 7vw, 2.6rem); font-weight: 700;
  letter-spacing: .22em; text-indent: .22em;
  color: var(--primary); background: var(--primary-dim);
  border-radius: var(--r-md); padding: 18px 20px; margin: var(--s-xl) 0;
}
.join-steps { text-align: left; color: var(--text-secondary); font-size: .95rem; padding-left: 1.2em; }
.join-steps li { margin-bottom: var(--s-sm); }

/* ---------------------------------------------------------------
   Prose (privacy / support)
   --------------------------------------------------------------- */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.8em; font-size: 1.4rem; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; color: var(--text-secondary); }
.prose li { margin-bottom: .4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .92rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.prose th { color: var(--text); font-weight: 650; }
.prose td { color: var(--text-secondary); }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 44px 0; font-size: .9rem; color: var(--text-muted);
}
.site-footer .container {
  display: flex; flex-wrap: wrap; gap: var(--s-lg);
  align-items: center; justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--s-xl); }
.site-footer a { color: var(--text-secondary); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

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