:root {
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-2: #eef3f4;
  --ink: #17212b;
  --muted: #5b6975;
  --line: #cfdae0;
  --teal: #0f766e;
  --teal-dark: #0b504b;
  --amber: #c47a00;
  --rose: #b83259;
  --blue: #22577a;
  --shadow: 0 18px 45px rgba(22, 36, 50, .09);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; }
.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  background: var(--ink);
  color: white;
  padding: 10px 12px;
  z-index: 10;
}
.skip-link:focus { top: 12px; }
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
}
.nav {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand, .nav-links { display: flex; align-items: center; gap: 12px; }
.brand { text-decoration: none; font-weight: 800; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-size: .85rem;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: .93rem;
}
.nav-links a:hover { color: var(--teal-dark); }
.hero-home, .page-hero, .content-shell, .tool-layout {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}
.hero-home {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .75fr);
  gap: 28px;
  align-items: center;
  padding: 26px 0 20px;
}
.hero-copy h1, .page-hero h1 {
  font-size: clamp(2.35rem, 5.4vw, 4.9rem);
  line-height: .96;
  margin: 0 0 18px;
  max-width: 900px;
  letter-spacing: 0;
}
.lead {
  color: var(--muted);
  line-height: 1.65;
  font-size: 1.08rem;
  max-width: 760px;
}
.eyebrow {
  color: var(--teal-dark);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .75rem;
  font-weight: 800;
  margin: 0 0 10px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.proof-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.proof-points span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-weight: 800;
  font-size: .84rem;
  padding: 8px 10px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 800;
}
.button.primary { background: var(--teal); color: white; border-color: var(--teal); }
.button.secondary { background: white; color: var(--ink); }
.hero-tool, .tool-card, .tool-panel, .result-panel, .learning-path, .cluster-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.hero-tool { padding: 22px; }
.hero-tool h2 { margin: 0 0 12px; }
.mini-output {
  display: grid;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 16px;
}
.mini-output strong { color: var(--rose); font-size: 1.2rem; }
.mini-plane svg, .visual-panel svg { width: 100%; height: auto; display: block; }
.mini-plane svg { max-height: 300px; }
.section-band { padding: 24px 0 46px; }
.section-heading { width: min(1180px, calc(100% - 28px)); margin: 0 auto 18px; }
.section-heading h2, .content-shell h2, .tool-panel h2, .result-panel h2 { margin: 0 0 10px; }
.section-heading p { color: var(--muted); line-height: 1.55; max-width: 760px; }
.tool-grid {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.tool-card { padding: 18px; min-height: 185px; display: flex; flex-direction: column; }
.tool-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.tool-card h3 { margin: 0 0 10px; font-size: 1.15rem; }
.tool-card h3 a { text-decoration: none; }
.tool-card h3 a:hover { color: var(--teal-dark); }
.tool-card p:not(.eyebrow) { color: var(--muted); line-height: 1.55; margin: 0; }
.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.status.live { background: #e8f6f3; color: var(--teal-dark); border-color: #9cd4cc; }
.status.planned { background: #fff6df; color: var(--amber); }
.page-hero { padding: 44px 0 22px; display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; }
.page-hero.compact { display: block; padding-bottom: 16px; }
.page-hero.compact h1 { font-size: clamp(2.1rem, 5vw, 4.6rem); }
.content-shell { padding: 0 0 46px; }
.search-box { display: grid; gap: 8px; color: var(--muted); font-weight: 700; margin-bottom: 14px; }
input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
}
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: white; }
.formula-table { width: 100%; border-collapse: collapse; min-width: 940px; }
.formula-table th, .formula-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.formula-table th { background: var(--surface-2); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
code, pre { font-family: "SFMono-Regular", Consolas, monospace; }
.learning-path { padding: 20px; margin-bottom: 16px; }
.learning-path li { margin: 7px 0; line-height: 1.5; }
.cluster-block { padding: 18px; margin-bottom: 14px; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; }
.cluster-block p:not(.eyebrow) { color: var(--muted); line-height: 1.55; margin: 0; }
.link-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.link-list a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  background: var(--surface-2);
}
.link-list span { color: var(--teal-dark); font-weight: 800; font-size: .82rem; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud span { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 10px; color: var(--muted); }
.tool-layout {
  display: grid;
  grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding-bottom: 46px;
}
.tool-panel, .result-panel { padding: 20px; }
.tool-panel { position: sticky; top: 86px; }
.tool-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tool-form label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; font-size: .9rem; }
.edge-warning {
  margin-top: 16px;
  border-left: 4px solid var(--amber);
  background: #fff8e6;
  padding: 12px;
  color: #674200;
  display: grid;
  gap: 4px;
  line-height: 1.45;
}
.formula-block { background: #edf7f5; border: 1px solid #b4ddd7; border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.formula-block code { white-space: normal; color: var(--teal-dark); font-weight: 800; }
.result-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 14px; }
.result-output {
  display: grid;
  gap: 10px;
}
.metric {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.metric span { display: block; color: var(--muted); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.metric strong { font-size: 1.25rem; color: var(--blue); overflow-wrap: anywhere; }
.matrix-block {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.matrix-block span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.matrix-block pre {
  margin: 0;
  white-space: pre-wrap;
  color: var(--blue);
  font-weight: 800;
}
.worked-output {
  min-height: 170px;
  white-space: pre-wrap;
  overflow: auto;
  margin: 0;
  background: #16212b;
  color: #f5f7f9;
  border-radius: 8px;
  padding: 14px;
  line-height: 1.55;
}
.visual-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.note { color: var(--muted); line-height: 1.6; }
.understanding-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.understanding-grid article, .practice-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}
.understanding-grid p:not(.eyebrow), .practice-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.practice-card {
  margin-top: 12px;
  background: #fff9ed;
  border-color: #efd29b;
}
.related-tools { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.related-tools div { display: flex; flex-wrap: wrap; gap: 8px; }
.related-tools a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--teal-dark);
  font-weight: 800;
}
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 18px 14px;
  text-align: center;
}
.svg-label { font: 700 12px system-ui, sans-serif; fill: var(--ink); }
.svg-muted { fill: var(--muted); }
@media (max-width: 920px) {
  .hero-home, .tool-layout, .cluster-block, .result-grid, .understanding-grid { grid-template-columns: 1fr; }
  .hero-home { min-height: auto; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-panel { position: static; }
  .page-hero { display: block; }
}
@media (max-width: 640px) {
  .nav { align-items: flex-start; flex-direction: column; padding: 12px 0; }
  .nav-links { flex-wrap: wrap; }
  .hero-copy h1, .page-hero h1 { font-size: 2.35rem; }
  .tool-grid, .link-list, .tool-form { grid-template-columns: 1fr; }
  .hero-actions .button { width: 100%; }
}
