:root {
  --paper: #F8F2E7;
  --sand: #EDE2CE;
  --ink: #12211A;
  --forest: #1E4A38;
  --orange: #E4571C;
  --orange-deep: #B33E10;
  --ember: #F79B4B;
  --neon: #D9F24B;
  --terracotta: #A8342A;
  --moss: #64756B;
  --chalk: #FFFDF8;
  --max: 1280px;
  --gutter: 24px;
  --radius-card: 28px;
  --radius-pill: 999px;
  --header-min: 64px;
  --font-body: "Source Han Sans SC", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .045;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(18, 33, 26, .18) 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(18, 33, 26, .10) 5px 6px);
  mix-blend-mode: multiply;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote {
  margin: 0;
}

ul, ol {
  padding: 0;
}

img, svg, video {
  max-width: 100%;
}

img {
  display: block;
}

a {
  color: var(--orange-deep);
  text-underline-offset: .2em;
}

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

button {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--forest);
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--neon);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transform: translateY(-180%);
  transition: transform .18s var(--ease);
}

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

.content-wrap {
  width: min(calc(100% - (var(--gutter) * 2)), var(--max));
  margin-inline: auto;
}

.page-section {
  padding-block: clamp(56px, 8vw, 112px);
}

.section-band {
  background: var(--sand);
}

.section-head {
  display: grid;
  gap: 12px;
  max-width: 66ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--orange-deep);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: currentColor;
}

.display-title {
  max-width: 12ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(44px, 7.5vw, 128px);
  font-weight: 300;
  letter-spacing: -.03em;
  line-height: .95;
}

.lead {
  max-width: 66ch;
  color: var(--forest);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.6;
}

.chapter-index {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--moss);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  line-height: 1.2;
}

.is-current .chapter-index,
[data-chapter].is-current .chapter-index {
  color: var(--orange);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}

.btn--primary {
  background: var(--orange);
  color: var(--ink);
}

.btn--primary:hover {
  background: var(--neon);
}

.btn--ghost {
  border-color: var(--forest);
  color: var(--forest);
}

.btn--ghost:hover {
  background: var(--forest);
  color: var(--paper);
}

.btn--dark {
  background: var(--ink);
  color: var(--paper);
}

.btn--dark:hover {
  background: var(--forest);
  color: var(--neon);
}

.tag,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  line-height: 1.2;
  white-space: nowrap;
}

.tag {
  background: var(--ember);
  color: var(--ink);
}

.pill {
  border: 1px solid rgba(30, 74, 56, .28);
  background: var(--paper);
  color: var(--forest);
}

.metric {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
}

.metric__value {
  color: var(--forest);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1;
}

.metric__label {
  color: var(--moss);
  font-size: 11px;
  letter-spacing: .12em;
  line-height: 1.2;
}

.metric--on-dark .metric__value {
  color: var(--neon);
}

.metric--on-dark .metric__label {
  color: rgba(237, 226, 206, .72);
}

.breadcrumbs {
  padding-block: 16px;
  font-size: 12px;
  color: var(--moss);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-item:not(:last-child)::after {
  content: "/";
  color: var(--moss);
}

.breadcrumb-link {
  color: var(--forest);
  text-decoration: none;
}

.breadcrumb-link:hover {
  color: var(--orange-deep);
}

.breadcrumb-current {
  color: var(--orange-deep);
  font-family: var(--font-mono);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: var(--gutter);
  align-items: start;
}

.main-column {
  min-width: 0;
}

.sticky-rail {
  position: sticky;
  top: calc(var(--header-min) + 16px);
  align-self: start;
  min-width: 0;
}

.archive-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--forest);
  border-radius: var(--radius-card);
  background: var(--chalk);
  color: var(--ink);
  text-decoration: none;
}

.archive-card:hover {
  border-color: var(--orange);
}

.archive-card.is-selected {
  box-shadow: 0 4px 0 var(--orange);
}

.archive-card__label {
  color: var(--orange-deep);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  line-height: 1.2;
}

.archive-card__title {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.25;
}

.archive-card__meta {
  color: var(--moss);
  font-size: 12px;
  line-height: 1.5;
}

