/* AudienceKit design system tokens (default and Hot Mess presets). */
@font-face {
  font-family: "Figtree";
  src: url("../fonts/Figtree-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../fonts/Figtree-Italic-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --font-sans: Figtree, "Avenir Next", "Segoe UI", system-ui, sans-serif;

  --surface: #f0f2f5;
  --surface-raised: #ffffff;
  --surface-sunken: #f5f6f7;
  --control-fill: #e4e6eb;
  --control-fill-hover: #d8dadf;
  --hover-overlay: rgba(0,0,0,0.05);
  --press-overlay: rgba(0,0,0,0.1);
  --border: #ced0d4;
  --border-strong: #84878c;
  --ink: #1c1e21;
  --ink-muted: #5c6068;
  --accent: #0e7268;
  --accent-strong: #0a5952;
  --accent-soft: #e3f3f0;
  --on-accent: #ffffff;
  --accent-ink: #0b6158;
  --focus: #0a5952;
  --spectrum-1: #f08a6c;
  --spectrum-2: #f4bf4f;
  --spectrum-3: #79c7a0;
  --spectrum-4: #58b2c8;
  --spectrum-5: #8d9ae3;
  --spectrum-6: #e48fb4;
  --on-spectrum: #1d2125;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 12px 28px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.1);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 999px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #18191b;
    --surface-raised: #242527;
    --surface-sunken: #1d1e20;
    --control-fill: #3a3b3e;
    --control-fill-hover: #4a4b4e;
    --hover-overlay: rgba(255,255,255,0.1);
    --press-overlay: rgba(255,255,255,0.18);
    --border: #3a3b3e;
    --border-strong: #7b7e83;
    --ink: #e4e6eb;
    --ink-muted: #b0b3b8;
    --accent: #4fd1bf;
    --accent-strong: #86e3d6;
    --accent-soft: #123430;
    --on-accent: #062824;
    --accent-ink: #6fdcca;
    --focus: #86e3d6;
    --spectrum-1: #f29a80;
    --spectrum-2: #f6c96a;
    --spectrum-3: #86d1ac;
    --spectrum-4: #6cc0d4;
    --spectrum-5: #9ea9ea;
    --spectrum-6: #eaa2c2;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow-md: 0 12px 28px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.3);
    color-scheme: dark;
  }
}

/* The Hot Mess preset, scoped to its showcase. */
.theme-hot-mess {
  --surface: #f6eff3;
  --surface-raised: #ffffff;
  --surface-sunken: #faf4f7;
  --control-fill: #efe4ea;
  --border: #e6d3dc;
  --ink: #24161d;
  --ink-muted: #6b5360;
  --accent: #b8236f;
  --accent-strong: #951b5a;
  --accent-soft: #fde6f1;
  --on-accent: #ffffff;
  --accent-ink: #a01f61;
  --focus: #7a1d6e;
  --spectrum-1: #e40303;
  --spectrum-2: #ff8c00;
  --spectrum-3: #ffed00;
  --spectrum-4: #008026;
  --spectrum-5: #004dff;
  --spectrum-6: #750787;
  --shadow-sm: 0 1px 2px rgba(36,22,29,0.2);
  --shadow-md: 0 12px 28px rgba(36,22,29,0.2), 0 2px 4px rgba(36,22,29,0.1);
}
@media (prefers-color-scheme: dark) {
  .theme-hot-mess {
    --surface: #1a1519;
    --surface-raised: #272026;
    --surface-sunken: #201a1f;
    --control-fill: #3d3239;
    --border: #3e333b;
    --ink: #f3e6ee;
    --ink-muted: #c2adba;
    --accent: #ff7ab6;
    --accent-strong: #ffa6cf;
    --accent-soft: #3b1a2c;
    --on-accent: #3a0a22;
    --accent-ink: #ff93c4;
    --focus: #ffa6cf;
    --spectrum-1: #ff4d4d;
    --spectrum-2: #ffa133;
    --spectrum-3: #ffe94d;
    --spectrum-4: #2fbf5b;
    --spectrum-5: #4d86ff;
    --spectrum-6: #c77dff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 12px 28px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.3);
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--ink-muted); }

.skip {
  position: absolute; left: var(--space-4); top: -100px;
  background: var(--surface-raised); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md); z-index: 10;
}
.skip:focus { top: var(--space-4); }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--space-4); }
@media (min-width: 720px) { .wrap { padding: 0 var(--space-6); } }

/* Type */
.display {
  font-size: clamp(32px, 5.5vw, 52px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.title { font-size: 24px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; }
.heading { font-size: 17px; line-height: 22px; font-weight: 700; }
.lede { font-size: 17px; line-height: 26px; color: var(--ink-muted); max-width: 560px; }
.caption {
  font-size: 12px; line-height: 16px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted);
}
.body-sm { font-size: 13px; line-height: 16px; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  font: 600 15px/20px var(--font-sans);
  background: var(--control-fill); color: var(--ink);
  position: relative; transition: background-color 150ms ease-out;
}
.button:hover { text-decoration: none; color: var(--ink); background: var(--control-fill-hover); }
.button--primary { background: var(--accent); color: var(--on-accent); }
.button--primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.button--lg { min-height: 44px; padding: 0 var(--space-5); }

/* Header */
.site-header { background: var(--surface-raised); box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 5; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 56px; }
.wordmark { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; color: var(--ink); }
.wordmark:hover { color: var(--ink); text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: var(--space-1); }
.site-nav a:not(.button) {
  color: var(--ink); font-weight: 600; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}
.site-nav a:not(.button):hover { background: var(--hover-overlay); text-decoration: none; }
@media (max-width: 640px) { .site-nav a:not(.button) { display: none; } }

/* Spectrum */
.spectrum { display: flex; height: 6px; }
.spectrum span { flex: 1; }
.spectrum span:nth-child(1) { background: var(--spectrum-1); }
.spectrum span:nth-child(2) { background: var(--spectrum-2); }
.spectrum span:nth-child(3) { background: var(--spectrum-3); }
.spectrum span:nth-child(4) { background: var(--spectrum-4); }
.spectrum span:nth-child(5) { background: var(--spectrum-5); }
.spectrum span:nth-child(6) { background: var(--spectrum-6); }

/* Sections */
.section { padding: var(--space-12) 0; }
@media (min-width: 720px) { .section { padding: 80px 0; } }
.section__head { max-width: 640px; margin-bottom: var(--space-8); display: grid; gap: var(--space-3); }

/* Hero */
.hero { padding: var(--space-12) 0; }
@media (min-width: 720px) { .hero { padding: 88px 0 80px; } }
.hero__grid { display: grid; gap: var(--space-12); align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.1fr 1fr; } }
.hero__copy { display: grid; gap: var(--space-5); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }

