:root {
  color-scheme: light;
  --ink: #151b1a;
  --muted: #5a6764;
  --canvas: #eef2f0;
  --paper: #ffffff;
  --soft: #e4eeeb;
  --sea: #0d5260;
  --sea-deep: #082f38;
  --aqua: #7cd1c2;
  --clay: #b5432f;
  --gold: #d1a43a;
  --line: #d6dfdc;
  --line-dark: rgba(255, 255, 255, 0.22);
  --content: 1240px;
  --shadow: 0 12px 28px rgba(8, 47, 56, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 68px;
}

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

body,
button,
input {
  font-size: 16px;
}

button,
input {
  font: inherit;
}

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

a {
  color: var(--sea);
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

figure {
  margin: 0;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-160%);
}

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

.app-header {
  background: var(--sea-deep);
  color: var(--paper);
}

.topbar,
.hero-grid,
.hero-metrics,
.quick-nav,
.research-tools,
.section-band > *,
.app-footer > * {
  width: min(calc(100% - 48px), var(--content));
  margin-right: auto;
  margin-left: auto;
}

.topbar {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line-dark);
}

.brand {
  color: var(--paper);
  font-weight: 800;
  text-decoration: none;
}

.edition {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  color: #c8d9d5;
  font-size: 0.8rem;
  font-weight: 700;
}

.edition span {
  width: 8px;
  height: 8px;
  background: var(--aqua);
  border-radius: 50%;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 64px;
  min-height: 508px;
  align-items: center;
  padding-top: 44px;
  padding-bottom: 44px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow,
.section-title > p {
  margin-bottom: 14px;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-copy .eyebrow {
  color: var(--aqua);
}

h1 {
  max-width: 790px;
  margin-bottom: 22px;
  font-size: 3.75rem;
  line-height: 1.04;
  letter-spacing: 0;
}

h1 span {
  display: block;
  color: #f3cf79;
  font-size: 0.48em;
  line-height: 1.4;
}

.lede {
  max-width: 720px;
  margin-bottom: 28px;
  color: #d6e2df;
  font-size: 1.12rem;
  line-height: 1.75;
}

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

.primary-action,
.text-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  text-decoration: none;
}

.primary-action {
  padding: 0 18px;
  background: var(--paper);
  color: var(--sea-deep);
  border-radius: 6px;
}

.text-action {
  color: #dcecea;
}

.text-action span {
  margin-left: 8px;
  font-size: 1.25rem;
}

.hero-object {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 410px;
  margin-bottom: 0;
  overflow: hidden;
  background: #101817;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.3);
}

.hero-object img {
  width: 100%;
  height: 330px;
  object-fit: cover;
  object-position: center 42%;
}

.hero-object figcaption {
  padding: 15px 17px 17px;
  color: #cbd7d4;
  font-size: 0.78rem;
  line-height: 1.55;
}

.hero-object figcaption span {
  display: block;
  margin-bottom: 5px;
  color: var(--aqua);
  font-size: 0.69rem;
  font-weight: 900;
}

.hero-object figcaption a {
  color: var(--paper);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-dark);
}

.hero-metrics p {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 84px;
  margin-bottom: 0;
  padding: 20px 24px;
  border-right: 1px solid var(--line-dark);
}

.hero-metrics p:last-child {
  border-right: 0;
}

.hero-metrics strong {
  color: #f3cf79;
  font-size: 1.65rem;
}

.hero-metrics span {
  color: #c8d9d5;
  font-size: 0.82rem;
  font-weight: 700;
}

.quick-nav {
  scrollbar-width: none;
}

.quick-nav::-webkit-scrollbar {
  display: none;
}

nav.quick-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 2px;
  width: 100%;
  max-width: none;
  overflow-x: auto;
  padding: 0 max(24px, calc((100% - var(--content)) / 2));
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 5px 18px rgba(21, 27, 26, 0.06);
  backdrop-filter: blur(12px);
}

.quick-nav a {
  flex: 0 0 auto;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 3px solid transparent;
  color: #33413e;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.quick-nav a:hover,
.quick-nav a[aria-current] {
  border-color: var(--clay);
  color: var(--ink);
}

main {
  display: block;
}

.research-tools {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 18px;
  align-items: end;
  padding-top: 26px;
  padding-bottom: 26px;
}

.search-box {
  display: grid;
  gap: 8px;
}

.search-box > span,
.progress-copy > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.search-box input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid #bdcac6;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}

.search-box input::placeholder {
  color: #87938f;
}

.progress-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px 12px;
  align-items: center;
  min-height: 74px;
  padding: 11px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-copy strong {
  color: var(--clay);
  font-size: 1.15rem;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--sea);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 900;
}

