:root {
  color-scheme: light;
  --ink: #172322;
  --muted: #53625f;
  --navy: #12303a;
  --teal: #2f6f6a;
  --sage: #dce8dd;
  --sage-strong: #93b5a1;
  --stone: #f6f0e6;
  --paper: #fffdf7;
  --sand: #ead8c3;
  --rust: #b25f3f;
  --copper: #c1784f;
  --line: #d8d0c4;
  --shadow: 0 18px 45px rgba(18, 48, 58, 0.12);
  --max: 1160px;
  --narrow: 760px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
figure {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

figure {
  margin: 0;
}

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

a:hover {
  color: var(--rust);
}

p,
ul,
ol {
  margin-top: 0;
  overflow-wrap: break-word;
}

p:last-child,
ul:last-child,
ol:last-child {
  margin-bottom: 0;
}

h1,
h2,
h3 {
  color: var(--navy);
  line-height: 1.08;
  margin: 0 0 0.7em;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h1 {
  font-size: clamp(2.35rem, 6vw, 5.9rem);
  max-width: 13ch;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
}

strong {
  color: var(--navy);
}

.container {
  width: min(var(--max), calc(100% - 40px));
  max-width: calc(100% - 28px);
  margin-inline: auto;
}

.narrow {
  width: min(var(--narrow), calc(100% - 40px));
  max-width: calc(100% - 28px);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--navy);
  padding: 0.7rem 1rem;
  border: 2px solid var(--teal);
  border-radius: 6px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 247, 0.95);
  border-bottom: 1px solid rgba(216, 208, 196, 0.9);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 220px;
  flex-shrink: 1;
  color: var(--navy);
  text-decoration: none;
}

.brand > span:last-child {
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--paper);
  background: var(--navy);
  border-radius: 8px;
  font-weight: 800;
}

.brand-name,
.brand-tagline {
  display: block;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-tagline {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

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

.nav-toggle {
  display: none;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.72rem;
  border-radius: 6px;
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  background: var(--sage);
}

.hero {
  position: relative;
  min-height: calc(100svh - 76px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--navy);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(18, 48, 58, 0.9) 0%, rgba(18, 48, 58, 0.72) 42%, rgba(18, 48, 58, 0.12) 100%),
    linear-gradient(0deg, rgba(18, 48, 58, 0.88) 0%, rgba(18, 48, 58, 0.02) 45%);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: clamp(4rem, 11vh, 8rem) 0 clamp(2.5rem, 7vh, 5rem);
  color: var(--paper);
}

.hero h1,
.hero .lead {
  color: var(--paper);
}

.hero .lead {
  max-width: 690px;
  font-size: clamp(1.18rem, 2vw, 1.55rem);
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.78rem 1rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--paper);
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
}

.button:hover {
  background: var(--sage);
  color: var(--navy);
}

.button-secondary {
  background: rgba(255, 253, 247, 0.12);
  color: var(--paper);
  border-color: rgba(255, 253, 247, 0.46);
}

.button-secondary:hover {
  background: rgba(255, 253, 247, 0.2);
  color: var(--paper);
}

.button-muted {
  background: var(--sage);
  border-color: var(--line);
}

.button-muted:hover {
  background: var(--sand);
}

.section {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}

.section-tight {
  padding: clamp(2rem, 5vw, 4rem) 0;
}

.section-paper {
  background: var(--paper);
}

.section-sage {
  background: #eef4ee;
}

.section-sand {
  background: #f0e4d5;
}

.eyebrow {
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 0.85rem;
  text-transform: uppercase;
}

.lead {
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.28rem);
}

.intro-grid,
.page-hero-grid,
.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.intro-grid > *,
.page-hero-grid > *,
.two-column > *,
.content-flow {
  min-width: 0;
}

.intro-copy > * + *,
.content-flow > * + * {
  margin-top: 1.1rem;
}

.content-flow ul,
.content-flow ol {
  padding-left: 1.35rem;
}

.content-flow li + li {
  margin-top: 0.55rem;
}

.content-flow a:not(.button) {
  font-weight: 700;
}

.image-frame {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: var(--sand);
  max-width: 100%;
}

.image-frame img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.image-frame-square img {
  aspect-ratio: 1;
}

.notice {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.98rem;
}

.notice-medical {
  border-left-color: var(--rust);
}

