/* =============================================================
   Vitarix — Apple System CSS
   Single source of truth. No imports, no dependencies, no utility
   soup. Near-monochrome, system fonts, whitespace-forward.

   Palette: white / near-black / grey. The phone screenshots are
   the only color on the page — same principle as apple.com.

   Dark mode: Apple's actual dark mode palette, auto-enabled via
   prefers-color-scheme. Matches apple.com dark mode exactly.
   ============================================================= */

/* ─── Tokens (Light mode — default) ────────────────────────── */
:root {
  /* Monochrome ramp (Apple's actual values, tuned for WCAG AA) */
  --white:       #FFFFFF;
  --cloud:       #F5F5F7;   /* section background variation */
  --hairline:    #D2D2D7;   /* separators, borders */
  --grey-1:      #6E6E73;   /* body text, captions — 5.07:1 on white */
  --grey-2:      #6E6E73;   /* secondary captions */
  --grey-3:      #AEAEB2;   /* disabled, faint */
  --ink:         #1D1D1F;   /* headlines, primary text — Apple's near-black */
  --ink-soft:    #424245;   /* body prose — 10:1 on white */
  --link:        #0066CC;   /* link blue */

  /* Semantic aliases (so dark mode can override just these) */
  --bg:          var(--white);
  --bg-elevated: var(--cloud);
  --text:        var(--ink);
  --text-soft:   var(--ink-soft);
  --text-mute:   var(--grey-1);
  --text-faint:  var(--grey-2);
  --border:      var(--hairline);
  --nav-bg:      rgba(255, 255, 255, 0.72);

  /* Motion */
  --ease:        cubic-bezier(0.42, 0, 0.58, 1);
  --dur:         0.3s;

  /* Layout */
  --maxw:        980px;
  --maxw-narrow: 740px;
  --gutter:      clamp(1.25rem, 5vw, 2rem);
  --section-y:   clamp(5rem, 12vw, 8.75rem);

  /* Type scale */
  --fs-hero:     clamp(2.75rem, 7vw, 5rem);
  --fs-h1:       clamp(2.25rem, 5vw, 3.5rem);
  --fs-h2:       clamp(1.75rem, 3.5vw, 2.5rem);
  --fs-h3:       clamp(1.375rem, 2vw, 1.75rem);
  --fs-body:     1.1875rem;   /* 19px — Apple's body size */
  --fs-body-sm:  1rem;
  --fs-caption:  0.875rem;

  /* Radii */
  --r-card:      18px;
  --r-pill:      980px;
  --r-phone:     44px;
}

/* ─── Dark mode (Apple's actual dark palette) ──────────────── */
/* Auto-enabled via prefers-color-scheme. Matches apple.com dark mode. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #000000;   /* Apple uses true black for OLED */
    --bg-elevated: #1C1C1E;   /* card/panel background */
    --text:        #F5F5F7;   /* primary text — white-ish */
    --text-soft:   #E5E5E7;   /* body prose */
    --text-mute:   #A2A2A7;   /* captions — 7:1 on black, passes AA */
    --text-faint:  #8E8E93;   /* faint text — 5.5:1 on black, passes AA */
    --border:      #38383A;   /* separators — visible on black */
    --nav-bg:      rgba(0, 0, 0, 0.72);
    --link:        #2997FF;   /* Apple's dark-mode link blue — brighter for contrast */
      --glow-color: rgba(255,255,255,0.06);
  }
}

/* ─── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Inter", system-ui, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.47;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul, ol { list-style: none; }

/* ─── Layout primitives ───────────────────────────────────── */
.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow {
  max-width: var(--maxw-narrow);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section-cloud { background: var(--bg-elevated); }

/* ─── Typography ───────────────────────────────────────────── */
.hero-title {
  font-size: var(--fs-hero);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.07;
  text-wrap: balance;
}
.h1 {
  font-size: var(--fs-h1);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}
.h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.12;
  text-wrap: balance;
}
.h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.body { font-size: var(--fs-body); line-height: 1.47; color: var(--text-mute); }
.body-lg { font-size: 1.3125rem; line-height: 1.4; color: var(--text-mute); letter-spacing: -0.01em; }
.caption { font-size: var(--fs-caption); color: var(--text-faint); line-height: 1.4; }