.progress-meter {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  background: var(--soft);
  border-radius: 5px;
}

.progress-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--sea);
  transition: width 180ms ease;
}

.search-summary {
  grid-column: 1 / -1;
  min-height: 20px;
  margin-bottom: -10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.section-band {
  padding: 72px 0;
  scroll-margin-top: 54px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.section-band--intro,
.section-band--objects,
.section-band--sources {
  background: #f4f7f6;
}

.section-band--route {
  background: #e8f0ee;
}

.section-band--plan {
  background: #f5f1e8;
}

.section-title {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 28px;
}

.section-title > p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  padding-top: 9px;
}

.section-title > p span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  background: var(--clay);
  border-radius: 50%;
  color: var(--paper);
  font-size: 0.7rem;
}

h2 {
  max-width: 850px;
  margin-bottom: 8px;
  font-size: 2.3rem;
  line-height: 1.16;
  letter-spacing: 0;
}

.section-deck {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.08rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.grid.seven {
  grid-template-columns: repeat(7, minmax(190px, 1fr));
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
}

.grid.seven .card {
  scroll-snap-align: start;
}

.card {
  display: grid;
  min-width: 0;
  min-height: 100%;
  gap: 12px;
  align-content: start;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--sea);
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(21, 27, 26, 0.05);
}

.card.has-image {
  overflow: hidden;
}

.card-media {
  margin: -20px -20px 4px;
  background: #131817;
}

.card-media img {
  width: 100%;
  height: 235px;
  object-fit: cover;
}

.card-media figcaption {
  padding: 9px 12px;
  color: #cbd7d4;
  font-size: 0.7rem;
  line-height: 1.45;
}

.card p {
  margin-bottom: 0;
  color: #3d4a47;
  line-height: 1.72;
}

.card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 5px;
  background: #edf1f0;
  color: #46524f;
  font-size: 0.7rem;
  font-weight: 900;
}

.badge.a {
  background: #dcefeb;
  color: #064b51;
}

.badge.b {
  background: #f5e7bd;
  color: #684b0a;
}

.badge.c {
  background: #f1ddd7;
  color: #79301f;
}

.done-button {
  min-height: 39px;
  margin-top: auto;
  border: 1px solid #a8c8c2;
  border-radius: 6px;
  background: #eff8f6;
  color: var(--sea);
  cursor: pointer;
  font-weight: 900;
}

.done-button[data-done="true"] {
  background: var(--sea);
  border-color: var(--sea);
  color: var(--paper);
}

.route-filter {
  display: inline-flex;
  gap: 0;
  margin-bottom: 20px;
  padding: 3px;
  background: #d4e1de;
  border-radius: 7px;
}

.route-filter button {
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #3d4e4a;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

.route-filter button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--sea-deep);
  box-shadow: 0 2px 8px rgba(8, 47, 56, 0.1);
}

.route-layout {
  display: grid;
  grid-template-columns: minmax(290px, 0.72fr) minmax(0, 1.45fr);
  gap: 20px;
  align-items: start;
}

.route-index {
  position: sticky;
  top: 74px;
  min-height: 520px;
  padding: 20px;
  overflow: hidden;
  background: var(--sea-deep);
  border-radius: 8px;
  color: var(--paper);
  box-shadow: var(--shadow);
}

.route-index-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-dark);
  color: #bad7d1;
  font-size: 0.68rem;
  font-weight: 900;
}

.route-index-head strong {
  color: #f3cf79;
}

.route-rail {
  position: relative;
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.route-rail::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 16px;
  width: 1px;
  background: rgba(124, 209, 194, 0.45);
}

.route-dot {
  position: relative;
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 35px;
  color: #d7e4e1;
}

.route-dot span:first-child {
  position: relative;
  z-index: 1;
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  background: var(--paper);
  border: 3px solid var(--sea-deep);
  border-radius: 50%;
  color: var(--sea-deep);
  font-size: 0.7rem;
  font-weight: 900;
}

.route-dot[data-kind="mythic"] span:first-child {
  background: #f3cf79;
}

.route-dot span:last-child {
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
}

.stack {
  display: grid;
  gap: 12px;
}

.stack .card {
  grid-template-columns: minmax(0, 1fr) 118px;
}

.stack .card .meta,
.stack .card h3,
.stack .card p {
  grid-column: 1;
}

