/* ============================================================
   FlowWagon — styles.css
   Built from FlowWagon_Master_Brief.md (the source of truth).
   Light base · one teal accent used sparingly · generous whitespace.
   ============================================================ */

/* ---------- Design tokens (§3 colour, §4 type, §5 layout) ---------- */
:root {
  /* Colour */
  --white:        #FFFFFF;
  --surface:      #F7F6F3;
  --ink:          #1A1A1A;
  --stone:        #6B6A66;
  --mist:         #E7E5E0;
  --teal:         #0F7A61;
  --teal-deep:    #0B5C49;
  --teal-wash:    #E6F2EE;
  --warm-black:   #15140F;

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Layout */
  --container:    1240px;
  --pad-x:        24px;
  --section-y:    112px;
  --radius-card:  16px;
  --radius-pill:  999px;

  /* 8px base unit spacing scale */
  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 40px;
  --s-6: 48px;
  --s-8: 64px;
  --s-10: 80px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-deep); }

h1, h2, h3, p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Typography (§4) ---------- */
.h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.005em;
}

.h3 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.3;
}

.lead { font-size: 19px; color: var(--stone); }

.body  { font-size: 17px; line-height: 1.6; }
.muted { color: var(--stone); }

.small { font-size: 13px; line-height: 1.5; }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--teal);
  margin-bottom: var(--s-2);
}

/* ---------- Layout helpers (§5) ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section { padding-block: var(--section-y); }
.section--surface { background: var(--surface); }
.section--dark { background: var(--warm-black); color: var(--white); }

.section-head { max-width: 680px; margin-bottom: var(--s-8); }
.section-head .body { color: var(--stone); margin-top: var(--s-2); }
.section-head--center { max-width: 760px; margin-inline: auto; text-align: center; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}

/* ---------- Buttons (§6) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-pill);
  padding: 14px 26px;
  border: 1px solid transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: var(--white); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover { color: var(--teal); border-color: var(--teal); }

.btn .arrow { font-size: 1em; line-height: 1; }

/* quiet inline text link with arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--teal);
}
.link-arrow:hover { color: var(--teal-deep); }
.link-arrow .arrow { transition: transform .18s ease; }
.link-arrow:hover .arrow { transform: translateX(3px); }

/* ---------- Cards (§6) ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: var(--radius-card);
  padding: 28px;
  transition: border-color .18s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { border-color: var(--ink); }

.card .icon { margin-bottom: var(--s-3); color: var(--teal); }
.card .card-title { margin-bottom: var(--s-2); }
.card .card-body { color: var(--stone); font-size: 16px; }
.card .link-arrow { margin-top: var(--s-3); }

/* ---------- Nav (§6) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  /* Permanent hairline so the white header is always separated from the
     section below it, on every page. */
  border-bottom: 1px solid var(--mist);
  transition: box-shadow .2s ease;
}
.nav.scrolled {
  box-shadow: 0 8px 24px -18px rgba(21, 20, 15, 0.22);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  height: 72px;
}
.nav-logo img { height: 32px; width: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-5);
}
.nav-links a.nav-link {
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}
.nav-links a.nav-link:hover { color: var(--teal); }
.nav-cta { display: flex; align-items: center; gap: var(--s-3); }

.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 8px;
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero { padding-block: var(--s-10) var(--section-y); }
.hero h1 { margin-bottom: var(--s-3); }
.hero .lead { max-width: 36ch; }
.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-5);
  flex-wrap: wrap;
}

/* Centred hero — wider, comfortable measure, everything centred */
.hero--centered { text-align: center; }
.hero--centered .hero-copy {
  max-width: 860px;
  margin-inline: auto;
}
.hero--centered .lead { max-width: 60ch; margin-inline: auto; }
.hero--centered .hero-actions { justify-content: center; }

/* ---------- Steps (How it works) ---------- */
.step .step-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: var(--s-2);
}
.step .card-body { margin-top: 0; }

/* ---------- Why FlowWagon ---------- */
.why-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}
.why-item { border-top: 2px solid var(--ink); padding-top: var(--s-3); }
.why-item h3 { margin-bottom: var(--s-1); }
.why-item p { color: var(--stone); font-size: 16px; }

/* ---------- AI Audit section ---------- */
.audit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-8);
  align-items: start;
}
.audit-list { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-2); }
.audit-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 16px;
}
.audit-list .tick {
  flex: none;
  width: 22px; height: 22px;
  margin-top: 1px;
  color: var(--teal);
}
.audit-cta { margin-top: var(--s-5); }
.audit-note { margin-top: var(--s-3); color: var(--stone); }

.audit-panel {
  background: var(--surface);
  border: 1px solid var(--mist);
  border-radius: var(--radius-card);
  padding: 36px;
}
.audit-panel .eyebrow { margin-bottom: var(--s-3); }
.audit-panel h2 { margin-bottom: var(--s-3); }

