/* Enable Coffee — marketing/legal site
 * Espresso & Amber palette (default) — see docs/content/drafts/brand-colours.md
 * Shared by every page in /web/. No build step. No framework.
 * Dark mode follows the OS preference automatically.
 */

:root {
  --ec-bg: #FBF7EF;
  --ec-surface: #F2EBDC;
  --ec-text: #2D1F14;
  --ec-text-muted: #5C4A38;
  --ec-accent: #B45309;
  --ec-accent-strong: #8A3F07;
  --ec-border: #E2D8C1;
  --ec-focus: #2563EB;

  --ec-radius: 12px;
  --ec-max-width: 44rem;
  --ec-narrow-width: 36rem;
}

/* Dark values — applied when (a) user has explicitly chosen dark via the
 * theme toggle (data-theme="dark"), OR (b) no explicit choice and system
 * preference is dark. Explicit data-theme="light" overrides system dark. */
:root[data-theme="dark"] {
  --ec-bg: #1F1812;
  --ec-surface: #2D2620;
  --ec-text: #F5EFE3;
  --ec-text-muted: #C0B19A;
  --ec-accent: #F59E0B;
  --ec-accent-strong: #FBBF24;
  --ec-border: #3F362C;
  --ec-focus: #60A5FA;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ec-bg: #1F1812;
    --ec-surface: #2D2620;
    --ec-text: #F5EFE3;
    --ec-text-muted: #C0B19A;
    --ec-accent: #F59E0B;
    --ec-accent-strong: #FBBF24;
    --ec-border: #3F362C;
    --ec-focus: #60A5FA;
  }
}

* { box-sizing: border-box; }

html { font-size: 100%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ec-text);
  background: var(--ec-bg);
  -webkit-font-smoothing: antialiased;
}

/* Skip link — visible on focus only */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--ec-text);
  color: var(--ec-bg);
  text-decoration: none;
  border-radius: 0 0 var(--ec-radius) var(--ec-radius);
  z-index: 100;
}
.skip-link:focus { top: 0; }

/* Layout */
.site-header {
  border-bottom: 1px solid var(--ec-border);
  background: var(--ec-bg);
}
.site-header .inner {
  max-width: var(--ec-max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.site-header a.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--ec-text);
  font-weight: 600;
  font-size: 1.125rem;
}
.site-header a.brand svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--ec-accent);
  flex-shrink: 0;
}

/* Theme toggle — pushed right via auto-margin so it works with or
 * without a brand link to its left */
.theme-toggle {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--ec-border);
  color: var(--ec-text-muted);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover { border-color: var(--ec-accent); color: var(--ec-text); }
.theme-toggle:focus-visible { outline: 2px solid var(--ec-focus); outline-offset: 2px; }
.theme-toggle svg { width: 1rem; height: 1rem; flex-shrink: 0; }
/* Show only the icon for the current state — the others are hidden via JS-set data attribute */
.theme-toggle__label { font-weight: 500; }
.theme-toggle__icon-sun,
.theme-toggle__icon-moon,
.theme-toggle__icon-auto { display: none; }
.theme-toggle[data-theme-state="auto"] .theme-toggle__icon-auto { display: inline-block; }
.theme-toggle[data-theme-state="light"] .theme-toggle__icon-sun { display: inline-block; }
.theme-toggle[data-theme-state="dark"] .theme-toggle__icon-moon { display: inline-block; }
/* Default before JS runs — show "auto" icon so we never have an empty button flicker */
.theme-toggle:not([data-theme-state]) .theme-toggle__icon-auto { display: inline-block; }

