/* Safemii website — single shared stylesheet (the ONE brand system).
   Brand colors/tokens mirror the app (SafemiiTheme.kt + DesignTokens.kt) and the
   mark in branding/safemii-icon.svg. Every page links this file; no page defines
   its own colors/spacing/type.

   Design system: 8pt spacing grid + modular type scale + restrained color
   (headlines are near-black, indigo is an accent only). Calm, premium, uncrowded.
*/

:root {
  /* ── Color — app brand tokens (light) ────────────────── */
  --primary: #4F46E5;
  --primary-press: #4338CA;
  --secondary: #0D9373;
  --surface: #FFFFFF;
  --bg: #F8FAFC;
  --surface-2: #F1F5F9;
  --text: #0F172A;          /* headlines + body — near-black, not colored */
  --text-soft: #475569;     /* secondary body */
  --text-mute: #64748B;     /* captions, notes */
  --border: #E2E8F0;        /* hairline */
  --border-soft: #EEF2F6;
  --error: #DC2626;

  /* Elevation — extremely subtle, premium depth (not boxy borders) */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .07);

  /* ── Spacing — 8pt grid ──────────────────────────────── */
  --s1: .25rem;  --s2: .5rem;  --s3: .75rem; --s4: 1rem;
  --s5: 1.5rem;  --s6: 2rem;   --s7: 3rem;   --s8: 4rem;
  --s9: 5rem;    --s10: 7rem;
  /* Vertical rhythm between major sections (fluid). */
  --section-y: clamp(3.5rem, 8vw, 6.5rem);

  /* ── Radius ──────────────────────────────────────────── */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-full: 999px;

  /* ── Type scale (modular, fluid where it matters) ────── */
  --fs-xs: .8125rem;   /* 13 */
  --fs-sm: .9375rem;   /* 15 */
  --fs-base: 1.0625rem;/* 17 — body */
  --fs-lead: 1.1875rem;/* 19 — lead paragraph */
  --fs-h3: 1.25rem;    /* 20 */
  --fs-h2: clamp(1.5rem, 1rem + 1.6vw, 1.875rem);   /* 24 → 30 */
  --fs-h1: clamp(2rem, 1.3rem + 2.4vw, 2.75rem);    /* 32 → 44 */
  --fs-hero: clamp(2.25rem, 1.2rem + 4.6vw, 3.5rem);/* 36 → 56 */

  --lh-tight: 1.12;
  --lh-head: 1.25;
  --lh-body: 1.65;
  --ls-hero: -0.03em;
  --ls-head: -0.02em;
  --ls-eyebrow: 0.08em;

  /* Layout widths */
  --w-page: 1120px;
  --measure: 44rem;   /* ~66ch reading width for prose */

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #818CF8;
    --primary-press: #A5B4FC;
    --secondary: #34D399;
    --surface: #0F172A;
    --bg: #020617;
    --surface-2: #1E293B;
    --text: #F1F5F9;
    --text-soft: #CBD5E1;
    --text-mute: #94A3B8;
    --border: #1E293B;
    --border-soft: #172033;
    --error: #F87171;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .45);
  }
}

/* ── Reset / base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
}
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

.container { max-width: var(--w-page); margin: 0 auto; padding-inline: clamp(1.25rem, 5vw, 2rem); }

/* Eyebrow label — small caps tracking above section headings (premium cue) */
.eyebrow {
  display: block; font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase;
  color: var(--primary); margin-bottom: var(--s3);
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--w-page); margin: 0 auto;
  padding: var(--s5) clamp(1.25rem, 5vw, 2rem);
}
.brand { display: inline-flex; align-items: center; gap: var(--s2);
  font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none; }
.brand img { width: 26px; height: 26px; }
.site-header nav { display: flex; gap: var(--s5); }
.site-header nav a { color: var(--text-soft); text-decoration: none; font-size: var(--fs-sm);
  font-weight: 500; transition: color .15s; }
.site-header nav a:hover { color: var(--text); }

/* ── Buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center;
  padding: .75rem 1.5rem; border-radius: var(--r-sm); font-size: var(--fs-sm);
  font-weight: 600; letter-spacing: -0.01em; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-press); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--text-mute); }
.btn-disabled { background: var(--surface-2); color: var(--text-mute); border-color: var(--border);
  cursor: not-allowed; box-shadow: none; }
.btn-disabled:hover { border-color: var(--border); }

/* ── Hero ───────────────────────────────────────────────── */
.hero { text-align: center; padding: clamp(2.5rem, 6vw, 4.5rem) 0 var(--section-y); max-width: 46rem; margin-inline: auto; }
.hero h1 { font-size: var(--fs-hero); font-weight: 800; line-height: var(--lh-tight);
  letter-spacing: var(--ls-hero); color: var(--text); margin-bottom: var(--s5); text-wrap: balance; }