.stack .done-button {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: stretch;
  min-height: 100%;
}

.compact .card {
  gap: 9px;
  padding: 17px;
  border-top-color: var(--clay);
}

.source-key {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 20px;
}

.source-key span {
  padding: 9px 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.source-key strong {
  color: var(--clay);
}

.source-link {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 7px 11px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 900;
  text-decoration: none;
}

.empty-state {
  padding: 22px;
  background: var(--paper);
  border: 1px dashed #aebbb7;
  border-radius: 8px;
  color: var(--muted);
}

.app-footer {
  padding: 34px 0;
  background: #101716;
  color: var(--paper);
}

.app-footer > div {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.app-footer span,
.app-footer p {
  color: #b9c5c2;
}

.app-footer p {
  max-width: 900px;
  margin-bottom: 0;
  line-height: 1.65;
}

.update-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100% - 36px);
  padding: 12px 12px 12px 16px;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
  color: var(--paper);
}

.update-notice[hidden] {
  display: none;
}

.update-notice button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: var(--aqua);
  color: var(--sea-deep);
  cursor: pointer;
  font-weight: 900;
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    gap: 34px;
  }

  h1 {
    font-size: 3rem;
  }

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

  .route-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .stack .card {
    grid-template-columns: 1fr;
  }

  .stack .card .meta,
  .stack .card h3,
  .stack .card p,
  .stack .done-button {
    grid-column: 1;
  }

  .stack .done-button {
    grid-row: auto;
    min-height: 39px;
  }
}

@media (max-width: 760px) {
  .topbar,
  .hero-grid,
  .hero-metrics,
  .research-tools,
  .section-band > *,
  .app-footer > * {
    width: min(calc(100% - 36px), var(--content));
  }

  .hero-grid {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 32px;
    padding-bottom: 28px;
  }

  .hero-copy {
    max-width: none;
  }

  .hero-object {
    grid-template-columns: minmax(150px, 0.45fr) minmax(0, 0.55fr);
    grid-template-rows: 230px;
    min-height: 230px;
  }

  .hero-object img {
    height: 230px;
  }

  .hero-object figcaption {
    align-self: center;
  }

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

  .hero-metrics p:nth-child(2) {
    border-right: 0;
  }

  .hero-metrics p:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-dark);
  }

  .research-tools,
  .section-title,
  .route-layout,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .section-band {
    padding: 54px 0;
  }

  .section-title {
    gap: 5px;
  }

  .section-title > p {
    padding-top: 0;
  }

  h2 {
    font-size: 1.9rem;
  }

  .route-index {
    position: relative;
    top: auto;
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .topbar {
    min-height: 54px;
  }

  .edition {
    font-size: 0.7rem;
  }

  .edition span {
    display: none;
  }

  .eyebrow {
    font-size: 0.7rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  .lede {
    font-size: 1rem;
  }

  .hero-actions {
    gap: 12px;
  }

  .primary-action,
  .text-action {
    font-size: 0.88rem;
  }

  .hero-object {
    grid-template-columns: 42% minmax(0, 1fr);
    grid-template-rows: 200px;
    min-height: 200px;
  }

  .hero-object img {
    height: 200px;
  }

  .hero-object figcaption {
    padding: 13px;
    font-size: 0.68rem;
  }

  .hero-metrics p {
    min-height: 68px;
    padding: 14px 12px;
  }

  .hero-metrics strong {
    font-size: 1.35rem;
  }

  nav.quick-nav {
    padding-right: 10px;
    padding-left: 10px;
  }

  .quick-nav a {
    min-height: 50px;
    padding: 0 11px;
    font-size: 0.78rem;
  }

  .research-tools {
    gap: 13px;
  }

  .search-box input {
    font-size: 0.92rem;
  }

  .progress-copy {
    display: grid;
    gap: 2px;
  }

  .section-band {
    padding: 46px 0;
  }

  h2 {
    font-size: 1.65rem;
  }

  .section-deck {
    font-size: 0.9rem;
  }

  .route-filter {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .route-filter button {
    flex: 1 0 auto;
  }

  .grid.seven {
    grid-template-columns: repeat(7, 82vw);
  }

  .card {
    padding: 17px;
  }

  .card-media {
    margin: -17px -17px 4px;
  }

  .card-media img {
    height: 220px;
  }

  .update-notice {
    right: 12px;
    bottom: 12px;
    left: 12px;
    justify-content: space-between;
    max-width: none;
  }
}

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

  .progress-meter span {
    transition: none;
  }
}
