/* Commonplace — a field guide to the everyday city. */

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

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

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

:root {
  --paper: #eef0e7;
  --paper-deep: #dfe4d5;
  --ink: #10140e;
  --ink-soft: #3c4637;
  --signal: #d7ff4a;
  --signal-deep: #b9e62e;
  --flare: #b8350a;
  --focus: #5b3df5;
  --line: rgba(16, 20, 14, 0.24);
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --pad: clamp(18px, 3.35vw, 48px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
  scrollbar-color: var(--ink) var(--paper);
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-width: 300px;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(16, 20, 14, 0.11) 0.55px, transparent 0.55px);
  background-size: 9px 9px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: var(--paper);
  border-left: 1px solid var(--line);
}

::-webkit-scrollbar-thumb {
  background: var(--ink);
  border: 3px solid var(--paper);
}

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

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--signal);
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  transform: translateY(-160%);
}

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

/* ---------- Masthead ---------- */

.masthead {
  position: relative;
  z-index: 30;
  background: var(--signal);
  border-bottom: 1px solid var(--ink);
}

.masthead::after {
  content: "";
  position: absolute;
  right: var(--pad);
  bottom: -5px;
  width: 72px;
  height: 5px;
  background: var(--ink);
}

.masthead__inner {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: clamp(18px, 3vw, 46px);
  align-items: center;
  min-height: 76px;
  padding: 10px var(--pad);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  width: fit-content;
}

.brand__mark {
  width: 27px;
  height: 27px;
  fill: currentColor;
  transition: transform 450ms var(--ease);
}

.brand:hover .brand__mark {
  transform: rotate(90deg);
}

.brand__name {
  font-family: var(--sans);
  font-size: clamp(23px, 2vw, 28px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand__dot {
  width: 7px;
  height: 7px;
  margin-top: 12px;
  background: var(--flare);
}

.masthead__tagline,
.masthead__issue,
.masthead__saved {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.11em;
  line-height: 1.5;
  text-transform: uppercase;
}

.masthead__tagline {
  justify-self: center;
}

.masthead__issue {
  display: flex;
  gap: 18px;
  padding-left: 26px;
  border-left: 1px solid var(--ink);
}

.masthead__saved {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.masthead__saved svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

/* ---------- Intro ---------- */

.intro {
  display: grid;
  grid-template-columns: 58px minmax(0, 1.55fr) minmax(280px, 0.62fr);
  gap: clamp(24px, 3.8vw, 58px);
  align-items: end;
  padding: clamp(34px, 4.4vw, 56px) var(--pad) clamp(26px, 3.2vw, 40px);
}

.intro__rail {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0 3px;
  border-right: 1px solid var(--ink);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro__rail span:last-child {
  color: var(--flare);
}

.intro__main {
  min-width: 0;
}

.intro h1 {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(54px, 6.1vw, 88px);
  font-weight: 600;
  line-height: 0.91;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.marked {
  position: relative;
  display: inline-block;
  padding: 0 0.06em 0.04em;
  isolation: isolate;
}

.marked::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: -0.03em;
  bottom: 0.02em;
  height: 0.52em;
  background: var(--signal);
  transform: skewX(-5deg);
  transform-origin: left bottom;
}

.marked::after {
  content: "";
  position: absolute;
  right: -0.18em;
  bottom: 0.08em;
  width: 0.1em;
  height: 0.1em;
  background: var(--flare);
}

.intro__aside {
  max-width: 390px;
  padding-top: 15px;
  border-top: 2px solid var(--ink);
}

.lede {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(16.5px, 1.32vw, 19px);
  line-height: 1.58;
  text-wrap: pretty;
}

.signature {
  margin: 21px 0 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  line-height: 1.8;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Toolbar ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 184px auto minmax(112px, auto);
  gap: 14px;
  align-items: end;
  padding: 12px var(--pad);
  background: rgba(238, 240, 231, 0.97);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  backdrop-filter: blur(8px);
}

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin: 0 0 5px 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  line-height: 1.3;
  text-transform: uppercase;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 48px;
  border: 1px solid var(--ink);
  background: rgba(255, 255, 255, 0.18);
  transition: background 220ms ease;
}

.search-wrap:focus-within {
  background: #f7f8f1;
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.field__icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-left: 14px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linecap: round;
}

#search {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 8px 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 16px;
  letter-spacing: -0.01em;
  caret-color: var(--flare);
}

#search::placeholder {
  color: #626b5d;
  opacity: 1;
}

#search::-webkit-search-cancel-button {
  appearance: none;
}

