:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --paper-raised: #fbfaf6;
  --paper-deep: #e8e4da;
  --ink: #17231f;
  --muted: #59665f;
  --line: #cfd5cc;
  --line-strong: #9eaaa2;
  --coral: #a94732;
  --coral-soft: #f2d8cd;
  --blue: #426e7e;
  --blue-soft: #dce9ec;
  --green: #2e7763;
  --green-soft: #d9e8df;
  --gold: #9a6c18;
  --gold-soft: #eee3c8;
  --red: #a94a3d;
  --red-soft: #f0d9d5;
  --shadow: 0 18px 50px rgb(25 38 33 / 10%);
  --radius: 18px;
  --radius-small: 10px;
  --guide-content: min(1180px, calc(100vw - 48px));
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgb(215 95 67 / 8%), transparent 26rem),
    var(--paper);
  font-size: 16px;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.035em;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(3.2rem, 7vw, 6.8rem);
  line-height: 0.93;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(2.1rem, 4vw, 3.7rem);
  line-height: 1.02;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.12rem;
  line-height: 1.25;
}

::selection {
  color: var(--ink);
  background: var(--coral-soft);
}

:focus-visible {
  outline: 3px solid rgb(66 110 126 / 45%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  width: var(--guide-content);
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper-raised);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgb(255 255 255 / 48%);
  color: var(--ink);
}

.hero,
.guide-section,
.page-intro,
.anatomy-workbench,
.explorer-main,
.site-footer {
  width: var(--guide-content);
  margin-inline: auto;
}

.hero {
  display: grid;
  min-height: 650px;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  align-items: center;
  gap: clamp(40px, 8vw, 110px);
  padding-block: 80px;
}

.hero-copy {
  max-width: 790px;
}

.hero-overview h1 {
  font-size: clamp(3rem, 5.7vw, 5.5rem);
  line-height: 0.98;
}

.eyebrow {
  margin-bottom: 16px;
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgb(215 95 67 / 12%);
  vertical-align: 1px;
}

.lede {
  max-width: 750px;
  margin-bottom: 30px;
  color: #46524c;
  font-size: clamp(1.16rem, 2vw, 1.4rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 750;
  text-decoration: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--ink);
  box-shadow: 0 8px 24px rgb(23 35 31 / 15%);
  color: white;
}

.button-primary:hover {
  box-shadow: 0 12px 28px rgb(23 35 31 / 20%);
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgb(255 255 255 / 38%);
}

.button-secondary:hover {
  background: var(--paper-raised);
}

.button-small {
  min-height: 38px;
  padding: 8px 13px;
  font-size: 0.78rem;
}

.caveat {
  color: var(--muted);
  font-size: 0.84rem;
}

.hero-aside {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(251 250 246 / 64%);
  box-shadow: var(--shadow);
}

.aside-label {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.metric {
  min-height: 110px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric:nth-child(even) {
  border-right: 0;
}

.metric:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.metric strong {
  display: block;
  margin-bottom: 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.guide-section {
  padding-block: 100px;
}

.section-rule {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-tinted {
  position: relative;
  background: rgb(232 228 218 / 63%);
  box-shadow: 0 0 0 100vmax rgb(232 228 218 / 63%);
  clip-path: inset(0 -100vmax);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 48px;
}

.section-heading > p:last-child {
  color: var(--muted);
}

.compact-heading {
  max-width: 820px;
}

.system-section {
  display: grid;
  gap: 46px;
}

.system-section .section-heading {
  margin-bottom: 0;
}

.system-flow {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
}

.system-flow li {
  min-height: 260px;
  padding: 24px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.system-flow li:last-child {
  border-right: 0;
}

.system-flow li > span {
  display: block;
  margin-bottom: 58px;
  color: var(--coral);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.system-flow h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.system-flow p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.system-terms {
  display: grid;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgb(251 250 246 / 58%);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.system-terms div {
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.system-terms div:last-child {
  border-right: 0;
}

.system-terms dt {
  margin-bottom: 4px;
  font-size: 0.75rem;
  font-weight: 800;
}

.system-terms dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.plan-equation {
  margin: 0 0 32px;
  padding: 18px 20px;
  border-left: 3px solid var(--coral);
  background: var(--coral-soft);
  font: 0.9rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.plan-part-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
}

.plan-part-card {
  min-height: 280px;
  padding: 32px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.plan-part-card:nth-child(even) {
  border-right: 0;
}

.plan-part-card p {
  max-width: 680px;
  color: var(--muted);
}

.generation-boundary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.generation-boundary article {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

.generation-boundary article:last-child {
  background: var(--blue-soft);
}

.generation-boundary h3 {
  margin-bottom: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.generation-boundary ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.generation-boundary li + li {
  margin-top: 10px;
}

.section-heading-row {
  display: flex;
  max-width: none;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.section-heading-row > div {
  max-width: 720px;
}

.text-link {
  flex: none;
  margin-bottom: 18px;
  font-size: 0.84rem;
  font-weight: 750;
  text-underline-offset: 5px;
}

.text-link span {
  margin-left: 5px;
  color: var(--coral);
}

.plan-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.plan-card {
  display: flex;
  min-height: 450px;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  box-shadow: 0 8px 26px rgb(23 35 31 / 5%);
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.plan-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.plan-card-role {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 60px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-card-role span:last-child {
  color: var(--coral);
  font-size: 1.1rem;
}

.plan-card h3 {
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.1rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.plan-card-description {
  color: var(--muted);
  font-size: 0.9rem;
}

.plan-card-stats {
  display: grid;
  margin: auto 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
}

.plan-card-stats li {
  padding-right: 8px;
}

.plan-card-stats strong,
.plan-card-stats span {
  display: block;
}

.plan-card-stats strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 500;
}

.plan-card-stats span {
  color: var(--muted);
  font-size: 0.65rem;
}

.questions-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(50px, 10vw, 140px);
}

.question-intro p:last-child {
  color: var(--muted);
}

.question-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  list-style: none;
}

.question-list li {
  display: grid;
  min-height: 92px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 42px 1fr;
  font-size: 0.95rem;
  font-weight: 650;
}

.question-list span {
  align-self: start;
  padding-top: 4px;
  color: var(--coral);
  font-size: 0.68rem;
  font-weight: 850;
}

.site-footer {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer p {
  margin: 0;
}

.site-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer a {
  text-underline-offset: 4px;
}

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

.editor-error {
  color: var(--red);
}

.code-panel {
  max-height: 390px;
  margin: 0 0 30px;
  padding: 20px;
  border-radius: 12px;
  background: #18221e;
  color: #dbe7df;
  font: 0.78rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: auto;
  tab-size: 2;
}

.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
