/* Mounty web — tokens mirror the app's asset catalog (Resources/Assets.xcassets/colors)
   and type scale (Architecture/Services/Extensions/Font.swift). */
:root {
  --bg-primary: #fafafa;
  --bg-surface: #ffffff;
  --bg-surface-secondary: #e5e5ea;
  --bg-accent-green: #d4fae8;
  --accent-green: #29a648;
  --border-primary: #d1d1d6;
  --border-green: #34c759;
  --text-primary: #0a0a0a;
  --text-secondary: #3a3a3c;
  --text-tertiary: #8e8e93;
  --btn-primary: #207c38;
  --btn-primary-shadow: #165228;
  --btn-primary-text: #ffffff;
  --hero-bg: #207c38;
  --hero-text: #ffffff;
  --hero-topo: rgba(255, 255, 255, .22);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0a0a0a;
    --bg-surface: #1c1c1e;
    --bg-surface-secondary: #2c2c2e;
    --bg-accent-green: #0d2818;
    --accent-green: #30d158;
    --border-primary: #2c2c2e;
    --border-green: #30d158;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --text-tertiary: #636366;
    --btn-primary: #34c759;
    --btn-primary-shadow: #207c38;
    --btn-primary-text: #0a0a0a;
    --hero-bg: #0d2818;
    --hero-text: #ffffff;
    --hero-topo: rgba(48, 209, 88, .22);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.1px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-green); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--border-green); outline-offset: 3px; border-radius: 6px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg-primary) 85%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border-primary);
}
.topbar-inner {
  max-width: 960px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-primary); text-decoration: none;
  font-weight: 700; font-size: 19px; letter-spacing: -0.2px;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--btn-primary); color: var(--btn-primary-text);
  display: grid; place-items: center;
  box-shadow: 0 3px 0 var(--btn-primary-shadow);
}
.brand-mark svg { width: 20px; height: 20px; }

/* Segmented control, like the app's tab pickers */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--bg-surface-secondary); border-radius: 12px;
}
.segmented a, .segmented span {
  padding: 5px 12px; border-radius: 9px;
  font-size: 13px; font-weight: 600; line-height: 20px;
  color: var(--text-secondary); text-decoration: none;
}
.segmented [aria-current] {
  background: var(--bg-surface); color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

/* ---------- Layout ---------- */
.page { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }

/* ---------- Hero (green card with the app's topo pattern) ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--hero-bg); color: var(--hero-text);
  border-radius: 24px; padding: 32px 28px;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--hero-topo);
  -webkit-mask: url(/img/topo.svg) center / cover no-repeat;
          mask: url(/img/topo.svg) center / cover no-repeat;
}
.hero h1 {
  margin: 0; font-size: 32px; line-height: 40px; letter-spacing: -0.5px; font-weight: 700;
}
.hero p { margin: 8px 0 0; color: inherit; opacity: .85; }
.hero .eyebrow {
  display: inline-block; margin: 0 0 12px; padding: 2px 10px;
  border-radius: 999px; background: rgba(255, 255, 255, .16);
  font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .55px; text-transform: uppercase;
  opacity: 1;
}
.hero-art { width: 220px; margin: -12px -8px -20px 0; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .25)); }

/* ---------- Policy layout: TOC + sections ---------- */
.layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; margin-top: 24px; align-items: start; }
.toc {
  position: sticky; top: 88px;
  background: var(--bg-surface); border: 1px solid var(--border-primary); border-radius: 16px;
  padding: 8px;
}
.toc-title, .section-label {
  font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: .55px;
  text-transform: uppercase; color: var(--text-tertiary);
}
.toc-title { padding: 8px 12px 4px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc a {
  display: flex; gap: 10px; padding: 8px 12px; border-radius: 10px;
  color: var(--text-secondary); text-decoration: none; font-size: 13px; line-height: 20px; font-weight: 500;
}
.toc a::before {
  counter-increment: toc; content: counter(toc);
  color: var(--text-tertiary); font-variant-numeric: tabular-nums; min-width: 14px;
}
.toc a:hover { background: var(--bg-accent-green); color: var(--text-primary); }

.intro { margin: 0 0 16px; color: var(--text-secondary); }

.card {
  background: var(--bg-surface); border: 1px solid var(--border-primary); border-radius: 16px;
  padding: 20px 24px; margin: 0 0 16px;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2 {
  display: flex; align-items: center; gap: 12px;
  font-size: 19px; line-height: 26px; letter-spacing: -0.2px; font-weight: 700; margin: 0 0 12px;
}
.card h2 .num {
  flex: none; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--bg-accent-green); color: var(--accent-green);
  font-size: 13px; font-weight: 700;
}
.card h3 {
  font-size: 16px; line-height: 22px; font-weight: 600; margin: 20px 0 6px;
  padding-top: 16px; border-top: 1px solid var(--border-primary);
}
.card h2 + h3, .card h2 + p + h3 { border-top: 0; padding-top: 0; }
.card p, .card li { color: var(--text-secondary); }
.card strong { color: var(--text-primary); font-weight: 600; }
.card ul { padding-left: 0; list-style: none; margin: 8px 0; }
.card li { position: relative; padding-left: 20px; margin: 8px 0; }
.card li::before {
  content: ""; position: absolute; left: 4px; top: .65em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent-green);
}
.card em {
  font-style: normal; font-size: 13px; font-weight: 600; color: var(--text-primary);
  background: var(--bg-surface-secondary); border-radius: 6px; padding: 1px 6px;
}
code {
  font: 500 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-surface-secondary); border-radius: 6px; padding: 2px 6px;
}