/* Cards */
.card { background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: var(--space-6); }
.grid { display: grid; gap: var(--space-4); }
@media (min-width: 640px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
.feature { display: grid; gap: var(--space-2); align-content: start; }
.feature__icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); margin-bottom: var(--space-2);
}
.feature__icon svg { width: 20px; height: 20px; }
.feature p { color: var(--ink-muted); }

/* App mock (the audience preview) */
.mock { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; max-width: 440px; justify-self: center; width: 100%; }
.mock__body { padding: var(--space-4); display: grid; gap: var(--space-3); }
.aud-header { display: flex; align-items: center; gap: var(--space-3); }
.aud-mark {
  width: 48px; height: 48px; border-radius: var(--radius-pill); flex: none;
  display: grid; place-items: center; background: var(--accent); color: var(--on-accent);
  font-weight: 800; font-size: 22px;
}
.aud-header .title { color: var(--ink); }
.aud-header p { color: var(--ink-muted); }
.event { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3); background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.date-tile {
  width: 48px; flex: none; text-align: center; border-radius: var(--radius-md);
  background: var(--accent-soft); color: var(--accent-ink); padding: var(--space-1) 0;
}
.date-tile b { display: block; font-size: 20px; line-height: 24px; font-weight: 800; }
.date-tile span { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.04em; }
.event__meta { color: var(--ink-muted); }
.event__title { font-weight: 600; color: var(--ink); }
.chip-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); background: var(--control-fill); font-weight: 600; font-size: 13px; line-height: 20px; color: var(--ink); }
.chip--on { background: var(--accent-soft); color: var(--accent-ink); }
.dot { width: 8px; height: 8px; border-radius: var(--radius-pill); }

/* Steps */
.steps { counter-reset: step; }
.step { display: grid; gap: var(--space-2); }
.step__num {
  counter-increment: step; width: 32px; height: 32px; border-radius: var(--radius-pill);
  display: grid; place-items: center; background: var(--control-fill); font-weight: 700; margin-bottom: var(--space-2);
}
.step__num::before { content: counter(step); }
.step p { color: var(--ink-muted); }

/* Hot Mess showcase */
.showcase { background: var(--surface); }
.showcase__grid { display: grid; gap: var(--space-8); align-items: center; }
@media (min-width: 900px) { .showcase__grid { grid-template-columns: 1fr 1fr; } }
.showcase__copy { display: grid; gap: var(--space-4); }
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-3); }
.list li { display: flex; gap: var(--space-3); }
.list svg { width: 20px; height: 20px; flex: none; color: var(--accent-ink); margin-top: 0; }

/* Developers band */
.dev { display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 900px) { .dev { grid-template-columns: 1fr 1fr; } }
.code {
  background: #1c1e21; color: #e4e6eb; border-radius: var(--radius-lg);
  padding: var(--space-5); overflow-x: auto; font: 13px/20px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin: 0;
  border: 1px solid var(--border);
}
.code .k { color: #86e3d6; }
.code .s { color: #f6c96a; }
.code .c { color: #b0b3b8; }

/* CTA */
.cta { text-align: center; display: grid; gap: var(--space-4); justify-items: center; padding: var(--space-12) var(--space-6); }

/* Footer */
.site-footer { background: var(--surface-raised); margin-top: var(--space-12); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; justify-content: space-between; padding-top: var(--space-6); padding-bottom: var(--space-6); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--space-4); }

/* 404 */
.notfound { min-height: 50vh; display: grid; place-content: center; gap: var(--space-4); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Legal pages */
.legal { max-width: 760px; padding-top: var(--space-12); display: grid; gap: var(--space-6); }
.legal__head { display: grid; gap: var(--space-2); }
.legal__nav { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.prose { font-size: 15px; line-height: 24px; }
.prose > * + * { margin-top: var(--space-4); }
.prose h2 { font-size: 17px; line-height: 22px; font-weight: 700; margin-top: var(--space-8); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 15px; line-height: 20px; font-weight: 600; margin-top: var(--space-5); }
.prose ul, .prose ol { padding-left: var(--space-6); margin-bottom: 0; }
.prose li + li { margin-top: var(--space-2); }
.prose p, .prose li { color: var(--ink); }
.prose code { font: 13px/20px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-sunken); padding: 0 var(--space-1); border-radius: var(--radius-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 20px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: var(--space-2) var(--space-3) var(--space-2) 0; border-bottom: 1px solid var(--border); }
.prose th { font-weight: 600; }
.table-scroll { overflow-x: auto; }
