/* EquoMate, shared site styles
   Design tokens translated 1:1 from the mobile app's theme system
   (src/theme/light.ts, dark.ts, tokens.ts, typography.ts) so this site
   reads as the same product. See README in this folder for the mapping. */

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/Inter-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/Inter-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/Inter-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../assets/fonts/PlusJakartaSans-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Light palette, src/theme/light.ts */
  --bg: #F5F8F7;
  --surface: #FFFFFF;
  --surface-alt: #F5F8F7;
  --border: #E6EEEB;
  --border-strong: #DDE7E4;
  --divider: #EEF3F1;
  --ink: #172B4D;
  --ink-muted: #607080;
  --ink-faint: #8D9AA6;
  --primary: #18A999;
  --primary-pressed: #0F6F65;
  --primary-soft: #E5F5F1;
  --on-primary: #FFFFFF;
  --mint-text: #0F6F65;
  --negative: #E76F61;
  --negative-soft: #FBEAE7;
  --warning: #F4B942;
  --warning-soft: #FDF3DC;
  --accent: #FFB86B;
  --shadow-tint: 23, 43, 77;

  /* Spacing, 8pt grid, src/theme/tokens.ts */
  --sp-4: 4px; --sp-8: 8px; --sp-12: 12px; --sp-16: 16px; --sp-20: 20px;
  --sp-24: 24px; --sp-32: 32px; --sp-40: 40px; --sp-48: 48px; --sp-64: 64px;

  /* Radius */
  --r-chip: 12px; --r-card: 16px; --r-input: 16px; --r-button: 16px; --r-pill: 999px;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-wordmark: 'Plus Jakarta Sans', var(--font-body);

  --max-width: 1120px;
  --content-width: 760px;
}

* { box-sizing: border-box; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 16px;
  border-radius: var(--r-button);
  font-weight: 600;
  font-size: 14px;
  transition: top 150ms ease;
}
.skip-link:focus {
  top: 12px;
  text-decoration: none;
}

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

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

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

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

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 var(--sp-12);
}
h1 { font-size: 34px; letter-spacing: -0.6px; }
h2 { font-size: 24px; letter-spacing: -0.3px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0 0 var(--sp-16); color: var(--ink); }
ul, ol { margin: 0 0 var(--sp-16); padding-left: 1.3em; }
li { margin-bottom: var(--sp-8); }
strong { font-weight: 600; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-24);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 248, 247, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-12);
  color: var(--ink);
  text-decoration: none;
}
.brand-lockup:hover { text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-word {
  font-family: var(--font-wordmark);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.4px;
  white-space: nowrap;
}
.brand-word .equo { color: var(--ink); }
.brand-word .mate { color: var(--primary); }

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-24);
}
.header-nav a {
  color: var(--ink-muted);
  font-size: 15px;
  font-weight: 500;
}
.header-nav a:hover { color: var(--primary); }
.header-nav a.current { color: var(--ink); font-weight: 600; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-button);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-pressed); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

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

.hero {
  padding: var(--sp-64) 0 var(--sp-40);
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  color: var(--mint-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: var(--sp-16);
}
.hero h1 { max-width: 20ch; }
.hero .updated {
  color: var(--ink-muted);
  font-size: 14px;
  margin-top: var(--sp-8);
  margin-bottom: 0;
}
.hero .lede {
  max-width: 62ch;
  font-size: 17px;
  color: var(--ink-muted);
  margin-top: var(--sp-20);
}

/* ---------- Policy layout ---------- */

.policy-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: var(--sp-48);
  padding: var(--sp-48) 0 var(--sp-64);
  align-items: start;
}

.toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.toc-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-muted);
  margin-bottom: var(--sp-12);
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.4;
}
.toc a:hover { color: var(--primary); text-decoration: none; }
.toc a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.policy-content { max-width: var(--content-width); min-width: 0; }

.policy-content section {
  scroll-margin-top: 96px;
  padding-top: var(--sp-32);
  margin-top: var(--sp-32);
  border-top: 1px solid var(--divider);
}
.policy-content section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.policy-content section h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-number {
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 16px;
}

.policy-content h3 { margin-top: var(--sp-24); }

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--sp-20);
  margin: var(--sp-16) 0;
  box-shadow: 0 1px 2px rgba(var(--shadow-tint), 0.06);
}
.callout p:last-child { margin-bottom: 0; }
.callout-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: var(--sp-8);
  display: flex;
  align-items: center;
  gap: 8px;
}

