:root {
  --ink: #091a2f;
  --ink-deep: #061322;
  --ink-soft: #102941;
  --paper: #f1eee5;
  --paper-soft: #e5e0d4;
  --paper-bright: #faf8f2;
  --acid: #dbf56d;
  --mint: #8fe1cf;
  --coral: #f49a79;
  --yellow: #f3cd6a;
  --white: #fffdf7;
  --muted: #8190a0;
  --muted-dark: #596878;
  --line: rgba(222, 236, 230, 0.15);
  --line-dark: rgba(9, 26, 47, 0.13);
  --mono: "DM Mono", "Cascadia Mono", monospace;
  --sans: "IBM Plex Sans Condensed", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  background: url("assets/archive-texture.png") center top / cover no-repeat;
  content: "";
  opacity: 0.8;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: rgba(6, 19, 34, 0.32);
  content: "";
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

button,
a,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.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;
}

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
}

.site-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1440px, calc(100% - 80px));
  min-height: 78px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--acid);
  color: var(--acid);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.1;
}

.brand-copy strong {
  color: var(--paper-bright);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  transition: color 180ms ease;
}

.nav-link span {
  color: #526579;
  font-family: var(--mono);
  font-size: 9px;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--paper-bright);
}

.nav-link.is-active::before {
  width: 5px;
  height: 5px;
  margin-right: 2px;
  border-radius: 50%;
  background: var(--acid);
  content: "";
}

.header-action {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-size: 12px;
  transition: border-color 180ms ease, background 180ms ease;
}

.header-action:hover {
  border-color: rgba(219, 245, 109, 0.55);
  background: rgba(219, 245, 109, 0.06);
}

.header-action svg {
  width: 14px;
  height: 14px;
  color: var(--acid);
}

.header-action b {
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  place-items: center;
  border-radius: 50%;
  background: var(--acid);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
}

main {
  width: min(1440px, calc(100% - 80px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(370px, 0.84fr);
  gap: 90px;
  min-height: 600px;
  padding: 98px 0 100px;
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.eyebrow-line {
  display: inline-block;
  width: 30px;
  height: 1px;
  background: var(--mint);
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  color: var(--paper-bright);
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.22;
}

.hero h1 em,
.guide-card h3 em,
.about-copy h2 em {
  color: var(--acid);
  font-style: normal;
}

.hero-lede {
  max-width: 500px;
  margin: 28px 0 34px;
  color: #a9b5bd;
  font-size: 16px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 17px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--acid);
  color: var(--ink);
}

.button-primary:hover {
  background: #e7fb90;
}

.button-paper {
  background: var(--mint);
  color: var(--ink);
}

.button-paper:hover {
  background: #b8f0e3;
}

.button-answer {
  background: var(--coral);
  color: var(--ink);
}

.button-answer:hover {
  background: #ffc0a9;
}

.button-quiet {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
}

.button-quiet:hover {
  border-color: rgba(143, 225, 207, 0.6);
  color: var(--mint);
}

.hero-footnote {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 48px;
  color: #7f91a1;
  font-size: 11px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 4px rgba(219, 245, 109, 0.12);
}

.footnote-divider {
  width: 22px;
  height: 1px;
  margin: 0 3px;
  background: var(--line);
}

.hero-index {
  position: relative;
  min-height: 380px;
  padding: 31px 32px 28px;
  border: 1px solid rgba(219, 245, 109, 0.37);
  background: rgba(11, 35, 53, 0.74);
  box-shadow: 14px 14px 0 rgba(219, 245, 109, 0.09);
}

.hero-index::before,
.hero-index::after {
  position: absolute;
  width: 9px;
  height: 9px;
  border-color: var(--acid);
  content: "";
}

.hero-index::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.hero-index::after {
  right: -1px;
  bottom: -1px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.index-topline,
.index-title-row,
.index-note,
.stats-grid {
  position: relative;
  z-index: 1;
}

.index-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8193a2;
  font-size: 10px;
}

.index-stamp {
  padding: 4px 7px;
  border: 1px solid rgba(143, 225, 207, 0.4);
  color: var(--mint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.index-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 66px;
}

.index-kicker {
  color: var(--coral);
  font-family: var(--mono);
  font-size: 10px;
}

.index-title-row h2 {
  margin: 8px 0 0;
  color: var(--paper-bright);
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.25;
}

.index-title-row h2 strong {
  color: var(--acid);
  font-weight: 600;
}

.index-number {
  color: var(--paper-bright);
  font-family: var(--serif);
  font-size: 80px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 0.9;
}

.index-number span {
  margin-left: 5px;
  color: var(--mint);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
}

.index-rule {
  height: 1px;
  margin: 29px 0 21px;
  background: var(--line);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 15px;
  border-right: 1px solid var(--line);
}

.stat-cell:first-child {
  padding-left: 0;
}

.stat-cell:last-child {
  border-right: 0;
}

.stat-value {
  color: var(--paper-bright);
  font-family: var(--mono);
  font-size: 20px;
}

.stat-label {
  color: #8193a2;
  font-size: 11px;
}

.index-note {
  display: flex;
  gap: 11px;
  margin-top: 31px;
  padding-top: 17px;
  border-top: 1px dashed var(--line);
  color: #a9b8c0;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.7;
}

.index-note svg {
  width: 15px;
  height: 15px;
  color: var(--coral);
  flex: 0 0 auto;
}

.index-note p {
  margin: 0;
}

.archive-section,
.guide-section {
  padding: 106px 0 108px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 42px;
}

.section-heading .eyebrow {
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  color: var(--paper-bright);
  font-family: var(--serif);
  font-size: 54px;
  font-weight: 600;
  line-height: 1.1;
}

.section-aside {
  margin: 0 0 4px;
  color: #8fa0ad;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.75;
  text-align: right;
}

.archive-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 52px;
  align-items: start;
}

.search-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.level-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.level-tab {
  display: inline-flex;
  min-height: 37px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  background: transparent;
  color: #8395a4;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  transition: color 180ms ease, background 180ms ease;
}

.level-tab span {
  color: #55697b;
  font-size: 9px;
}

.level-tab:hover {
  color: var(--paper);
}

.level-tab.is-active {
  background: var(--paper);
  color: var(--ink);
}

.level-tab.is-active span {
  color: var(--ink-soft);
}

.search-field {
  display: flex;
  width: min(320px, 45%);
  min-height: 39px;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: rgba(4, 17, 31, 0.28);
  color: #93a7b4;
}

.search-field svg {
  width: 15px;
  height: 15px;
  color: var(--mint);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--paper-bright);
  font-size: 12px;
}

.search-field input::placeholder {
  color: #6e8191;
}

.search-field kbd {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  color: #718494;
  font-family: var(--mono);
  font-size: 10px;
}

.filter-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 65px;
  border-bottom: 1px solid var(--line);
}