.clear-search {
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-right: 4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
}

.clear-search svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.select-wrap {
  position: relative;
}

#category {
  appearance: none;
  width: 100%;
  height: 48px;
  padding: 0 38px 0 13px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.18);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.select-wrap__chevron {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.saved-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  padding: 0 15px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background 180ms ease, color 180ms ease;
}

.saved-toggle > svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.saved-toggle__count {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 10.5px;
}

.saved-toggle:hover {
  background: var(--paper-deep);
}

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

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

.results {
  align-self: center;
  justify-self: end;
  margin: 15px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- Story list ---------- */

.stories {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px var(--pad) 0;
  scroll-margin-top: 88px;
}

.loading {
  margin: 0;
  padding: 40px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  min-height: 474px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.feature__figure {
  position: relative;
  margin: 0;
  min-height: 380px;
  overflow: hidden;
  border-right: 1px solid rgba(238, 240, 231, 0.3);
  background: #252b21;
}

.feature__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.03);
  transition: transform 900ms var(--ease), filter 500ms ease;
}

.feature:hover .feature__figure img {
  transform: scale(1.025);
  filter: saturate(1) contrast(1.02);
}

.feature__caption {
  position: absolute;
  top: 16px;
  left: 16px;
  margin: 0;
  padding: 5px 8px 4px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.11em;
  line-height: 1.4;
  text-transform: uppercase;
}

.feature__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(28px, 3.4vw, 50px);
}

.feature__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--signal);
}

.feature__title {
  max-width: 12ch;
  margin: 18px 0 20px;
  font-family: var(--sans);
  font-size: clamp(38px, 4.35vw, 64px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--signal);
  text-wrap: balance;
}

.feature__summary {
  max-width: 45ch;
  margin: 0;
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.58;
  color: #e7ebde;
  text-wrap: pretty;
}

.feature__byline {
  margin: 23px 0 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
  color: #b8c0ae;
}

.open-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.open-item svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 240ms var(--ease);
}

.open-item:hover svg {
  transform: translateX(4px);
}

.feature .open-item {
  margin-top: 28px;
  border-color: var(--signal);
  background: var(--signal);
  color: var(--ink);
}

.feature .open-item:hover {
  background: var(--paper);
  border-color: var(--paper);
}

.story-row {
  display: grid;
  grid-template-columns: 48px 132px minmax(0, 1fr) 126px auto;
  gap: clamp(14px, 2vw, 28px);
  align-items: center;
  padding: 21px 5px;
  border-bottom: 1px solid var(--line);
  transition: background 240ms ease;
}

.story-row:hover {
  background: rgba(215, 255, 74, 0.27);
}

.story-row__index {
  align-self: start;
  padding-top: 5px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--flare);
}

.story-row__thumb {
  width: 132px;
  aspect-ratio: 3 / 2;
  margin: 0;
  overflow: hidden;
  background: var(--paper-deep);
}

.story-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.6) contrast(0.98);
  transition: filter 400ms ease, transform 700ms var(--ease);
}

.story-row:hover .story-row__thumb img {
  filter: saturate(1) contrast(1.02);
  transform: scale(1.04);
}

.story-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.11em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.topic {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

.topic::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--flare);
}

.row-saved {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--flare);
}

