/*
  MVP by OSD Labs — shared site styles.
  Design tokens mirror the mobile app's actual brand system
  (src/constants/theme.ts) exactly: same dark/light palettes, same
  Sora (headings/buttons/numbers) + Inter (body) typography split.
  Dark is the primary theme (matches the app's own default surface),
  but a full light palette is defined too and respected via
  prefers-color-scheme — this is a genuine dual-theme site, not a
  dark-only page with a token light fallback.
*/

:root {
  --bg: #0e0e0f;
  --surface: #1a1a1c;
  --elevated: #242426;
  --orange: #ff6a1a;
  --orange-pressed: #e85a0a;
  --text: #f1ece4;
  --text-secondary: rgba(241, 236, 228, 0.72);
  --text-tertiary: rgba(241, 236, 228, 0.5);
  --border: rgba(241, 236, 228, 0.12);
  --focus-ring: #ff9a5c;
  /* Orange-as-TEXT-colour token, kept separate from --orange (used for
     button fills/dots/border accents, which have no contrast requirement
     of their own). On the near-black dark background #ff6a1a measures
     ~6.9:1 — safe. On the light theme's near-white surfaces it measures
     ~3:1 even at large/bold sizes, which fails WCAG AA — so the light
     override below falls back to the normal text colour instead of
     inventing an off-brand shade of orange. */
  --accent-text: var(--orange);

  --font-heading: 'Sora', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --max-width: 960px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f4ef;
    --surface: #ffffff;
    --elevated: #efeae4;
    --text: #161617;
    --text-secondary: rgba(22, 22, 23, 0.68);
    --text-tertiary: rgba(22, 22, 23, 0.48);
    --border: rgba(22, 22, 23, 0.1);
    --focus-ring: #c2470a;
    --accent-text: var(--text);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  text-decoration: underline;
}

/* Orange text at body size doesn't reliably meet AA contrast on the light
   surface — links use the ordinary text colour with an underline instead,
   and orange stays reserved for large headings, buttons (dark text on an
   orange fill) and small accent labels where size/weight compensates. */
p a,
li a,
.body-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-underline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.2rem, 5vw + 1rem, 3.6rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw + 1rem, 2.1rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
  color: var(--text-secondary);
}

.eyebrow {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* Skip link — hidden until focused, standard accessible pattern */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--orange);
  color: #161617;
  padding: 0.6em 1em;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Header / nav ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.site-nav {
  display: flex;
  gap: 1.6rem;
}

.site-nav a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--text);
  text-decoration: none;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85em 1.6em;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--orange);
  color: #161617;
}

.btn-primary:hover {
  background: var(--orange-pressed);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--orange);
  text-decoration: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5em 1em;
  border-radius: var(--radius-pill);
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}

/* ---------- Hero ---------- */

.hero {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
}

.hero .eyebrow {
  display: block;
  margin-bottom: 1rem;
}

.hero p.lead {
  max-width: 640px;
  margin: 1.25rem auto 2rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

/* ---------- Feature cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 3rem 0;
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

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

.card h2 {
  font-size: 1.15rem;
  margin-bottom: 0.6em;
  color: var(--text);
}

.card ul {
  margin: 0.75em 0 0;
  padding-left: 1.1em;
  color: var(--text-secondary);
}

.card li {
  margin-bottom: 0.4em;
}

.card p:last-child {
  margin-bottom: 0;
}

/* ---------- Final CTA ---------- */

.final-cta {
  text-align: center;
  padding: 3.5rem 0 4.5rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.final-cta h2 {
  margin-bottom: 0.3em;
}

/* ---------- Content pages (privacy / support / delete-account) ---------- */

.content-page main {
  padding: 3rem 0 4rem;
}

.content-page .page-intro {
  margin-bottom: 2.5rem;
}

.content-page .updated {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.content-page section {
  margin-bottom: 2.5rem;
}

.content-page section:last-child {
  margin-bottom: 0;
}

.content-page h2 {
  margin-bottom: 0.6em;
}

.content-page ul,
.content-page ol {
  color: var(--text-secondary);
  padding-left: 1.3em;
}

.content-page li {
  margin-bottom: 0.5em;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.step-card h2 {
  font-size: 1.25rem;
  color: var(--accent-text);
  margin-bottom: 0.5em;
}

.step-path {
  font-family: var(--font-heading);
  font-weight: 600;
  background: var(--elevated);
  border-radius: var(--radius-sm);
  padding: 0.5em 0.8em;
  display: inline-block;
  margin: 0.5em 0 1em;
}

.topic-list {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}

.topic {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

.topic h3 {
  margin-bottom: 0.35em;
}

.topic p {
  margin-bottom: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer p {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--text);
}

/* ---------- Reduced motion ---------- */

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

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
  .site-nav {
    gap: 1rem;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }
}