/* ─── Navigation ───────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav__brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}
.nav__links { display: flex; align-items: center; gap: 2rem; }
.nav__link {
  font-size: 0.875rem;
  color: var(--text);
  opacity: 0.88;
  transition: opacity var(--dur) var(--ease);
}
.nav__link:hover { opacity: 1; }
.nav__actions { display: flex; align-items: center; gap: 1rem; }
.nav__lang {
  font-size: 0.875rem;
  color: var(--text);
  opacity: 0.72;
  padding: 0.25rem 0.5rem;
  transition: opacity var(--dur) var(--ease);
}
.nav__lang:hover { opacity: 1; }
@media (max-width: 768px) {
  .nav__links { display: none; }
}

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--r-pill);
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { opacity: 0.8; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--ink);
}
.btn-secondary:hover { background: var(--bg-elevated); }
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 1.0625rem;
  color: var(--link);   /* Apple's link blue — the one allowed accent */
  transition: opacity var(--dur) var(--ease);
}
.btn-link:hover { opacity: 0.7; }
.btn-link::after { content: "›"; font-size: 1.2em; line-height: 1; }

/* ─── Hero ─────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding-block: clamp(4rem, 10vw, 7rem) clamp(2rem, 5vw, 3rem);
  overflow: hidden;
}
.hero__eyebrow {
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-mute);   /* was --ink at opacity 0.6 (3.27:1, failed AA); --grey-1 = 5.07:1 */
  margin-bottom: 1rem;
}
.hero__title { margin-bottom: 1.25rem; }
.hero__sub {
  max-width: 640px;
  margin: 0 auto 2.5rem;
  font-size: 1.375rem;
  line-height: 1.4;
  color: var(--text-mute);
  letter-spacing: -0.01em;
}
.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
  align-items: center;
}

/* Hero phone — larger, with subtle product-stage treatment */
.hero__shot {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  display: flex;
  justify-content: center;
  position: relative;
}
.hero__shot img {
  max-width: 440px;
  width: 100%;
  border-radius: var(--r-phone);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.08),
    0 8px 24px -4px rgba(0,0,0,0.12),
    0 24px 80px -12px rgba(0,0,0,0.18);
  position: relative;
  z-index: 2;
}
/* Subtle radial glow behind the phone — barely visible, adds depth */
.hero__shot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  max-width: 700px;
  max-height: 700px;
  background: radial-gradient(ellipse at center, var(--glow-color, rgba(29,29,31,0.04)) 0%, transparent 60%);
  z-index: 1;
  pointer-events: none;
}
@media (max-width: 768px) {
  .hero__shot img { max-width: 300px; }
  .hero__shot::before { max-width: 500px; max-height: 500px; }
}