.archive-card__score {
  color: var(--forest);
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1;
}

.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(30, 74, 56, .18);
  border-radius: var(--radius-card);
  background: var(--sand);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame--wide {
  aspect-ratio: 21 / 9;
}

.media-frame--portrait {
  aspect-ratio: 3 / 4;
}

.media-frame--square {
  aspect-ratio: 1 / 1;
}

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 210;
  height: 2px;
  background: rgba(248, 242, 231, .14);
  pointer-events: none;
}

.read-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--neon);
  transition: width .12s linear;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid rgba(248, 242, 231, .12);
}

.header-shell {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: var(--max);
  min-height: var(--header-min);
  margin-inline: auto;
  padding: 8px var(--gutter);
  transition: min-height .2s var(--ease), padding .2s var(--ease);
}

.site-header[data-scrolled] .header-shell {
  min-height: 48px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--paper);
  text-decoration: none;
}

.brand__mark {
  display: inline-flex;
  align-items: baseline;
  color: var(--paper);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.1em;
  line-height: 1;
}

.brand__mark::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--orange);
}

.brand__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.05;
}

.brand__latin,
.brand__sub {
  font-family: var(--font-mono);
  letter-spacing: .24em;
}

.brand__latin {
  color: var(--ember);
  font-size: 10px;
}

.brand__sub {
  color: rgba(248, 242, 231, .55);
  font-size: 8px;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(248, 242, 231, .24);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--paper);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--forest);
}

.nav-toggle__lines {
  display: grid;
  gap: 5px;
  width: 16px;
}

.nav-toggle__line {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .18s var(--ease), opacity .18s var(--ease);
}

.site-header[data-open] .nav-toggle__line:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.site-header[data-open] .nav-toggle__line:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

.nav-toggle__text {
  white-space: nowrap;
}

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

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__item {
  flex-shrink: 0;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: var(--radius-pill);
  color: rgba(248, 242, 231, .82);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  transition: background .16s var(--ease), color .16s var(--ease);
}

.site-nav__link:hover {
  background: var(--forest);
  color: var(--paper);
}

.site-nav__link[aria-current="page"] {
  background: var(--forest);
  color: var(--paper);
}

.site-nav__index {
  color: var(--moss);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  line-height: 1;
}

.site-nav__link[aria-current="page"] .site-nav__index {
  color: var(--orange);
}

.site-nav__label {
  line-height: 1;
}

.site-nav__footer {
  display: none;
}

.site-nav__search {
  width: 100%;
}

.site-nav__footer-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--orange);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.site-nav__footer-link--muted {
  border: 1px solid rgba(248, 242, 231, .26);
  background: transparent;
  color: var(--paper);
  font-weight: 400;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.league-control {
  position: relative;
}

.league-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(248, 242, 231, .24);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--paper);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease);
}

.league-trigger:hover {
  background: var(--forest);
  border-color: var(--forest);
}

.league-trigger__label {
  white-space: nowrap;
}

.league-trigger__count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--neon);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
}

.league-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 300;
  width: min(420px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--forest);
  border-radius: 24px;
  background: var(--chalk);
  color: var(--ink);
  box-shadow: 0 18px 44px rgba(18, 33, 26, .24);
}

.league-panel__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.3;
}

.league-panel__note {
  color: var(--moss);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .08em;
}

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

.league-chip {
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid rgba(30, 74, 56, .28);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}

.league-chip:hover {
  border-color: var(--orange);
}

.league-chip.is-active,
.league-chip[aria-pressed="true"] {
  border-color: var(--forest);
  background: var(--neon);
  color: var(--ink);
  font-weight: 700;
}

.league-panel__clear {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  border: 1px solid var(--forest);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--forest);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.league-panel__clear:hover {
  background: var(--forest);
  color: var(--paper);
}

.search-box {
  display: flex;
  align-items: center;
  width: 152px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(248, 242, 231, .24);
  border-radius: var(--radius-pill);
  background: rgba(248, 242, 231, .06);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}

.search-box:focus-within {
  border-color: var(--neon);
  box-shadow: 0 0 0 2px var(--forest);
}

