:root {
  --bg: #f8f7f2;
  --surface: #ffffff;
  --ink: #191a1d;
  --muted: #555c66;
  --line: #d7d2c5;
  --signal: #f49b14;
  --signal-strong: #b45309;
  --graphite: #202329;
  --track: #2f333b;
  --good: #146c43;
  --bad: #b42318;
  --focus: #006dcb;
  --shadow: 0 18px 48px rgba(25, 26, 29, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111316;
    --surface: #1c2026;
    --ink: #f4f4ef;
    --muted: #bac0c8;
    --line: #3a4049;
    --signal: #ffb000;
    --signal-strong: #ffd166;
    --graphite: #0d0f12;
    --track: #252b33;
    --good: #57d68d;
    --bad: #ff8a80;
    --focus: #7cc4ff;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(244, 155, 20, 0.13) 0 12px, transparent 12px 28px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.07;
  background-image:
    linear-gradient(45deg, var(--ink) 25%, transparent 25%),
    linear-gradient(-45deg, var(--ink) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--ink) 75%),
    linear-gradient(-45deg, transparent 75%, var(--ink) 75%);
  background-position: 0 0, 0 16px, 16px -16px, -16px 0;
  background-size: 32px 32px;
  pointer-events: none;
}

a {
  color: var(--signal-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

img {
  max-width: 100%;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  background: var(--ink);
  color: var(--bg);
  padding: 0.65rem 0.9rem;
}

.skip-link:focus {
  top: 1rem;
}

.site-header,
.site-footer,
main {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.site-header nav,
.site-footer nav,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.site-header nav a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding: clamp(2rem, 8vw, 5rem) 0 2rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--signal-strong);
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.6rem, 11vw, 6.8rem);
}

h2 {
  font-size: clamp(1.6rem, 5vw, 3rem);
}

h3 {
  font-size: 1.2rem;
}

.lede,
.summary {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(1.08rem, 2.5vw, 1.35rem);
}

.pit-board {
  align-self: end;
  width: min(100%, 390px);
  background: var(--graphite);
  color: #fff7e3;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1rem 1rem 3.25rem;
  min-height: 190px;
  text-decoration: none;
  display: grid;
  align-content: space-between;
  position: relative;
  overflow: hidden;
}

.pit-board::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34px;
  background: repeating-linear-gradient(90deg, #fff 0 22px, #111 22px 44px);
  opacity: 0.88;
}

.pit-board span,
.pit-board small {
  color: #ffd166;
  font-weight: 800;
  text-transform: uppercase;
}

.pit-board strong {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(2.3rem, 11vw, 4.8rem);
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.planner-shell,
.results,
.review,
.math-note,
.article,
.simple-page {
  padding: clamp(1.25rem, 4vw, 2.5rem) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: 1rem;
}

.planner-grid {
  display: grid;
  gap: 1rem;
}

.input-panel,
.review-form {
  display: grid;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1rem, 4vw, 1.5rem);
}

label {
  display: grid;
  gap: 0.25rem;
  font-weight: 800;
}

label span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  padding: 0.75rem 0.85rem;
  font: inherit;
}

input[type="number"] {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}

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

.form-error,
.warning,
.form-status,
.copy-status {
  margin: 0.25rem 0 0;
  color: var(--bad);
  font-weight: 750;
}

.form-status,
.copy-status {
  color: var(--good);
}

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

.result-grid div {
  min-width: 0;
  background: var(--graphite);
  color: #fff7e3;
  border-left: 7px solid var(--signal);
  border-radius: 8px;
  padding: 0.9rem;
}

.result-grid span {
  display: block;
  color: #ffd166;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.result-grid strong {
  display: block;
  margin-top: 0.35rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(1.55rem, 8vw, 3.4rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.button {
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.button.primary {
  background: var(--signal);
  color: #161616;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

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

summary {
  cursor: pointer;
  font-weight: 850;
}

.article {
  max-width: 780px;
}

.article p,
.article li,
.simple-page p {
  color: var(--muted);
}

.article section {
  margin-top: 2rem;
}

.link-list {
  display: grid;
  gap: 0.45rem;
  padding-left: 1.1rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding: 1.5rem 0 2rem;
  color: var(--muted);
}

.site-footer p {
  margin-top: 0;
}

.site-footer a {
  color: var(--ink);
  font-weight: 700;
}

.visually-hidden,
.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (min-width: 760px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 390px;
    align-items: end;
  }

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

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

@media (max-width: 540px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .button {
    width: 100%;
  }
}