main {
  max-width: var(--ec-max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
main.narrow { max-width: var(--ec-narrow-width); }

h1, h2, h3 {
  color: var(--ec-text);
  line-height: 1.25;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
h1 { font-size: 2rem; margin-top: 0; }
h2 { font-size: 1.5rem; border-bottom: 1px solid var(--ec-border); padding-bottom: 0.4rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }

.lede {
  font-size: 1.15rem;
  color: var(--ec-text-muted);
  margin-bottom: 1.5rem;
}

a { color: var(--ec-accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--ec-accent-strong); }
a:focus-visible {
  outline: 2px solid var(--ec-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

ul, ol { padding-left: 1.5rem; margin: 0 0 1rem; }
li { margin-bottom: 0.4rem; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}
th, td {
  border-bottom: 1px solid var(--ec-border);
  padding: 0.6rem 0.5rem;
  text-align: left;
  vertical-align: top;
}
th {
  font-weight: 600;
  background: var(--ec-surface);
}

code {
  background: var(--ec-surface);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.callout {
  background: var(--ec-surface);
  border-left: 4px solid var(--ec-accent);
  padding: 1rem 1.25rem;
  border-radius: var(--ec-radius);
  margin: 1.25rem 0;
}
.callout p:last-child { margin-bottom: 0; }

.meta {
  color: var(--ec-text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}
.steps > li {
  counter-increment: step;
  padding: 1rem 1.25rem 1rem 3.25rem;
  position: relative;
  background: var(--ec-surface);
  border-radius: var(--ec-radius);
  margin-bottom: 0.75rem;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--ec-accent);
  color: #fff;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-footer {
  border-top: 1px solid var(--ec-border);
  padding: 1.5rem 1.25rem 2.5rem;
  font-size: 0.95rem;
  color: var(--ec-text-muted);
}
.site-footer .inner {
  max-width: var(--ec-max-width);
  margin: 0 auto;
}
.site-footer nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.site-footer nav a {
  color: var(--ec-text-muted);
}

/* ============================================================
 * Landing page (index.html only)
 * ============================================================ */

/* Wider main column on the landing so the multi-step rows breathe */
main.landing { max-width: 56rem; padding-bottom: 1rem; }

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}
.hero .hero-icon {
  width: 4.5rem;
  height: 4.5rem;
  color: var(--ec-accent);
  margin-bottom: 1rem;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 0.25rem; }
.hero .tagline {
  font-size: 1.25rem;
  color: var(--ec-text-muted);
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* Mission band — centred lede on a soft surface */
.mission {
  background: var(--ec-surface);
  border-radius: var(--ec-radius);
  padding: 2rem 1.5rem;
  text-align: center;
  margin: 1.5rem 0 3rem;
}
.mission p {
  font-size: 1.2rem;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 36rem;
}
.mission p + p { margin-top: 0.75rem; color: var(--ec-text-muted); font-size: 1.05rem; }

/* Section headings on the landing (consistent rhythm) */
.landing-section { margin: 3rem 0; }
.landing-section > h2 {
  border-bottom: none;
  padding-bottom: 0;
  text-align: center;
  margin-bottom: 0.4rem;
}
.landing-section > .section-sub {
  text-align: center;
  color: var(--ec-text-muted);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

/* "Pick your role" hub on the homepage — two big linked cards.
 * Desktop: icon on the left, text block on the right (horizontal).
 * Mobile (<44rem): icon on top, text below (vertical), full-width single column. */
.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}
.role-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.25rem;
  background: var(--ec-surface);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--ec-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
/* Belt-and-braces: explicitly nuke any inherited underlines on every child
 * of the role-card. Some browsers paint the anchor's underline behind nested
 * block elements unless told otherwise. */
.role-card,
.role-card * { text-decoration: none; }
.role-card:hover,
.role-card:focus-visible {
  border-color: var(--ec-accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.role-card:focus-visible {
  outline: 2px solid var(--ec-focus);
  outline-offset: 4px;
}
.role-card__illo-wrap {
  flex: 0 0 auto;
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.role-card .role-illo {
  width: 4rem;
  height: 4rem;
  color: var(--ec-accent);
  display: block;
}
.role-card__body {
  flex: 1 1 auto;
  min-width: 0;
}
.role-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  color: var(--ec-text);
  border-bottom: none;
  padding-bottom: 0;
}
.role-card p {
  margin: 0 0 0.6rem;
  color: var(--ec-text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.role-card .role-card__cta {
  display: inline-block;
  color: var(--ec-accent);
  font-weight: 600;
  font-size: 0.92rem;
}
.role-card:hover .role-card__cta { color: var(--ec-accent-strong); }

@media (max-width: 44rem) {
  .role-cards { grid-template-columns: 1fr; }
  .role-card {
    flex-direction: column;
    text-align: center;
    padding: 1.75rem 1.25rem;
  }
  .role-card__illo-wrap { margin-bottom: 0.25rem; }
}

/* Cross-link block at the bottom of /clients and /runners */
.cross-link {
  background: var(--ec-surface);
  border-radius: var(--ec-radius);
  padding: 1.5rem 1.5rem;
  margin: 2.5rem 0 1rem;
  text-align: center;
}
.cross-link p { margin: 0; }
.cross-link a { font-weight: 600; }

/* How-it-works: flow grids (used on /clients and /runners) */
.flow {
  margin-bottom: 2.5rem;
}
.flow h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--ec-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.flow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.flow-steps li {
  margin: 0;
  text-align: center;
  background: var(--ec-surface);
  border-radius: var(--ec-radius);
  padding: 1.5rem 1rem 1.25rem;
}
.flow-steps .illo {
  width: 5.5rem;
  height: 5.5rem;
  color: var(--ec-accent);
  margin: 0 auto 1rem;
  display: block;
}
.flow-steps .step-label {
  display: block;
  font-size: 0.8rem;
  color: var(--ec-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.flow-steps h4 {
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}
.flow-steps p {
  font-size: 0.95rem;
  margin: 0;
  color: var(--ec-text-muted);
  line-height: 1.45;
}

/* Feature strip — small icon+label pills */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.feature {
  background: var(--ec-surface);
  border-radius: var(--ec-radius);
  padding: 1.25rem 1rem;
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
}
.feature .icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--ec-accent);
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.feature h4 { margin: 0 0 0.25rem; font-size: 1rem; }
.feature p {
  font-size: 0.9rem;
  margin: 0;
  color: var(--ec-text-muted);
  line-height: 1.45;
}

/* Accessibility statement — prominent its-own-section, not footer-buried */
.a11y-statement {
  background: var(--ec-surface);
  border-left: 4px solid var(--ec-accent);
  border-radius: var(--ec-radius);
  padding: 1.75rem 1.5rem;
}
.a11y-statement h2 {
  border-bottom: none;
  margin-top: 0;
  font-size: 1.4rem;
}
.a11y-statement p:last-child { margin-bottom: 0; }
.a11y-statement ul { margin: 0.5rem 0 1rem; }

/* FAQ — native <details>/<summary> */
.faq details {
  background: var(--ec-surface);
  border-radius: var(--ec-radius);
  padding: 0;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq details[open] { background: var(--ec-bg); border: 1px solid var(--ec-border); }
.faq summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 2.5rem;
  color: var(--ec-text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ec-accent);
  font-size: 1.25rem;
  font-weight: 400;
  transition: transform 0.15s ease;
}
.faq details[open] summary::after {
  content: "−";
}
.faq summary:focus-visible {
  outline: 2px solid var(--ec-focus);
  outline-offset: -2px;
}
.faq .faq-body {
  padding: 0 1.25rem 1.25rem;
}
.faq .faq-body p:last-child { margin-bottom: 0; }

/* Coming soon block */
.coming-soon {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--ec-surface);
  border-radius: var(--ec-radius);
}
.coming-soon h2 {
  border-bottom: none;
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}
.coming-soon p { margin-bottom: 0.75rem; }

/* Trust strip — three short lines side by side */
.trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
  margin: 2.5rem 0 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--ec-border);
  border-bottom: 1px solid var(--ec-border);
}
.trust h4 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.trust p { margin: 0; font-size: 0.85rem; color: var(--ec-text-muted); }

/* ============================================================
 * Responsive — collapse multi-column grids on narrow screens
 * ============================================================ */
@media (max-width: 44rem) {
  .flow-steps,
  .features,
  .trust {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 30rem) {
  h1 { font-size: 1.6rem; }
  .hero h1 { font-size: 2rem; }
  main { padding: 2rem 1rem 3rem; }
  .mission { padding: 1.5rem 1.25rem; }
  .mission p { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
