/* AutoMail — site styles
 * Palette from design-system/DESIGN.md (founder-set manual palette) + scale tokens from
 * design-system/tokens.css. One elevation strategy: hairline borders + tinted grounds (no shadows).
 * Sections alternate cream / tinted grounds; navy is reserved for primary actions and the closing CTA.
 */

:root {
  /* Colour — design-system/DESIGN.md */
  --bg: #f8f6f0;
  --surface: #efede8;
  --fg: #0f1e33;
  --fg-2: #334155;
  --muted: #8f959b;      /* decorative dividers only — fails AA as text on cream */
  --border: #cecfce;
  --accent: #1e3a5f;
  --accent-hover: #16294a;
  --accent-2: #e0b04b;
  --on-accent: #ffffff;
  --success: #15803d;
  --danger: #b91c1c;

  /* Type */
  --font-display: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.1875rem;
  --text-xl: 1.375rem;
  --text-2xl: 2.125rem;
  --step-2: clamp(1.75rem, 3.2vw, 2.25rem);
  --step-1: clamp(2.5rem, 6vw, 4.25rem);
  --leading-body: 1.6;
  --leading-tight: 1.14;

  /* Space */
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
  --sp-16: 64px;
  --section-y: clamp(64px, 9vw, 120px);
  --gutter: 24px;
  --container: 1200px;
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 72px;
  --ring: 0 0 0 4px rgba(30, 58, 95, 0.22);
  --motion: 200ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  font-weight: 400;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  letter-spacing: -0.018em;
  margin: 0 0 var(--sp-4);
  font-weight: 700;
  color: var(--fg);
}

h1 { font-size: var(--step-1); }
h2 { font-size: var(--step-2); font-weight: 700; }
h3 { font-size: var(--text-xl); font-weight: 600; }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

strong { font-weight: 600; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 12px 18px;
  z-index: 60;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 246, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: border-color var(--motion) var(--ease);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  min-height: var(--header-h);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--fg); }
.wordmark svg { display: block; }
.wordmark small {
  display: block;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 500;
  line-height: 1.2;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  margin-left: auto;
}
.site-nav a {
  color: var(--fg-2);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color var(--motion) var(--ease), border-color var(--motion) var(--ease);
}
.site-nav a:hover { color: var(--accent); border-bottom-color: var(--accent-2); }

.header-cta { margin-left: var(--sp-2); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  color: var(--fg);
}
.nav-toggle svg { display: block; }

.mobile-nav[hidden] { display: none; }
.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: var(--sp-4) var(--gutter) var(--sp-6);
}
.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.mobile-nav a {
  display: block;
  padding: 12px 0;
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--motion) var(--ease), color var(--motion) var(--ease),
    border-color var(--motion) var(--ease), transform var(--motion) var(--ease);
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: rgba(30, 58, 95, 0.07); color: var(--accent-hover); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.65; cursor: progress; }

/* ---------- Sections ---------- */

.section { padding: var(--section-y) 0; }
.section-tint { background: var(--surface); border-block: 1px solid var(--border); }
.section-navy { background: var(--accent); color: #eef2f7; }
.section-navy h2, .section-navy h3 { color: #fff; }
.section-navy p { color: #d7e0ec; }
.section-navy a { color: #fff; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-4);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--accent-2);
}

.section-head { max-width: 62ch; margin-bottom: var(--sp-12); }
.section-head p { color: var(--fg-2); font-size: var(--text-lg); margin-bottom: 0; }

.grid { display: grid; gap: var(--sp-6); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-8) var(--sp-6);
}
.section-tint .card { background: var(--bg); }
.card h3 { margin-bottom: var(--sp-3); }
.card p { color: var(--fg-2); font-size: var(--text-base); }
.card .icon { margin-bottom: var(--sp-4); }

.icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.section-tint .icon { background: var(--surface); }

/* ---------- Hero ---------- */

.hero { padding: clamp(40px, 6vw, 84px) 0 var(--section-y); }
.hero-grid {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  grid-template-columns: 1fr;
  align-items: start;
}
.hero-copy h1 { max-width: 24ch; }
.hero-sub {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--fg-2);
  max-width: 58ch;
  margin-bottom: var(--sp-8);
}

.trust-bar {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-6);
  margin: var(--sp-6) 0 0;
  padding: 0;
}
.trust-bar li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--fg-2);
}

/* ---------- Lead form ---------- */

.lead-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-6);
}
.lead-form h2 { font-size: var(--text-xl); margin-bottom: var(--sp-2); }
.lead-form .form-intro {
  color: var(--fg-2);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-6);
}
.field { margin-bottom: var(--sp-4); }
.field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--fg);
}
.field .hint { font-weight: 400; color: var(--fg-2); }
.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--fg);
  background: #fffefb;
  border: 1px solid #b9bcbb;
  border-radius: var(--radius-sm);
  transition: border-color var(--motion) var(--ease);
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--fg-2); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.field-error {
  display: none;
  color: var(--danger);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-top: 6px;
}
.field.has-error input,
.field.has-error textarea { border-color: var(--danger); }
.field.has-error .field-error { display: block; }