.split-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-16);
  margin: var(--sp-20) 0;
}
.split-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--sp-20);
}
.split-card h4 {
  margin: 0 0 var(--sp-8);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.split-card p, .split-card ul { font-size: 14.5px; color: var(--ink-muted); margin-bottom: var(--sp-8); }
.split-card ul { padding-left: 1.1em; }
.split-card li { margin-bottom: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-local { background: var(--ink-muted); }
.dot-shared { background: var(--primary); }

.table-wrap {
  overflow-x: auto;
  margin: var(--sp-16) 0;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 14px;
  background: var(--surface);
}
th, td {
  border-bottom: 1px solid var(--divider);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}
tr:last-child th, tr:last-child td { border-bottom: none; }
th {
  font-family: var(--font-body);
  font-weight: 600;
  background: var(--surface-alt);
  white-space: nowrap;
}
td { color: var(--ink-muted); }
td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--sp-12) 0 var(--sp-16); }
.tag {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-chip);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--ink-muted);
}
.tag.no::before { content: '✕ '; color: var(--negative); font-weight: 700; }
.tag.yes::before { content: '✓ '; color: var(--primary); font-weight: 700; }

.note {
  font-size: 13.5px;
  color: var(--ink-muted);
}

.back-to-top {
  display: inline-block;
  margin-top: var(--sp-48);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Mobile TOC (details/summary) ---------- */

.toc-mobile { display: none; }
.toc-mobile summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  font-weight: 600;
  font-size: 14px;
}
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary .chevron { transition: transform 150ms ease; color: var(--ink-faint); }
.toc-mobile[open] summary .chevron { transform: rotate(180deg); }
.toc-mobile ol {
  list-style: none;
  margin: var(--sp-8) 0 0;
  padding: var(--sp-8) 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}
.toc-mobile li a { display: block; padding: 8px 16px; color: var(--ink-muted); font-size: 14px; }

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-40) 0;
  margin-top: var(--sp-32);
}
.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-16);
}
.footer-links { display: flex; gap: var(--sp-24); flex-wrap: wrap; }
.footer-links a { color: var(--ink-muted); font-size: 14px; }
.footer-links a:hover { color: var(--primary); }
.footer-copy { color: var(--ink-muted); font-size: 13px; }

/* ---------- Home page ---------- */

.home-hero {
  padding: var(--sp-64) 0;
  text-align: center;
}
.home-hero .brand-mark-lg {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-24);
  box-shadow: 0 12px 32px rgba(var(--shadow-tint), 0.16);
}
.home-hero .brand-mark-lg svg { width: 42px; height: 42px; }
.home-hero h1 {
  font-family: var(--font-wordmark);
  font-size: 44px;
  letter-spacing: -1px;
  margin: 0 auto var(--sp-12);
}
.home-hero .tagline {
  font-size: 20px;
  font-style: italic;
  color: var(--ink-muted);
  margin: 0 auto var(--sp-24);
}
.home-hero .sub {
  max-width: 52ch;
  margin: 0 auto var(--sp-32);
  color: var(--ink-muted);
  font-size: 16.5px;
}
.home-hero .cta-row {
  display: flex;
  gap: var(--sp-12);
  justify-content: center;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px 9px 14px;
  margin: 0 0 var(--sp-24);
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(var(--shadow-tint), 0.18);
}
.store-badge-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.store-badge-icon svg { width: 100%; height: 100%; }
.store-badge-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.store-badge-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.72);
}
.store-badge-store {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #FFFFFF;
  font-family: var(--font-wordmark);
}

.home-section { padding: var(--sp-48) 0; border-top: 1px solid var(--border); }
.home-section h2 { text-align: center; margin-bottom: var(--sp-8); }
.home-section .section-sub {
  text-align: center;
  color: var(--ink-muted);
  max-width: 56ch;
  margin: 0 auto var(--sp-32);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-20);
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--sp-24);
}
.feature-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--mint-text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-16);
  font-size: 18px;
}
.feature-card h3 { margin-bottom: var(--sp-8); font-size: 16px; }
.feature-card p { font-size: 14.5px; color: var(--ink-muted); margin-bottom: 0; }

.privacy-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: var(--sp-32);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-24);
  flex-wrap: wrap;
}
.privacy-banner h2 { margin-bottom: var(--sp-8); text-align: left; }
.privacy-banner p { color: var(--ink-muted); margin-bottom: 0; max-width: 52ch; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .policy-layout { grid-template-columns: 1fr; gap: var(--sp-24); }
  .toc { display: none; }
  .toc-mobile { display: block; margin-bottom: var(--sp-8); }
  .split-cards { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .home-hero h1 { font-size: 34px; }
  .privacy-banner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  .container { padding: 0 var(--sp-16); }
  .hero { padding: var(--sp-40) 0 var(--sp-24); }
  .hero h1 { font-size: 27px; }
  h2 { font-size: 20px; }
  .header-nav a:not(.current) { display: none; }
  .home-hero { padding: var(--sp-48) 0; }
}

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

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