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

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

@font-face {
  font-family: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --ink: #121314;
  --paper: #f3f1e9;
  --white: #fffef9;
  --blue: #2146c7;
  --yellow: #f2e84f;
  --coral: #f36f56;
  --pink: #f2a1bd;
  --line: 2px solid var(--ink);
  --display: "Oswald", "Arial Narrow", sans-serif;
  --sans: "Work Sans", Helvetica, sans-serif;
  --serif: "Literata", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
  scrollbar-color: var(--blue) var(--paper);
  scrollbar-width: thin;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.detail-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

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

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

:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
}

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

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

.issue-bar {
  min-height: 40px;
  padding: 8px clamp(16px, 3vw, 44px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  color: var(--white);
  background: var(--ink);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.issue-bar > :last-child {
  text-align: right;
}

.masthead {
  min-height: 226px;
  padding: 22px clamp(16px, 3vw, 44px) 18px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 240px;
  align-items: end;
  gap: 26px;
  color: var(--white);
  background: var(--blue);
  border-bottom: var(--line);
}

.masthead h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(4.8rem, 10.4vw, 6rem);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.04em;
}

.masthead p {
  margin: 0 0 4px;
  font-size: clamp(0.9rem, 1.25vw, 1.1rem);
  font-weight: 600;
  line-height: 1.35;
}

.masthead__mark {
  height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
  color: var(--ink);
  background: var(--yellow);
  border: var(--line);
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.browse-tools {
  padding: 24px clamp(16px, 3vw, 44px);
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(260px, 1.2fr) minmax(190px, 0.72fr) auto;
  align-items: end;
  gap: 18px;
  background: var(--yellow);
  border-bottom: var(--line);
}

.browse-tools__intro h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1;
  text-transform: uppercase;
}

.browse-tools__intro p {
  margin: 8px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-wrap,
.select-wrap {
  position: relative;
}

.search-wrap svg,
.select-wrap svg {
  position: absolute;
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.search-wrap svg {
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
}

.select-wrap svg {
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
}

input[type="search"],
select {
  width: 100%;
  height: 48px;
  color: var(--ink);
  background: var(--white);
  border: var(--line);
  border-radius: 0;
  font-weight: 580;
}

input[type="search"] {
  padding: 0 14px 0 46px;
  caret-color: var(--blue);
}

input[type="search"]::placeholder {
  color: #57574f;
  opacity: 1;
}

select {
  padding: 0 42px 0 14px;
  appearance: none;
}

.saved-toggle {
  min-height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--white);
  background: var(--ink);
  border: var(--line);
  border-radius: 0;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.03em;
}

.saved-toggle svg,
.save-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

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

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

.saved-count {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin-left: 4px;
  color: var(--ink);
  background: var(--yellow);
  border: 1px solid currentColor;
  font-variant-numeric: tabular-nums;
}

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

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

.story--wide {
  grid-column: span 6;
}

.story--lead {
  grid-column: 1 / -1;
  min-height: 480px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.8fr);
}

.story__media {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  background: var(--blue);
}

.story--wide .story__media {
  min-height: 310px;
}

.story--lead .story__media {
  min-height: 480px;
}

.story__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.04);
  transition: transform 550ms cubic-bezier(0.16, 1, 0.3, 1), filter 550ms cubic-bezier(0.16, 1, 0.3, 1);
}

.story:has(.story__open:hover) .story__media img {
  transform: scale(1.025);
  filter: saturate(1) contrast(1.02);
}

.illustration-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 8px;
  color: var(--ink);
  background: var(--yellow);
  border: 1px solid var(--ink);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.story__content {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.story--lead .story__content {
  padding: clamp(30px, 4vw, 58px);
  background: var(--coral);
}

.story__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.story__number {
  min-width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: var(--white);
  background: var(--blue);
  border: 1px solid var(--ink);
  font-family: var(--display);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.story--lead .story__number {
  color: var(--ink);
  background: var(--yellow);
}

.story__content h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(2rem, 3.2vw, 3.45rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  text-wrap: balance;
}

.story:not(.story--lead) .story__content h2 {
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
}

.story__summary {
  margin: 0 0 24px;
  max-width: 48ch;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.6;
}

.story__byline {
  margin: auto 0 16px;
  padding-top: 18px;
  border-top: 1px solid var(--ink);
  font-size: 0.72rem;
  font-weight: 650;
}

.story__open,
.empty-state button,
.reader-close,
.save-button {
  border-radius: 0;
}

.story__open {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--white);
  background: var(--ink);
  border: 2px solid var(--ink);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 180ms ease, background-color 180ms ease;
}

.story__open svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.story__open:hover {
  color: var(--ink);
  background: var(--yellow);
}

.story__open:hover svg {
  transform: translateX(5px);
}

.loading-state,
.empty-state {
  grid-column: 1 / -1;
  min-height: 360px;
  padding: 60px 20px;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--pink);
}

.empty-state__inner {
  max-width: 560px;
}

