/*
 * HomeBase landing page styles.
 *
 * Tokens mirror packages/ui/src/theme/palette.cjs (the app's single source of
 * truth). Kept by hand here because this static page can't import the .cjs;
 * if palette.cjs changes, update these to match. Light/dark follow the OS via
 * prefers-color-scheme, the same way the app's `dark:` variant does.
 */

:root {
  /* themed (stable hex) — light */
  --background: #f6f5f2;
  --surface: #ffffff;
  --surface-alt: #efede8;
  --text-primary: #191c1d;
  --text-secondary: #5e6266;
  --text-tertiary: #9ca0a4;
  --accent: #a09080; /* warm neutral — the Warm Field Guide accent */
  --on-accent: #ffffff;
  --warning: #c77c18;
  --tip: #b07f23;

  /* role tokens — light */
  --border: rgba(20, 28, 28, 0.08);
  --pressed: rgba(0, 0, 0, 0.04);
  --primary: #0d9488; /* teal — primary action */
  --primary-hover: #0b7d73;
  --on-primary: #ffffff;
  --warning-tint: rgba(232, 160, 32, 0.12);
  --tip-tint: rgba(196, 149, 58, 0.1);

  /* type ramp (px / weight from palette.cjs typography) */
  --fs-display: 34px;
  --fs-title-1: 28px;
  --fs-title-2: 22px;
  --fs-title-3: 18px;
  --fs-body: 16px;
  --fs-callout: 14px;
  --fs-caption: 12px;

  /* radius */
  --r-card: 16px;
  --r-card-sm: 12px;
  --r-pill: 9999px;

  --max-width: 1040px;
  --font:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Inter", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0f1213;
    --surface: #181c1e;
    --surface-alt: #21262a;
    --text-primary: #f1f3f4;
    --text-secondary: #a2a8ad;
    --text-tertiary: #6c7277;
    --accent: #b0a090;
    --warning: #e8a020;
    --tip: #d4a94e;
    --border: rgba(255, 255, 255, 0.09);
    --pressed: rgba(255, 255, 255, 0.04);
    --primary: #2dd4bf;
    --primary-hover: #5fe0d0;
    --on-primary: #06231f;
    --warning-tint: rgba(232, 160, 32, 0.16);
    --tip-tint: rgba(212, 169, 78, 0.14);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---- The signature AccentRule motif: short bar under a heading ---- */
.accent-rule {
  width: 28px;
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--accent);
  border: none;
  margin: 12px 0 0;
}
.accent-rule.center {
  margin-left: auto;
  margin-right: auto;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-body);
  font-weight: 600;
  border-radius: var(--r-pill);
  padding: 14px 26px;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    transform 150ms ease;
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-text {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 14px 12px;
}
.btn-text:hover {
  color: var(--text-primary);
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--background) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-title-3);
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}
.brand svg {
  display: block;
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 88px 0 64px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 16ch;
  margin: 24px auto 0;
}
.hero .subhead {
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--text-secondary);
  max-width: 56ch;
  margin: 20px auto 0;
}
.hero .cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}
.hero-logo {
  display: block;
  margin: 0 auto;
}
.cta-row.cta-row--standalone {
  margin-top: 28px;
}
.hero .reassure {
  font-size: var(--fs-caption);
  color: var(--text-tertiary);
  margin-top: 16px;
}

/* ---- Section scaffolding ---- */
section {
  padding: 56px 0;
}
.section-head {
  max-width: 60ch;
}
.section-head.center {
  margin: 0 auto;
  text-align: center;
}
.section-head h2 {
  font-size: var(--fs-title-1);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-head p {
  color: var(--text-secondary);
  margin-top: 12px;
}

/* ---- Card grid ---- */
.grid {
  display: grid;
  gap: 16px;
  margin-top: 36px;
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 860px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .grid-4,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Warm Field Guide card: surface paper, single hairline, no shadow */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 22px;
}
.card .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--fs-callout);
}
.card h3 {
  font-size: var(--fs-title-3);
  font-weight: 600;
  margin-top: 14px;
}
.card p {
  color: var(--text-secondary);
  font-size: var(--fs-callout);
  margin-top: 8px;
}

/* ---- Example guide mock ---- */
.example {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 28px;
  margin-top: 36px;
}
.chip {
  display: inline-block;
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: var(--r-pill);
  padding: 4px 12px;
}
.example h3 {
  font-size: var(--fs-title-2);
  font-weight: 700;
  margin-top: 14px;
}
.example .overview {
  color: var(--text-secondary);
  margin-top: 10px;
}
.step {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.step:first-of-type {
  margin-top: 12px;
}
.step .body {
  flex: 1;
}
/* Caution: a filled tint + a bold role-colored eyebrow carry the signal — no left-stripe
   (that single-side accent border is an AI-design cliché). */
.callout {
  background: var(--warning-tint);
  border-radius: var(--r-card-sm);
  padding: 10px 14px;
  margin-top: 10px;
  font-size: var(--fs-callout);
}
/* Tip: an un-boxed aside — a hanging eyebrow over a hairline, not another tinted box. */
.callout.tip {
  background: transparent;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 0 0;
}
.callout .label {
  font-weight: 700;
  color: var(--warning);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.callout.tip .label {
  color: var(--tip);
}
.part-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  font-size: var(--fs-callout);
}
.part-row .part-meta {
  color: var(--text-tertiary);
  font-size: var(--fs-caption);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 56px;
  text-align: center;
}
.site-footer .tagline {
  font-size: var(--fs-title-3);
  font-weight: 600;
}
.site-footer .links {
  margin-top: 16px;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}
.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--fs-callout);
}
.site-footer a:hover {
  color: var(--text-primary);
}
.site-footer .copyright {
  color: var(--text-tertiary);
  font-size: var(--fs-caption);
  margin-top: 20px;
}

/* ---- Legal / prose pages (privacy, terms) ---- */
.legal {
  padding: 56px 0 72px;
}
.legal .container {
  max-width: 74ch;
}
.legal h1 {
  font-size: var(--fs-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.legal .updated {
  color: var(--text-tertiary);
  font-size: var(--fs-callout);
  margin-top: 8px;
}
.legal .lead {
  font-size: var(--fs-title-3);
  color: var(--text-secondary);
  margin-top: 18px;
}
.legal h2 {
  font-size: var(--fs-title-2);
  font-weight: 700;
  margin-top: 44px;
}
.legal h3 {
  font-size: var(--fs-title-3);
  font-weight: 600;
  margin-top: 26px;
}
.legal p,
.legal li {
  color: var(--text-secondary);
  margin-top: 12px;
}
.legal ul {
  margin-top: 12px;
  padding-left: 22px;
}
.legal li {
  margin-top: 8px;
}
.legal strong {
  color: var(--text-primary);
}
.legal a {
  color: var(--primary);
  text-decoration: none;
}
.legal a:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  /* Same specificity as the .btn rule above and declared later, so it wins
     without !important — the only transitions on the page live on .btn. */
  .btn {
    transition: none;
  }
}