.year-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.year-chips::-webkit-scrollbar {
  display: none;
}

.year-chip {
  min-height: 27px;
  padding: 0 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #7f92a2;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
  transition: color 180ms ease, border-color 180ms ease;
}

.year-chip:hover,
.year-chip.is-active {
  border-color: rgba(143, 225, 207, 0.48);
  color: var(--mint);
}

.type-select {
  position: relative;
  display: inline-flex;
  min-width: 143px;
  height: 33px;
  align-items: center;
  gap: 7px;
  margin-left: 0;
  padding: 0 8px;
  border-left: 1px solid var(--line);
}

.month-select {
  margin-left: auto;
}

.type-select span {
  color: #6f8391;
  font-size: 10px;
  white-space: nowrap;
}

.type-select select {
  width: 92px;
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-size: 11px;
}

.type-select option {
  background: var(--ink);
  color: var(--paper);
}

.type-select svg {
  position: absolute;
  right: 0;
  width: 13px;
  height: 13px;
  color: var(--mint);
  pointer-events: none;
}

.clear-button {
  padding: 5px 0 5px 10px;
  border-left: 1px solid var(--line);
  background: transparent;
  color: #718494;
  cursor: pointer;
  font-size: 10px;
  white-space: nowrap;
}

.clear-button:hover {
  color: var(--paper);
}

.results-bar {
  display: flex;
  align-items: center;
  min-height: 52px;
  gap: 10px;
  color: #8092a0;
  font-family: var(--mono);
  font-size: 10px;
}

.results-bar > span:first-child {
  color: var(--acid);
}

.results-divider {
  width: 22px;
  height: 1px;
  background: var(--line);
}

.results-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: #728495;
}

.results-sort svg {
  width: 13px;
  height: 13px;
}

.material-list {
  display: flex;
  flex-direction: column;
}