.empty-state h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(2.7rem, 6vw, 5rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.empty-state p {
  margin: 0 auto 24px;
  max-width: 46ch;
  font-family: var(--serif);
}

.empty-state button {
  padding: 12px 18px;
  color: var(--white);
  background: var(--ink);
  border: var(--line);
  font-weight: 750;
}

.site-footer {
  min-height: 300px;
  padding: 42px clamp(16px, 3vw, 44px);
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  align-items: end;
  gap: 40px;
  color: var(--white);
  background: var(--blue);
  border-top: var(--line);
}

.footer-wordmark {
  font-family: var(--display);
  font-size: clamp(4rem, 8vw, 6rem);
  font-weight: 700;
  line-height: 0.78;
  letter-spacing: -0.04em;
}

.site-footer > p {
  margin: 0;
  max-width: 26ch;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.35;
}

.footer-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.reader {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: var(--coral);
  border: 0;
  overflow: auto;
}

.reader::backdrop {
  background: rgba(18, 19, 20, 0.72);
}

.reader[open] {
  animation: reader-in 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes reader-in {
  from { clip-path: inset(0 0 0 100%); }
  to { clip-path: inset(0); }
}

.reader-shell {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(270px, 30vw) minmax(0, 1fr);
}

.reader-aside {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  background: var(--coral);
  border-right: var(--line);
}

.reader-aside__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.reader-close {
  min-height: 42px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  background: var(--ink);
  border: var(--line);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.reader-close svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.reader-aside__image {
  flex: 1;
  min-height: 260px;
  position: relative;
  overflow: hidden;
  border: var(--line);
}

.reader-aside__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reader-aside__meta {
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.reader-article {
  width: min(860px, calc(100% - 48px));
  min-height: calc(100dvh - 48px);
  margin: 24px;
  padding: clamp(34px, 6vw, 86px);
  background: var(--white);
  box-shadow: 0 20px 45px rgba(18, 19, 20, 0.22);
}

.reader-article__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 54px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}

.reader-category {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.save-button {
  min-height: 42px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  background: var(--yellow);
  border: var(--line);
  font-size: 0.72rem;
  font-weight: 760;
}

.save-button[aria-pressed="true"] {
  color: var(--white);
  background: var(--blue);
}

.reader-article h2 {
  margin: 0 0 24px;
  max-width: 12ch;
  font-family: var(--display);
  font-size: clamp(3.2rem, 6vw, 5.5rem);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-wrap: balance;
}

.reader-deck {
  margin: 0 0 38px;
  max-width: 54ch;
  font-family: var(--serif);
  font-size: clamp(1.18rem, 2vw, 1.4rem);
  font-weight: 500;
  line-height: 1.5;
}

.reader-byline {
  margin-bottom: 48px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.reader-body {
  max-width: 68ch;
  font-family: var(--serif);
  font-size: clamp(1.06rem, 1.4vw, 1.2rem);
  line-height: 1.78;
}

.reader-body p {
  margin: 0 0 1.45em;
}

.reader-body p:first-child::first-letter {
  float: left;
  margin: 0.05em 0.12em 0 0;
  color: var(--blue);
  font-family: var(--display);
  font-size: 4.9em;
  font-weight: 600;
  line-height: 0.72;
}

@media (max-width: 1000px) {
  .browse-tools {
    grid-template-columns: 1fr 1fr;
  }

  .browse-tools__intro {
    grid-column: 1 / -1;
  }

  .story {
    grid-column: span 6;
  }

  .story--lead {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .issue-bar {
    grid-template-columns: 1fr auto;
    min-height: 38px;
    gap: 10px;
    font-size: 0.62rem;
  }

  .issue-bar__center {
    display: none;
  }

  .masthead {
    min-height: 178px;
    padding: 18px 16px 16px;
    grid-template-columns: 48px 1fr;
    gap: 14px;
  }

  .masthead h1 {
    min-width: 0;
    font-size: clamp(3.3rem, 15.5vw, 4.2rem);
  }

  .masthead p {
    grid-column: 2;
    font-size: 0.78rem;
  }

  .masthead__mark {
    grid-row: 1 / span 2;
    height: 100%;
    min-height: 98px;
    font-size: 0.62rem;
  }

  .browse-tools {
    padding: 20px 16px;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .browse-tools__intro,
  .saved-toggle {
    grid-column: auto;
  }

  .saved-toggle {
    justify-content: center;
  }

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

  .story,
  .story--wide,
  .story--lead {
    grid-column: 1;
  }

  .story--lead {
    min-height: 0;
    display: flex;
  }

  .story__media,
  .story--wide .story__media,
  .story--lead .story__media {
    min-height: 250px;
    aspect-ratio: 4 / 3;
  }

  .story--lead .story__content {
    padding: 24px 20px;
  }

  .story__meta {
    margin-bottom: 20px;
  }

  .story__content h2,
  .story:not(.story--lead) .story__content h2 {
    font-size: 2.15rem;
  }

  .site-footer {
    min-height: 360px;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 28px;
  }

  .footer-wordmark {
    font-size: 5.6rem;
  }

  .reader-shell {
    display: block;
  }

  .reader-aside {
    position: relative;
    height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: var(--line);
  }

  .reader-aside__brand {
    margin-bottom: 14px;
  }

  .reader-aside__image {
    min-height: 180px;
    height: 32vh;
    flex: none;
  }

  .reader-aside__meta {
    padding-top: 12px;
  }

  .reader-article {
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    padding: 34px 20px 64px;
    box-shadow: none;
  }

  .reader-article__topline {
    margin-bottom: 38px;
  }

  .reader-article h2 {
    font-size: clamp(3.1rem, 14vw, 4.5rem);
  }
}

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

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