.callout {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.callout-question {
  border-top: 6px solid var(--teal);
}

.callout-reality {
  border-top: 6px solid var(--rust);
}

.callout h2,
.callout h3 {
  margin-bottom: 0.55rem;
}

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

.chapter-card,
.info-card {
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}

.chapter-card a {
  display: grid;
  min-height: 100%;
  color: inherit;
  text-decoration: none;
}

.chapter-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.chapter-card-content,
.info-card {
  padding: 1.15rem;
}

.chapter-card h3,
.info-card h3 {
  margin-bottom: 0.45rem;
}

.chapter-card p,
.info-card p {
  color: var(--muted);
  font-size: 0.98rem;
}

.split-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.toc {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.toc-title {
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 0.55rem;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.toc li + li {
  margin-top: 0.32rem;
}

.checklist {
  list-style: none;
  padding: 0;
}

.checklist li {
  position: relative;
  padding-left: 2rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.46em;
  width: 1rem;
  height: 1rem;
  border-radius: 4px;
  background: var(--sage);
  border: 2px solid var(--teal);
}

.timeline {
  display: grid;
  gap: 1rem;
  border-left: 3px solid var(--sage-strong);
  padding-left: 1.2rem;
}

.timeline-item {
  position: relative;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1.2rem - 8px);
  top: 1.4rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--rust);
  border: 3px solid var(--stone);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
  font-size: 0.98rem;
}

.comparison-table th,
.comparison-table td {
  padding: 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.comparison-table th {
  background: var(--navy);
  color: var(--paper);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.comparison-table tr:last-child td {
  border-bottom: 0;
}

.worksheet {
  display: grid;
  gap: 1rem;
}

.worksheet-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.worksheet-lines {
  min-height: 94px;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 30px, rgba(83, 98, 95, 0.35) 31px);
}

.print-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

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

.cluster-list ul {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.breadcrumbs {
  padding-top: 1.2rem;
  font-size: 0.9rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.4rem;
  color: var(--muted);
}

.page-hero {
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.page-hero h1 {
  max-width: 14ch;
}

.page-hero .lead {
  max-width: 720px;
}

.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 1rem 1.1rem;
}

.faq-list summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 800;
}

.faq-list p {
  margin-top: 0.75rem;
  color: var(--muted);
}

.chapter-nav {
  width: min(var(--max), calc(100% - 40px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.chapter-nav-link {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--navy);
  text-decoration: none;
}

.chapter-nav-link-next {
  text-align: right;
}

.chapter-nav-link span {
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.site-footer {
  background: var(--navy);
  color: rgba(255, 253, 247, 0.82);
  padding: 2.5rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: start;
}

.footer-kicker {
  color: var(--paper);
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.footer-updated {
  margin-top: 0.85rem;
  color: rgba(255, 253, 247, 0.68);
  font-size: 0.9rem;
}

.site-footer nav {
  display: grid;
  gap: 0.45rem;
}

.site-footer a {
  color: var(--paper);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--copper);
  outline-offset: 3px;
}

@media (max-width: 960px) {
  body {
    font-size: 17px;
  }

  .intro-grid,
  .page-hero-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

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

  .nav-toggle {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--paper);
  }

  .nav-toggle span[aria-hidden="true"],
  .nav-toggle span[aria-hidden="true"]::before,
  .nav-toggle span[aria-hidden="true"]::after {
    width: 20px;
    height: 2px;
    display: block;
    background: var(--navy);
  }

  .nav-toggle span[aria-hidden="true"] {
    position: relative;
  }

  .nav-toggle span[aria-hidden="true"]::before,
  .nav-toggle span[aria-hidden="true"]::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .nav-toggle span[aria-hidden="true"]::before {
    top: -6px;
  }

  .nav-toggle span[aria-hidden="true"]::after {
    top: 6px;
  }

  .nav-list {
    position: absolute;
    left: 20px;
    right: 20px;
    top: 72px;
    display: none;
    grid-template-columns: 1fr;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  .nav-list[data-open] {
    display: grid;
  }

  .nav-list a {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .container,
  .narrow,
  .chapter-nav {
    width: min(100% - 28px, var(--max));
  }

  .brand {
    min-width: 0;
  }

  .brand-name {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.88rem;
  }

  .brand-tagline {
    display: none;
  }

  .hero {
    min-height: calc(92svh - 76px);
  }

  .hero::after {
    background:
      linear-gradient(0deg, rgba(18, 48, 58, 0.92) 0%, rgba(18, 48, 58, 0.7) 60%, rgba(18, 48, 58, 0.34) 100%);
  }

  .hero-content {
    padding-bottom: 2rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .button {
    width: 100%;
  }

  .chapter-grid,
  .card-grid,
  .cluster-list,
  .split-list,
  .chapter-nav,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .chapter-nav-link-next {
    text-align: left;
  }

  .worksheet-row {
    grid-template-columns: 1fr;
  }

  .comparison-table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 380px) {
  .brand-name {
    max-width: 178px;
  }
}

@media print {
  .site-header,
  .site-footer,
  .breadcrumbs,
  .chapter-nav,
  .print-actions,
  .nav-toggle,
  .toc {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
    font-size: 12pt;
  }

  .section,
  .page-hero {
    padding: 1rem 0;
  }

  .container,
  .narrow {
    width: 100%;
  }

  .callout,
  .notice,
  .info-card,
  .worksheet-row {
    break-inside: avoid;
    box-shadow: none;
  }

  a {
    color: #111;
    text-decoration: none;
  }
}
