/* jistevenson.com's palette and type, mobile first: base rules target a 360–390 px phone. */

@font-face {
  font-family: 'Newsreader Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/newsreader.woff2) format('woff2-variations');
}

@font-face {
  font-family: 'Hanken Grotesk Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/hanken-grotesk.woff2) format('woff2-variations');
}

:root {
  --ground: #ffffff;
  --surface: #f6f6ee;
  --ink: #1d2114;
  --muted: #51553f;
  --line: #e0e2d4;
  --primary: #4d6a26;
  --primary-deep: #3a501c;
  --tint: #eef2e2;
  --accent: #b02a3a;
  --accent-deep: #8e1f2e;
  --warn: #8a5a00;
  --warn-tint: #fbf3df;
  --bad-tint: #fbecee;

  --serif: 'Newsreader Variable', 'Iowan Old Style', Georgia, serif;
  --sans: 'Hanken Grotesk Variable', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --gutter: clamp(16px, 5vw, 48px);

  color-scheme: light;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

p,
ol,
ul {
  margin: 0;
}

a {
  color: var(--primary);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--primary-deep);
  text-decoration-color: var(--accent);
}

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

h1,
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.018em;
}

.wrap {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.small {
  font-size: 0.875rem;
}

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

/* The bar back to the main site */
.top {
  border-bottom: 1px solid var(--line);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.home,
.small-link {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  color: var(--ink);
  text-decoration: none;
}

.home {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
}

.small-link {
  font-weight: 600;
  font-size: 0.9375rem;
}

.home:hover,
.small-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.intro {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-block: clamp(32px, 6vw, 64px) 24px;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  font-size: clamp(2.25rem, 5.6vw, 3.75rem);
  line-height: 1.04;
}

.lead {
  max-width: 34em;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--muted);
}

/* The input */
.tool {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool label {
  font-weight: 600;
}

textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid var(--muted);
  border-radius: 12px;
  background: var(--ground);
  color: var(--ink);
  font: inherit;
  font-size: 1.125rem;
  resize: vertical;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.btn {
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-deep);
}

.btn:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: progress;
}

.status {
  color: var(--muted);
  font-size: 0.9375rem;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.examples p {
  width: 100%;
}

.chip {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ground);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--primary);
  background: var(--tint);
}

/* One block per sentence, between thin rules */
.results {
  margin-top: 32px;
  border-top: 1px solid var(--line);
}

.results:empty {
  border-top: 0;
}

.sentence {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}

.tp {
  color: var(--muted);
  font-size: 0.9375rem;
}

.english {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  line-height: 1.3;
}

.verdict {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.verdict.good {
  background: var(--tint);
  color: var(--primary-deep);
}

.verdict.warn {
  background: var(--warn-tint);
  color: var(--warn);
}

.verdict.bad {
  background: var(--bad-tint);
  color: var(--accent-deep);
}

.notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.severity {
  font-weight: 700;
}

.note.error .severity {
  color: var(--accent-deep);
}

.note.warning .severity {
  color: var(--warn);
}

.note.info .severity {
  color: var(--muted);
}

/* How it parses, collapsed */
.parse summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
}

.tree,
.tree ul {
  padding-left: 0;
  list-style: none;
}

.tree ul {
  margin-left: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.node {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  padding-block: 3px;
  font-size: 0.9375rem;
}

.kind {
  font-weight: 600;
}

.role {
  color: var(--muted);
  font-size: 0.8125rem;
}

.role::before {
  content: '(';
}

.role::after {
  content: ')';
}

.words {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--primary-deep);
}

.about {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-block: 56px;
}

.about h2 {
  font-size: 1.75rem;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 1.3em;
}

.steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

.foot {
  border-top: 1px solid var(--line);
  padding-block: 24px 32px;
  color: var(--muted);
  font-size: 0.875rem;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

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