.row-saved svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.story-row__title {
  margin: 6px 0 7px;
  font-family: var(--sans);
  font-size: clamp(21px, 1.85vw, 26px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.027em;
  text-wrap: balance;
}

.story-row__summary {
  max-width: 66ch;
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.story-row__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.readtime {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.story-row .open-item {
  min-height: 44px;
  padding: 0 13px;
  border-color: var(--line);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.story-row .open-item:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--signal);
}

/* ---------- Empty state ---------- */

.empty-state {
  position: relative;
  min-height: 340px;
  padding: clamp(36px, 5vw, 70px);
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.empty-state::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -140px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(215, 255, 74, 0.45);
  border-radius: 50%;
}

.empty-state__index {
  margin: 0 0 24px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
}

.empty-state__title {
  max-width: 12ch;
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(40px, 4.8vw, 68px);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.04em;
  color: var(--signal);
}

.empty-state__copy {
  max-width: 48ch;
  margin: 20px 0 28px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: #e3e8da;
}

.empty-state__reset {
  position: relative;
  z-index: 1;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--signal);
  border-radius: 0;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
}

.empty-state__reset:hover {
  background: var(--paper);
  border-color: var(--paper);
}

/* ---------- Footer ---------- */

.footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(24px, 4vw, 60px);
  align-items: end;
  margin-top: 56px;
  padding: clamp(30px, 4vw, 48px) var(--pad);
  background: var(--ink);
  color: var(--paper);
}

.footer__brand {
  display: grid;
  gap: 8px;
}

.footer__name {
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--signal);
}

.footer__issue,
.footer__end {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.11em;
  line-height: 1.6;
  text-transform: uppercase;
  color: #b8c0ae;
}

.footer__note {
  max-width: 72ch;
  margin: 0;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.6;
  color: #c9d0c0;
}

.footer__end {
  max-width: 20ch;
  text-align: right;
  justify-self: end;
  color: var(--signal);
}

/* ---------- Detail ---------- */

.detail {
  border-top: 1px solid var(--ink);
  background: var(--paper);
}

.detail-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 56px;
  padding: 8px var(--pad);
  border-bottom: 1px solid var(--ink);
  background: rgba(238, 240, 231, 0.96);
  backdrop-filter: blur(8px);
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.back-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms var(--ease);
}

.back-button:hover svg {
  transform: translateX(-4px);
}

.back-button:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.detail-bar__label {
  margin: 0 0 0 auto;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.progress {
  position: relative;
  width: clamp(90px, 18vw, 240px);
  height: 3px;
  overflow: hidden;
  background: var(--line);
}

.progress__fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--flare);
  transition: width 100ms linear;
}

.article {
  max-width: 1188px;
  margin: 0 auto;
  padding: clamp(34px, 5.2vw, 68px) var(--pad) clamp(48px, 6vw, 80px);
}

.article__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: clamp(32px, 5.2vw, 68px);
  align-items: end;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--ink);
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px 4px;
  background: var(--ink);
  color: var(--signal);
}

.topic-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--signal);
}

.article__title {
  max-width: 14ch;
  margin: 18px 0 18px;
  font-family: var(--sans);
  font-size: clamp(42px, 5.2vw, 82px);
  font-weight: 600;
  line-height: 0.93;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.article__summary {
  max-width: 56ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.52;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.article__aside {
  display: grid;
  gap: 14px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
}

.byline {
  display: grid;
  gap: 2px;
  margin: 0;
}

.byline__label,
.article-datum__label {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.13em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.byline__name,
.article-datum__value {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.45;
}

.save-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  min-height: 52px;
  margin-top: 6px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  transition: background 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.save-button > svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.save-button:hover {
  background: var(--paper-deep);
}

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

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

.save-button.is-popping > svg {
  animation: bookmark-pop 420ms var(--ease);
}

@keyframes bookmark-pop {
  0% { transform: scale(1) rotate(0); }
  38% { transform: scale(1.28) rotate(-6deg); }
  70% { transform: scale(0.94) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

.article__figure {
  position: relative;
  aspect-ratio: 16 / 7.2;
  margin: 34px 0 0;
  overflow: hidden;
  background: var(--paper-deep);
}

.article__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.86) contrast(1.02);
}

.article__figure figcaption {
  position: absolute;
  right: 14px;
  bottom: 14px;
  margin: 0;
  padding: 5px 8px 4px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
}

.article__body-wrap {
  display: grid;
  grid-template-columns: 176px minmax(0, 700px);
  gap: clamp(28px, 5.2vw, 64px);
  max-width: 1000px;
  margin: clamp(34px, 5vw, 58px) auto 0;
}

.article__rail {
  position: sticky;
  top: 82px;
  align-self: start;
  display: grid;
  gap: 19px;
  padding-top: 13px;
  border-top: 1px solid var(--ink);
}

.article-datum {
  display: grid;
  gap: 3px;
  margin: 0;
}

.article__body {
  font-family: var(--serif);
  font-size: clamp(18px, 1.43vw, 20.5px);
  line-height: 1.78;
  color: #1b2019;
}

.article__body p {
  margin: 0 0 1.25em;
  text-wrap: pretty;
}

.article__body p:first-child::first-letter {
  float: left;
  margin: 0.05em 0.09em 0 0;
  font-family: var(--sans);
  font-size: 4.15em;
  font-weight: 600;
  line-height: 0.72;
  color: var(--flare);
}

.article__body p:last-child {
  margin-bottom: 0;
}

.article__end {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 34px 0 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.article__end::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--flare);
}

.related {
  max-width: 1000px;
  margin: clamp(54px, 7vw, 82px) auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--ink);
}

.related__title {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.related__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}

.related__link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 17px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background 200ms ease, padding 200ms ease;
}

