@font-face {
  font-family: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Oswald";
  src: url("assets/oswald.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #121413;
  --paper: #f4f2e9;
  --lime: #d9ff43;
  --orange: #ff6138;
  --blue: #84b9ff;
  --muted: #a6aaa3;
  --line: rgba(244, 242, 233, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--ink);
  color-scheme: dark;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background: var(--ink);
  font-family: "Work Sans", Arial, sans-serif;
  -webkit-tap-highlight-color: rgba(217, 255, 67, 0.25);
}

button,
input,
select,
a {
  touch-action: manipulation;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  color: inherit;
}

button {
  cursor: pointer;
}

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

h1,
h2,
h3 {
  text-wrap: balance;
  scroll-margin-top: 2rem;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  color: var(--ink);
  background: var(--lime);
  font-weight: 700;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

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

.site-header {
  min-height: 78px;
  padding: 0 3.5vw;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.wordmark {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-family: "Oswald", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.wordmark-mark {
  width: 28px;
  height: 28px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--lime);
  transform: rotate(-4deg);
}

.wordmark-mark i {
  display: block;
  height: 4px;
  background: var(--ink);
}

.header-note {
  margin: 0;
  color: var(--muted);
}

.issue-line {
  margin: 0;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 97, 56, 0.16);
}

.intro {
  position: relative;
  min-height: 400px;
  padding: 54px 3.5vw 64px;
  display: grid;
  grid-template-columns: 150px minmax(560px, 890px) 1fr;
  gap: 3vw;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to right, transparent 38%, black);
}

.intro-kicker {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--lime);
  font: 0.68rem/1.3 "IBM Plex Mono", monospace;
  letter-spacing: 0.1em;
}

.intro-copy {
  position: relative;
  z-index: 1;
}

.intro h1 {
  max-width: 880px;
  margin: 0;
  font-family: "Oswald", Impact, sans-serif;
  font-size: clamp(4.6rem, 7.8vw, 8.5rem);
  line-height: 0.89;
  font-weight: 600;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.intro-copy > p {
  max-width: 610px;
  margin: 28px 0 0;
  color: #c9ccc5;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.5;
}

.route-map {
  position: absolute;
  z-index: 0;
  right: -20px;
  bottom: 6px;
  width: 430px;
  height: 300px;
  opacity: 0.85;
}

.route {
  position: absolute;
  display: block;
  height: 7px;
  border-radius: 99px;
  transform-origin: left;
}

.route-a { width: 410px; right: -70px; top: 75px; background: var(--lime); transform: rotate(-27deg); }
.route-b { width: 365px; right: -5px; top: 216px; background: var(--orange); transform: rotate(12deg); }
.route-c { width: 250px; right: 136px; top: 158px; background: var(--blue); transform: rotate(48deg); }

.station {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.s1 { top: 104px; right: 110px; }
.s2 { top: 187px; right: 214px; }
.s3 { top: 232px; right: 58px; }
.s4 { top: 66px; right: 33px; }

.browse {
  padding: 58px 3.5vw 100px;
}

.browse-title-row {
  margin-bottom: 30px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--lime);
  font: 0.7rem "IBM Plex Mono", monospace;
  letter-spacing: 0.12em;
}

.browse h2 {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-size: clamp(2.7rem, 4vw, 4.5rem);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.result-count {
  margin: 0 0 6px;
  color: var(--muted);
  font: 0.72rem "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.controls {
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(210px, 0.58fr) auto;
  border: 1px solid var(--line);
  background: #191c1a;
}

.search-field,
.select-field {
  min-width: 0;
  padding: 14px 18px 16px;
  border-right: 1px solid var(--line);
}

.search-field > span:first-child,
.select-field > span:first-child {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font: 0.62rem "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-input-wrap,
.select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input-wrap:focus-within,
.select-wrap:focus-within {
  color: var(--lime);
}

.search-input-wrap svg {
  flex: 0 0 auto;
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.search-input-wrap input,
.select-wrap select {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--paper);
  background: transparent;
  font-size: 1rem;
}

.search-input-wrap input::placeholder {
  color: #747972;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  appearance: none;
  padding-right: 28px;
  color: var(--paper);
  background-color: #191c1a;
}

.select-wrap svg {
  position: absolute;
  right: 0;
  width: 16px;
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.saved-toggle {
  min-width: 205px;
  padding: 15px 20px;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--paper);
  background: transparent;
  font-weight: 650;
  transition: color 160ms ease, background-color 160ms ease;
}

.saved-toggle:hover {
  background: #242824;
}

.saved-toggle[aria-pressed="true"] {
  color: var(--ink);
  background: var(--lime);
}

.saved-toggle svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.saved-toggle[aria-pressed="true"] svg {
  fill: currentColor;
}

.saved-count {
  min-width: 23px;
  height: 23px;
  padding: 3px 6px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 0.7rem/15px "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.story-card {
  min-width: 0;
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper);
}

.story-card:nth-child(5n + 1),
.story-card:nth-child(5n + 2) {
  grid-column: span 6;
}

.card-visual {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: #4b514c;
}

.story-card:nth-child(5n + 1) .card-visual,
.story-card:nth-child(5n + 2) .card-visual {
  height: 300px;
}

.card-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, transparent 45%, rgba(18,20,19,.58));
  pointer-events: none;
}