.hero .tagline { font-size: var(--fs-lead); line-height: 1.5; color: var(--text-soft);
  max-width: 36rem; margin: 0 auto var(--s6); text-wrap: pretty; }
.hero-cta { display: inline-flex; gap: var(--s3); flex-wrap: wrap; justify-content: center; }
.platform-note { margin-top: var(--s5); font-size: var(--fs-xs); color: var(--text-mute); letter-spacing: .01em; }
.launch-note { margin-top: var(--s3); font-size: var(--fs-sm); color: var(--text-soft); }

/* ── Sections (home) ────────────────────────────────────── */
.section { padding-block: var(--section-y); }
.section > h2 { font-size: var(--fs-h2); font-weight: 700; line-height: var(--lh-head);
  letter-spacing: var(--ls-head); text-align: center; margin-bottom: var(--s7); text-wrap: balance; }
.section-copy { max-width: 42rem; margin: 0 auto var(--s7); text-align: center; }
.section-copy h2 { font-size: var(--fs-h2); font-weight: 700; line-height: var(--lh-head);
  letter-spacing: var(--ls-head); margin-bottom: var(--s3); text-wrap: balance; }
.section-copy p { color: var(--text-soft); font-size: var(--fs-base); line-height: 1.6; }
.grid { display: grid; gap: var(--s5); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }

/* Product workflow preview - dummy data, not a fake screenshot. */
.product-preview { padding-top: 0; }
.preview-stage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.preview-card { min-height: 15rem; display: flex; flex-direction: column; gap: var(--s4);
  padding: var(--s5); background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.preview-top { display: flex; justify-content: space-between; gap: var(--s3);
  color: var(--text-mute); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; }
.sample-text { color: var(--text); font-size: var(--fs-sm); line-height: 1.65; }
.finding-list { list-style: none; display: grid; gap: var(--s3); margin: 0; }
.finding-list li { display: flex; align-items: center; gap: var(--s3);
  color: var(--text); font-size: var(--fs-sm); }
.risk { min-width: 4.25rem; text-align: center; border-radius: var(--r-full);
  padding: .2rem .55rem; font-size: var(--fs-xs); font-weight: 800; }
.risk-high { color: #991B1B; background: #FEE2E2; }
.risk-medium { color: #92400E; background: #FEF3C7; }
.risk-low { color: #075985; background: #E0F2FE; }
.clean-preview { border-color: color-mix(in srgb, var(--secondary) 30%, var(--border-soft));
  background: color-mix(in srgb, var(--secondary) 5%, var(--surface)); }

@media (prefers-color-scheme: dark) {
  .risk-high { color: #FCA5A5; background: rgba(127, 29, 29, .45); }
  .risk-medium { color: #FCD34D; background: rgba(120, 53, 15, .45); }
  .risk-low { color: #7DD3FC; background: rgba(12, 74, 110, .45); }
}

.step { text-align: center; padding: var(--s4); }
.step .num { display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: var(--r-full);
  background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary);
  font-weight: 700; font-size: var(--fs-sm); margin-bottom: var(--s4); }
.step h3 { font-size: var(--fs-h3); font-weight: 650; letter-spacing: var(--ls-head); margin-bottom: var(--s2); }
.step p { font-size: var(--fs-sm); color: var(--text-soft); }

.card { padding: var(--s6); background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--border-soft); box-shadow: var(--shadow-xs);
  transition: box-shadow .2s, transform .2s; }
.card h3 { font-size: var(--fs-h3); font-weight: 650; letter-spacing: var(--ls-head);
  margin-bottom: var(--s2); color: var(--text); }
.card p { font-size: var(--fs-sm); color: var(--text-soft); line-height: 1.6; }
.card ul { margin: var(--s3) 0 0 var(--s5); color: var(--text-soft); font-size: var(--fs-sm); }
.card li { margin-bottom: var(--s2); }
a.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ── Trust band ─────────────────────────────────────────── */
.trust { text-align: center; padding: var(--s8) var(--s6); margin-block: var(--section-y);
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-xl); box-shadow: var(--shadow-sm); }
.trust h2 { font-size: var(--fs-h2); font-weight: 700; letter-spacing: var(--ls-head); margin-bottom: var(--s3); text-wrap: balance; }
.trust p { font-size: var(--fs-base); color: var(--text-soft); max-width: 38rem; margin: 0 auto; }
.trust a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.trust a:hover { text-decoration-color: var(--primary); }

/* ── Prose (content pages) ──────────────────────────────── */
.prose { max-width: var(--measure); margin-inline: auto; padding-block: var(--s8) var(--section-y); }
.prose h1 { font-size: var(--fs-h1); font-weight: 800; line-height: var(--lh-tight);
  letter-spacing: var(--ls-hero); margin-bottom: var(--s5); text-wrap: balance; }
.prose h2 { font-size: var(--fs-h2); font-weight: 700; line-height: var(--lh-head);
  letter-spacing: var(--ls-head); margin: var(--s8) 0 var(--s4); text-wrap: balance; }
.prose h3 { font-size: var(--fs-h3); font-weight: 650; letter-spacing: var(--ls-head); margin: var(--s6) 0 var(--s3); }
.prose p { margin-bottom: var(--s4); color: var(--text-soft); }
.prose ul, .prose ol { margin: 0 0 var(--s4) var(--s5); }
.prose li { margin-bottom: var(--s2); color: var(--text-soft); }
.prose li::marker { color: var(--text-mute); }
.prose strong { color: var(--text); font-weight: 650; }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.prose a:hover { text-decoration-color: var(--primary); }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--text-soft); text-wrap: pretty; }

/* Breadcrumb (guides) */
.crumb { font-size: var(--fs-xs); color: var(--text-mute); margin-bottom: var(--s4); letter-spacing: .01em; }
.crumb a { color: var(--text-mute); }
.meta { color: var(--text-mute); font-size: var(--fs-xs); margin-bottom: var(--s4); letter-spacing: .01em; }

/* Answer-first TL;DR callout */
.tldr { background: var(--surface-2); border: 1px solid var(--border-soft);
  border-left: 3px solid var(--primary); border-radius: var(--r-md);
  padding: var(--s5) var(--s6); margin: 0 0 var(--s7); }
.tldr p { margin: 0; font-size: var(--fs-base); color: var(--text); line-height: 1.6; }
.note { background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-md); padding: var(--s5) var(--s6); margin: var(--s6) 0; }
.note p:last-child { margin-bottom: 0; }
.checklist { list-style: none; margin-left: 0 !important; }
.checklist li { position: relative; padding-left: 1.75rem; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--secondary); font-weight: 800; }
.pill-list { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s4) 0 var(--s5); }
.pill { border: 1px solid var(--border); border-radius: var(--r-full); padding: .35rem .75rem;
  color: var(--text-soft); background: var(--surface); font-size: var(--fs-sm); }
