:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1412;
  --bg-2: #161c19;
  --paper: #1a221e;
  --ink: #e8eee9;
  --muted: #b7c4bc;
  --faint: #7e8d85;
  --line: #2a3530;
  --rail: #3dba8a;
  --accent: #e85d04;
  --accent-ink: #1a1008;
  --header-bg: #0f1412;
  --header-ink: #e8eee9;
  --search-bg: #161c19;
  --footer-surface: #0a0e0c;
  --font-display: Iowan Old Style, Palatino Linotype, Palatino, "Times New Roman", serif;
  --font: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --touch: 2.75rem;
  --header-h: 4.4rem;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--rail);
  --z-header: 40;
  --wrap: 74rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6f4;
  --bg-2: #e7ece8;
  --paper: #ffffff;
  --ink: #121816;
  --muted: #3a4540;
  --faint: #5c6a63;
  --line: #cfd8d3;
  --rail: #0b6e4f;
  --accent: #c4450a;
  --accent-ink: #fff8f3;
  --header-bg: #f3f6f4;
  --header-ink: #121816;
  --search-bg: #ffffff;
  --footer-surface: #121816;
}

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

html {
  overflow-x: clip;
  background: var(--bg);
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

::selection {
  background: var(--rail);
  color: var(--bg);
}

a {
  color: var(--rail);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

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

:focus {
  outline: none;
}

:focus-visible {
  box-shadow: var(--focus);
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 1.45rem;
  margin: 1.6rem 0 0.5rem;
}

h3 {
  font-size: 1.15rem;
  margin: 1.1rem 0 0.35rem;
}

p,
li {
  margin: 0 0 0.85rem;
}

.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  z-index: 60;
  transform: translateY(-200%);
  background: var(--paper);
  color: var(--ink);
  padding: 0.5rem 0.8rem;
}

.skip:focus {
  transform: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  flex: 0 0 auto;
  padding-top: var(--safe-top);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.header-scroll {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 1.1rem;
  min-height: var(--header-h);
  min-width: max-content;
  width: 100%;
  padding: 0.45rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--header-ink);
  flex: 0 0 auto;
}

.brand:hover {
  color: var(--header-ink);
}

.brand-word {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-mark {
  display: inline-flex;
  color: var(--rail);
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 0.7rem;
  color: var(--header-ink);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.nav-link.is-active {
  border-bottom-color: var(--rail);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--search-bg);
  border: 1px solid var(--line);
}

.header-search input {
  min-height: var(--touch);
  min-width: 12rem;
  border: 0;
  background: transparent;
  color: var(--header-ink);
  padding: 0 0.7rem;
  font: inherit;
}

.header-search button,
.theme-toggle {
  min-width: var(--touch);
  min-height: var(--touch);
  border: 0;
  background: transparent;
  color: var(--header-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html[data-theme="dark"] .theme-icon-dark,
html[data-theme="light"] .theme-icon-light {
  display: none;
}

.hero-media {
  margin: 0;
}

.hero-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.hero-intro {
  padding-top: 1.6rem;
  padding-bottom: 0.4rem;
}

.hero-kicker,
.kicker {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.byline-line {
  color: var(--faint);
  font-size: 0.95rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 0 1rem;
  background: var(--rail);
  color: var(--bg);
  text-decoration: none;
  border: 1px solid var(--rail);
  cursor: pointer;
  font: inherit;
}

.btn:hover {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn--ghost:hover {
  color: var(--ink);
  border-color: var(--rail);
  background: transparent;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 1.1rem;
  margin: 1.2rem 0 2rem;
}

.tl-card {
  background: var(--paper);
  border: 1px solid var(--line);
}

.tl-card-media {
  display: block;
}

.tl-card-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.tl-card-body {
  padding: 0.9rem 1rem 1.1rem;
}

.tl-card-body h2 {
  font-size: 1.2rem;
  margin: 0.2rem 0 0.5rem;
}

.tl-card-body h2 a {
  color: var(--ink);
  text-decoration: none;
}

.tl-card-body h2 a:hover {
  color: var(--rail);
}

.shelf,
.story-block,
.page-trust,
.faq-block,
.related {
  padding-bottom: 2rem;
}

.story-block p,
.body-copy p,
.page-trust p {
  color: var(--ink);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0.8rem 0 0;
  margin: 0 0 0.6rem;
  color: var(--faint);
  font-size: 0.92rem;
}

.crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--faint);
}

.timeline-rail {
  position: relative;
  margin: 1.2rem 0 2rem;
  padding-left: 1.4rem;
  border-left: 2px solid var(--rail);
}

.timeline-item {
  position: relative;
  margin: 0 0 1.6rem;
}

.tick {
  position: absolute;
  left: -1.4rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  background: var(--accent);
  transform: translateX(-6px);
}

.item-date {
  font-size: 0.92rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin: 0 0 0.25rem;
}

.item-extra {
  font-size: 0.92rem;
  color: var(--faint);
  margin: 0 0 0.6rem;
}

.item-extra span {
  color: var(--muted);
}

.item-figure {
  margin: 0.6rem 0 0.8rem;
}

.item-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
}

.group-head {
  margin: 0 0 1rem;
}

.group-summary {
  color: var(--muted);
}

.order-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  margin: 0.8rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
}

.order-tab {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 0.9rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.order-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--rail);
}

.order-note {
  color: var(--faint);
  font-size: 0.95rem;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding: 0.8rem 0 0.2rem;
}

.author-box {
  width: min(100% - 2rem, var(--wrap));
  margin: 0 auto 2rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
}

.related ul,
.hit-list {
  list-style: none;
  padding: 0;
}

.hit-list li {
  border-top: 1px solid var(--line);
  padding: 0.8rem 0 0.2rem;
}

.search-page {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.search-page input {
  flex: 1 1 12rem;
  min-height: var(--touch);
  border: 1px solid var(--line);
  background: var(--search-bg);
  color: var(--ink);
  padding: 0 0.8rem;
  font: inherit;
}

.see-also {
  padding-bottom: 2.5rem;
  color: var(--muted);
}

.site-footer {
  margin-top: auto;
  background: var(--footer-surface);
  color: #e8eee9;
  padding: 2rem 0 2.4rem;
  padding-bottom: calc(2.4rem + var(--safe-bottom));
}

.site-footer a {
  color: #3dba8a;
}

.site-footer h2 {
  font-size: 1rem;
  margin: 0 0 0.6rem;
  color: #e8eee9;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-note {
  color: #b7c4bc;
}

.brand--foot {
  color: #e8eee9;
  margin-bottom: 0.6rem;
}

@media (max-width: 48rem) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
