:root {
  --bg: #f7f5f0;
  --panel: #ffffff;
  --ink: #151716;
  --muted: #5d6661;
  --line: #d9ded6;
  --green: #1f6f5b;
  --red: #d9503f;
  --blue: #316d8c;
  --gold: #bc8316;
  --dark: #20211f;
  --shadow: 0 18px 48px rgba(21, 23, 22, 0.12);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.62;
}

a {
  color: inherit;
}

.hero {
  min-height: 86vh;
  padding: 18px 18px 54px;
  background:
    linear-gradient(115deg, rgba(21, 23, 22, 0.96), rgba(21, 23, 22, 0.82)),
    url("/assets/field-guide-thumbnail.jpg") center / cover;
  color: #fff;
}

.nav {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.hero-grid {
  width: min(1180px, 100%);
  min-height: calc(86vh - 72px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.75fr);
  gap: 44px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
a,
summary,
pre,
textarea,
button {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 830px;
  margin: 0;
  font-size: 4.2rem;
  line-height: 0.98;
  letter-spacing: 0;
}

.lede {
  max-width: 740px;
  margin: 22px 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.18rem;
}

.source-note {
  max-width: 720px;
  border-left: 4px solid var(--gold);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 8px;
}

.hero-card {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: var(--shadow);
}

.hero-card img {
  display: block;
  width: 100%;
}

.hero-card figcaption {
  padding: 14px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
}

.band {
  padding: 72px 18px;
}

.band:nth-of-type(even) {
  background: #eef4ef;
}

.compact {
  padding-top: 54px;
}

.section-head,
.chapter,
.map-grid,
.glossary,
.workbook,
.quiz {
  width: min(1180px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.section-head {
  margin-bottom: 30px;
}

.section-head h2,
.chapter-body h2 {
  max-width: 900px;
  margin: 0;
  font-size: 2.45rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.section-head p:not(.eyebrow),
.chapter-body > p {
  max-width: 860px;
  color: var(--muted);
  font-size: 1.05rem;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.map-grid a {
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  text-decoration: none;
  font-weight: 950;
  box-shadow: 0 8px 22px rgba(21, 23, 22, 0.05);
}

.map-grid span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}

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

.glossary article,
.explain-card,
.split article,
.timeline div,
.principle,
.matrix article,
.methods article,
.quote-grid article,
.workbook > div,
.quiz-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(21, 23, 22, 0.05);
}

.glossary h3,
.split h3,
.matrix h3,
.methods h3,
.quote-grid h3,
.workbook h3,
.quiz-card h3 {
  margin: 0 0 8px;
  line-height: 1.16;
}

.glossary p,
.split p,
.matrix p,
.methods p,
.quote-grid p,
.workbook p {
  margin: 0;
  color: var(--muted);
}

.chapter {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 34px;
}

.chapter-label {
  position: sticky;
  top: 16px;
  align-self: start;
  border-radius: 8px;
  padding: 14px;
  background: var(--dark);
  color: #fff;
  font-weight: 950;
  text-align: center;
}

.chapter-body {
  display: grid;
  gap: 22px;
}

.explain-card {
  border-left: 5px solid var(--red);
}

.explain-card h3,
.principle h3 {
  margin-top: 0;
}

.split,
.quote-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quote-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.timeline strong {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
}

.principle {
  border-left: 5px solid var(--green);
  background: #fbfdfb;
}

.matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.use {
  margin-top: 12px !important;
  color: var(--ink) !important;
  font-weight: 750;
}

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

pre {
  margin: 16px 0 0;
  white-space: pre-wrap;
  border-radius: 8px;
  padding: 14px;
  background: #f4f6f3;
  color: #202220;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

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

textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
}

.quiz {
  display: grid;
  gap: 14px;
}

.answers {
  display: grid;
  gap: 10px;
}

.answer {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9faf8;
  color: var(--ink);
  text-align: left;
  font-weight: 750;
  cursor: pointer;
}

.answer.correct {
  border-color: var(--green);
  background: #e6f2ec;
}

.answer.wrong {
  border-color: var(--red);
  background: #fff0ed;
}

.explain {
  margin-bottom: 0;
  color: var(--muted);
}

.score {
  position: sticky;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  padding: 14px;
  background: var(--dark);
  color: #fff;
  box-shadow: var(--shadow);
}

button.reset {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 18px;
  background: var(--dark);
  color: rgba(255, 255, 255, 0.78);
}

.footer a {
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 960px) {
  h1 {
    font-size: 3rem;
  }

  .hero-grid,
  .chapter,
  .glossary,
  .methods,
  .quote-grid,
  .workbook,
  .split {
    grid-template-columns: 1fr;
  }

  .chapter-label {
    position: static;
    text-align: left;
  }

  .map-grid,
  .timeline,
  .matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .hero {
    padding: 14px 14px 42px;
  }

  .nav {
    justify-content: flex-start;
  }

  h1 {
    font-size: 2.35rem;
  }

  .section-head h2,
  .chapter-body h2 {
    font-size: 1.85rem;
  }

  .map-grid,
  .timeline,
  .matrix {
    grid-template-columns: 1fr;
  }

  .band {
    padding: 52px 14px;
  }

  .score {
    align-items: stretch;
    flex-direction: column;
  }
}