.related__link:hover {
  background: rgba(215, 255, 74, 0.27);
  padding-left: 10px;
  padding-right: 10px;
}

.related__link-main {
  display: grid;
  gap: 4px;
}

.related__link-topic {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--flare);
}

.related__link-title {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.related__link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.article__back {
  display: flex;
  justify-content: center;
  max-width: 1000px;
  margin: 42px auto 0;
}

.article__back .open-item:hover svg {
  transform: translateX(-4px);
}

/* Detail entrance: one authored moment. */
.detail.is-entering .article__head,
.detail.is-entering .article__figure,
.detail.is-entering .article__body-wrap {
  animation: detail-rise 620ms var(--ease) both;
}

.detail.is-entering .article__figure {
  animation-delay: 70ms;
}

.detail.is-entering .article__body-wrap {
  animation-delay: 130ms;
}

@keyframes detail-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .masthead__tagline {
    display: none;
  }

  .masthead__inner {
    grid-template-columns: auto 1fr auto;
  }

  .masthead__issue {
    justify-self: end;
  }

  .intro {
    grid-template-columns: 46px minmax(0, 1.55fr) minmax(245px, 0.62fr);
  }

  .toolbar {
    grid-template-columns: minmax(200px, 1fr) 166px auto;
  }

  .results {
    grid-column: 1 / -1;
    justify-self: start;
    margin: 0 0 0 2px;
  }

  .story-row {
    grid-template-columns: 42px 112px minmax(0, 1fr) auto;
  }

  .story-row__thumb {
    width: 112px;
  }

  .story-row__side .readtime {
    display: none;
  }

  .story-row__summary {
    max-width: 58ch;
  }

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

@media (max-width: 820px) {
  .masthead__issue {
    display: none;
  }

  .masthead__inner {
    grid-template-columns: auto 1fr;
    min-height: 68px;
  }

  .masthead__saved {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin-top: 0;
  }

  .intro {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .intro__aside {
    grid-column: 2;
    max-width: 520px;
    margin-top: 4px;
  }

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

  .feature__figure {
    min-height: 300px;
    aspect-ratio: 16 / 9;
    border-right: 0;
    border-bottom: 1px solid rgba(238, 240, 231, 0.3);
  }

  .feature__body {
    padding: 30px;
  }

  .feature__title {
    max-width: 17ch;
  }

  .article__head {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .article__aside {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .save-button {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
  }

  .article__body-wrap {
    grid-template-columns: 1fr;
  }

  .article__rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    border-top: 1px solid var(--line);
  }

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

  .footer__note {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .footer__end {
    justify-self: end;
  }
}

@media (max-width: 640px) {
  :root {
    --pad: 18px;
  }

  .masthead__inner {
    gap: 12px;
    min-height: 62px;
  }

  .brand {
    gap: 8px;
  }

  .brand__mark {
    width: 22px;
    height: 22px;
  }

  .brand__name {
    font-size: 22px;
  }

  .brand__dot {
    width: 5px;
    height: 5px;
    margin-top: 10px;
  }

  .masthead__saved {
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 32px;
    padding-bottom: 28px;
  }

  .intro__rail {
    display: none;
  }

  .intro h1 {
    font-size: clamp(42px, 12.5vw, 58px);
  }

  .intro__aside {
    grid-column: 1;
    padding-top: 13px;
    max-width: none;
  }

  .lede {
    font-size: 16px;
  }

  .signature {
    margin-top: 14px;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .field--search {
    grid-column: 1 / -1;
  }

  .search-wrap,
  #category,
  .saved-toggle {
    height: 44px;
  }

  .saved-toggle {
    padding: 0 9px;
    font-size: 12.5px;
    gap: 6px;
  }

  .saved-toggle > svg {
    width: 14px;
    height: 14px;
  }

  .saved-toggle__count {
    min-width: 20px;
    height: 20px;
    font-size: 9.5px;
  }

  .results {
    grid-column: 1 / -1;
    margin-top: 2px;
  }

  .stories {
    padding-top: 18px;
  }

  .feature {
    min-height: 0;
  }

  .feature__figure {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .feature__body {
    padding: 24px 20px 26px;
  }

  .feature__title {
    margin-top: 14px;
    font-size: clamp(34px, 10vw, 44px);
  }

  .feature__summary {
    font-size: 16px;
  }

  .feature .open-item {
    margin-top: 22px;
  }

  .story-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 18px 2px;
  }

  .story-row__index {
    padding-top: 3px;
    font-size: 9.5px;
  }

  .story-row__thumb {
    display: none;
  }

  .story-row__title {
    margin-top: 5px;
    font-size: 21px;
    line-height: 1.08;
  }

  .story-row__summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 14px;
    line-height: 1.45;
  }

  .story-row__side {
    padding-top: 2px;
  }

  .story-row .open-item {
    min-height: 44px;
    padding: 0 10px;
    border-color: var(--ink);
    font-size: 10px;
  }

  .empty-state {
    min-height: 300px;
    padding: 32px 22px;
  }

  .empty-state__title {
    font-size: 40px;
  }

  .footer {
    grid-template-columns: 1fr;
    gap: 22px;
    margin-top: 38px;
    padding-top: 30px;
    padding-bottom: 34px;
  }

  .footer__note,
  .footer__end {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    text-align: left;
  }

  .detail-bar {
    gap: 12px;
    min-height: 52px;
  }

  .detail-bar__label {
    display: none;
  }

  .progress {
    margin-left: auto;
    width: 112px;
  }

  .article {
    padding-top: 30px;
  }

  .article__head {
    padding-bottom: 24px;
  }

  .article__title {
    font-size: clamp(38px, 11.4vw, 52px);
    line-height: 0.95;
  }

  .article__summary {
    font-size: 17.5px;
  }

  .article__aside {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .save-button {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  .article__figure {
    aspect-ratio: 4 / 3;
    margin-top: 24px;
  }

  .article__body-wrap {
    margin-top: 30px;
  }

  .article__rail {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .article__body {
    font-size: 18px;
    line-height: 1.75;
  }

  .article__body p:first-child::first-letter {
    font-size: 3.7em;
  }

  .related {
    margin-top: 52px;
  }

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

  .related__link-title {
    font-size: 17px;
  }
}

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

  .detail.is-entering .article__head,
  .detail.is-entering .article__figure,
  .detail.is-entering .article__body-wrap,
  .save-button.is-popping > svg {
    animation: none;
  }

  .feature__figure img,
  .story-row__thumb img,
  .brand__mark,
  .open-item svg,
  .back-button svg,
  .progress__fill {
    transition: none;
  }

  .feature:hover .feature__figure img,
  .story-row:hover .story-row__thumb img,
  .brand:hover .brand__mark,
  .open-item:hover svg,
  .back-button:hover svg {
    transform: none;
  }
}
