/* The Clearest Path — marketing site design system
   Brand tokens are literal, non-substitutable: see theme/colors.ts + the
   app's OFFICIAL COLOURWAY constants (used across dark surfaces, PathMark,
   journal moods) for where these exact hexes come from. */

@import url("https://fonts.googleapis.com/css2?family=Marcellus&family=Inter:wght@400;500;600&display=swap");

:root {
  --deep-green: #3E473A;
  --muted-clay: #9B715D;
  --warm-ivory: #F7F3EC;
  --soft-oat: #E7DFD1;
  --border: #8A887D;
  --charcoal: #333230;
  --gold: #B99B5F; /* earned/premium accent only — Plus, never general UI */

  --ink-on-dark: #F2EFE8;
  --text-secondary: #5D5A53;

  --serif: "Marcellus", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 1120px;
  --max-content: 640px;

  --radius-control: 10px;
  --radius-card: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--charcoal);
  background: var(--warm-ivory);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--charcoal);
  margin: 0;
  font-weight: 400;
}
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap-narrow {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- texture ----------
   Reproduces the original site's own fine-grain noise (an SVG
   feTurbulence filter, not a tiled bitmap) at the same settings it used
   on the dark hero: 200x200 tile, baseFrequency .85, 3 octaves,
   desaturated, 5% opacity. Kept as its own data-URI (no external file)
   so it renders identically anywhere. */
.textured-dark {
  position: relative;
  background-color: var(--deep-green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}
.textured {
  background-color: var(--warm-ivory);
}
/* The softer, warmer grain used on the original site's light/parchment
   buttons: 140x140 tile, baseFrequency .65, 4 octaves, 16% opacity. */
.textured-paper {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 243, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand .mark {
  width: 1.5px;
  height: 22px;
  border-radius: 999px;
  background: var(--gold);
}
.brand .word {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--charcoal);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--charcoal); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius-control);
  background: var(--deep-green);
  color: var(--ink-on-dark) !important;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
}
.nav-toggle span { width: 20px; height: 1px; background: var(--charcoal); }
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px 24px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--warm-ivory);
}
.mobile-nav a {
  padding: 12px 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--charcoal);
  border-bottom: 1px solid var(--soft-oat);
}
.mobile-nav.open { display: flex; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: opacity 0.15s, transform 0.15s;
  border: 1px solid transparent;
}
.btn:hover { opacity: 0.88; }
.btn-primary { background: var(--deep-green); color: var(--ink-on-dark); }
.btn-clay { background: var(--muted-clay); color: var(--warm-ivory); }
.btn-outline-dark { border-color: rgba(242,239,232,0.5); color: var(--ink-on-dark); }
.btn-outline-dark:hover { border-color: var(--ink-on-dark); }
.btn-outline { border-color: var(--border); color: var(--charcoal); }
.btn-outline:hover { border-color: var(--charcoal); }
/* Solid warm-ivory button with the original site's parchment grain,
   used for the secondary hero action ("Explore the App") — matches how
   it looked before, not the clay/terracotta swap. */
