/* Voice linter. Visual direction borrowed from DESIGN.md (white canvas, compact ink type,
   one saturated blue for actions, 20px cards, 14px controls, quiet layered shadows). */

@font-face {
  font-family: 'Source Sans 3';
  src: url('fonts/source-sans-3-latin-wght.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('fonts/source-serif-4-latin-wght.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #000000;
  --graphite: #161618;
  --charcoal: #6a6a6b;
  --studio: #0f0f12;
  --blue: #0d44e8;
  --blue-bright: #174ef2;
  --mist: #f5f6f8;
  --line: rgba(22, 22, 24, 0.09);
  --sweep: linear-gradient(90deg, #161618 0%, #161618 35%, #174ef2 100%);

  /* Severity: one restrained hue each, used for dots and highlights only. */
  --must: #d43d2a;
  --must-bg: rgba(212, 61, 42, 0.16);
  --look: #c98a00;
  --look-bg: rgba(232, 168, 0, 0.2);
  --tip: #6a6a6b;
  --tip-bg: rgba(22, 22, 24, 0.07);

  --sans: 'Source Sans 3', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  --r-card: 20px;
  --r-ctl: 14px;
  --shadow-card: rgba(22, 22, 24, 0.02) 0 7px 20px -8px, rgba(22, 22, 24, 0.02) 0 29px 33px -4px, rgba(22, 22, 24, 0.05) 0 22px 30px -8px, rgba(22, 22, 24, 0.06) 0 0 0 1px;
  --shadow-blue: rgba(4, 24, 85, 0.28) 0 2px 6px -1px, rgba(66, 174, 247, 0.48) 0 6px 14px 0 inset;
  --shadow-chip: rgba(22, 22, 24, 0.12) 0 2px 6px -1px, rgba(22, 22, 24, 0.12) 0 0 0 1px;

  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font: 450 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
code { font-size: 0.92em; background: var(--mist); padding: 1px 6px; border-radius: 6px; }
kbd { font: 550 12px/1 var(--sans); padding: 3px 6px; border-radius: 6px; background: var(--mist); box-shadow: inset 0 -1px 0 var(--line); }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--studio); color: #fff; padding: 8px 12px; border-radius: 10px; }

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

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border-radius: var(--r-ctl); border: 1px solid transparent;
  font: 550 16px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; border-color: rgba(255, 255, 255, 0.9); box-shadow: var(--shadow-blue); }
.btn-primary:hover { background: #0a3bd0; }
.btn-outline { background: var(--paper); color: var(--graphite); border-color: var(--graphite); }
.btn-outline:hover { background: var(--mist); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 15px; }
.btn-wide { min-width: 220px; }
.btn-ghost-dark { color: #fff; border-color: rgba(255, 255, 255, 0.3); background: transparent; }
.btn-ghost-dark:hover { background: rgba(255, 255, 255, 0.08); }

.chip-btn {
  min-height: 34px; padding: 0 12px; border-radius: 10px;
  border: 0; background: var(--paper); color: var(--graphite);
  box-shadow: var(--shadow-chip);
  font: 550 14px/1 var(--sans); cursor: pointer;
}
.chip-btn:hover { background: var(--mist); }

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 600 17px/1 var(--sans); color: var(--ink); text-decoration: none; letter-spacing: -0.2px; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: var(--studio); display: grid; align-content: center; gap: 3px; padding: 0 6px; }
.mark i { display: block; height: 3px; border-radius: 2px; background: #fff; }
.mark i:nth-child(2) { width: 60%; background: var(--blue-bright); }
.mark i:nth-child(3) { width: 80%; }
.nav nav { display: flex; align-items: center; gap: 24px; }
.nav nav a:not(.btn) { font: 550 15px/1.6 var(--sans); text-decoration: none; color: var(--graphite); }
.nav nav a:not(.btn):hover { color: var(--blue); }

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -40% 10% auto; height: 620px; z-index: -1;
  background: radial-gradient(closest-side, rgba(23, 78, 242, 0.13), rgba(66, 174, 247, 0.06) 55%, transparent);
  pointer-events: none;
}
.hero-inner { text-align: center; padding: 72px 0 40px; display: grid; justify-items: center; gap: 20px; }
.badge {
  display: inline-block; background: var(--studio); color: #fff;
  font: 550 14px/1 var(--sans); letter-spacing: 0.14px;
  padding: 9px 13px 9px 12px; border-radius: var(--r-ctl);
}
.hero h1 {
  max-width: 820px; text-wrap: balance;
  font-size: clamp(38px, 6vw, 60px); line-height: 1.1; letter-spacing: -1.2px;
}
h1 .sweep { white-space: nowrap; }
.sweep { background: var(--sweep); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sweep-light { background: linear-gradient(90deg, #fff 0%, #fff 30%, #6f95ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 620px; color: var(--charcoal); font-size: 19px; line-height: 1.6; letter-spacing: 0.1px; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }

.steps { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; color: var(--charcoal); font: 550 14px/1.4 var(--sans); }
.steps li { display: inline-flex; align-items: center; gap: 8px; }
.steps span, .num {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(22, 22, 24, 0.06); color: var(--graphite); font: 600 12px/1 var(--sans);
}

/* ---------- Workspace ---------- */

.tool { padding-bottom: 24px; }
.card { background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); overflow: hidden; }
.ws-input { padding: 28px; display: grid; gap: 28px; align-content: start; }
.ws-results { padding: 28px; background: linear-gradient(180deg, #f7f8fb, #f3f5f9); border-left: 1px solid var(--line); min-height: 100%; }

.block { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 12px; }
.block-head { display: flex; align-items: center; gap: 10px; padding: 0; font: 600 20px/1.4 var(--sans); color: var(--ink); letter-spacing: -0.2px; }
.block-head .num { background: var(--blue); color: #fff; }
.block-head label { cursor: text; }
.block-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; }
.helper { color: var(--charcoal); font-size: 15px; line-height: 1.5; }
.helper.small { font-size: 14px; }
.helper a { color: var(--blue); text-decoration: none; font-weight: 550; }
.helper a:hover { text-decoration: underline; }

.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--mist); border-radius: var(--r-ctl); width: fit-content; max-width: 100%; }
.seg { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 9px 16px; border-radius: 10px; font: 550 15px/1.3 var(--sans); color: var(--charcoal); }
.seg:hover span { color: var(--graphite); }
.seg.is-on span { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-chip); }
.seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }

/* Editor: a transparent textarea over a highlight layer with identical metrics. */
.editor { position: relative; border-radius: var(--r-ctl); background: var(--paper); box-shadow: inset 0 0 0 1px rgba(22, 22, 24, 0.16); }
.editor:focus-within { box-shadow: inset 0 0 0 2px var(--blue); }
.editor textarea, .backdrop {
  font: 400 17px/1.7 var(--serif); letter-spacing: 0;
  padding: 18px 20px; margin: 0; border: 0;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal;
}
.backdrop { position: absolute; inset: 0; color: transparent; overflow: hidden; pointer-events: none; }
.editor textarea {
  position: relative; display: block; width: 100%; min-height: 300px;
  resize: none; overflow: hidden; background: transparent; color: var(--ink);
  border-radius: var(--r-ctl); outline: none;
}
.editor textarea::placeholder { color: #9a9a9c; font-family: var(--sans); font-size: 16px; }
.backdrop mark { color: transparent; border-radius: 3px; padding: 0; }
.backdrop mark[data-sev='error'] { background: var(--must-bg); box-shadow: inset 0 -2px 0 var(--must); }
.backdrop mark[data-sev='warn'] { background: var(--look-bg); box-shadow: inset 0 -2px 0 var(--look); }
.backdrop mark[data-sev='info'] { background: var(--tip-bg); }
.backdrop mark.wide { background: transparent; box-shadow: none; text-decoration: underline wavy; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.backdrop mark.wide[data-sev='warn'] { text-decoration-color: var(--look); color: transparent; }
.backdrop mark.wide[data-sev='info'] { text-decoration-color: var(--tip); }
.backdrop mark.wide[data-sev='error'] { text-decoration-color: var(--must); }
.backdrop mark.is-active { outline: 2px solid var(--blue); outline-offset: 1px; }

.editor-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--charcoal); font: 450 14px/1.4 var(--sans); }
.lock { display: inline-flex; align-items: center; gap: 6px; }

.run-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.kbd-hint { color: var(--charcoal); font-size: 14px; }

/* ---------- Results ---------- */

#results { margin-top: 16px; display: grid; gap: 16px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px; border-radius: 10px;
  background: var(--paper); box-shadow: var(--shadow-chip);
  font: 550 13px/1.2 var(--sans); color: var(--graphite);
}
.pill i, .tally i { width: 8px; height: 8px; border-radius: 50%; background: var(--tip); display: inline-block; }
[data-sev='error'] > i { background: var(--must); }
[data-sev='warn'] > i { background: var(--look); }

.summary { display: grid; gap: 6px; }
.big { font: 450 18px/1.3 var(--sans); color: var(--graphite); }
.big strong { font: 600 40px/1 var(--sans); color: var(--ink); letter-spacing: -0.8px; margin-right: 6px; }
.sub { color: var(--charcoal); font-size: 15px; }
.tally { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; font: 550 14px/1.4 var(--sans); }
.tally span { display: inline-flex; align-items: center; gap: 6px; }
.next { background: var(--paper); border-radius: var(--r-ctl); padding: 12px 14px; font-size: 15px; line-height: 1.5; box-shadow: var(--shadow-chip); }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button {
  border: 0; cursor: pointer; padding: 7px 12px; border-radius: 10px;
  background: transparent; color: var(--charcoal); font: 550 14px/1.2 var(--sans);
}
.tabs button span { color: inherit; opacity: 0.7; margin-left: 2px; }
.tabs button:hover { color: var(--graphite); background: rgba(22, 22, 24, 0.04); }
.tabs button[aria-selected='true'] { background: var(--studio); color: #fff; }

.result-list { display: grid; gap: 12px; }
.result {
  position: relative; background: var(--paper); border-radius: 16px; padding: 16px;
  box-shadow: var(--shadow-card); display: grid; gap: 8px;
}
.result-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.where { color: var(--charcoal); font: 550 13px/1.2 var(--sans); }
.result h3 { font-size: 18px; line-height: 1.35; letter-spacing: -0.1px; }
.problem { color: var(--graphite); font-size: 15px; }
.fix { font-size: 15px; color: var(--graphite); }
.fix strong { font-weight: 600; color: var(--ink); }

.occs { display: flex; flex-wrap: wrap; gap: 6px; }
.occ {
  display: inline-flex; align-items: baseline; gap: 8px; max-width: 100%;
  border: 0; text-align: left; cursor: pointer;
  padding: 6px 10px; border-radius: 10px; background: var(--mist);
  font: 450 15px/1.4 var(--serif); color: var(--ink);
}
.occ[data-sev='error'] { background: var(--must-bg); }
.occ[data-sev='warn'] { background: var(--look-bg); }
.occ:hover { box-shadow: 0 0 0 1px rgba(22, 22, 24, 0.25); }
.occ.is-active { box-shadow: 0 0 0 2px var(--blue); }
.occ-line { font: 550 12px/1 var(--sans); color: var(--charcoal); white-space: nowrap; }
.occ-text { min-width: 0; overflow-wrap: anywhere; }
span.occ { cursor: default; }

.more summary { cursor: pointer; color: var(--blue); font: 550 14px/1.4 var(--sans); width: fit-content; }
.more[open] { display: grid; gap: 8px; }
.more p { font-size: 15px; color: var(--charcoal); }
.more .owner { font-size: 14px; }

.idle { display: grid; gap: 12px; justify-items: start; }
.idle > h3 { font-size: 20px; }
.idle > p { color: var(--charcoal); font-size: 15px; }
.idle-icon { display: grid; gap: 5px; width: 44px; padding: 10px; border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-chip); }
.idle-icon i { height: 4px; border-radius: 2px; background: rgba(22, 22, 24, 0.18); }
.idle-icon i:nth-child(2) { width: 60%; background: var(--must); }
.result.is-sample { width: 100%; opacity: 0.92; outline: 1px dashed rgba(22, 22, 24, 0.2); outline-offset: 4px; }
.sample-tag { position: absolute; top: -10px; right: 14px; background: var(--studio); color: #fff; font: 550 12px/1 var(--sans); padding: 5px 8px; border-radius: 8px; }

.clean { display: grid; gap: 10px; justify-items: start; background: var(--paper); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-card); }
.clean-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--blue); box-shadow: var(--shadow-blue); }
.clean h3 { font-size: 22px; }
.clean p { color: var(--charcoal); }