.material-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 17px;
  min-height: 153px;
  padding: 24px 0 22px;
  border-bottom: 1px solid var(--line);
  transition: padding 180ms ease, background 180ms ease;
}

.material-card:hover {
  padding-right: 13px;
  padding-left: 13px;
  background: rgba(219, 245, 109, 0.04);
}

.card-index {
  padding-top: 4px;
  color: #65798b;
  font-family: var(--mono);
  font-size: 11px;
}

.card-body {
  min-width: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  color: #7f93a1;
  font-family: var(--mono);
  font-size: 10px;
}

.level-pill {
  padding: 3px 6px;
  background: var(--paper);
  color: var(--ink);
  font-size: 9px;
  font-weight: 600;
}

.level-pill.level-six {
  background: var(--mint);
}

.edition-flag {
  padding: 3px 6px;
  border: 1px solid rgba(255, 169, 135, 0.62);
  color: var(--coral);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.card-body h3 {
  margin: 0;
  color: var(--paper-bright);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
}

.card-body p {
  max-width: 620px;
  margin: 7px 0 13px;
  color: #8497a5;
  font-size: 12px;
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  color: #8295a4;
  font-family: var(--mono);
  font-size: 9px;
}

.tag svg {
  width: 11px;
  height: 11px;
}

.source-tag {
  border-style: dashed;
  color: var(--mint);
  transition: border-color 180ms ease, color 180ms ease;
}

.source-tag:hover {
  border-color: rgba(219, 245, 109, 0.6);
  color: var(--acid);
}

.card-side {
  display: flex;
  min-width: 278px;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
}

.file-meta-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.file-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7e92a0;
  font-family: var(--mono);
  font-size: 9px;
  white-space: nowrap;
}

.file-meta svg {
  width: 13px;
  height: 13px;
}

.paper-meta svg {
  color: var(--mint);
}

.answer-meta svg {
  color: var(--coral);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button {
  display: inline-grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  color: #8296a4;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.icon-button svg {
  width: 14px;
  height: 14px;
}

.icon-button:hover,
.icon-button.is-favorite {
  border-color: rgba(219, 245, 109, 0.7);
  background: rgba(219, 245, 109, 0.1);
  color: var(--acid);
}

.browse-button {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: #9aabb5;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  transition: border-color 180ms ease, color 180ms ease;
}

.browse-button:hover {
  border-color: rgba(219, 245, 109, 0.6);
  color: var(--acid);
}

.browse-button svg {
  width: 13px;
  height: 13px;
}

.download-button {
  display: inline-flex;
  min-width: 66px;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  transition: background 180ms ease, transform 180ms ease;
}

.paper-download {
  background: var(--mint);
}

.answer-download {
  background: var(--coral);
}

.paper-download:hover {
  background: #b8f0e3;
  transform: translateY(-1px);
}

.answer-download:hover {
  background: #ffc0a9;
  transform: translateY(-1px);
}

.download-button svg {
  width: 13px;
  height: 13px;
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed var(--line);
  color: #8ba0ad;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state svg {
  width: 27px;
  height: 27px;
  color: var(--mint);
}

.empty-state h3 {
  margin: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 20px;
}

.empty-state p {
  margin: 0 0 8px;
  font-size: 12px;
}

.archive-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-block {
  padding: 22px 20px;
  border: 1px solid var(--line);
  background: rgba(7, 24, 40, 0.56);
}

.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--mint);
}

.side-heading svg {
  width: 15px;
  height: 15px;
}

.side-label {
  color: #8194a2;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.collection-count {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 27px;
}

.collection-count span {
  color: var(--acid);
  font-family: var(--serif);
  font-size: 52px;
  line-height: 0.9;
}

.collection-count small {
  color: #a2b1ba;
  font-size: 12px;
}

.collection-bar {
  height: 3px;
  margin: 17px 0 13px;
  background: rgba(219, 245, 109, 0.15);
}

.collection-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--acid);
  transition: width 240ms ease;
}

.side-copy {
  min-height: 42px;
  margin: 0;
  color: #8295a3;
  font-size: 11px;
  line-height: 1.65;
}

.side-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 0;
  background: transparent;
  color: var(--mint);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
}

.side-link:hover {
  color: var(--acid);
}

.side-link svg {
  width: 13px;
  height: 13px;
}

.recent-block {
  min-height: 161px;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 18px;
}

