/* Maat Journal — website stylesheet.
   Tokens mirror the app's light "Papyrus" theme (maat-app lib/core/theme/app_theme.dart, docs/BRAND.md). */

:root {
  --bg: #f5eedd;
  --card: #fffcf5;
  --surface-low: #ebe2c8;
  --surface-container: #fbf6e8;
  --ink: #2b2318;
  --ink-2: #6b5e47;
  --gold: #c8962d;
  --gold-deep: #82621d;
  --border: #beab7f;
  --divider: #d5c9a8;
  --shadow: rgba(43, 35, 24, 0.07);
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-quote: "Newsreader", Georgia, serif;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --measure: 62ch;
  --page: min(1120px, calc(100% - 48px));
}

*, *::before, *::after { box-sizing: border-box; }
[id] { scroll-margin-top: 88px; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(125% 90% at 50% -10%, rgba(200, 150, 45, 0.11), transparent 70%),
    var(--bg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-deep); text-underline-offset: 0.15em; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.5rem, 5.4vw, 4.25rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.25; }
.lede { color: var(--ink-2); font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.55; max-width: var(--measure); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink-2); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 24px; height: 2px; border-radius: 1px; background: var(--gold); }
.gold { color: var(--gold-deep); }
.skip-link { position: absolute; left: -999px; top: 8px; padding: 8px 12px; background: var(--card); border-radius: var(--r-md); z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 20px; border-radius: var(--r-md); border: 1px solid transparent;
  font: 600 0.95rem/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease), box-shadow 160ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--gold); color: #000; }
.btn-primary:hover { background: #d4a439; }
.btn-secondary { background: var(--surface-container); color: var(--ink); border-color: rgba(190, 171, 127, 0.4); font-weight: 500; }
.btn-secondary:hover { background: var(--card); }
.btn-store { background: var(--ink); color: var(--bg); padding: 10px 18px; text-align: left; min-width: 168px; }
.btn-store:hover { background: #3a2f24; }
.btn-store svg { width: 22px; height: 22px; flex: none; fill: currentColor; }
.btn-store small { display: block; font-size: 0.66rem; font-weight: 500; opacity: 0.8; line-height: 1.1; }
.btn-store strong { display: block; font-size: 1rem; font-weight: 600; line-height: 1.15; }
.btn-store span { display: grid; }
.store-row { display: flex; flex-wrap: wrap; gap: 12px; }
.text-link { color: var(--gold-deep); font-weight: 500; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- nav ---------- */
.site-nav { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(245, 238, 221, 0.82); border-bottom: 0.5px solid rgba(213, 201, 168, 0.65); }
.site-nav .inner { width: var(--page); margin: 0 auto; min-height: 64px; display: flex; align-items: center; gap: 24px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--font-body); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; }
.wordmark img { width: 34px; height: 29px; }
.site-nav ul { display: flex; gap: 24px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.site-nav ul a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; font-weight: 500; padding: 8px 0; }
.site-nav ul a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-actions .btn { min-height: 40px; padding: 8px 16px; font-size: 0.875rem; }
.lang-switcher select {
  min-height: 40px; padding: 6px 30px 6px 12px; border-radius: var(--r-md); border: 1px solid rgba(190, 171, 127, 0.4);
  background: var(--surface-container) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%236b5e47' stroke-width='1.5'/></svg>") no-repeat right 10px center;
  color: var(--ink); font: 500 0.875rem var(--font-body); appearance: none; -webkit-appearance: none; cursor: pointer;
}

/* ---------- layout ---------- */
.section { width: var(--page); margin: 0 auto; padding: clamp(64px, 9vw, 112px) 0; }
.section-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 56px); display: grid; gap: 16px; }
.band { background: var(--surface-low); }
.band .section { padding-block: clamp(56px, 8vw, 96px); }

