/* Datum website styles.
   Colors come straight from the app's asset catalog (datum/Datum/Assets.xcassets), spacing from
   AppSpacing (4/8/16/24/32) and the card radius from AppRadius.card (18) in Theme.swift. */

:root,
[data-theme="dark"] {
  --bg: #0C0D0F;            /* AppBackground */
  --surface: #131519;       /* AppSurface */
  --text: #F2F3F5;          /* AppTextPrimary */
  --muted: #9AA0A8;         /* AppTextSecondary */
  --hairline: #1E2126;      /* AppHairline */
  --accent: #A78BFA;        /* AccentColor */
  --accent-fill: #7C3AED;   /* AppAccentFill */
  --on-accent: #FFFFFF;     /* AppOnAccent */
  --nav-bg: rgba(12, 13, 15, 0.82);
  --code-bg: #1A1D22;
  --shadow: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #F4F2F8;
  --surface: #FFFFFF;
  --text: #1A1626;
  --muted: #605A70;
  --hairline: #E7E2F1;
  --accent: #7C3AED;
  --accent-fill: #5B21B6;
  --on-accent: #FFFFFF;
  --nav-bg: rgba(244, 242, 248, 0.82);
  --code-bg: #EFEBF6;
  --shadow: rgba(26, 22, 38, 0.18);
  color-scheme: light;
}

:root {
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --radius-card: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, sans-serif;
  --header-h: 72px;
}

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

html { scroll-padding-top: calc(var(--header-h) + var(--space-md)); -webkit-text-size-adjust: 100%; }

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

img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 var(--space-xl); }

.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: var(--space-md); top: var(--space-md); z-index: 100; background: var(--surface); padding: var(--space-sm) var(--space-md); border-radius: 999px; }

/* Buttons: the app's capsule style. */
.btn {
  display: inline-block;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 700;
  padding: 13px 24px;
  border-radius: 999px;
  text-align: center;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-sm { font-size: 14px; font-weight: 600; padding: 10px 20px; }
.btn-lg { font-size: 16px; padding: 15px 28px; }
.btn-block { display: block; width: 100%; }
.btn-outline {
  display: inline-block;
  color: var(--text);
  font-weight: 600;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  line-height: 1.2;
}
.btn-outline:hover { text-decoration: none; border-color: var(--muted); }

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: var(--space-md); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 19px; font-weight: 700; letter-spacing: -0.3px; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 9px; display: block; }
.site-nav { display: flex; align-items: center; gap: var(--space-xl); }
.nav-link { font-size: 15px; font-weight: 500; color: var(--muted); }
.nav-link:hover { color: var(--text); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--hairline); color: var(--text);
}
[data-theme="dark"] .icon-moon, [data-theme="light"] .icon-sun { display: none; }

/* Hero */
.hero { padding-top: 88px; padding-bottom: 88px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px; align-items: center; }
.hero-title { margin: 0 0 20px; font-size: 52px; line-height: 1.08; font-weight: 800; letter-spacing: -1px; }
.hero-lede { margin: 0 0 var(--space-xl); font-size: 18px; color: var(--muted); max-width: 480px; }
.hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-actions .btn-outline { padding: 15px 20px; font-size: 16px; }
.hero-note { margin: 18px 0 0; font-size: 13px; color: var(--muted); }
.hero-phone-wrap { display: flex; justify-content: center; }
.phone {
  width: 300px; max-width: 100%; padding: 14px; border-radius: 42px;
  background: #1a1a1e; border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 40px 70px -24px rgba(0, 0, 0, 0.45);
}
.phone img { display: block; width: 100%; border-radius: 30px; }

/* Trust row */
.section-trust { padding-bottom: 88px; }
.trust-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-md); }
.tile { padding: 20px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; }
.tile-title { margin: 0 0 var(--space-xs); font-size: 15px; font-weight: 700; }
.tile-text { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }

/* Features */
.section-features { padding-bottom: 96px; }
.section-head { margin-bottom: 44px; max-width: 560px; }
.section-title { margin: 0 0 12px; font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -0.5px; }
.section-lede { margin: 0 0 36px; font-size: 16px; color: var(--muted); max-width: 620px; }
/* All six cards are the same size: every card's image area has the screenshots' exact phone
   proportions (380x826), so screenshots show in full with no cropping, and every row is as tall as
   the tallest card, so all six match. */
.features-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--space-lg); align-items: stretch; }
.feature-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-card); overflow: hidden; }
.feature-shot, .feature-icon { display: block; width: 100%; aspect-ratio: 380 / 826; border-bottom: 1px solid var(--hairline); }
.feature-shot { height: auto; }
.feature-icon { display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--accent); }
.feature-body { padding: 22px; }
.feature-body h3 { margin: 0 0 var(--space-sm); font-size: 17px; font-weight: 700; }
.feature-body .badge { display: inline-block; margin: 0 0 10px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.3px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.feature-body p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* Reports */
.section-reports { background: var(--surface); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 88px 0; }
.reports-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.report-item { display: flex; gap: 14px; padding: 18px; background: var(--bg); border: 1px solid var(--hairline); border-radius: 14px; }
.report-item h3 { margin: 0 0 var(--space-xs); font-size: 15px; font-weight: 700; }
.report-item p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); margin-top: 7px; flex-shrink: 0; }

/* CTA */
.section-cta { padding-top: 96px; padding-bottom: 96px; text-align: center; }
.section-cta .section-title { font-size: 32px; }
.section-cta .section-lede { margin: 0 auto 30px; max-width: 480px; }

/* Footer */
.site-footer { border-top: 1px solid var(--hairline); }