.recent-empty {
  margin: 0;
  color: #6e8291;
  font-size: 11px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a4b1b8;
  font-size: 11px;
}

.recent-item svg {
  width: 13px;
  height: 13px;
  color: var(--coral);
  flex: 0 0 auto;
}

.recent-item span {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item small {
  flex: 0 0 auto;
  padding: 1px 4px;
  border: 1px solid var(--line);
  color: var(--mint);
  font-family: var(--mono);
  font-size: 8px;
}

.signal-block {
  display: flex;
  gap: 13px;
  border-color: rgba(244, 154, 121, 0.36);
  background: rgba(244, 154, 121, 0.05);
}

.signal-mark {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--coral);
  color: var(--coral);
  font-family: var(--mono);
  font-size: 12px;
}

.signal-block p {
  margin: 8px 0 0;
  color: #c1b4a8;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.7;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 14px;
}

.guide-card {
  position: relative;
  min-height: 310px;
  padding: 24px 25px 23px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(7, 24, 40, 0.57);
}

.guide-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.guide-index {
  color: #8da0ad;
  font-family: var(--mono);
  font-size: 10px;
}

.guide-card-top svg {
  width: 18px;
  height: 18px;
  color: var(--mint);
}

.guide-card h3 {
  position: relative;
  z-index: 1;
  margin: 67px 0 18px;
  color: var(--paper-bright);
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.2;
}

.guide-card p {
  position: relative;
  z-index: 1;
  max-width: 240px;
  margin: 0;
  color: #91a1ad;
  font-size: 12px;
  line-height: 1.75;
}

.guide-stamp {
  position: absolute;
  right: 23px;
  bottom: 23px;
  color: #62798b;
  font-family: var(--mono);
  font-size: 9px;
}

.guide-card-large::after,
.guide-card-accent::after,
.guide-card-dark::after {
  position: absolute;
  right: -35px;
  bottom: -72px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(143, 225, 207, 0.22);
  border-radius: 50%;
  content: "";
}

.guide-card-large::before,
.guide-card-accent::before,
.guide-card-dark::before {
  position: absolute;
  right: 16px;
  bottom: 18px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(143, 225, 207, 0.16);
  border-radius: 50%;
  content: "";
}

.guide-card-accent {
  border-color: rgba(219, 245, 109, 0.35);
  background: var(--acid);
}

.guide-card-accent .guide-index,
.guide-card-accent p,
.guide-card-accent .guide-stamp {
  color: #40552d;
}

.guide-card-accent .guide-card-top svg,
.guide-card-accent h3 em {
  color: var(--ink);
}

.guide-card-accent h3 {
  color: var(--ink);
}

.guide-card-accent::after,
.guide-card-accent::before {
  border-color: rgba(9, 26, 47, 0.24);
}

.guide-card-dark {
  background: var(--paper);
}

.guide-card-dark .guide-index,
.guide-card-dark p,
.guide-card-dark .guide-stamp {
  color: #6d7880;
}

.guide-card-dark .guide-card-top svg {
  color: var(--ink);
}

.guide-card-dark h3 {
  color: var(--ink);
}

.guide-card-dark h3 em {
  color: #c4775d;
}

.guide-card-dark::after,
.guide-card-dark::before {
  border-color: rgba(9, 26, 47, 0.19);
}

.about-section {
  display: grid;
  grid-template-columns: 1.15fr 1.55fr 0.8fr;
  align-items: center;
  gap: 40px;
  min-height: 290px;
  padding: 66px 0 70px;
  border-top: 1px solid var(--line);
}

.about-mark {
  display: grid;
  width: 136px;
  height: 136px;
  place-items: center;
  border: 1px solid rgba(219, 245, 109, 0.5);
  color: var(--acid);
  font-family: var(--serif);
  font-size: 48px;
  transform: rotate(-7deg);
}

.about-copy .eyebrow {
  margin-bottom: 15px;
}

.about-copy h2 {
  margin: 0;
  color: var(--paper-bright);
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 600;
  line-height: 1.4;
}

.about-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-self: end;
  color: #7d909f;
  font-size: 11px;
  text-align: right;
}

.about-meta .mono {
  color: var(--mint);
}

.site-footer {
  display: flex;
  width: min(1440px, calc(100% - 80px));
  min-height: 75px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: #718594;
  font-family: var(--mono);
  font-size: 10px;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mint);
}

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

