:root {
  --ink: #17383a;
  --ink-deep: #0d292b;
  --paper: #f4efe2;
  --paper-light: #fbf8ef;
  --rule: #c9c2b1;
  --muted: #66736f;
  --pass: #25876b;
  --pass-dark: #17624f;
  --limited: #d47d24;
  --limited-dark: #93500d;
  --gold: #f0cf71;
  --sans: "Trebuchet MS", "Gill Sans", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 24%, rgba(212, 125, 36, 0.08), transparent 27rem),
    linear-gradient(135deg, var(--paper-light), var(--paper));
  font-family: var(--sans);
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button,
select {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  color: var(--paper-light);
  background: var(--ink-deep);
  transform: translateY(-150%);
}

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

.hero {
  position: relative;
  overflow: hidden;
  min-height: 680px;
  padding: 1.2rem clamp(1.25rem, 5vw, 5rem) 3rem;
  color: var(--paper-light);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 34px 34px,
    radial-gradient(circle at 83% 34%, rgba(240, 207, 113, 0.14), transparent 22rem),
    var(--ink-deep);
}

.hero::after {
  position: absolute;
  right: -9rem;
  bottom: -17rem;
  width: 42rem;
  height: 42rem;
  border: 1px solid rgba(240, 207, 113, 0.25);
  border-radius: 50%;
  box-shadow:
    0 0 0 4rem rgba(240, 207, 113, 0.035),
    0 0 0 9rem rgba(240, 207, 113, 0.02);
  content: "";
}

.topbar,
.hero__grid,
.hero__finding,
.atlas-shell,
.reading-guide,
.conclusion,
footer {
  width: min(100%, 1440px);
  margin-inline: auto;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
}

.wordmark span {
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar__links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: clamp(3rem, 7vw, 8rem);
  align-items: end;
  padding-block: clamp(5rem, 10vw, 8rem) 4rem;
}

