/* Reach — Direction C ("Studio"). Design tokens first, components after. */

:root {
  --paper: #EFEDE6;
  --surface: #FFFFFF;
  --sunken: #F7F6F1;
  --ink: #111110;
  --ink-2: #3A3835;
  --muted: #5C5A55;
  --rule: #E2E0D8;

  --blue: #2F4BF0;
  --blue-ink: #1E34C4;
  --blue-tint: #DDE3FF;
  --orange: #FF5B2E;
  --orange-tint: #FFE0D5;
  --yellow: #FFD400;

  --line: 2px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);
  --pop-lg: 6px 6px 0 var(--ink);

  --display: 'Bricolage Grotesque', 'Helvetica Neue', Helvetica, sans-serif;
  --body: 'Archivo', 'Helvetica Neue', Helvetica, sans-serif;

  --gutter: 44px;
  --maxw: 1280px;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
a:hover { color: var(--blue-ink); }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.03em; margin: 0; }

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header__in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}
.nav { display: flex; gap: 8px; flex-grow: 1; flex-wrap: wrap; }
.nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.nav a[aria-current="page"] {
  font-weight: 700;
  background: var(--yellow);
  border: var(--line);
}

/* ---------- buttons & chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .06s ease;
}
.btn--primary { background: var(--blue); color: #FFFFFF; }
.btn--pop { box-shadow: var(--pop); }
.btn--pop:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 13px; font-weight: 600; }

.chip {
  display: inline-block;
  padding: 5px 10px;
  border: var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.chip--orange { background: var(--orange); }
.chip--yellow { background: var(--yellow); }
.chip--plain { background: var(--surface); }

.note { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- cards ---------- */

.card { background: var(--surface); border: var(--line); padding: 22px 24px; }
.card--pop { box-shadow: var(--pop); }
.card--pop-lg { box-shadow: var(--pop-lg); }
.card__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card__title { font-size: 21px; font-weight: 700; text-transform: uppercase; }
.card__kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  flex-grow: 1;
}

/* ---------- landing ---------- */