/* ---------- Sections ---------- */

.section { padding: 80px 0 0; }
.section-head { max-width: 680px; display: grid; gap: 12px; margin-bottom: 32px; }
.eyebrow { font: 550 14px/1.4 var(--sans); color: var(--blue); }
.section-head h2 { font-size: clamp(30px, 4vw, 40px); line-height: 1.2; letter-spacing: -0.8px; }
.section-lead { color: var(--charcoal); font-size: 18px; line-height: 1.67; }

.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.rule { padding: 20px; display: grid; gap: 10px; align-content: start; }
.rule h3 { font-size: 20px; line-height: 1.35; letter-spacing: -0.2px; }
.rule-why { color: var(--charcoal); font-size: 15px; line-height: 1.55; }
.ex { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; font: 450 15px/1.5 var(--serif); color: var(--ink); }
.ex span { font: 550 12px/1.3 var(--sans); color: var(--charcoal); letter-spacing: 0.2px; }
.ex-bad { background: rgba(212, 61, 42, 0.07); }
.ex-bad span { color: #a3301f; }
.ex-good { background: rgba(13, 68, 232, 0.06); }
.ex-good span { color: var(--blue); }

.own-guide { margin-top: 24px; padding: 0; }
.own-guide summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; }
.own-guide summary::-webkit-details-marker { display: none; }
.own-guide summary > span:first-child { display: grid; gap: 2px; }
.own-guide strong { font-weight: 600; color: var(--ink); font-size: 17px; }
.chev { width: 36px; height: 36px; flex: none; border-radius: 50%; background: rgba(22, 22, 24, 0.05); position: relative; }
.chev::after { content: ''; position: absolute; left: 13px; top: 11px; width: 8px; height: 8px; border-right: 2px solid var(--graphite); border-bottom: 2px solid var(--graphite); transform: rotate(45deg); transition: transform 0.15s; }
.own-guide[open] .chev::after { transform: translateY(4px) rotate(-135deg); }
.own-body { padding: 0 24px 24px; display: grid; gap: 14px; justify-items: start; color: var(--charcoal); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.faq { padding: 24px; display: grid; gap: 8px; align-content: start; }
.faq h3 { font-size: 20px; letter-spacing: -0.2px; }
.faq p { color: var(--charcoal); font-size: 16px; line-height: 1.6; }

/* ---------- Footer band ---------- */

.band { margin-top: 96px; background: var(--studio); color: rgba(255, 255, 255, 0.72); }
.band-inner { padding: 56px 0; display: grid; gap: 14px; justify-items: start; }
.band-title { color: #fff; font: 600 clamp(24px, 3vw, 32px)/1.2 var(--sans); letter-spacing: -0.5px; }
.band p:not(.band-title) { max-width: 620px; }

.noscript { padding: 24px; text-align: center; }

/* ---------- Responsive ---------- */

@media (min-width: 960px) {
  .ws-input { position: sticky; top: 64px; align-self: start; }
}
@media (max-width: 959px) {
  .workspace { grid-template-columns: 1fr; }
  .ws-results { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .nav nav a:not(.btn) { display: none; }
  .hero-inner { padding: 48px 0 28px; }
  .lead { font-size: 17px; }
  .cta-row { width: 100%; }
  .cta-row .btn { flex: 1 1 100%; }
  .ws-input, .ws-results { padding: 20px 16px; }
  .editor textarea, .backdrop { font-size: 16px; padding: 14px 14px; }
  .editor textarea { min-height: 240px; }
  .run-row .btn { width: 100%; }
  .kbd-hint { display: none; }
  .faq-grid { grid-template-columns: 1fr; }
  .section { padding-top: 56px; }
  .big strong { font-size: 34px; }
}

.band-ctas { justify-content: flex-start; margin-top: 0; }
.own-body a { color: var(--blue); font-weight: 550; }