.card-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.08);
  transition: transform 500ms cubic-bezier(.2,.7,.2,1), filter 250ms ease;
}

.story-card:hover .card-visual img {
  transform: scale(1.035);
  filter: grayscale(0%) contrast(1.03);
}

.image-note {
  position: absolute;
  z-index: 2;
  left: 12px;
  bottom: 12px;
  padding: 4px 7px;
  color: var(--paper);
  background: rgba(18, 20, 19, 0.75);
  font: 0.55rem "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-number {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--ink);
  background: var(--lime);
  font: 0.75rem "IBM Plex Mono", monospace;
}

.card-copy {
  min-width: 0;
  flex: 1;
  padding: 22px 23px 20px;
  display: flex;
  flex-direction: column;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #5a5e59;
  font: 0.64rem "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.category {
  color: #2c5112;
  font-weight: 700;
}

.card-copy h3 {
  margin: 16px 0 10px;
  font-family: "Oswald", sans-serif;
  font-size: clamp(1.8rem, 2.4vw, 2.65rem);
  line-height: 1.05;
  font-weight: 520;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.story-card:nth-child(n + 3) .card-copy h3 {
  font-size: clamp(1.65rem, 2vw, 2.15rem);
}

.summary {
  margin: 0;
  color: #4f534e;
  line-height: 1.5;
  text-wrap: pretty;
}

.card-footer {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #c8c9c0;
}

.author {
  color: #5c605b;
  font: 0.68rem "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.open-item {
  padding: 10px 0 8px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  display: inline-flex;
  gap: 22px;
  color: var(--ink);
  background: transparent;
  font-size: 0.77rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 160ms ease, border-color 160ms ease;
}

.open-item:hover {
  color: #d73614;
  border-color: #d73614;
}

.empty-state {
  min-height: 380px;
  padding: 64px 24px;
  text-align: center;
  border: 1px dashed #525750;
}

.empty-code {
  margin: 0 0 18px;
  color: var(--orange);
  font: 0.7rem "IBM Plex Mono", monospace;
  letter-spacing: 0.1em;
}

.empty-state h3 {
  margin: 0;
  font: 500 3.5rem/1 "Oswald", sans-serif;
  text-transform: uppercase;
}

.empty-state > p:not(.empty-code) {
  margin: 16px 0 28px;
  color: var(--muted);
}

.empty-state button {
  padding: 13px 20px;
  border: 1px solid var(--lime);
  color: var(--ink);
  background: var(--lime);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color 160ms ease, background-color 160ms ease;
}

.empty-state button:hover {
  color: var(--lime);
  background: transparent;
}

.site-footer {
  min-height: 185px;
  padding: 38px 3.5vw max(38px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  color: var(--ink);
  background: var(--lime);
}

.footer-wordmark {
  font: 600 clamp(2.5rem, 5vw, 5rem)/0.9 "Oswald", sans-serif;
  letter-spacing: -0.04em;
}

.footer-wordmark span {
  color: var(--orange);
}

.site-footer p,
.site-footer a {
  margin: 0;
  font: 0.7rem "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-footer a {
  justify-self: end;
  text-underline-offset: 4px;
}

.site-footer a:hover {
  text-decoration-thickness: 3px;
}

.story-dialog {
  width: min(1160px, calc(100% - 48px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
  overscroll-behavior: contain;
}

.story-dialog::backdrop {
  background: rgba(7, 9, 8, 0.82);
  backdrop-filter: blur(7px);
}

.detail-shell {
  min-height: min(760px, calc(100dvh - 48px));
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(460px, 1.18fr);
}

.detail-aside {
  position: sticky;
  top: 0;
  height: min(760px, calc(100dvh - 48px));
  padding: 28px;
  display: flex;
  flex-direction: column;
  color: var(--paper);
  background: var(--ink);
}

.detail-aside img {
  width: 100%;
  height: 285px;
  display: block;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1);
}

.detail-aside-label {
  margin: 10px 0 0;
  color: var(--muted);
  font: 0.58rem "IBM Plex Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.detail-index {
  margin: auto 0 0;
  color: var(--lime);
  font: 600 clamp(5rem, 8vw, 8rem)/0.8 "Oswald", sans-serif;
}

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

.close-detail,
.save-item {
  min-height: 44px;
  border: 1px solid #6a6e68;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--paper);
  background: transparent;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.close-detail {
  width: 44px;
  padding: 0;
  justify-content: center;
  font-size: 1.3rem;
}

.save-item {
  padding: 0 14px;
}

.close-detail:hover,
.save-item:hover {
  border-color: var(--lime);
}

.save-item[aria-pressed="true"] {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--lime);
}

.save-item svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.save-item[aria-pressed="true"] svg {
  fill: currentColor;
}

.detail-article {
  min-width: 0;
  padding: 55px clamp(38px, 5vw, 80px) 70px;
}

.detail-category {
  margin: 0;
  color: #356412;
  font: 700 0.68rem "IBM Plex Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.detail-article h2 {
  margin: 18px 0 24px;
  font: 560 clamp(3.1rem, 5vw, 5.1rem)/0.96 "Oswald", sans-serif;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.detail-dek {
  margin: 0 0 25px;
  color: #454943;
  font-size: 1.15rem;
  line-height: 1.52;
  text-wrap: pretty;
}

.detail-byline {
  padding: 16px 0;
  border-top: 1px solid #c6c7be;
  border-bottom: 1px solid #c6c7be;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  color: #555952;
  font: 0.66rem "IBM Plex Mono", monospace;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.article-body {
  margin-top: 34px;
}

.article-body p {
  margin: 0 0 1.35em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.17rem;
  line-height: 1.72;
  text-wrap: pretty;
}

.article-body p:first-child::first-letter {
  float: left;
  margin: 0.06em 0.09em 0 0;
  color: #d73614;
  font: 600 4.5rem/0.75 "Oswald", sans-serif;
}

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

  .header-note {
    display: none;
  }

  .intro {
    grid-template-columns: 95px 1fr;
  }

  .route-map {
    right: -160px;
    opacity: .45;
  }

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

  .saved-toggle {
    grid-column: 1 / -1;
    min-height: 54px;
    border-top: 1px solid var(--line);
  }

  .select-field {
    border-right: 0;
  }

  .story-card,
  .story-card:nth-child(5n + 1),
  .story-card:nth-child(5n + 2) {
    grid-column: span 6;
  }

  .detail-shell {
    grid-template-columns: 1fr;
  }

  .detail-aside {
    position: relative;
    height: 330px;
  }

  .detail-aside img {
    position: absolute;
    inset: 0;
    height: 100%;
    opacity: .48;
  }

  .detail-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(18,20,19,.25), var(--ink));
  }

  .detail-controls,
  .detail-index,
  .detail-aside-label {
    position: relative;
    z-index: 1;
  }

  .detail-index {
    margin-top: auto;
  }

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

  .site-footer p {
    display: none;
  }
}

@media (max-width: 600px) {
  .site-header {
    min-height: 62px;
    padding: 0 18px;
  }

  .wordmark {
    font-size: 1.18rem;
  }

  .wordmark-mark {
    width: 24px;
    height: 24px;
  }

  .issue-line {
    font-size: .57rem;
  }

  .intro {
    min-height: 420px;
    padding: 32px 18px 38px;
    grid-template-columns: 1fr;
    align-content: space-between;
  }

  .intro-kicker {
    height: auto;
    flex-direction: row;
  }

  .intro h1 {
    font-size: clamp(3.75rem, 20vw, 5.1rem);
    line-height: .9;
  }

  .intro-copy > p {
    margin-top: 22px;
    font-size: 1rem;
  }

  .route-map {
    right: -250px;
    bottom: 40px;
  }

  .browse {
    padding: 42px 14px 72px;
  }

  .browse-title-row {
    display: block;
  }

  .browse h2 {
    font-size: 2.8rem;
  }

  .result-count {
    margin-top: 15px;
  }

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

  .search-field,
  .select-field {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .saved-toggle {
    grid-column: auto;
    border-top: 0;
  }

  .story-grid {
    gap: 14px;
  }

  .story-card,
  .story-card:nth-child(5n + 1),
  .story-card:nth-child(5n + 2) {
    grid-column: 1 / -1;
  }

  .card-visual,
  .story-card:nth-child(5n + 1) .card-visual,
  .story-card:nth-child(5n + 2) .card-visual {
    height: 210px;
  }

  .card-copy {
    padding: 20px;
  }

  .card-copy h3,
  .story-card:nth-child(n + 3) .card-copy h3 {
    font-size: 2rem;
  }

  .story-dialog {
    width: 100%;
    height: 100dvh;
    max-height: none;
  }

  .detail-shell {
    min-height: 100dvh;
  }

  .detail-aside {
    height: 265px;
    padding: max(18px, env(safe-area-inset-top)) 18px 22px;
  }

  .detail-index {
    font-size: 5rem;
  }

  .detail-article {
    padding: 38px 22px max(55px, env(safe-area-inset-bottom));
  }

  .detail-article h2 {
    font-size: 3.15rem;
  }

  .article-body p {
    font-size: 1.1rem;
  }

  .site-footer {
    min-height: 150px;
    padding-inline: 18px;
  }
}

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