.hero { padding: 62px 0 52px; display: grid; grid-template-columns: 7fr 4fr; gap: 44px; align-items: start; }
.hero__title {
  font-size: clamp(40px, 6vw, 78px);
  line-height: 0.94;
  font-weight: 800;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  margin: 22px 0 0;
  text-wrap: balance;
}
.hero__title mark { background: var(--yellow); color: inherit; box-shadow: 0 0 0 6px var(--yellow); }
.hero__lede { font-size: 18px; line-height: 1.6; color: var(--ink-2); font-weight: 500; max-width: 540px; margin: 26px 0 0; text-wrap: pretty; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

.facts { background: var(--yellow); border: var(--line); box-shadow: var(--pop-lg); padding: 24px 28px; margin: 0; }
.facts > div { display: flex; align-items: baseline; gap: 14px; padding: 14px 0; border-bottom: var(--line); }
.facts > div:last-child { border-bottom: none; padding-bottom: 0; }
.facts dt { font-size: 13px; font-weight: 600; flex-grow: 1; }
.facts dd { margin: 0; font-family: var(--display); font-size: 32px; font-weight: 800; letter-spacing: -0.03em; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding-bottom: 52px; }
.step__num {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  border: var(--line);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.step h2 { font-size: 22px; font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; margin-bottom: 10px; }
.step p { margin: 0; font-size: 14px; line-height: 1.62; color: var(--ink-2); }

.slab {
  background: var(--ink);
  color: #FFFFFF;
  border: var(--line);
  box-shadow: 6px 6px 0 var(--blue);
  padding: 36px 34px;
  display: flex;
  align-items: center;
  gap: 44px;
  flex-wrap: wrap;
}
.slab h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 800; text-transform: uppercase; line-height: 1.04; letter-spacing: -0.035em; }
.slab p { margin: 10px 0 0; font-size: 14px; line-height: 1.62; color: #D5D3CC; max-width: 640px; }
.slab dl { margin: 0; display: flex; gap: 30px; flex-wrap: wrap; }
.slab dt { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--yellow); margin-bottom: 6px; }
.slab dd { margin: 0; font-size: 16px; font-weight: 600; }

.site-footer {
  border-top: var(--line);
  margin-top: 52px;
  padding: 24px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.site-footer .wrap { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer span:first-child { flex-grow: 1; }

/* ---------- charts ---------- */

.legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.legend i { width: 16px; height: 4px; display: block; }
.legend i.ig { background: var(--blue); }
.legend i.yt { background: var(--orange); }
.chart { width: 100%; height: auto; display: block; }

/* ---------- dashboard ---------- */

.app { padding: 26px 0 40px; display: flex; flex-direction: column; gap: 16px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters .spacer { flex-grow: 1; }
.filters label { font-size: 13px; font-weight: 600; }
.select {
  min-height: 40px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  border: var(--line);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
}
.seg[aria-pressed="true"] { background: var(--blue); color: #FFFFFF; box-shadow: 3px 3px 0 var(--ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--surface); border: var(--line); padding: 14px 18px; }
.stat__label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat__value { font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; margin: 5px 0; }
.stat__delta { font-size: 12px; font-weight: 600; color: var(--blue); }
.stat__delta--flat { color: var(--muted); }

.cols { display: grid; grid-template-columns: 2.1fr 1fr; gap: 16px; align-items: stretch; }

.split { display: flex; flex-direction: column; gap: 18px; height: 100%; }
.split__row { display: flex; flex-direction: column; gap: 8px; }
.split__top { display: flex; align-items: baseline; gap: 10px; }
.split__name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; flex-grow: 1; }
.split__name i { width: 10px; height: 10px; border: 1px solid var(--ink); display: block; }
.split__name i.ig { background: var(--blue); }
.split__name i.yt { background: var(--orange); }
.split__val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.split__rate { margin-top: auto; background: var(--yellow); border: var(--line); padding: 12px 14px; display: flex; align-items: baseline; gap: 12px; }
.split__rate span { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; flex-grow: 1; }
.split__rate strong { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  padding: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  border-bottom: var(--line);
}
.table td { padding: 11px 0; border-bottom: 1px solid var(--rule); font-weight: 500; }
.table tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-weight: 400; font-variant-numeric: tabular-nums; }
.table .er { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.table .dim { color: var(--muted); font-size: 13px; font-weight: 400; }
.badge { display: inline-block; padding: 3px 7px; border: var(--line); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge--ig { background: var(--blue-tint); }
.badge--yt { background: var(--orange-tint); }

/* ---------- drafts ---------- */

.studio { display: grid; grid-template-columns: 364px 1fr; gap: 22px; align-items: start; }
.panel { background: var(--surface); border: var(--line); padding: 16px 18px; }
.panel + .panel { margin-top: 14px; }
.panel__label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.panel p { margin: 10px 0 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.panel fieldset { margin: 0; padding: 0; border: none; }
.panel legend { padding: 0; }

.radio-row { display: flex; align-items: center; gap: 11px; min-height: 44px; }
.radio-row input { width: 17px; height: 17px; accent-color: var(--blue); }
.radio-row label { font-size: 15px; font-weight: 500; flex-grow: 1; }
.radio-row .lim { font-size: 11px; font-weight: 600; color: var(--muted); }

.tones { display: flex; flex-wrap: wrap; gap: 8px; }
.tone[aria-pressed="true"] { background: var(--blue); color: #FFFFFF; box-shadow: 3px 3px 0 var(--ink); }

.range { width: 100%; height: 24px; accent-color: var(--blue); }
.range-scale { display: flex; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 8px; }
.range-scale span:first-child, .range-scale span:nth-child(2) { flex-grow: 1; }
.range-scale span:nth-child(2) { text-align: center; }

.callout { background: var(--yellow); border: var(--line); padding: 14px 16px; margin-top: 14px; }
.callout p { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.5; }

.draft { background: var(--surface); border: var(--line); box-shadow: 5px 5px 0 var(--ink); padding: 20px 26px; display: flex; flex-direction: column; gap: 16px; }
.draft__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-bottom: var(--line); padding-bottom: 12px; }
.draft__head h1 { font-size: 25px; font-weight: 800; text-transform: uppercase; letter-spacing: -0.035em; flex-grow: 1; }
.draft__count { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.draft__body {
  background: var(--sunken);
  border: var(--line);
  padding: 20px 24px;
  min-height: 260px;
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.72;
  font-weight: 500;
  white-space: pre-line;
  max-width: 62ch;
}
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { font-size: 13px; font-weight: 600; background: var(--blue-tint); border: var(--line); padding: 5px 10px; }
.draft__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.draft__actions .spacer { flex-grow: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(140%);
  background: var(--ink);
  color: #FFFFFF;
  border: var(--line);
  box-shadow: var(--pop);
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  transition: transform .18s ease;
  z-index: 50;
}
.toast.is-up { transform: translateX(-50%) translateY(0); }

/* ---------- demo banner ---------- */

.demo-bar {
  background: var(--orange);
  border-bottom: var(--line);
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
}
.demo-bar .wrap { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .studio { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --gutter: 24px; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 40px 0 36px; }
  .steps { grid-template-columns: 1fr; }
  .slab { gap: 24px; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .site-header__in { gap: 12px; padding-top: 12px; padding-bottom: 12px; }
  .table .hide-sm { display: none; }
  .draft__body { padding: 16px; }
}

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