.eyebrow {
  margin: 0 0 1.2rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow--dark {
  color: var(--limited-dark);
}

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

h1 {
  max-width: 900px;
  margin-bottom: 1.8rem;
  font-family: var(--serif);
  font-size: clamp(3.4rem, 7.3vw, 7.7rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.96;
}

h1 em {
  color: var(--gold);
  font-weight: 400;
}

.lede {
  max-width: 650px;
  margin-bottom: 0;
  color: #c9d3ce;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.65;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.26);
  border-left: 1px solid rgba(255, 255, 255, 0.26);
}

.scoreboard div {
  display: flex;
  min-height: 112px;
  padding: 1rem;
  flex-direction: column-reverse;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.26);
  border-bottom: 1px solid rgba(255, 255, 255, 0.26);
}

.scoreboard dt {
  color: #aebdb7;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scoreboard dd {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1.08;
}

.scoreboard__pass dd {
  color: #82d5b8;
}

.scoreboard__limited dd {
  color: #f1a958;
}

.hero__finding {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 800px);
  gap: 1rem;
  align-items: start;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.finding-index {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.8rem;
}

.hero__finding p {
  margin-bottom: 0;
  color: #b9c7c2;
  line-height: 1.6;
}

.hero__finding strong {
  color: var(--paper-light);
}

.atlas-shell {
  padding: clamp(4.5rem, 8vw, 8rem) clamp(1.25rem, 4vw, 4rem);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  gap: 3rem;
  align-items: end;
  margin-bottom: 3rem;
}

.section-heading h2,
.reading-guide h2,
.conclusion h2 {
  margin-bottom: 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5vw, 5.2rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.section-intro {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.controls {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1.1fr auto auto;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  border: 1px solid var(--rule);
  background: rgba(251, 248, 239, 0.72);
}

.controls label {
  display: grid;
  gap: 0.45rem;
}

.controls label span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

select,
.button {
  min-height: 44px;
  border: 1px solid var(--rule);
  border-radius: 0;
}

select {
  width: 100%;
  padding: 0.65rem 2rem 0.65rem 0.75rem;
  color: var(--ink);
  background: var(--paper-light);
}

.button {
  display: inline-flex;
  padding: 0.7rem 1rem;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.button:hover,
.button:focus-visible {
  border-color: var(--ink);
}

.button--signal {
  color: #fffaf0;
  border-color: var(--limited-dark);
  background: var(--limited-dark);
}

.button--dark {
  color: var(--paper-light);
  border-color: var(--ink);
  background: var(--ink);
}

.button--quiet {
  background: var(--paper-light);
}

.atlas-status {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
}

.atlas-status p {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
}

.legend {
  display: flex;
  gap: 1.4rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.legend span {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}

.legend__swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  background: var(--pass);
}

.legend__swatch--limited {
  background: var(--limited);
}

.atlas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
  padding-top: 2rem;
}

.heatmap-panel {
  min-width: 0;
}

.slot-header,
.mission-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) repeat(20, minmax(25px, 1fr));
  gap: 3px;
}

.slot-header {
  margin-bottom: 0.5rem;
  align-items: end;
}

.slot-header__label {
  padding: 0 0.55rem 0.35rem;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.slot-header__slot {
  padding-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
}

.batch-group {
  margin-bottom: 1.4rem;
}

.batch-heading {
  display: flex;
  margin: 0 0 0.45rem;
  align-items: center;
  gap: 0.75rem;
  color: var(--limited-dark);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.batch-heading::after {
  height: 1px;
  flex: 1;
  background: var(--rule);
  content: "";
}

.mission-row {
  margin-bottom: 3px;
}

.mission-label {
  display: flex;
  min-width: 0;
  padding: 0 0.55rem;
  align-items: center;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell,
.cell-placeholder {
  aspect-ratio: 1.05;
  min-width: 0;
  border: 0;
  border-radius: 3px;
}

.cell {
  position: relative;
  display: grid;
  padding: 0;
  place-items: center;
  color: white;
  background: var(--pass);
  cursor: pointer;
  font-size: clamp(0.45rem, 0.7vw, 0.64rem);
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.cell:hover,
.cell:focus-visible,
.cell[aria-pressed="true"] {
  z-index: 2;
  outline: 2px solid var(--paper-light);
  box-shadow: 0 0 0 4px var(--ink);
  transform: scale(1.13);
}

.cell--limited {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16) 25%, transparent 25%) 0 0 / 7px 7px,
    var(--limited);
}

.cell-placeholder {
  border: 1px dashed rgba(102, 115, 111, 0.24);
}

.empty-state {
  padding: 3rem 1rem;
  border: 1px dashed var(--rule);
  color: var(--muted);
  text-align: center;
}

.detail-panel {
  position: sticky;
  top: 1rem;
  min-height: 480px;
  padding: 1.5rem;
  color: var(--paper-light);
  background:
    linear-gradient(145deg, transparent 74%, rgba(240, 207, 113, 0.08) 74%),
    var(--ink-deep);
}

.detail-panel__kicker {
  margin-bottom: 2rem;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.detail-panel h3 {
  margin-bottom: 1rem;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
}

.detail-panel__empty {
  color: #aebdb7;
  line-height: 1.65;
}

.status-chip {
  display: inline-flex;
  margin-bottom: 1.4rem;
  padding: 0.4rem 0.55rem;
  color: #dff8ed;
  border: 1px solid #56a98e;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.status-chip--limited {
  color: #ffddad;
  border-color: #e9a252;
}

.detail-list {
  margin: 0;
}

.detail-list div {
  padding: 0.8rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.detail-list dt {
  margin-bottom: 0.35rem;
  color: #8fa29b;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
  line-height: 1.45;
}

.detail-list a {
  color: var(--gold);
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.detail-actions .button--quiet {
  color: var(--ink);
}

.reading-guide {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(3rem, 9vw, 9rem);
  padding: clamp(4.5rem, 8vw, 8rem) clamp(1.25rem, 5vw, 5rem);
  border-top: 1px solid var(--rule);
}

.reading-guide__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.reading-guide__steps li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}

.reading-guide__steps li:last-child {
  border-bottom: 1px solid var(--rule);
}

.reading-guide__steps span {
  color: var(--limited-dark);
  font-family: var(--serif);
  font-size: 1.35rem;
}

.reading-guide__steps h3 {
  margin-bottom: 0.45rem;
  font-family: var(--serif);
  font-size: 1.4rem;
}

.reading-guide__steps p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.conclusion {
  padding: clamp(4.5rem, 9vw, 9rem) clamp(1.25rem, 8vw, 8rem);
  color: var(--paper-light);
  background: var(--ink);
}

.conclusion h2 {
  max-width: 1100px;
  margin-bottom: 2rem;
}

.conclusion > p:not(.eyebrow) {
  max-width: 760px;
  color: #c7d1cc;
  font-size: 1.08rem;
  line-height: 1.75;
}

.conclusion__links {
  display: flex;
  margin-top: 3rem;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

footer {
  display: flex;
  padding: 2rem clamp(1.25rem, 5vw, 5rem);
  justify-content: space-between;
  gap: 2rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

footer p {
  margin: 0;
}

@media (max-width: 1120px) {
  .hero__grid,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .scoreboard {
    max-width: 650px;
  }

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

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

  .detail-panel {
    position: static;
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .hero {
    min-height: auto;
    padding-inline: 1.1rem;
  }

  .topbar__links a:first-child,
  .topbar__links a:nth-child(2) {
    display: none;
  }

  .hero__grid {
    gap: 2.5rem;
    padding-block: 4.5rem 3rem;
  }

  h1 {
    font-size: clamp(3rem, 15vw, 5rem);
  }

  .scoreboard div {
    min-height: 96px;
  }

  .hero__finding {
    grid-template-columns: 2.5rem 1fr;
  }

  .atlas-shell {
    padding-inline: 1rem;
  }

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

  .controls label {
    grid-column: 1 / -1;
  }

  .atlas-status {
    padding-block: 0.8rem;
    align-items: flex-start;
    flex-direction: column;
  }

  .slot-header {
    display: none;
  }

  .mission-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 1.1rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--rule);
  }

  .mission-label {
    grid-column: 1 / -1;
    padding: 0.2rem 0;
    font-family: var(--serif);
    font-size: 1.05rem;
  }

  .cell {
    aspect-ratio: 1.8;
    font-size: 0.7rem;
  }

  .cell-placeholder {
    aspect-ratio: 1.8;
  }

  .reading-guide {
    grid-template-columns: 1fr;
  }

  .conclusion {
    margin-inline: 0;
  }

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

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