/* ---------- FAQ ---------- */
.faq-list {
  max-width: 820px;
  border-top: 1px solid var(--mist);
}
.faq-item { border-bottom: 1px solid var(--mist); }
.faq-q {
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  padding: var(--s-3) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}
.faq-q .faq-icon {
  flex: none;
  position: relative;
  width: 16px; height: 16px;
  transition: transform .2s ease;
}
.faq-q .faq-icon::before,
.faq-q .faq-icon::after {
  content: "";
  position: absolute;
  background: var(--teal);
  border-radius: 2px;
}
.faq-q .faq-icon::before { left: 0; top: 7px; width: 16px; height: 2px; }
.faq-q .faq-icon::after  { left: 7px; top: 0; width: 2px; height: 16px; transition: opacity .2s ease; }
.faq-item[aria-expanded="true"] .faq-icon::after { opacity: 0; }
.faq-a {
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease;
}
.faq-a-inner {
  padding-bottom: var(--s-3);
  color: var(--stone);
  font-size: 16px;
  max-width: 70ch;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-8);
  align-items: start;
}
.contact-aside .h2 { margin-bottom: var(--s-3); }
.contact-aside .body { color: var(--stone); }
.contact-actions {
  margin-top: var(--s-5);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.contact-email {
  font-weight: 500;
}

.form { display: flex; flex-direction: column; gap: var(--s-3); }
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: 13px; font-weight: 500; color: var(--ink); }
.field-group input,
.field-group textarea {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .15s ease;
}
.field-group input:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--teal);
}
.field-group textarea { resize: vertical; min-height: 110px; }
.form .btn { align-self: flex-start; margin-top: var(--s-1); }

.form-success {
  display: none;
  border: 1px solid var(--teal);
  background: var(--teal-wash);
  border-radius: var(--radius-card);
  padding: 28px;
  color: var(--ink);
}
.form-success.show { display: block; }
.form-success h3 { margin-bottom: var(--s-1); }
.form-success p { color: var(--stone); font-size: 16px; }
.form.hide { display: none; }

/* ---------- Footer ---------- */
.footer { background: var(--warm-black); color: rgba(255,255,255,0.72); }
.footer .container { padding-block: var(--s-10) var(--s-6); }
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--s-6);
  padding-bottom: var(--s-8);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-brand img { height: 26px; width: auto; margin-bottom: var(--s-3); }
.footer-brand p { color: rgba(255,255,255,0.6); font-size: 15px; max-width: 32ch; }
.footer-col h4 {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.5);
  margin: 0 0 var(--s-3);
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  color: rgba(255,255,255,0.78);
  font-size: 15px;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-top: var(--s-5);
  flex-wrap: wrap;
}
.footer-legal { display: flex; gap: var(--s-4); }
.footer-legal a, .footer-copy { color: rgba(255,255,255,0.6); font-size: 13px; }
.footer-legal a:hover { color: var(--white); }
.footer-social { display: flex; gap: var(--s-2); }
.footer-social a {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.78);
}
.footer-social a:hover { border-color: var(--white); color: var(--white); }

/* ---------- Stub pages ---------- */
.stub { min-height: 60vh; padding-block: var(--s-10); }
.stub .back { margin-bottom: var(--s-4); display: inline-flex; align-items: center; gap: 6px; }
.stub h1 { margin-bottom: var(--s-3); max-width: 18ch; }
.stub .lead { max-width: 60ch; margin-bottom: var(--s-6); }

/* Centred intro on the /book page, above the calendar */
.book-head { text-align: center; max-width: 760px; margin: 0 auto var(--s-8); }
.book-head h1 { max-width: 22ch; margin-inline: auto; }
.book-head .lead { max-width: 64ch; margin: var(--s-3) auto 0; }

.stub-prose { max-width: 760px; }
.stub-prose h2 { margin: var(--s-6) 0 var(--s-2); font-size: 22px; }
.stub-prose p { color: var(--stone); margin-bottom: var(--s-3); }
.stub-prose strong { color: var(--ink); font-weight: 500; }
.stub-prose a { font-weight: 500; }
.stub-prose .small { color: var(--stone); }

/* Bulleted lists in legal prose */
.stub-prose ul {
  list-style: none;
  margin: 0 0 var(--s-3);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stub-prose li {
  position: relative;
  padding-left: 22px;
  color: var(--stone);
}
.stub-prose li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

/* "Last updated" meta line under the page title */
.legal-meta {
  display: block;
  margin-bottom: var(--s-5);
  font-size: 13px;
  color: var(--stone);
}
.legal-meta strong { color: var(--ink); font-weight: 500; }

.calendar-embed {
  border: 2px dashed var(--mist);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 64px 32px;
  text-align: center;
}
.calendar-embed .eyebrow { color: var(--stone); }
.calendar-embed h2 { margin-bottom: var(--s-2); }
.calendar-embed p { color: var(--stone); max-width: 52ch; margin: 0 auto var(--s-4); }
.calendar-embed code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: 6px;
  padding: 2px 8px;
}

/* ============================================================
   Responsive — desktop-first, fully mobile-responsive (§5)
   ============================================================ */
@media (max-width: 980px) {
  .audit-grid,
  .contact-grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .footer-top { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  :root { --section-y: 64px; }

  .h1 { font-size: 40px; }
  .h2 { font-size: 30px; }

  .hero { padding-block: var(--s-6) var(--section-y); }

  /* mobile nav */
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--mist);
    padding: var(--s-2) var(--pad-x) var(--s-4);
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a.nav-link { padding: 12px 0; width: 100%; }

  .grid-3,
  .why-list { grid-template-columns: 1fr; gap: var(--s-3); }

  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 460px) {
  .footer-top { grid-template-columns: 1fr; }
  .hero-actions .btn,
  .form .btn { width: 100%; justify-content: center; }
  .nav-logo img { height: 26px; }
  .nav-cta .btn-primary { padding: 11px 16px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .faq-a, .faq-icon, .link-arrow .arrow { transition: none; }
}
