/* Centenarians web — design tokens (CLAUDE.md §7.1) mapped onto Bootstrap 5.3. */
:root {
  --evergreen: #0F3D3E;
  --evergreen-600: #1E5A5B;
  --gold: #E8B04B;
  --cream: #FAF7F0;
  --ink: #1B1F23;
  --slate: #5B6670;
  --mint: #3C9D6E;
  --amber: #D98E04;
  --brick: #C8463D;
  --night: #0E1416;
  --night-card: #172022;

  /* semantic */
  --bg: var(--cream);
  --surface: #FFFFFF;
  --surface-alt: #F1ECE0;
  --text: var(--ink);
  --text-muted: #4A545D;      /* darker than slate for AA contrast on cream */
  --primary: var(--evergreen);
  --primary-hover: var(--evergreen-600);
  --on-primary: #FFFFFF;
  --link: var(--evergreen);
  --border: #D9D2C3;
  --focus: #B57A0E;
  --accent: var(--gold);

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
  --tap: 48px;

  --bs-body-font-family: var(--font-sans);
  --bs-body-font-size: 1.125rem; /* 18px */
  --bs-body-line-height: 1.45;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-link-color: var(--link);
  --bs-link-color-rgb: 15, 61, 62;
  --bs-link-hover-color: var(--primary-hover);
  --bs-border-color: var(--border);
  --bs-secondary-color: var(--text-muted);
  --bs-emphasis-color: var(--text);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--night);
    --surface: var(--night-card);
    --surface-alt: #121B1D;
    --text: #EEF1EF;
    --text-muted: #B4BEC5;
    --primary: var(--gold);
    --primary-hover: #F0C46E;
    --on-primary: #10181A;
    --link: #F0C46E;
    --border: #2C3A3D;
    --focus: var(--gold);
    --bs-link-color-rgb: 240, 196, 110;
    color-scheme: dark;
  }
  .navbar-toggler-icon { filter: invert(1); }
}

html { font-size: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, .brand, .footer-brand { font-family: var(--font-serif); font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.25rem); line-height: 1.12; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.2; margin-bottom: 1rem; }
h3 { font-size: 1.3rem; line-height: 1.3; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.lead { font-size: 1.25rem; color: var(--text-muted); }
.muted, .small, .text-muted { color: var(--text-muted) !important; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--primary-hover); }
[x-cloak] { display: none !important; }

/* Focus — always visible, high contrast */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.btn:focus-visible, .form-control:focus, .form-check-input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 45%, transparent); outline: 3px solid var(--focus); }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 2000;
  background: var(--primary); color: var(--on-primary); padding: 0.75rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 1rem; color: var(--on-primary); }
main:focus { outline: none; }

/* Buttons & touch targets */
.btn { min-height: var(--tap); padding: 0.65rem 1.25rem; font-weight: 600; border-radius: 12px; font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.btn-lg { font-size: 1.15rem; padding: 0.8rem 1.6rem; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-color: var(--on-primary);
  --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover); --bs-btn-hover-color: var(--on-primary);
  --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-border-color: var(--primary-hover); --bs-btn-active-color: var(--on-primary); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary); --bs-btn-hover-color: var(--on-primary); --bs-btn-hover-border-color: var(--primary);
  --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-color: var(--on-primary); }
.nav-link, .footer-links a, .site-footer li a { min-height: var(--tap); display: inline-flex; align-items: center; }
.form-control { min-height: var(--tap); background: var(--surface); color: var(--text); border-color: var(--border); }
.form-label { font-weight: 600; }

/* Header */
.site-header { background: var(--bg); border-bottom: 1px solid var(--border); }
.navbar { padding: 0.5rem 0; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.4rem; color: var(--text); }
.brand:hover { color: var(--text); }
.nav-link { color: var(--text); font-weight: 500; padding: 0.5rem 0.9rem !important; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--link); text-decoration: underline; }
.navbar-toggler { min-width: var(--tap); min-height: var(--tap); border-color: var(--border); }
.lang-switch { display: flex; align-items: center; }
.lang-link[aria-current="true"] { font-weight: 700; text-decoration: underline; }
.btn-cta { margin-left: 0.5rem; }