.form-note {
  font-size: var(--text-sm);
  color: var(--fg-2);
  margin-top: var(--sp-4);
}
.form-status { margin-top: var(--sp-4); font-size: var(--text-sm); font-weight: 500; }
.form-status[data-state="ok"] { color: var(--success); }
.form-status[data-state="error"] { color: var(--danger); }
.form-status:empty { display: none; }

.section-navy .lead-form,
.section-navy .lead-form h2,
.section-navy .lead-form h3,
.section-navy .lead-form label { color: var(--fg); }
.section-navy .lead-form .form-intro,
.section-navy .lead-form .form-note { color: var(--fg-2); }

/* ---------- Steps ---------- */

.steps { counter-reset: step; display: grid; gap: var(--sp-6); }
.step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: var(--sp-4);
  align-items: start;
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: 0; padding-bottom: 0; }
.step-num {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
}
.step h3 { margin-bottom: var(--sp-2); }
.step p { color: var(--fg-2); }

.hero-art { width: 100%; height: auto; display: block; }
.hero-art-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-6);
}
.hero-art-cap {
  font-size: var(--text-sm);
  color: var(--fg-2);
  margin: var(--sp-4) 0 0;
}

/* ---------- Proof ---------- */

.commitments { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-4); }
.commitments li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: var(--sp-3);
  align-items: start;
}
.commitments strong { display: block; }
.commitments span { color: var(--fg-2); font-size: var(--text-base); }

/* ---------- FAQ ---------- */

.faq { max-width: 76ch; }
.faq details {
  border-bottom: 1px solid var(--border);
  padding: var(--sp-4) 0;
}
.faq details:first-of-type { border-top: 1px solid var(--border); }
.faq summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--fg);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
}
.faq details[open] summary::after { content: "\2013"; }
.faq .faq-a { padding-top: var(--sp-4); color: var(--fg-2); }
.faq .faq-a p:last-child { margin-bottom: 0; }

/* ---------- Subpages ---------- */

.page-head {
  padding: clamp(48px, 7vw, 88px) 0 var(--sp-8);
  border-bottom: 1px solid var(--border);
}
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); max-width: 26ch; }
.page-head p { color: var(--fg-2); font-size: var(--text-lg); max-width: 62ch; margin-bottom: 0; }
.crumbs { font-size: var(--text-sm); color: var(--fg-2); margin-bottom: var(--sp-4); }
.crumbs a { color: var(--fg-2); }
.prose { max-width: 74ch; }
.prose h2 { font-size: clamp(1.5rem, 2.4vw, 1.875rem); margin-top: var(--sp-12); }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--fg-2); }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 6px; }

/* ---------- Utilities ---------- */

.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-bullets { padding-left: 20px; margin: 0; color: var(--fg-2); }
.plain-bullets li { margin-bottom: 8px; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mt-16 { margin-top: var(--sp-16); }
.center-y { align-items: center; }
.muted-text { color: var(--fg-2); }
.quiet-h h2 { font-size: var(--text-2xl); }
.measure { max-width: 62ch; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--fg);
  color: #c9d2de;
  padding: var(--sp-16) 0 var(--sp-8);
}
.footer-grid {
  display: grid;
  gap: var(--sp-8);
  grid-template-columns: 1fr;
}
.site-footer .wordmark { color: #fff; }
.site-footer .wordmark small { color: #9fb0c4; }
.site-footer h2 {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9fb0c4;
  font-weight: 600;
  margin-bottom: var(--sp-4);
}
.site-footer p { font-size: var(--text-sm); color: #c9d2de; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer a { color: #eaf0f7; text-decoration: none; font-size: var(--text-sm); }
.site-footer a:hover { text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  margin-top: var(--sp-12);
  padding-top: var(--sp-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4) var(--sp-6);
  justify-content: space-between;
  font-size: var(--text-sm);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise 620ms var(--ease) both; }
  .hero-art .flow-dash {
    stroke-dasharray: 7 7;
    animation: dash 14s linear infinite;
  }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes dash {
  to { stroke-dashoffset: -280; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ---------- Breakpoints ---------- */

@media (min-width: 760px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; align-items: center; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .hero-copy .lead-form { max-width: 520px; }
}

@media (max-width: 899px) {
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-cta {
    display: inline-flex;
    min-height: 42px;
    padding: 10px 16px;
    font-size: var(--text-sm);
  }
  .mobile-nav[data-open="true"] { display: block; }
  .mobile-nav[data-open="false"] { display: none; }
}

@media (min-width: 900px) {
  :root { --gutter: 36px; }
  .mobile-nav { display: none !important; }
}
