:root {
  color-scheme: light;
  --ink: #18201d;
  --muted: #66706b;
  --line: #d9dfdb;
  --paper: #fbfcf8;
  --panel: #ffffff;
  --green: #167f5f;
  --gold: #b98210;
  --red: #b73b33;
  --blue: #256a8a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
a { color: inherit; }
button, input, select { font: inherit; }
button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  border-radius: 8px;
  padding: .75rem 1rem;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }

.hero {
  min-height: 72vh;
  padding: 1.25rem clamp(1rem, 4vw, 4rem) 4rem;
  color: white;
  background:
    linear-gradient(90deg, rgba(16, 25, 22, .88), rgba(16, 25, 22, .5)),
    url("assets/hero.webp") center/cover;
}
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
}
nav div { display: flex; flex-wrap: wrap; gap: 1rem; }
nav a { text-decoration: none; opacity: .9; }
.hero section {
  max-width: 760px;
  margin: clamp(4rem, 13vh, 8rem) auto 0;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  font-size: .78rem;
}
h1 {
  margin: 0;
  font-size: clamp(3rem, 9vw, 6.8rem);
  line-height: .92;
  letter-spacing: 0;
}
h2, h3 { letter-spacing: 0; }
.hero p:last-child {
  max-width: 620px;
  font-size: 1.25rem;
  line-height: 1.5;
}

.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}
.calculator {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, .9fr);
  gap: 1rem;
  margin-top: -3rem;
  align-items: start;
}
.panel, .verdict, .table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 14px 45px rgba(30, 42, 36, .08);
}
.grid, .mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
label {
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-weight: 650;
  font-size: .9rem;
}
label span {
  display: flex;
  align-items: center;
  gap: .4rem;
}
input, select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem .75rem;
  color: var(--ink);
  background: #fff;
}
small { color: var(--muted); }
.start-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.check {
  display: flex;
  align-items: center;
  margin: 1rem 0;
}
.check input { width: auto; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.actions button:last-child, .chips button {
  color: var(--ink);
  background: white;
}
.results {
  display: grid;
  gap: 1rem;
}
.verdict {
  border-top: 8px solid var(--green);
}
.verdict.warn { border-top-color: var(--gold); }
.verdict.bad { border-top-color: var(--red); }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e6f4ef;
  color: var(--green);
  padding: .3rem .65rem;
  font-weight: 800;
}
.verdict.bad .badge { background: #f9e8e6; color: var(--red); }
.verdict.warn .badge { background: #fbf0d8; color: var(--gold); }
.big {
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
  margin: .75rem 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .85rem;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}
.metric strong { font-size: 1.25rem; }
.ad {
  min-height: 92px;
  border: 1px dashed #a7b0ab;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f3f6f1;
}
.table-wrap, details.panel, .share { margin-top: 1rem; }
.table-wrap { overflow-x: auto; padding-right: 1.5rem; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th, td {
  padding: .7rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
th:last-child, td:last-child { padding-right: 1.25rem; }
th:first-child, td:first-child { text-align: left; }
summary {
  cursor: pointer;
  font-size: 1.35rem;
  font-weight: 800;
}
.advanced {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.advanced section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
}
.wide { grid-column: span 2; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.chips button { padding: .55rem .7rem; }
.share {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 1rem;
  align-items: center;
}
canvas {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.education {
  margin-top: 3rem;
  padding: 3rem 0;
  background: #eef3ef;
}
.education .shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.education h2, .education blockquote { grid-column: 1 / -1; }
.education article {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}
blockquote {
  margin: 0;
  padding: 1rem;
  border-left: 6px solid var(--blue);
  background: white;
  font-size: 1.2rem;
}
footer {
  padding: 2rem 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  .calculator, .share, .education .shell { grid-template-columns: 1fr; }
  .advanced { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .metrics, .grid, .mini-grid { grid-template-columns: 1fr; }
  nav { align-items: flex-start; flex-direction: column; }
}