/* Sections */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--surface-alt); }
.section-cta { background: var(--evergreen); color: #fff; }
.section-cta h2, .section-cta p { color: #fff; }
.section-cta .store-badge { background: #fff; color: var(--evergreen); }
.section-cta .store-note { color: #DCE7E5; }
.narrow { max-width: 820px; }
.page-head { padding: 3.5rem 0 2rem; }
.eyebrow { font-family: var(--font-serif); color: var(--evergreen-600); font-weight: 600; font-size: 1.2rem; margin-bottom: 0.5rem; }
@media (prefers-color-scheme: dark) {
  .eyebrow { color: var(--gold); }
  .section-cta { background: var(--night-card); border-top: 1px solid var(--border); }
  .section-cta .store-badge { background: var(--gold); color: var(--night); }
}

/* Hero */
.hero { padding: 4rem 0 3.5rem; }
.hero h1 { margin-bottom: 1.25rem; }
.hero-secondary { margin-top: 1rem; font-weight: 600; }
.brief-card {
  background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--gold);
  border-radius: var(--radius); padding: 1.75rem; box-shadow: 0 10px 30px rgba(15, 61, 62, 0.08); margin: 0;
}
.brief-label { font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem; }
.brief-text { font-family: var(--font-serif); font-size: 1.3rem; line-height: 1.4; }

/* Store badges (text-based, no hotlinked trademarks) */
.store-badges { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }
.section-cta .store-badges { justify-content: center; }
.store-badge {
  display: inline-flex; align-items: center; gap: 0.7rem; min-height: 56px; padding: 0.5rem 1.2rem;
  background: var(--ink); color: #fff; border-radius: 12px; text-decoration: none; line-height: 1.1;
}
.store-badge:hover { color: #fff; background: #000; }
.store-badge-small { display: block; font-size: 0.78rem; }
.store-badge-big { display: block; font-size: 1.2rem; font-weight: 700; }
.store-note { width: 100%; margin: 0.25rem 0 0; color: var(--text-muted); font-size: 0.95rem; }
@media (prefers-color-scheme: dark) { .store-badge { background: #fff; color: var(--ink); } .store-badge:hover { background: var(--cream); color: var(--ink); } }

/* Steps */
.steps { list-style: none; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.step-num { display: inline-flex; width: 44px; height: 44px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--gold); color: var(--evergreen); font-family: var(--font-serif); font-weight: 700; font-size: 1.3rem; margin-bottom: 0.75rem; }
.badge-soon { display: inline-block; font-family: var(--font-sans); font-size: 0.8rem; font-weight: 700; padding: 0.15rem 0.55rem;
  border-radius: 999px; background: color-mix(in srgb, var(--gold) 30%, transparent); color: var(--text); vertical-align: middle; }

.track-grid { list-style: none; padding: 0; display: grid; gap: 0.75rem 2rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.track-grid li, .check-list li { position: relative; padding-left: 1.9rem; }
.track-grid li::before, .check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--mint); font-weight: 700; }

.promise { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; height: 100%; }
.promise h3 { font-size: 1.2rem; }
.promise p { margin: 0; color: var(--text-muted); }

/* Plans */
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem 1.75rem; height: 100%; position: relative; }
.plan-featured { border: 3px solid var(--gold); }
.plan-flag { position: absolute; top: -0.9rem; left: 1.5rem; background: var(--gold); color: var(--evergreen); font-weight: 700; font-size: 0.85rem; padding: 0.2rem 0.75rem; border-radius: 999px; margin: 0; }
.plan-price { font-size: 2.3rem; font-family: var(--font-serif); font-weight: 700; margin-bottom: 0.25rem; }
.plan-period, .plan-alt { font-family: var(--font-sans); font-size: 1rem; font-weight: 500; color: var(--text-muted); }
.plan-note { font-weight: 600; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { margin-bottom: 0.55rem; }
.plans-footnote { margin-top: 1.5rem; color: var(--text-muted); font-size: 0.95rem; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { min-height: var(--tap); padding: 1rem 2.5rem 1rem 0; font-weight: 600; font-size: 1.15rem; cursor: pointer; list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 0.5rem; top: 0.85rem; font-size: 1.4rem; color: var(--link); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding-bottom: 1rem; margin: 0; color: var(--text-muted); }

/* Prose / legal */
.prose h2 { font-size: 1.5rem; margin-top: 2.25rem; }
.prose p, .prose li { max-width: 70ch; }
.legal-updated { color: var(--text-muted); font-weight: 600; }
.summary-box { background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--evergreen); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.summary-box h2 { margin-top: 0; font-size: 1.3rem; }
.table { --bs-table-bg: var(--surface); --bs-table-color: var(--text); --bs-table-border-color: var(--border); }
.alert-emergency { background: color-mix(in srgb, var(--brick) 12%, var(--surface)); border: 2px solid var(--brick); color: var(--text); border-radius: 12px; }
.alert-emergency::before { content: "⚠ "; font-weight: 700; }

/* Auth fallbacks & errors */
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem 2rem; }
.auth-form { max-width: 460px; }
.open-app { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.error-code { font-family: var(--font-serif); font-size: 5rem; color: var(--gold); font-weight: 700; margin: 0; }

/* Footer */
.site-footer { background: var(--evergreen); color: #E6EFEE; padding: 3rem 0 2rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--gold); }
.site-footer .small, .site-footer .text-muted { color: #CFDCDA !important; }
.footer-brand { color: #fff; font-size: 1.4rem; display: flex; gap: 0.5rem; align-items: center; }
.footer-heading { color: #fff; font-family: var(--font-sans); font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.footer-disclaimer { border-top: 1px solid rgba(255,255,255,0.25); margin-top: 2rem; padding-top: 1.25rem; }
.site-footer :focus-visible { outline-color: var(--gold); }
@media (prefers-color-scheme: dark) { .site-footer { background: #091011; border-top: 1px solid var(--border); } }

/* Cookie banner */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050; background: var(--surface); border-top: 2px solid var(--primary);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.12); padding: 1rem 0; }
.cookie-banner .container { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.cookie-banner p { flex: 1 1 420px; margin: 0; }
.cookie-manage summary { list-style: none; }
.cookie-manage summary::-webkit-details-marker { display: none; }
.cookie-manage-panel { margin-top: 0.75rem; padding: 1rem; border: 1px solid var(--border); border-radius: 12px; max-width: 420px; }
.form-switch .form-check-input { width: 3em; height: 1.6em; }
.form-check-label { padding-left: 0.5rem; }

/* Android install banner */
.android-banner { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0.5rem 0; }
.android-banner .container { display: flex; align-items: center; gap: 0.75rem; }
.android-banner-text { flex: 1; line-height: 1.2; }
.android-banner-close { font-size: 1.6rem; color: var(--text); text-decoration: none; min-width: var(--tap); }

.flash-stack { margin-top: 1rem; }

@media (max-width: 575.98px) {
  .section { padding: 3rem 0; }
  .btn-cta { margin: 0.5rem 0 0; }
  .auth-card { padding: 1.75rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