.related { border-top: 1px solid var(--border-soft); margin-top: var(--s7); padding-top: var(--s5); }

/* ── FAQ ────────────────────────────────────────────────── */
.faq { display: grid; gap: var(--s3); }
.faq details { border: 1px solid var(--border-soft); border-radius: var(--r-md);
  padding: var(--s4) var(--s5); background: var(--surface); box-shadow: var(--shadow-xs);
  transition: box-shadow .2s; }
.faq details[open] { box-shadow: var(--shadow-sm); }
.faq summary { font-weight: 650; cursor: pointer; font-size: var(--fs-base); letter-spacing: -0.01em;
  list-style: none; display: flex; justify-content: space-between; gap: var(--s4); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-mute); font-weight: 400; font-size: 1.25rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin: var(--s3) 0 0; color: var(--text-soft); font-size: var(--fs-sm); line-height: 1.6; }

/* ── Comparison table ───────────────────────────────────── */
.cmp { width: 100%; border-collapse: collapse; margin: var(--s4) 0 var(--s7); font-size: var(--fs-sm);
  border: 1px solid var(--border-soft); border-radius: var(--r-md); overflow: hidden; }
.cmp th, .cmp td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border-soft); }
.cmp thead th { background: var(--surface-2); font-weight: 650; color: var(--text); letter-spacing: -0.01em; }
.cmp tbody tr:last-child td { border-bottom: 0; }
.cmp td:first-child { color: var(--text-mute); }
.cmp td:last-child { color: var(--text); font-weight: 550; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { text-align: center; padding: var(--s8) var(--s5) var(--s7);
  color: var(--text-mute); font-size: var(--fs-xs);
  border-top: 1px solid var(--border-soft); margin-top: var(--section-y); }
.site-footer nav { display: flex; gap: var(--s5); justify-content: center; flex-wrap: wrap; margin-bottom: var(--s4); }
.site-footer a { color: var(--text-soft); text-decoration: none; font-size: var(--fs-sm); }
.site-footer a:hover { color: var(--text); }

/* ── Scroll reveal (subtle, JS-enhanced, motion-safe) ───── */
html.reveal-ready .reveal { opacity: 0; transform: translateY(14px); }
html.reveal-ready .reveal.in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.2,.6,.2,1); }
@media (prefers-reduced-motion: reduce) {
  html.reveal-ready .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 600px) {
  .site-header { padding-block: var(--s4); }
  .site-header nav { gap: var(--s4); }
  .card { padding: var(--s5); }
  .trust { padding: var(--s7) var(--s5); }
  .preview-stage { grid-template-columns: 1fr; }
  .preview-card { min-height: auto; }
  .preview-top { flex-direction: column; gap: var(--s1); }
}

/* ── Self-hosted variable font (activate to upgrade from system stack) ──
   Drop Inter (or similar) .woff2 in /fonts, then prepend "Inter var" to --font.
@font-face {
  font-family: "Inter var";
  src: url("/fonts/Inter-roman.var.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; font-style: normal;
}
*/