.btn-ivory {
  background-color: var(--soft-oat);
  color: var(--deep-green);
  border-color: var(--border);
}
.btn-ivory:hover { opacity: 0.92; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- eyebrow / rule ---------- */
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.eyebrow-on-dark { color: rgba(242,239,232,0.7); }
.rule {
  width: 1.5px;
  height: 20px;
  border-radius: 999px;
  background: var(--gold);
  margin: 20px auto;
}

/* ---------- sections ---------- */
section { padding: 72px 0; }
.section-tight { padding: 56px 0; }
.center { text-align: center; }

h1.display { font-size: 40px; line-height: 1.2; }
h2.display { font-size: 32px; line-height: 1.25; }
@media (max-width: 640px) {
  h1.display { font-size: 28px; line-height: 1.3; }
  h2.display { font-size: 26px; line-height: 1.3; }
}

.lede {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ---------- cards ---------- */
.card {
  background: #FCFAF6;
  border: 1px solid var(--soft-oat);
  border-radius: var(--radius-card);
  padding: 28px;
}
.grid {
  display: grid;
  gap: 20px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  background: var(--soft-oat);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}
.footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 12.5px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}
.footer-links a:hover { color: var(--charcoal); }
.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- FAQ accordion ---------- */
.faq-item {
  border-bottom: 1px solid var(--soft-oat);
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--charcoal);
}
.faq-q .icon { flex: none; font-size: 18px; color: var(--muted-clay); transition: transform 0.2s; }
.faq-item.open .faq-q .icon { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.faq-item.open .faq-a { max-height: 600px; }
.faq-a p {
  padding: 0 0 22px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ---------- legal pages ---------- */
.legal h2 {
  font-size: 20px;
  margin-top: 40px;
  margin-bottom: 12px;
}
.legal h2:first-of-type { margin-top: 0; }
.legal p, .legal li {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.legal strong { color: var(--charcoal); }
.legal ul { padding-left: 20px; margin-bottom: 14px; }
.legal li { list-style: disc; margin-bottom: 8px; }
.legal-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.legal-notice {
  background: var(--soft-oat);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  font-size: 13.5px;
  color: var(--charcoal);
  margin: 24px 0 40px;
}

/* ---------- accessibility ---------- */
html.a11y-larger-text { font-size: 113%; }
html.a11y-wide-spacing body { letter-spacing: 0.01em; line-height: 1.75; }
html.a11y-wide-spacing p, html.a11y-wide-spacing li { letter-spacing: 0.01em; line-height: 1.8; }
html.a11y-reduced-motion *, html.a11y-reduced-motion *::before, html.a11y-reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
html.a11y-high-contrast body { background: #FFFFFF; color: #000000; }
html.a11y-high-contrast .textured-dark,
html.a11y-high-contrast .textured,
html.a11y-high-contrast .textured-paper { background-image: none !important; }
html.a11y-high-contrast .textured-dark { background-color: #14170F; }
html.a11y-high-contrast .textured-dark .text-on-dark,
html.a11y-high-contrast .textured-dark .text-on-dark-70,
html.a11y-high-contrast .textured-dark .eyebrow-on-dark { color: #FFFFFF; }
html.a11y-high-contrast .card,
html.a11y-high-contrast .why-card,
html.a11y-high-contrast .share-card,
html.a11y-high-contrast .price-box { background: #FFFFFF; border-color: #000000; border-width: 1.5px; }
html.a11y-high-contrast .lede, html.a11y-high-contrast .text-secondary,
html.a11y-high-contrast .eyebrow, html.a11y-high-contrast .legal p, html.a11y-high-contrast .legal li,
html.a11y-high-contrast .faq-a p, html.a11y-high-contrast .footer-links a { color: #000000 !important; }
html.a11y-high-contrast a { text-decoration: underline; }
html.a11y-high-contrast .btn-primary { background: #000000; color: #FFFFFF; }
html.a11y-high-contrast .btn-ivory, html.a11y-high-contrast .btn-outline { background: #FFFFFF; color: #000000; border: 2px solid #000000; }

.a11y-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  border-radius: 999px;
  background: var(--deep-green);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(41,42,39,0.3);
  z-index: 200;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
}
.a11y-fab:hover { transform: scale(1.05); }
.a11y-fab svg { width: 22px; height: 22px; }
.a11y-fab[hidden] { display: none; }

.a11y-backdrop {
  position: fixed; inset: 0; background: rgba(41,42,39,0.35);
  z-index: 210; display: flex; align-items: flex-end; justify-content: center;
}
.a11y-backdrop[hidden] { display: none; }
.a11y-sheet {
  width: 100%;
  max-width: 420px;
  background: #FCFAF6;
  border-radius: 20px 20px 0 0;
  padding: 24px 24px 28px;
  box-shadow: 0 -8px 30px rgba(41,42,39,0.2);
}
@media (min-width: 640px) {
  .a11y-backdrop { align-items: center; }
  .a11y-sheet { border-radius: 16px; margin-bottom: 40px; }
}
.a11y-sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.a11y-sheet-header h2 { font-size: 19px; }
.a11y-close { background: none; border: none; cursor: pointer; padding: 6px; color: var(--text-secondary); }
.a11y-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--soft-oat);
}
.a11y-row-text p:first-child { font-size: 14.5px; font-weight: 500; color: var(--charcoal); }
.a11y-row-text p:last-child { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.a11y-switch {
  position: relative; flex: none; width: 42px; height: 25px; border-radius: 999px;
  background: var(--soft-oat); border: 1px solid var(--border); cursor: pointer; padding: 0;
  transition: background 0.15s;
}
.a11y-switch[aria-checked="true"] { background: var(--accent, #6F7965); }
.a11y-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px;
  border-radius: 999px; background: #fff; transition: transform 0.15s;
}
.a11y-switch[aria-checked="true"]::after { transform: translateX(17px); }
.a11y-reset {
  width: 100%; text-align: center; background: none; border: none; cursor: pointer;
  margin-top: 20px; font-size: 11px; color: var(--text-secondary); padding: 8px;
}
.a11y-hide {
  width: 100%; text-align: center; background: none; border: none; cursor: pointer;
  margin-top: 4px; font-size: 12.5px; color: var(--muted-clay); padding: 8px;
}

/* ---------- utility ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--deep-green);
  color: var(--ink-on-dark);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 16px; top: 16px; }
.mt-xs { margin-top: 8px; } .mt-sm { margin-top: 16px; } .mt-md { margin-top: 24px; }
.mt-lg { margin-top: 40px; } .mt-xl { margin-top: 56px; }
.text-on-dark { color: var(--ink-on-dark); }
.text-on-dark-70 { color: rgba(242,239,232,0.75); }
.gold-text { color: var(--gold); }
.clay-text { color: var(--muted-clay); }
