:root {
  color-scheme: light;
  --ink: #101923;
  --muted: #52616f;
  --navy: #0b1220;
  --navy-2: #121d2d;
  --surface: #ffffff;
  --surface-2: #f4f7fa;
  --line: #d8e0e8;
  --cyan: #0ba7c7;
  --blue: #246bfe;
  --amber: #b66a00;
  --red: #b42318;
  --green: #147a4b;
  --shadow: 0 18px 45px rgba(16, 25, 35, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: #f7fafc;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

a { color: #0c5bd8; }
a:focus-visible, button:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid #74d7ee;
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 5;
  padding: .7rem 1rem;
  background: #fff;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(11, 18, 32, 0.96);
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: .85rem 1.25rem;
}

.brand, .nav-links a {
  color: #fff;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid rgba(116, 215, 238, .55);
  border-radius: 8px;
  color: #baf3ff;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  font-size: .95rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .75fr);
  gap: 2rem;
  align-items: center;
  padding: 4.5rem max(1.25rem, calc((100vw - 1180px) / 2)) 3rem;
  background:
    linear-gradient(135deg, rgba(11,18,32,.96), rgba(18,29,45,.94)),
    radial-gradient(circle at 85% 25%, rgba(11,167,199,.45), transparent 28%);
  color: #fff;
}

.eyebrow {
  margin: 0 0 .55rem;
  color: #0b7891;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow { color: #74d7ee; }

h1, h2, h3 { line-height: 1.15; letter-spacing: 0; }
h1 { max-width: 760px; margin: 0; font-size: clamp(2.25rem, 5vw, 4.8rem); }
h2 { margin: 0 0 1rem; font-size: clamp(1.65rem, 3vw, 2.35rem); }
h3 { margin: 0 0 .65rem; font-size: 1.08rem; }

.lede {
  max-width: 740px;
  color: #dbe9f3;
  font-size: 1.12rem;
}

.tagline {
  color: #aeeeff;
  font-weight: 700;
}

.signal-panel {
  display: grid;
  gap: .85rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  box-shadow: var(--shadow);
}

.signal-panel div {
  display: grid;
  gap: .2rem;
  padding: .9rem;
  border-left: 3px solid var(--cyan);
  background: rgba(255,255,255,.06);
}

.signal-panel span { color: #dbe9f3; }

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3.25rem 1.25rem;
}

.analyzer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 1.4rem;
  align-items: start;
}

.input-panel, .results-panel, .notice, .privacy-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-panel, .results-panel { padding: 1.25rem; }

.notice {
  margin: 1rem 0;
  padding: 1rem;
  background: #eef8fb;
  box-shadow: none;
}

.check-row {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: .65rem;
  align-items: start;
  margin-top: .9rem;
  font-weight: 700;
}

.check-row input {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: .15rem;
}

.textarea-label {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
}

.field-help, .form-meta, .score-note, .empty-state, .meta-row, .limits, .footer, .about p, .privacy-band p {
  color: var(--muted);
}

.secondary-label {
  margin-top: 1.15rem;
}

.file-input {
  width: 100%;
  min-height: 3rem;
  margin-top: .65rem;
  padding: .7rem;
  border: 1px solid #bac8d6;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.help-details {
  margin-top: .75rem;
  padding: .8rem .9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.help-details summary {
  cursor: pointer;
  font-weight: 800;
}

.help-details p {
  margin: .65rem 0 0;
  color: var(--muted);
}

.help-links {
  display: grid;
  gap: .35rem;
  margin: .75rem 0 0;
  padding-left: 1.25rem;
}

.help-links a {
  font-weight: 700;
}

.help-note {
  font-size: .95rem;
}

textarea {
  width: 100%;
  min-height: 21rem;
  margin-top: .7rem;
  padding: .9rem;
  resize: vertical;
  border: 1px solid #bac8d6;
  border-radius: 8px;
  color: var(--ink);
  font: 1rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #fff;
}

textarea[aria-invalid="true"] {
  border-color: var(--red);
}

.form-meta, .controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}

.form-meta {
  margin-top: .45rem;
  font-size: .92rem;
}

.error {
  min-height: 1.5rem;
  color: var(--red);
  font-weight: 700;
}

button {
  min-height: 2.75rem;
  border: 1px solid #aebdca;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

button {
  cursor: pointer;
  padding: .72rem 1rem;
  font-weight: 700;
}

button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.results-panel {
  position: sticky;
  top: 5rem;
}

.empty-state {
  display: grid;
  min-height: 18rem;
  place-items: center;
  padding: 1.25rem;
  border: 1px dashed #b5c3d0;
  border-radius: 8px;
  text-align: center;
}

.score-summary {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--surface-2);
}

.score-number {
  display: flex;
  align-items: baseline;
  justify-content: center;
  min-height: 7rem;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 3rem;
  font-weight: 800;
}

.score-number small { font-size: 1.1rem; }
.tone-some .score-number { background: #7b5b00; }
.tone-elevated .score-number { background: var(--amber); }
.tone-high .score-number, .tone-very-high .score-number { background: var(--red); }

.result-label {
  margin: 0 0 .4rem;
  font-size: 1.35rem;
  font-weight: 800;
}

.next-steps, .limits {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.next-steps ul, .limits ul { padding-left: 1.2rem; }

.finding-list {
  display: grid;
  gap: .7rem;
}

.finding-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.finding-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: .85rem 1rem;
  cursor: pointer;
  font-weight: 800;
}

.points {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: .2rem .55rem;
  color: #fff;
  background: var(--navy-2);
  font-size: .9rem;
}

.finding-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--line);
}

.meta-row { margin: .7rem 0 0; }

.split {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 2rem;
}

.steps {
  display: grid;
  gap: .8rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .75rem 1rem;
  align-items: start;
  padding: 1rem;
  border-left: 4px solid var(--cyan);
  background: #fff;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
}

.steps span { color: var(--muted); }

.glossary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.glossary article {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.privacy-band {
  padding: 2rem;
  background: #eef8fb;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem max(1.25rem, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line);
  background: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .hero, .analyzer-grid, .split {
    grid-template-columns: 1fr;
  }

  .results-panel {
    position: static;
  }

  .glossary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    padding-top: 3rem;
  }

  .score-summary {
    grid-template-columns: 1fr;
  }

  .controls, .footer {
    align-items: stretch;
    flex-direction: column;
  }

  .glossary {
    grid-template-columns: 1fr;
  }
}
