/* ─────────────────────────────────────────────
   Tradie Design System — tokens.css
   Single source of truth.
   Spec: docs/superpowers/specs/2026-07-22-design-system-design.md
   ───────────────────────────────────────────── */

:root {
  /* NOTE: hex + scale values are duplicated as visible text in brand.html — update both together. */
  /* Greens — the brand's spine */
  --green-950: #0A1611;   /* pit: footer, deepest moments */
  --green-900: #0E1F17;   /* ink: dark sections AND all text on light */
  --green-800: #122820;   /* surface-dark: cards on dark sections */
  --green-700: #1E4636;   /* border-dark: dividers on dark */
  --green-600: #177A4C;   /* working green: links, ticks, stats on light (AA text-safe) */

  /* Accent — one spark CTA per screenful; never white text on it */
  --accent:       #3DDC84;
  --accent-hover: #2FC974;
  --accent-tint:  #DCF5E7;

  /* Light side — sage family only */
  --paper:  #FFFFFF;
  --sage:   #EEF1F0;
  --muted:  #5F6D66;
  --border: #E0E6E2;

  /* Aliases */
  --ink: var(--green-900);

  /* Type */
  --font-head: 'Bricolage Grotesque', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  /* Radii: controls 8 / cards 12 / photos 16 */
  --radius-control: 8px;
  --radius-card:    12px;
  --radius-photo:   16px;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* ── Typography (spec §3) ── */
h1, h2, h3 { font-family: var(--font-head); }
h1 { font-size: clamp(2.4rem, 7vw, 4.2rem);  font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.7rem, 5vw, 2.6rem);  font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.05rem, 3vw, 1.25rem); font-weight: 600; line-height: 1.3; }
p  { font-size: clamp(1rem, 2.5vw, 1.1rem); max-width: 65ch; }

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.on-dark .eyebrow, .eyebrow.on-dark { color: rgba(255,255,255,0.55); }

.stat {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  line-height: 1;
  color: var(--green-600);
}
.on-dark .stat { color: var(--accent); }

.text-muted { color: var(--muted); }

/* ── Layout helpers ── */
.container { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 640px) { .container { padding: 0 2rem; } }

section { padding: 5rem 0; }
@media (min-width: 640px) { section { padding: 6.5rem 0; } }

.bg-dark  { background: var(--green-900); color: #fff; }
.bg-pit   { background: var(--green-950); }
.bg-sage  { background: var(--sage); }

/* ── Buttons ── */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-control);
  padding: 0.875rem 1.75rem;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  -webkit-appearance: none;
  appearance: none;
}
.btn:active { transform: translateY(1px); }

.btn-primary        { background: var(--accent); color: var(--ink); }
.btn-primary:hover  { background: var(--accent-hover); }

.btn-secondary        { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-secondary:hover  { border-color: var(--green-600); color: var(--green-600); }
.on-dark .btn-secondary, .btn-secondary.on-dark { color: #fff; border-color: rgba(255,255,255,0.4); }
.on-dark .btn-secondary:hover, .btn-secondary.on-dark:hover { border-color: #fff; color: #fff; }

.btn-lg { font-size: 1.1rem; padding: 1rem 2rem; }

.text-link {
  color: var(--green-600);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-link:hover { color: var(--green-900); }

/* ── Step card (on sage: no border, no shadow) ── */
.step {
  background: var(--paper);
  border-radius: var(--radius-card);
  padding: 2rem 1.75rem;
}
.step-number {
  font-family: var(--font-head);
  font-size: 3rem;
  font-weight: 800;
  color: var(--green-600);
  line-height: 1;
  display: block;
  margin-bottom: 0.875rem;
}

/* ── Check item ── */
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  line-height: 1.5;
}
.check-icon {
  flex-shrink: 0;
  margin-top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--green-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.form-group input {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-control);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--ink);
  background: var(--paper);
  -webkit-appearance: none;
  appearance: none;
}
.form-group input:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.25);
}
.form-group input::placeholder { color: var(--muted); opacity: 0.55; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 0;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.site-logo { display: block; color: var(--ink); line-height: 0; }
.site-logo svg { height: 28px; width: auto; display: block; }

/* ── Footer ── */
.site-footer { background: var(--green-950); padding: 2.75rem 0; text-align: center; }
.site-footer p { color: rgba(255,255,255,0.5); font-size: 0.875rem; line-height: 1.7; max-width: none; }
.site-footer p + p { margin-top: 0.3rem; }
.site-footer a { color: rgba(255,255,255,0.68); text-decoration: underline; text-underline-offset: 2px; } /* AA on --green-950 */
.site-footer a:hover { color: #fff; }

/* ── Photography (spec §5) ──
   Photos run BRIGHT. A dark wash is added ONLY when text sits directly on
   the image (.photo-card--caption). Text-on-card heroes need no wash. */

/* Hero showcase: bright full-bleed photo + an overlapping content card */
.hero-photo { overflow: hidden; }
.hero-photo > img {
  display: block;
  width: 100%;
  height: clamp(240px, 42vw, 460px);
  object-fit: cover;
  object-position: center 28%;
  filter: saturate(0.95);
}
.hero-card {
  position: relative;
  z-index: 1;
  margin: -3.5rem auto 0;
  max-width: 640px;
  background: var(--paper);
  border-radius: var(--radius-card);
  padding: 2.25rem 1.75rem 2.5rem;
  text-align: center;
  box-shadow: 0 12px 40px rgba(14, 31, 23, 0.13); /* = --green-900 @ 13% */
}
@media (min-width: 640px) {
  .hero-card { margin-top: -5rem; padding: 2.75rem 2.5rem 3rem; }
}
.hero-card p { color: var(--muted); margin: 1rem auto 1.75rem; max-width: 440px; }
.hero-card > :last-child { margin-bottom: 0; }

/* Photo card: rounded, bright by default */
.photo-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-photo);
}
.photo-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.95);
}
/* Caption variant — the only place a wash is applied, so white text stays legible */
.photo-card--caption::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14,31,23,0.55), rgba(14,31,23,0.08)); /* = --green-900 */
}
.photo-card > figcaption {
  position: absolute;
  z-index: 1;
  bottom: 0.875rem;
  left: 1rem;
  right: 1rem;
  font-family: var(--font-head);
  font-weight: 700;
  color: #fff;
}

/* ── Motion: nudge, never bounce ── */
.fade-in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: none; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; transition: none; }
}