/* Cookie consent banner: opt-in only, see static/site.js */
.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  box-shadow: 0 -8px 24px var(--shadow);
}
.consent-banner[hidden] { display: none; }
.consent-banner-inner {
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
}
.consent-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); max-width: 720px; }
.consent-actions { display: flex; gap: var(--space-sm); flex-shrink: 0; }
.site-footer-inner { padding-top: 40px; padding-bottom: 40px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-md); }
.footer-brand { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.footer-brand img { width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; }
.footer-links { display: flex; gap: var(--space-lg); flex-wrap: wrap; align-items: center; }
.footer-links a { font-size: 13px; color: var(--muted); }
.site-version { font-size: 12px; color: var(--muted); opacity: 0.7; font-variant-numeric: tabular-nums; }

/* Modal */
.modal[hidden] { display: none; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 50; }
.modal-card {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 51;
  width: 380px; max-width: calc(100vw - 48px);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; padding: 28px;
  box-shadow: 0 30px 60px -12px var(--shadow);
}
.modal-close { position: absolute; top: var(--space-md); right: var(--space-md); width: 28px; height: 28px; border-radius: 999px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.modal-title { margin: 0 0 var(--space-sm); font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }
.modal-text { margin: 0 0 20px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.modal-text:last-child { margin-bottom: 0; }
.modal label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.modal input {
  width: 100%; font: inherit; font-size: 15px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--hairline); background: var(--bg); color: var(--text); margin-bottom: var(--space-md);
}
.form-error { margin: -8px 0 var(--space-md); font-size: 13px; color: #F87171; }
[data-theme="light"] .form-error { color: #B91C1C; }

/* Documentation */
.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding-top: 48px; padding-bottom: 96px; align-items: start; }
.docs-nav { position: sticky; top: calc(var(--header-h) + var(--space-lg)); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; padding-right: var(--space-sm); }
.docs-home-link { display: block; font-size: 14px; font-weight: 600; margin-bottom: var(--space-lg); }
.docs-nav-group { margin-bottom: var(--space-lg); }
.docs-nav-group h2 { margin: 0 0 var(--space-sm); font-size: 12px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.docs-nav-group ul { list-style: none; margin: 0; padding: 0; }
.docs-nav-group a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 8px; font-size: 14px; color: var(--text); }
.docs-nav-group a:hover { background: var(--surface); text-decoration: none; }
.docs-nav-group a[aria-current="page"] { background: var(--surface); color: var(--accent); font-weight: 600; }
.docs-nav-mobile { display: none; }

.prose { max-width: 720px; min-width: 0; }
.prose h1 { font-size: 40px; line-height: 1.1; font-weight: 800; letter-spacing: -0.8px; margin: 0 0 var(--space-lg); }
.prose h2 { font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -0.3px; margin: 48px 0 var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--hairline); }
.prose h3 { font-size: 19px; line-height: 1.3; font-weight: 700; margin: 32px 0 var(--space-sm); }
.prose h4 { font-size: 16px; font-weight: 700; margin: var(--space-lg) 0 var(--space-sm); }
.prose h2, .prose h3, .prose h4 { position: relative; }
.heading-anchor { margin-left: var(--space-sm); color: var(--muted); font-weight: 400; opacity: 0; }
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .prose h4:hover .heading-anchor, .heading-anchor:focus { opacity: 1; text-decoration: none; }
.prose :target { animation: target-flash 1.6s ease-out; }
@keyframes target-flash { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } to { background: transparent; } }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--space-md); }
.prose ul, .prose ol { padding-left: var(--space-lg); }
.prose li { margin-bottom: 6px; }
.prose li > ul, .prose li > ol { margin-top: 6px; margin-bottom: 0; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 2px; }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em; background: var(--code-bg); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--code-bg); padding: var(--space-md); border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 0 0 var(--space-md); padding: var(--space-sm) var(--space-md); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: none; border-top: 1px solid var(--hairline); margin: var(--space-xl) 0; }
.prose img { display: block; margin: var(--space-lg) 0; border-radius: var(--radius-card); border: 1px solid var(--hairline); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 var(--space-lg); font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.prose th { font-weight: 700; background: var(--surface); }

.docs-index, .not-found { padding-top: 64px; padding-bottom: 96px; }
.docs-index h1, .not-found h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.8px; margin: 0 0 12px; }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 48px; max-width: 620px; }
.docs-index-group { margin-bottom: 40px; }
.doc-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md); align-items: start; }
.doc-card { display: block; padding: 20px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-card); }
.doc-card:hover { text-decoration: none; border-color: var(--accent); }
.doc-card-title { display: block; font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.doc-card-desc { display: block; font-size: 14px; line-height: 1.45; color: var(--muted); }

@media (max-width: 920px) {
  .container { padding: 0 var(--space-md); }
  .consent-banner-inner { flex-direction: column; align-items: stretch; gap: var(--space-md); }
  .consent-actions { justify-content: flex-end; }
  .nav-wide { display: none; }
  .hero { padding-top: 56px; padding-bottom: 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-title { font-size: 38px; }
  .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .reports-grid { grid-template-columns: 1fr; }
  .section-reports { padding: 64px 0; }
  .docs-layout { grid-template-columns: 1fr; gap: var(--space-lg); padding-top: var(--space-lg); }
  .docs-nav { display: none; }
  .docs-nav-mobile { display: block; background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 12px var(--space-md); }
  .docs-nav-mobile summary { font-weight: 600; cursor: pointer; }
  .docs-nav-mobile nav { padding-top: var(--space-md); }
  .doc-cards { grid-template-columns: 1fr; }
  .prose h1 { font-size: 32px; }
}

@media (max-width: 480px) {
  .site-nav { gap: var(--space-md); }
  .header-actions { gap: var(--space-sm); }
  .brand span { display: none; }
  .btn-sm { padding: 9px 14px; }
  .trust-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .prose :target { animation: none; }
}