.site-footer svg {
  width: 13px;
  height: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  padding: 2vh 1vw;
  place-items: center;
  background: rgba(3, 12, 22, 0.82);
}

.modal-backdrop[hidden] {
  display: none;
}

.preview-modal {
  display: grid;
  width: min(1360px, 98vw);
  height: min(94vh, 1040px);
  min-height: 680px;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(219, 245, 109, 0.45);
  background: var(--ink);
  box-shadow: 14px 14px 0 rgba(219, 245, 109, 0.11);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 23px 24px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  max-width: min(840px, 72vw);
  margin: 7px 0 0;
  color: var(--paper-bright);
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
}

.modal-close {
  width: 34px;
  height: 34px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 24px;
}

.preview-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  border: 1px solid var(--line);
}

.preview-kind {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: #91a2ad;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 180ms ease, color 180ms ease;
}

.preview-kind + .preview-kind {
  border-left: 1px solid var(--line);
}

.preview-kind.is-active {
  background: var(--mint);
  color: var(--ink);
}

.preview-kind[data-preview-kind="answer"].is-active {
  background: var(--coral);
}

.preview-kind svg,
.preview-source svg {
  width: 14px;
  height: 14px;
}

.preview-navigation {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  border: 1px solid var(--line);
}

.viewer-icon-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  background: transparent;
  color: #9badb8;
  cursor: pointer;
}

.viewer-icon-button:hover:not(:disabled) {
  background: rgba(143, 225, 207, 0.1);
  color: var(--mint);
}

.viewer-icon-button:disabled {
  color: #43596b;
  cursor: default;
}

.viewer-icon-button svg {
  width: 14px;
  height: 14px;
}

.preview-page-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8ea0ab;
  font-family: var(--mono);
  font-size: 10px;
}

.preview-page-status input {
  width: 38px;
  height: 26px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper-bright);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
  appearance: textfield;
}

.preview-page-status input::-webkit-inner-spin-button,
.preview-page-status input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.viewer-divider {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: var(--line);
}

.preview-zoom {
  width: 36px;
  color: #8ea0ab;
  font-family: var(--mono);
  font-size: 9px;
  text-align: center;
}

.preview-source {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 10px;
}

.preview-source:hover {
  color: var(--acid);
}

.preview-frame-wrap {
  position: relative;
  min-height: 0;
  margin: 0 18px 14px;
  overflow: auto;
  border: 1px solid #aab0b2;
  background: #cfd5d8;
  scrollbar-color: #71808a #dfe3e5;
}

.preview-frame-wrap canvas {
  display: block;
  margin: 18px auto;
  background: var(--paper-bright);
  box-shadow: 0 2px 12px rgba(9, 26, 47, 0.22);
}

.preview-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: #dfe3e5;
  color: #45545d;
  font-size: 12px;
}

.preview-loading[hidden] {
  display: none;
}

.preview-loading.is-error {
  color: #813f2b;
}

.loading-mark {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(9, 26, 47, 0.16);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: loading-spin 700ms linear infinite;
}

.preview-loading.is-error .loading-mark {
  display: none;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 66px;
  padding: 0 24px 18px;
  color: #8ea0ab;
  font-family: var(--mono);
  font-size: 10px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid rgba(219, 245, 109, 0.55);
  background: var(--ink-soft);
  color: var(--paper-bright);
  box-shadow: 5px 5px 0 rgba(219, 245, 109, 0.12);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop:not([hidden]) + .toast {
  bottom: 86px;
}

.toast svg {
  width: 15px;
  height: 15px;
  color: var(--acid);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal-in 700ms cubic-bezier(0.22, 0.8, 0.26, 1) forwards;
}

.reveal-delay-1 {
  animation-delay: 100ms;
}

.reveal-delay-2 {
  animation-delay: 180ms;
}

.reveal-delay-3 {
  animation-delay: 260ms;
}

@keyframes reveal-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 48px, 980px);
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
    gap: 45px;
  }

  .hero h1 {
    font-size: 60px;
  }

  .archive-layout {
    gap: 28px;
  }

  .archive-sidebar {
    width: 250px;
  }
}

