/* Reverb Analytics — site styles
   Palette and type scale are documented in ../brand-guide.md */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --text: #15181f;
  --muted: #5a606d;
  --border: #e3e0d8;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ef;
  --shadow: 0 1px 2px rgba(20, 24, 31, 0.04), 0 8px 24px rgba(20, 24, 31, 0.06);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --step-4: clamp(2rem, 4vw, 2.75rem);
  --step-5: clamp(2.5rem, 6vw, 4rem);

  --radius: 14px;
  --max: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #161a20;
    --surface-2: #1c2129;
    --text: #eceae4;
    --muted: #a3a8b3;
    --border: #2a303a;
    --accent: #5ec4b6;
    --accent-ink: #0b1513;
    --accent-soft: #15302d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
p { margin: 0 0 1em; }
/* Fraunces' ampersand is ornate and reads like "@" at heading sizes; set it in Inter instead */
.amp { font-family: var(--font-body); font-weight: 600; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 16px; top: 16px;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 100;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  min-height: 64px;
  flex-wrap: wrap;
  /* keeps a wrapped nav row (phones) off the header's bottom border */
  padding-block: 10px;
}
@media (max-width: 560px) {
  .nav { gap: 8px 16px; }
  .nav .btn { padding: 0.55em 1em; }
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-1);
}
.logo svg { width: 28px; height: 28px; color: var(--accent); }
.nav {
  display: flex;
  gap: clamp(12px, 3vw, 28px);
  align-items: center;
  flex-wrap: wrap;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 500;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75em 1.25em;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--step--1);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--muted); }
.nav .btn { color: var(--accent-ink); }

/* Sections */
section { padding-block: clamp(56px, 9vw, 112px); }
section + section { border-top: 1px solid var(--border); }
.eyebrow {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75em;
}
.lede { font-size: var(--step-1); color: var(--muted); max-width: 46rem; }
.section-head { max-width: 46rem; margin-bottom: clamp(32px, 5vw, 56px); }

/* Hero */
.hero { padding-block: clamp(64px, 12vw, 144px); position: relative; overflow: hidden; }
.hero h1 { max-width: 16ch; }
.hero .lede { margin-bottom: 2em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-wave {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: min(520px, 55vw);
  color: var(--accent);
  opacity: 0.18;
  pointer-events: none;
}
.hero .wrap { position: relative; }

/* Grids & cards */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 0.4em; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card.featured { border-color: var(--accent); position: relative; }
.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.card ul { padding-left: 1.1em; color: var(--muted); margin: 0 0 1em; }
.card li { margin-bottom: 0.35em; }
.muted { color: var(--muted); }

/* Problems list */
.problem {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.problem h3 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 600; }
.problem p { color: var(--muted); margin: 0; }

/* Process */
.steps { counter-reset: step; }
.step { position: relative; padding-top: 48px; }
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  top: 0; left: 0;
  font-family: var(--font-display);
  font-size: var(--step-3);
  color: var(--accent);
}
.step h3 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 600; }
.step p { color: var(--muted); }

/* Reverb feedback loop */
.loop {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  position: relative;
}
.loop-step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.loop-step h3 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 600; }
.loop-step p { color: var(--muted); margin: 0; }
.loop-num {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent-soft) 50%, transparent),
              0 0 0 12px color-mix(in srgb, var(--accent-soft) 25%, transparent);
}
.loop-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-weight: 700;
  z-index: 1;
}
.loop-step:last-child::after {
  content: "↺ back to 1";
  display: block;
  margin-top: 12px;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--accent);
}
@media (max-width: 960px) {
  .loop-step:not(:last-child)::after { content: none; }
}

/* Engagement models */
.price { font-family: var(--font-display); font-size: var(--step-2); margin: 0.25em 0 0.75em; }

/* CTA band */
.cta-band { background: var(--surface-2); }
.cta-band .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-band h2 { margin: 0; max-width: 22ch; }

/* Forms */
form { display: grid; gap: 16px; max-width: 640px; }
label { display: grid; gap: 6px; font-weight: 500; font-size: var(--step--1); }
input, textarea, select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}
textarea { min-height: 140px; resize: vertical; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.hp { position: absolute; left: -9999px; }

/* Breadcrumbs */
.crumbs { font-size: var(--step--1); color: var(--muted); margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs [aria-current] { color: var(--text); }

/* Portfolio */
.project-card { display: flex; flex-direction: column; gap: 10px; }
.project-card h3 { margin: 0; }
.project-card .badge { align-self: flex-start; margin-bottom: 0; }
.project-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }
.project-stat { font-family: var(--font-body); font-weight: 700; font-size: 1.9rem; letter-spacing: -0.02em; line-height: 1.1; margin-top: 4px; }
.project-stat-label { color: var(--muted); font-size: var(--step--1); }
.project-card .btn { align-self: flex-start; margin-top: auto; }
.project-card.is-upcoming { box-shadow: none; background: transparent; border-style: dashed; }
.badge.badge-muted { background: var(--surface-2); color: var(--muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 40px;
  color: var(--muted);
  font-size: var(--step--1);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer a { color: var(--muted); }

/* Prose pages */
.prose { max-width: 46rem; }
.prose h2 { font-size: var(--step-3); margin-top: 1.5em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }

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