/* ─── Moat (the 16,000 number) ─────────────────────────────── */
.moat {
  text-align: center;
  padding-block: var(--section-y);
}
.moat__number {
  font-size: clamp(6rem, 18vw, 12rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.moat__number-suffix {
  font-size: 0.5em;
  vertical-align: super;
  color: var(--text-mute);
}
.moat__caption {
  max-width: 540px;
  margin: 1.5rem auto 0;
  font-size: 1.375rem;
  line-height: 1.4;
  color: var(--text-mute);
}
.moat__stats {
  display: flex;
  justify-content: center;
  gap: clamp(2rem, 6vw, 4rem);
  margin-top: 3rem;
  flex-wrap: wrap;
}
.moat__stat-num {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.moat__stat-label {
  font-size: var(--fs-caption);
  color: var(--text-faint);
  margin-top: 0.25rem;
}

/* ─── Feature showcase (one phone per section) ─────────────── */
.feature {
  padding-block: var(--section-y);
  text-align: center;
}
.feature__headline {
  max-width: 640px;
  margin: 0 auto 1.5rem;
}
.feature__body {
  max-width: 560px;
  margin: 0 auto 3rem;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--text-mute);
}
.feature__shot {
  display: flex;
  justify-content: center;
}
.feature__shot img {
  max-width: 340px;
  width: 100%;
  border-radius: var(--r-phone);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.15);
}
.feature__shot-trio {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.feature__shot-trio img {
  max-width: 220px;
  border-radius: var(--r-phone);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.15);
}
@media (max-width: 768px) {
  .feature__shot img { max-width: 260px; }
  .feature__shot-trio img { max-width: 160px; }
}

/* ─── Pull quote ───────────────────────────────────────────── */
.quote {
  padding-block: var(--section-y);
  text-align: center;
}
.quote__text {
  max-width: 680px;
  margin: 0 auto;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text);
  text-wrap: balance;
}
.quote__attr {
  margin-top: 1.5rem;
  font-size: 1rem;
  color: var(--text-faint);
}

/* ─── FAQ ──────────────────────────────────────────────────── */
.faq { padding-block: var(--section-y); }
.faq__title { text-align: center; margin-bottom: 3rem; }
.faq__list { max-width: 680px; margin: 0 auto; }
.faq__item {
  border-bottom: 1px solid var(--border);
}
.faq__item summary {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text);
  padding: 1.25rem 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-faint);
  transition: transform var(--dur) var(--ease);
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__answer {
  padding-bottom: 1.25rem;
  color: var(--text-mute);
  line-height: 1.5;
}

/* ─── Final CTA ────────────────────────────────────────────── */
.cta-final {
  text-align: center;
  padding-block: var(--section-y);
  background: var(--bg-elevated);
}
.cta-final__title { margin-bottom: 1rem; }
.cta-final__sub {
  max-width: 540px;
  margin: 0 auto 2.5rem;
  font-size: 1.25rem;
  color: var(--text-mute);
}
.cta-final__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* ─── Footer ───────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 2.5rem 2rem;
  font-size: var(--fs-caption);
  color: var(--text-faint);
}
.footer__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer__links { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer__link { color: var(--text-faint); transition: color var(--dur) var(--ease); }
.footer__link:hover { color: var(--text); }

/* ─── GEO: Key Takeaways (AI-citable summary block) ────────── */
/* Per GEO skill: TL;DR/Key Takeaways placed after intro, highly cited by AI */
.geo-takeaways {
  max-width: 680px;
  margin: 0 auto;
  padding-block: clamp(2rem, 5vw, 3rem);
  text-align: start;
}
.geo-takeaways__title {
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
}
.geo-takeaways ul {
  padding-inline-start: 0;
  list-style: none;
}
.geo-takeaways li {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-soft);
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.geo-takeaways li:last-child { border-bottom: none; }
.geo-takeaways strong { color: var(--text); font-weight: 600; }

/* ─── GEO: Citable answer block (QAE pattern) ──────────────── */
/* Per GEO skill: Question (H2) → Answer (2 sentences) → Evidence */
.geo-answer {
  max-width: 680px;
  margin: 0 auto;
  padding-block: var(--section-y);
}
.geo-answer__question {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1rem;
  text-wrap: balance;
}
.geo-answer__answer {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--text-soft);
  margin-bottom: 1.5rem;
  font-weight: 400;
}
.geo-answer__evidence {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-mute);
}

/* ─── Content page (about, privacy, terms, ai-ethics) ──────── */
.page-header {
  text-align: center;
  padding-block: clamp(5rem, 12vw, 8rem) clamp(3rem, 6vw, 5rem);
}
.page-header__eyebrow {
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-mute);   /* was --ink at opacity 0.5 (failed AA); --grey-1 = 5.07:1 */
  margin-bottom: 1.5rem;
}
.page-header__title { margin-bottom: 1.75rem; }
.page-header__sub {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.375rem;
  line-height: 1.5;
  color: var(--text-soft);
}