/* hero */
.hero { width: var(--page); margin: 0 auto; padding: clamp(56px, 8vw, 96px) 0 clamp(48px, 7vw, 80px); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr); align-items: center; gap: clamp(32px, 6vw, 80px); }
.hero-copy { display: grid; gap: 24px; }
.hero-copy h1 { max-width: 12ch; }
.hero-copy .lede { max-width: 46ch; }
.hero-copy .store-row { margin-top: 8px; }
.hero-meta { color: var(--ink-2); font-size: 0.875rem; }
.hero-visual { display: flex; justify-content: center; }

/* phone frame */
.phone { width: min(300px, 100%); aspect-ratio: 9 / 19.5; padding: 10px; border-radius: 44px; background: #2b2318; box-shadow: 0 24px 60px rgba(43, 35, 24, 0.18), 0 2px 12px var(--shadow); }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 34px; background: var(--bg); }
.phone-sm { width: 100%; padding: 6px; border-radius: 28px; aspect-ratio: 9 / 16; }
.phone-sm img { border-radius: 22px; }

/* steps on the gold thread */
.steps { display: grid; gap: 0; max-width: 560px; }
.step { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 20px; padding-bottom: 32px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 11.5px; top: 22px; bottom: 0; width: 1px; background: var(--gold); opacity: 0.72; }
.step:last-child::before { display: none; }
.step .node { position: relative; width: 24px; height: 24px; display: grid; place-items: center; }
.step .node::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1.5px var(--bg); }
.step h3 { margin-bottom: 6px; }
.step p { color: var(--ink-2); max-width: 44ch; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }

/* cards */
.card { background: var(--card); border-radius: var(--r-lg); padding: 24px; box-shadow: 0 2px 12px var(--shadow); }
.card-hero { border-radius: var(--r-xl); }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.feature { display: grid; grid-template-columns: 1fr 120px; gap: 20px; align-items: start; }
.feature .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-container); display: grid; place-items: center; margin-bottom: 14px; }
.feature .icon svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.feature p { color: var(--ink-2); font-size: 0.95rem; }
.feature h3 { margin-bottom: 6px; }