/* ---------- Buttons (AppButton: 16px radius, 3px solid drop) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; padding: 0 20px; border-radius: 16px;
  background: var(--btn-primary); color: var(--btn-primary-text);
  font-weight: 700; font-size: 16px; text-decoration: none;
  box-shadow: 0 3px 0 var(--btn-primary-shadow);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--btn-primary-shadow); }
.btn.secondary {
  background: var(--bg-surface); color: var(--text-primary);
  border: 1px solid var(--border-primary); box-shadow: 0 3px 0 var(--border-primary);
}

.help {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--bg-accent-green); border-color: transparent;
}
.help h2 { margin: 0; }
.help p { margin: 4px 0 0; }

/* ---------- Home ---------- */
.home-hero { grid-template-columns: 1.1fr 1fr; padding: 40px 32px; }
.home-hero h1 { font-size: 40px; line-height: 46px; }
.home-hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.home-hero .btn { background: #ffffff; color: #165228; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.mounts { position: relative; height: 280px; }
.mounts img { position: absolute; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .3)); }
.mounts img:nth-child(1) { left: 0; top: 4%; width: 52%; }
.mounts img:nth-child(2) { right: 0; top: 0; width: 50%; }
.mounts img:nth-child(3) { left: 18%; bottom: 0; width: 64%; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.feature { margin: 0; }
.feature .icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bg-accent-green); color: var(--accent-green); margin-bottom: 12px;
}
.feature .icon svg { width: 22px; height: 22px; }
.feature h2 { font-size: 16px; line-height: 22px; margin: 0 0 4px; display: block; }
.feature p { margin: 0; font-size: 15px; }

.links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.link-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--text-primary); text-decoration: none; font-weight: 600; margin: 0;
}
.link-row:hover { border-color: var(--border-green); text-decoration: none; }
.link-row span { color: var(--text-tertiary); font-weight: 500; font-size: 13px; }

/* ---------- Footer ---------- */
.footer {
  max-width: 960px; margin: 0 auto; padding: 24px 16px 48px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--text-tertiary); font-size: 13px; border-top: 1px solid var(--border-primary);
}
.footer a { color: var(--text-secondary); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .features { grid-template-columns: 1fr; }
  .home-hero { grid-template-columns: 1fr; }
  .mounts { height: 200px; }
}
@media (max-width: 560px) {
  .hero { grid-template-columns: 1fr; padding: 24px 20px; border-radius: 20px; }
  .hero h1 { font-size: 27px; line-height: 34px; }
  .home-hero h1 { font-size: 32px; line-height: 40px; }
  .hero-art { width: 160px; margin: 0 auto -12px; }
  .card { padding: 16px 18px; }
  .links { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