@media (max-width: 840px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 55px;
    padding: 78px 0 82px;
  }

  .hero-index {
    max-width: 600px;
  }

  .archive-layout {
    grid-template-columns: 1fr;
  }

  .archive-sidebar {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .signal-block {
    grid-column: 1 / -1;
  }

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

  .guide-card-large {
    grid-column: 1 / -1;
  }

  .about-section {
    grid-template-columns: 120px 1fr;
  }

  .about-meta {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .site-header,
  main,
  .site-footer {
    width: calc(100% - 32px);
  }

  .site-header {
    min-height: 67px;
  }

  .header-action {
    padding: 8px;
  }

  .header-action span {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 62px 0 70px;
  }

  .hero h1 {
    font-size: 42px;
    line-height: 1.28;
  }

  .hero-lede {
    margin-top: 22px;
    font-size: 14px;
  }

  .hero-footnote {
    flex-wrap: wrap;
    margin-top: 35px;
  }

  .hero-index {
    min-height: 340px;
    padding: 23px 20px 22px;
    box-shadow: 8px 8px 0 rgba(219, 245, 109, 0.09);
  }

  .index-title-row {
    margin-top: 50px;
  }

  .index-title-row h2 {
    font-size: 31px;
  }

  .index-number {
    font-size: 61px;
  }

  .section-heading {
    display: block;
    margin-bottom: 31px;
  }

  .section-heading h2 {
    font-size: 42px;
  }

  .section-aside {
    margin-top: 15px;
    text-align: left;
  }

  .archive-section,
  .guide-section {
    padding: 74px 0 78px;
  }

  .search-panel {
    display: block;
  }

  .level-tabs {
    margin-bottom: 13px;
  }

  .search-field {
    width: 100%;
  }

  .filter-strip {
    display: block;
    padding: 12px 0;
  }

  .year-chips {
    padding-bottom: 10px;
  }

  .type-select {
    width: 100%;
    margin: 0;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .type-select select {
    width: auto;
  }

  .type-select svg {
    right: 2px;
    top: 10px;
  }

  .clear-button {
    display: block;
    margin-top: 10px;
    padding: 8px 0 0;
    border-top: 1px dashed var(--line);
    border-left: 0;
  }

  .results-bar {
    min-height: 47px;
    flex-wrap: wrap;
    gap: 7px;
    padding: 8px 0;
  }

  .results-sort {
    width: 100%;
    margin-left: 0;
  }

  .material-card {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 11px;
    padding: 20px 0;
  }

  .material-card:hover {
    padding-right: 8px;
    padding-left: 8px;
  }

  .card-side {
    grid-column: 2;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .file-meta-group {
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px 12px;
  }

  .card-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 31px 31px minmax(0, 1fr) minmax(0, 1fr);
    justify-content: stretch;
  }

  .browse-button {
    width: 31px;
    padding: 0;
  }

  .browse-button span {
    display: none;
  }

  .download-button {
    width: 100%;
    min-width: 0;
  }

  .card-body h3 {
    font-size: 19px;
  }

  .card-body p {
    font-size: 11px;
  }

  .archive-sidebar {
    display: flex;
  }

  .guide-grid {
    display: flex;
    flex-direction: column;
  }

  .guide-card,
  .guide-card-large {
    min-height: 264px;
  }

  .guide-card h3 {
    margin-top: 50px;
  }

  .about-section {
    grid-template-columns: 80px 1fr;
    gap: 20px;
    padding: 52px 0 58px;
  }

  .about-mark {
    width: 78px;
    height: 78px;
    font-size: 29px;
  }

  .about-copy h2 {
    font-size: 24px;
  }

  .about-meta {
    grid-column: 1 / -1;
    margin-top: 8px;
  }

  .site-footer {
    min-height: 88px;
    flex-wrap: wrap;
    gap: 9px;
    padding: 18px 0;
  }

  .footer-center {
    order: 3;
    width: 100%;
  }

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

  .modal-footer .button {
    width: 100%;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .preview-modal {
    width: 100%;
    height: calc(100dvh - 16px);
    min-height: 0;
    box-shadow: none;
  }

  .modal-header {
    padding: 14px;
  }

  .modal-header h2 {
    max-width: calc(100vw - 95px);
    font-size: 18px;
    overflow-wrap: anywhere;
  }

  .preview-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
  }

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

  .preview-navigation {
    justify-content: center;
  }

  .preview-source {
    justify-content: flex-end;
  }

  .preview-frame-wrap {
    margin: 0 8px 10px;
  }

  .modal-footer {
    min-height: 0;
    padding: 0 10px 10px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    justify-content: center;
  }

  .modal-backdrop:not([hidden]) + .toast {
    bottom: 82px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