/* Section title — large, centered, used before principles/prose blocks */
.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-align: center;
  color: var(--text);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  text-wrap: balance;
}

/* Prose sections for legal/content pages
   Readability fix: body text uses --ink-soft (near-black, 10:1 contrast)
   instead of --grey-1. Apple's actual prose pages (apple.com/legal)
   use near-black body text, not grey. Grey is for captions/secondary. */
.prose {
  max-width: 680px;
  margin: 0 auto;
  padding-block: var(--section-y);
}
.prose section { margin-bottom: 3.5rem; }
.prose section:last-child { margin-bottom: 0; }
.prose h2 {
  font-size: 1.875rem;        /* 30px — was 26px, bigger for hierarchy */
  font-weight: 600;
  letter-spacing: -0.018em;
  margin-bottom: 1.5rem;
  color: var(--text);
  line-height: 1.2;
}
.prose h3 {
  font-size: 1.3125rem;       /* 21px — was 20px */
  font-weight: 600;
  margin-top: 2.25rem;
  margin-bottom: 0.875rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.prose p {
  font-size: 1.125rem;       /* 18px */
  line-height: 1.7;          /* was 1.65 — more breathing room */
  color: var(--text-soft);     /* #424245 — 10:1 contrast */
  margin-bottom: 1.375rem;
  font-weight: 400;
}
.prose p:last-child { margin-bottom: 0; }
.prose ul {
  margin: 1.5rem 0;
  padding-inline-start: 1.5rem;
}
.prose li {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-soft);
  margin-bottom: 0.75rem;
  list-style: disc;
}
.prose a {
  color: var(--link);
  text-decoration: none;
}
.prose a:hover { text-decoration: underline; }

/* Value/principle list (about, ai-ethics) */
.principles {
  max-width: 680px;
  margin: 0 auto;
  padding-block: var(--section-y);
}
.principle {
  padding-block: 2.5rem;      /* was 2rem — more breathing room */
  border-bottom: 1px solid var(--border);
}
.principle:first-child { padding-top: 0; }
.principle:last-child { border-bottom: none; padding-bottom: 0; }
.principle__num {
  font-size: 0.8125rem;       /* 13px — small, monospaced feel */
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.875rem;
}
.principle__title {
  font-size: 1.625rem;        /* 26px — was 22px, much bigger */
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text);
}
.principle__body {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-soft);
}

/* Stats row (about page) */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(2.5rem, 7vw, 5rem);
  padding-block: clamp(3.5rem, 7vw, 6rem);
  border-block: 1px solid var(--border);
}
.stats-row__item { text-align: center; }
.stats-row__num {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.stats-row__label {
  font-size: var(--fs-caption);
  color: var(--text-faint);
  margin-top: 0.25rem;
}

/* ─── Bilingual / RTL ──────────────────────────────────────── */
.en { display: block; }
.ar { display: none; }
html[dir="rtl"] .en { display: none; }
html[dir="rtl"] .ar { display: block; }
html[dir="rtl"] { text-align: right; }
html[dir="rtl"] .hero,
html[dir="rtl"] .moat,
html[dir="rtl"] .feature,
html[dir="rtl"] .quote,
html[dir="rtl"] .cta-final,
html[dir="rtl"] .page-header { text-align: right; }
html[dir="rtl"] .hero__sub,
html[dir="rtl"] .hero__ctas,
html[dir="rtl"] .hero__shot,
html[dir="rtl"] .moat__caption,
html[dir="rtl"] .moat__stats,
html[dir="rtl"] .feature__headline,
html[dir="rtl"] .feature__body,
html[dir="rtl"] .feature__shot,
html[dir="rtl"] .page-header__sub { margin-inline: 0; margin-right: auto; }

/* ─── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Focus visibility ─────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 4px;
}
