:root {
  --bg: #f4f1ea;
  --paper: #fffcf8;
  --ink: #122033;
  --muted: #3e4d62;
  --line: #e3dcd0;
  --green: #176443;
  --green-deep: #0f4a31;
  --gold: #8a6a2e;
  --gold-soft: #f4ead4;
  --header-h: 4.25rem;
  --measure: 68ch;
  --wide: 72rem;
  --shadow: 0 1px 0 rgba(18, 32, 51, 0.04);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--green-deep);
}

a:hover {
  color: var(--green);
}

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 0.9rem;
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
}

.preview-bar {
  background: var(--ink);
  color: #f7f3ea;
  font-size: 0.875rem;
  line-height: 1.45;
  padding: 0.55rem 1.1rem;
  text-align: center;
}

.preview-bar p {
  margin: 0 auto;
  max-width: var(--wide);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #f4f1ea;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.header-inner,
.wrap {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 1 auto;
  min-width: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex: 0 0 auto;
}

.brand:hover {
  color: var(--green-deep);
}

.nav-details > summary {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
}

.nav-details > summary::-webkit-details-marker {
  display: none;
}

.nav-details > summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.55rem;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg) translateY(-0.1rem);
}

.nav-details[open] > summary::after {
  transform: rotate(225deg) translateY(-0.1rem);
}

.nav-list {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0.85rem;
}

.nav-details[open] > .nav-list {
  display: grid;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 0.4rem 1rem 0.9rem;
  box-shadow: 0 10px 24px rgba(18, 32, 51, 0.06);
}

.nav-list a {
  display: block;
  padding: 0.55rem 0.15rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.98rem;
}

.nav-list a:hover {
  color: var(--green-deep);
}

.hero {
  padding: 2.4rem 0 1.2rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.22;
  color: var(--ink);
}

h1 {
  margin: 0 0 0.9rem;
  max-width: 16ch;
  font-size: clamp(2.15rem, 6vw, 3.5rem);
}

.deck {
  max-width: 42rem;
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.btn-primary {
  background: var(--green);
  color: #fff;
}

.btn-primary:hover {
  background: var(--green-deep);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px #cfc6b6;
}

.btn-secondary:hover {
  color: var(--green-deep);
  box-shadow: inset 0 0 0 1.5px var(--green);
}

main section,
.toc {
  scroll-margin-top: calc(var(--header-h) + 0.9rem);
}

.panel,
.toc,
.concept,
.condition,
.misconception,
.guide-block,
.slot,
.faq,
.editorial {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.panel {
  padding: 1.15rem 1.15rem 0.3rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--green);
}

.section {
  padding: 1.35rem 0;
}

.section h2 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
}

.section h2::before {
  content: "";
  display: block;
  width: 2.4rem;
  height: 2px;
  margin-bottom: 0.65rem;
  background: var(--gold);
}

.prose,
.panel p,
.concept p,
.misconception p,
.faq p,
.editorial p,
.slot p {
  max-width: var(--measure);
}

.prose > * + *,
.panel > * + *,
.stack > * + * {
  margin-top: 0.85rem;
}

p {
  margin: 0 0 0.85rem;
}

.toc {
  padding: 1rem 1.15rem 1.1rem;
  margin: 0.4rem 0 0.6rem;
}

.toc ol {
  margin: 0.2rem 0 0;
  padding-left: 1.2rem;
}

.toc li + li {
  margin-top: 0.35rem;
}

.toc a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.concept-grid,
.misconception-list,
.condition-list {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.concept,
.misconception,
.condition {
  padding: 1rem 1.05rem 0.35rem;
}

.concept {
  border-top: 3px solid var(--gold);
}

.concept h3,
.misconception h3,
.condition h3,
.guide-block h3 {
  margin: 0 0 0.45rem;
  font-size: 1.22rem;
}

.note {
  max-width: var(--measure);
  padding: 0.85rem 1rem;
  background: var(--gold-soft);
  border-radius: 0.8rem;
}

.table-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.4rem 0.85rem 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

caption {
  text-align: left;
  font-weight: 700;
  padding: 0.75rem 0.2rem 0.55rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.55rem;
  border-top: 1px solid var(--line);
}

thead th {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  border-top: 0;
}

tbody th {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

.slot,
.faq,
.editorial,
.guide-block {
  padding: 1rem 1.05rem 0.4rem;
}

.slot {
  border-style: dashed;
  background: #fbfaf6;
}

.slot-label {
  margin: 0 0 0.4rem;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.guide-list {
  display: grid;
  gap: 0.8rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.faq-list {
  display: grid;
  gap: 0.65rem;
}

.faq {
  padding: 0;
  overflow: hidden;
}

.faq summary {
  cursor: pointer;
  padding: 0.95rem 1.05rem;
  font-weight: 700;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.6rem;
  border-right: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(-45deg) translateY(-0.1rem);
}

.faq[open] summary::before {
  transform: rotate(45deg) translateY(-0.12rem);
}

.faq p {
  margin: 0;
  padding: 0 1.05rem 1rem 2rem;
}

.editorial {
  border-left: 4px solid var(--gold);
}

.updated {
  margin: 0 0 0.8rem;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.figure {
  margin: 1.1rem 0 1.3rem;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
}

.figure figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.split {
  display: grid;
  gap: 0.8rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  color: #f3ead4;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.site-footer .brand {
  color: #f4f1ea;
  margin-bottom: 1rem;
}

.site-footer .brand:hover {
  color: #f3ead4;
}

.site-footer {
  margin-top: 1.5rem;
  background: var(--ink);
  color: #e7e1d6;
  padding: 1.8rem 0 2rem;
}

.site-footer p {
  max-width: var(--measure);
}

.age {
  color: #f3ead4;
  font-weight: 700;
}

@media (max-width: 719px) {
  .table-wrap {
    padding: 0.85rem;
  }

  .check-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .check-table,
  .check-table tbody,
  .check-table tr,
  .check-table th,
  .check-table td,
  .check-table caption {
    display: block;
    width: 100%;
  }

  .check-table tr {
    padding: 0.35rem 0 0.7rem;
    border-top: 1px solid var(--line);
  }

  .check-table tbody th,
  .check-table td {
    border-top: 0;
    padding: 0.35rem 0;
  }

  .check-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.12rem;
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}

@media (min-width: 720px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .check-table {
    table-layout: fixed;
  }

  .check-table.cols-3 th:nth-child(1) {
    width: 24%;
  }

  .check-table.cols-3 th:nth-child(2),
  .check-table.cols-3 th:nth-child(3) {
    width: 38%;
  }

  .concept-grid {
    grid-template-columns: 1fr 1fr;
  }

  .toc ol {
    columns: 2;
    column-gap: 2rem;
  }

  .toc li {
    break-inside: avoid;
  }
}

@media (min-width: 880px) {
  .nav-details {
    display: flex;
    align-items: center;
  }

  .nav-details::details-content {
    content-visibility: visible;
    height: auto;
  }

  .nav-details > summary {
    display: none;
  }

  .nav-list,
  .nav-details[open] > .nav-list {
    display: flex;
    position: static;
    width: max-content;
    align-items: center;
    gap: 0.2rem 1.15rem;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .nav-list a {
    padding: 0.35rem 0;
  }

  .hero {
    padding: 3.4rem 0 1.6rem;
  }

  .panel {
    padding: 1.4rem 1.5rem 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