.search-box__input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--paper);
  font-size: 12px;
  line-height: 1.2;
}

.search-box__input::placeholder {
  color: rgba(248, 242, 231, .55);
}

.search-box__input:focus-visible {
  outline: 0;
  box-shadow: none;
}

.search-box__input::-webkit-search-cancel-button {
  filter: invert(1);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--orange);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.2;
  white-space: nowrap;
  transition: background .16s var(--ease), color .16s var(--ease);
}

.header-cta:hover {
  background: var(--neon);
}

.active-league {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px var(--gutter);
  background: var(--sand);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.active-league__text {
  font-family: var(--font-mono);
  letter-spacing: .03em;
}

.active-league__clear {
  min-height: 28px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--orange-deep);
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
}

.site-footer {
  margin-top: 96px;
  border-top: 1px solid rgba(237, 226, 206, .16);
  background: var(--ink);
  color: var(--sand);
}

.footer-shell {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr 1fr;
  gap: 40px 56px;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: 64px var(--gutter) 28px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.footer-brand__mark {
  width: fit-content;
  color: var(--paper);
  font-size: clamp(42px, 5vw, 76px);
  font-weight: 300;
  letter-spacing: -.08em;
  line-height: .95;
  text-decoration: none;
}

.footer-brand__mark:hover {
  color: var(--neon);
}

.footer-brand__note {
  max-width: 24ch;
  margin: 0;
  color: rgba(237, 226, 206, .66);
  font-size: 12px;
  letter-spacing: .08em;
  line-height: 1.6;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  min-width: 0;
}

.footer-column {
  min-width: 0;
}

.footer-column__title,
.footer-title {
  margin: 0 0 12px;
  color: var(--ember);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1.3;
}

.footer-column__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-column__link {
  color: var(--sand);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
}

.footer-column__link:hover {
  color: var(--neon);
}

.footer-contact {
  min-width: 0;
  font-size: 12px;
  line-height: 1.7;
}

.footer-contact__line {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
}

.footer-contact__meta {
  margin: 0 0 6px;
  color: rgba(237, 226, 206, .66);
}

.footer-legal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(237, 226, 206, .16);
  color: rgba(237, 226, 206, .62);
  font-size: 11px;
  line-height: 1.5;
}

.footer-legal__copy,
.footer-legal__record {
  margin: 0;
}

.footer-legal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-legal__link {
  color: rgba(237, 226, 206, .72);
  text-decoration: none;
}

.footer-legal__link:hover {
  color: var(--neon);
}

@media (max-width: 1120px) {
  .header-shell {
    gap: 10px;
  }

  .header-tools {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    width: 100%;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    padding: 16px var(--gutter) 24px;
    border-top: 1px solid rgba(248, 242, 231, .14);
    background: var(--ink);
    box-shadow: 0 20px 40px rgba(18, 33, 26, .28);
  }

  .site-header[data-open] .site-nav {
    display: block;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .site-nav__link {
    justify-content: space-between;
    min-height: 48px;
    padding: 12px;
    border-radius: 16px;
    font-size: 16px;
  }

  .site-nav__index {
    color: var(--orange);
    font-size: 11px;
  }

  .site-nav__footer {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(248, 242, 231, .14);
  }

  .site-nav__search .search-box {
    width: 100%;
    min-height: 44px;
  }
}

@media (max-width: 980px) {
  .split-layout {
    grid-template-columns: 1fr;
  }

  .sticky-rail {
    position: static;
  }

  .footer-shell {
    grid-template-columns: 1fr 1.4fr;
    gap: 32px;
  }

  .footer-brand,
  .footer-contact {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  :root {
    --gutter: 16px;
  }

  body {
    font-size: 16px;
  }

  .brand__mark {
    font-size: 22px;
  }

  .brand__sub {
    display: none;
  }

  .active-league {
    justify-content: space-between;
  }

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

  .footer-shell {
    grid-template-columns: 1fr;
    padding-top: 48px;
    padding-bottom: 24px;
  }

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

  .footer-legal {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .header-shell {
    padding-inline: 12px;
  }

  .brand__meta {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