/* maat score band */
.score { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 6vw, 72px); align-items: center; }
.score-copy { display: grid; gap: 20px; }
.score-copy h2 { max-width: 18ch; }
.score-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 0.9rem; }
.score-facts li { display: inline-flex; align-items: center; gap: 8px; }
.score-facts li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.score-note { color: var(--ink-2); font-size: 0.875rem; }
.ring { width: 230px; height: 230px; display: grid; place-items: center; position: relative; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: rgba(190, 171, 127, 0.35); stroke-width: 2; }
.ring .arc { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; }
.ring .center { text-align: center; }
.ring .center strong { display: block; font-family: var(--font-display); font-size: 3.2rem; font-weight: 700; line-height: 1; }
.ring .center span { color: var(--ink-2); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* testimonials */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.quote { display: grid; gap: 16px; align-content: start; }
.quote blockquote { margin: 0; font-family: var(--font-quote); font-size: 1.15rem; line-height: 1.4; }
.quote figcaption { color: var(--ink-2); font-size: 0.85rem; }
.quote .stars { color: var(--gold); letter-spacing: 2px; font-size: 0.8rem; }

/* final cta */
.cta { text-align: center; display: grid; justify-items: center; gap: 24px; }
.cta h2 { max-width: 16ch; }
.cta .store-row { justify-content: center; }

/* footer */
.site-footer { border-top: 0.5px solid rgba(213, 201, 168, 0.65); }
.site-footer .inner { width: var(--page); margin: 0 auto; padding: 40px 0; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; color: var(--ink-2); font-size: 0.875rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer nav a { color: var(--ink-2); text-decoration: none; }
.site-footer nav a:hover { color: var(--ink); }
.site-footer .legal { display: grid; gap: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .phone { width: min(240px, 70vw); }
  .split, .score { grid-template-columns: 1fr; }
  .score .ring { justify-self: start; }
  .quotes { grid-template-columns: 1fr; }
  .site-nav ul { display: none; }
}
@media (max-width: 600px) {
  :root { --page: min(1120px, calc(100% - 32px)); }
  .feature-grid { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; }
  .feature .phone-sm { display: none; }
  .site-footer .inner { grid-template-columns: 1fr; }
  .nav-actions .btn-secondary { display: none; }
  .btn-store { flex: 1; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- inner pages ---------- */
.page-hero { width: var(--page); margin: 0 auto; padding: clamp(56px, 8vw, 96px) 0 clamp(24px, 4vw, 40px); display: grid; gap: 20px; max-width: 760px; }
.page-hero h1 { max-width: 16ch; }
.pillars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.pillars .card { display: grid; gap: 8px; align-content: start; }
.pillars .card p { color: var(--ink-2); font-size: 0.95rem; }
.card .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-container); display: grid; place-items: center; margin-bottom: 8px; }
.card .icon svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.band .step .node::after { box-shadow: 0 0 0 1.5px var(--surface-low); }
.code { margin: 0 0 20px; padding: 18px 20px; border-radius: var(--r-md); background: #2b2318; color: #f1e7d4; font: 0.85rem/1.6 "SF Mono", Menlo, Consolas, monospace; overflow-x: auto; }
.spec dl { margin: 12px 0 0; display: grid; gap: 10px; }
.spec dl div { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; padding-top: 10px; border-top: 0.5px solid rgba(213, 201, 168, 0.65); font-size: 0.9rem; }
.spec dt { color: var(--ink-2); }
.spec dd { margin: 0; font-weight: 500; }
.faq { display: grid; gap: 12px; max-width: 760px; }
.faq details { background: var(--card); border-radius: var(--r-lg); box-shadow: 0 2px 12px var(--shadow); padding: 4px 24px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold-deep); font-weight: 500; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); padding-bottom: 18px; max-width: 62ch; }
.story { display: grid; grid-template-columns: 220px 1fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.story-aside { display: grid; gap: 12px; position: sticky; top: 88px; }
.portrait { width: 96px; height: 96px; border-radius: 50%; background: var(--card); box-shadow: 0 2px 12px var(--shadow); display: grid; place-items: center; }
.story-sign { color: var(--ink-2); font-size: 0.9rem; }
.prose { display: grid; gap: 20px; max-width: 62ch; font-size: 1.08rem; line-height: 1.65; }
.prose p:first-child::first-letter { font-family: var(--font-quote); font-size: 3.2em; line-height: 0.8; float: left; margin: 8px 8px 0 0; color: var(--gold-deep); }
.findings { display: grid; gap: 20px; }
.finding { display: grid; gap: 10px; }
.finding p { color: var(--ink-2); max-width: 70ch; }
.finding .cite { font-size: 0.85rem; color: var(--ink-2); }
.finding .cite a { color: var(--gold-deep); }
.highlight { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.highlight ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.highlight li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; color: var(--ink-2); }
.highlight li::before { content: ""; width: 8px; height: 8px; margin: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1.5px var(--bg); }
.highlight li strong { color: var(--ink); display: block; }
.founder { display: grid; grid-template-columns: 96px 1fr; gap: 24px; align-items: center; }
.founder blockquote { margin: 0; font-family: var(--font-quote); font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.35; }
.founder .story-sign { margin-top: 10px; }
@media (max-width: 900px) { .story { grid-template-columns: 1fr; } .story-aside { position: static; } .highlight { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .pillars { grid-template-columns: 1fr; } .founder { grid-template-columns: 1fr; } .spec dl div { grid-template-columns: 1fr; gap: 2px; } }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat { display: grid; gap: 10px; align-content: start; }
.stat > strong { font-size: clamp(2.2rem, 3.5vw, 3rem); font-weight: 700; line-height: 1; color: var(--gold-deep); letter-spacing: -0.02em; }
.stat p { color: var(--ink-2); font-size: 0.95rem; }
.stat .cite { font-size: 0.8rem; }
@media (max-width: 900px) { .stats { grid-template-columns: 1fr; } }
