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

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

:root {
  --ink: #102a43;
  --paper: #fffdf5;
  --orange: #f05a28;
  --blue: #60c6d8;
  --yellow: #f4e36c;
  --lavender: #c9b8e7;
  --green: #8fcf9b;
  --line: #d4dce0;
  --display: "Oswald Local", "Arial Narrow", sans-serif;
  --reading: "Literata Local", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--reading);
  font-size: 16px;
}

body.detail-open { overflow: hidden; }

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

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

a { color: inherit; }

button { cursor: pointer; }

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

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

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

.masthead {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  height: 112px;
  padding: 24px 4.5vw;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--paper);
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 650;
  font-size: 22px;
  line-height: .82;
  text-transform: uppercase;
}

.brand-mark { width: 46px; height: 30px; overflow: visible; }
.brand-mark path { fill: none; stroke: currentColor; stroke-width: 2.5; }
.brand-mark circle { fill: var(--yellow); stroke: none; }

.masthead-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

.issue-link {
  justify-self: end;
  font-family: var(--display);
  font-weight: 550;
  font-size: 17px;
  line-height: 1.15;
  text-align: right;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.issue-link span { font-family: var(--reading); font-size: 11px; font-weight: 500; }

.hero {
  position: relative;
  min-height: min(760px, 86vh);
  padding: 165px 6vw 75px;
  overflow: hidden;
  color: var(--paper);
  background: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
  grid-template-rows: auto 1fr auto;
  column-gap: 5vw;
  align-items: end;
}

.hero::after {
  content: "";
  position: absolute;
  width: 34vw;
  height: 34vw;
  min-width: 380px;
  min-height: 380px;
  border: 42px solid var(--blue);
  border-radius: 50%;
  right: -12vw;
  top: 15%;
  opacity: .18;
}

.hero-kicker {
  align-self: start;
  grid-column: 1;
  margin: 0;
  font-size: clamp(17px, 1.4vw, 21px);
  font-style: italic;
}

.hero h1 {
  position: relative;
  z-index: 1;
  grid-column: 1;
  margin: 16px 0 0;
  font-family: var(--display);
  font-size: clamp(100px, 15.5vw, 238px);
  font-weight: 530;
  letter-spacing: -.055em;
  line-height: .76;
  text-transform: uppercase;
}

.hero-copy {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  max-width: 34ch;
  margin: 0;
  font-size: clamp(18px, 1.5vw, 23px);
  line-height: 1.55;
}

.start-link {
  grid-column: 2;
  position: relative;
  z-index: 1;
  justify-self: start;
  padding-bottom: 5px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 550;
  text-decoration: none;
  border-bottom: 2px solid var(--yellow);
}

.start-link span { display: inline-block; margin-left: 8px; color: var(--yellow); }

.hero-route {
  position: absolute;
  z-index: 0;
  top: 25%;
  left: 0;
  width: 52%;
  height: 46%;
  border-top: 10px solid var(--orange);
  border-right: 10px solid var(--orange);
  border-bottom: 10px solid var(--orange);
  border-radius: 0 180px 180px 0;
  transform: translateX(-18%);
}

.hero-route span {
  position: absolute;
  width: 23px;
  height: 23px;
  border: 6px solid var(--orange);
  border-radius: 50%;
  background: var(--paper);
}

.hero-route span:nth-child(1) { left: 23%; top: -17px; }
.hero-route span:nth-child(2) { left: 52%; top: -17px; }
.hero-route span:nth-child(3) { right: -17px; top: 32%; }
.hero-route span:nth-child(4) { left: 51%; bottom: -17px; }
.hero-route span:nth-child(5) { left: 18%; bottom: -17px; }

.browse {
  padding: clamp(70px, 8vw, 120px) 4.5vw 140px;
  background:
    radial-gradient(circle at 10% 13%, rgba(244,227,108,.24) 0 11%, transparent 11.2%),
    var(--paper);
}

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

.browse h2 {
  max-width: 860px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(58px, 7.5vw, 112px);
  font-weight: 500;
  line-height: .92;
  letter-spacing: -.035em;
  text-transform: uppercase;
}

.result-count {
  margin: 0 0 8px;
  flex: 0 0 auto;
  font-size: 14px;
  font-style: italic;
}

.controls {
  position: relative;
  z-index: 2;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 280px) auto;
  gap: 12px;
  align-items: end;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 10px 10px 0 var(--yellow);
}

.field label {
  display: block;
  margin: 0 0 8px 2px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
}

.input-wrap, .select-wrap { position: relative; display: block; }

.input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 21px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
}

.field input, .field select {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
}

.field input { padding: 0 14px 0 46px; }
.field select { padding: 0 45px 0 14px; appearance: none; }

.select-wrap::after {
  content: "";
  pointer-events: none;
  position: absolute;
  right: 17px;
  top: 20px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}

.saved-toggle {
  min-width: 170px;
  height: 50px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 2px solid var(--paper);
  border-radius: 0;
  color: var(--paper);
  background: transparent;
  font-family: var(--display);
  font-weight: 500;
  font-size: 16px;
}

.saved-toggle svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.saved-toggle[aria-pressed="true"] { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }
.saved-toggle[aria-pressed="true"] svg { fill: var(--ink); }

.saved-count {
  min-width: 22px;
  height: 22px;
  padding: 1px 5px 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--reading);
  font-size: 11px;
}

.route {
  --route-gap: clamp(22px, 2.4vw, 38px);
  position: relative;
  padding: 100px 0 40px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 68px var(--route-gap);
}

.route[hidden] { display: none; }

.route::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 158px;
  left: 3%;
  right: 3%;
  bottom: 104px;
  border-top: 9px solid var(--ink);
  border-right: 9px solid var(--ink);
  border-bottom: 9px solid var(--ink);
  border-radius: 0 100px 100px 0;
}

.story-card {
  --category: var(--blue);
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 360px;
  padding: 0 18px 22px;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
}

.story-card:nth-child(n+5) { transform: translateY(20px); }
.story-card[data-category="Culture"] { --category: var(--lavender); }
.story-card[data-category="Food"] { --category: var(--orange); }
.story-card[data-category="Movement"] { --category: var(--yellow); }
.story-card[data-category="People"] { --category: var(--blue); }
.story-card[data-category="Places"] { --category: var(--green); }

.card-stop {
  width: 29px;
  height: 29px;
  margin: -17px 0 22px;
  border: 7px solid var(--ink);
  border-radius: 50%;
  background: var(--category);
  box-shadow: 0 0 0 5px var(--paper);
}

.card-meta {
  margin: 0 0 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
}

.card-category {
  padding: 3px 7px 4px;
  background: var(--category);
}

.card-time { padding-top: 3px; white-space: nowrap; }

.story-card h3 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(27px, 2.2vw, 38px);
  font-weight: 550;
  line-height: 1;
}

.card-summary {
  margin: 0 0 26px;
  font-size: 14px;
  line-height: 1.58;
}

.card-byline {
  margin: auto 0 15px;
  font-size: 12px;
  font-style: italic;
}

.open-item {
  width: 100%;
  padding: 12px 10px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 560;
}

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

.empty-state {
  max-width: 600px;
  margin: 90px auto 10px;
  text-align: center;
}

.empty-state[hidden] { display: none; }
.empty-state svg { width: 120px; fill: none; stroke: var(--orange); stroke-width: 6; }
.empty-state svg circle { fill: var(--paper); }
.empty-state h3 { margin: 18px 0 10px; font-family: var(--display); font-size: 40px; font-weight: 550; }
.empty-state p { margin: 0 auto 24px; max-width: 44ch; line-height: 1.55; }
.empty-state button { padding: 12px 20px; border: 2px solid var(--ink); background: var(--yellow); font-family: var(--display); font-weight: 560; }

.footer {
  min-height: 260px;
  padding: 50px 4.5vw;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  gap: 30px;
  color: var(--paper);
  background: var(--ink);
}

.footer p { margin: 0; font-size: 13px; line-height: 1.65; }
.footer-name { font-family: var(--display); font-size: 50px !important; font-weight: 600; line-height: 1 !important; text-transform: uppercase; }
.footer a { justify-self: end; font-family: var(--display); font-size: 16px; text-underline-offset: 5px; }

.detail-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.detail-dialog::backdrop { background: rgba(16,42,67,.8); }

.detail-shell {
  --category: var(--blue);
  min-height: 100%;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr);
  background: var(--paper);
}

.detail-shell[data-category="Culture"] { --category: var(--lavender); }
.detail-shell[data-category="Food"] { --category: var(--orange); }
.detail-shell[data-category="Movement"] { --category: var(--yellow); }
.detail-shell[data-category="People"] { --category: var(--blue); }
.detail-shell[data-category="Places"] { --category: var(--green); }

.detail-side {
  position: relative;
  min-height: 100vh;
  padding: 36px clamp(28px, 4vw, 65px) 60px;
  overflow: hidden;
  color: var(--ink);
  background: var(--category);
  border-right: 2px dashed rgba(16,42,67,.45);
}

.detail-side::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  top: 38%;
  left: -310px;
  border: 34px solid var(--paper);
  border-radius: 50%;
  opacity: .6;
}

.detail-brand { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 650; text-transform: uppercase; }

.detail-side-copy {
  position: absolute;
  left: clamp(28px, 4vw, 65px);
  right: clamp(28px, 4vw, 65px);
  bottom: 55px;
}

.detail-category { margin: 0 0 13px; font-family: var(--display); font-size: 18px; font-weight: 560; }
.detail-summary { max-width: 38ch; margin: 0; font-size: clamp(19px, 1.6vw, 25px); line-height: 1.55; }

.detail-main {
  min-width: 0;
  padding: 34px clamp(28px, 6vw, 90px) 80px;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(33.333% - 1px), rgba(16,42,67,.08) calc(33.333% - 1px), rgba(16,42,67,.08) 33.333%),
    var(--paper);
}

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

.close-detail, .save-item {
  min-height: 46px;
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 550;
}

.close-detail { display: flex; align-items: center; gap: 9px; }
.close-detail span { font-family: var(--reading); font-size: 20px; }
.save-item { display: flex; align-items: center; gap: 9px; }
.save-item svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.save-item[aria-pressed="true"] { color: var(--paper); background: var(--ink); }
.save-item[aria-pressed="true"] svg { fill: var(--yellow); }

.article-header { max-width: 920px; margin: clamp(65px, 9vh, 110px) 0 50px; }
.article-header h2 { margin: 0; font-family: var(--display); font-size: clamp(58px, 6.8vw, 112px); font-weight: 530; letter-spacing: -.035em; line-height: .92; }
.article-byline { margin: 32px 0 0; font-size: 14px; font-style: italic; }
.article-body { max-width: 680px; font-size: clamp(18px, 1.35vw, 21px); line-height: 1.8; }
.article-body p { margin: 0 0 1.6em; }
.article-body p:first-child::first-letter { float: left; margin: .08em .09em 0 0; color: var(--orange); font-family: var(--display); font-size: 4.7em; line-height: .7; }
.article-end { width: 74px; height: 12px; margin-top: 48px; background: var(--category); }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr 300px; }
  .route { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route::before { top: 158px; bottom: 95px; }
  .story-card:nth-child(n+5) { transform: none; }
  .story-card:nth-child(even) { transform: translateY(25px); }
  .controls { grid-template-columns: 1fr 220px; }
  .saved-toggle { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .masthead { height: 88px; padding: 18px 20px; grid-template-columns: 1fr 1fr; }
  .brand { font-size: 19px; }
  .brand-mark { width: 37px; }
  .masthead-note { display: none; }
  .issue-link { font-size: 14px; }

  .hero {
    min-height: 735px;
    padding: 135px 20px 42px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero::after { min-width: 290px; min-height: 290px; right: -180px; top: 30%; border-width: 28px; }
  .hero-kicker { font-size: 16px; }
  .hero h1 { margin-top: 25px; font-size: clamp(86px, 25vw, 104px); line-height: .8; }
  .hero-copy { max-width: 30ch; margin-top: auto; font-size: 17px; line-height: 1.55; }
  .start-link { margin-top: 24px; font-size: 16px; }
  .hero-route { top: 25%; width: 72%; height: 35%; border-width: 7px; transform: translateX(-46%); }
  .hero-route span { width: 19px; height: 19px; border-width: 5px; }
  .hero-route span:nth-child(1), .hero-route span:nth-child(2) { top: -13px; }
  .hero-route span:nth-child(3) { right: -13px; }
  .hero-route span:nth-child(4), .hero-route span:nth-child(5) { bottom: -13px; }

  .browse { padding: 70px 20px 100px; overflow: hidden; }
  .browse-heading { display: block; margin-bottom: 26px; }
  .browse h2 { font-size: 59px; }
  .result-count { margin: 15px 0 0; }
  .controls { margin-right: 8px; padding: 15px; grid-template-columns: 1fr; box-shadow: 8px 8px 0 var(--yellow); }
  .saved-toggle { grid-column: auto; width: 100%; }

  .route { padding: 84px 0 0 42px; display: block; }
  .route::before {
    top: 32px;
    left: 7px;
    right: auto;
    bottom: 35px;
    width: 54px;
    border: 0;
    border-left: 8px solid var(--ink);
    border-top: 8px solid var(--ink);
    border-bottom: 8px solid var(--ink);
    border-radius: 40px 0 0 40px;
  }

  .story-card, .story-card:nth-child(even), .story-card:nth-child(n+5) {
    min-height: 0;
    margin-bottom: 34px;
    padding: 17px 17px 19px;
    transform: none;
  }

  .card-stop {
    position: absolute;
    top: 30px;
    left: -54px;
    margin: 0;
  }

  .story-card h3 { font-size: 31px; }
  .card-summary { margin-bottom: 24px; }
  .card-byline { margin-top: 0; }

  .footer { min-height: 310px; padding: 46px 20px; grid-template-columns: 1fr; align-items: start; }
  .footer a { justify-self: start; }

  .detail-shell { display: block; }
  .detail-side { min-height: 260px; padding: 25px 22px; border-right: 0; border-bottom: 2px dashed rgba(16,42,67,.45); }
  .detail-side::before { width: 260px; height: 260px; border-width: 22px; left: auto; right: -160px; top: -70px; }
  .detail-brand { display: none; }
  .detail-side-copy { position: relative; left: auto; right: auto; bottom: auto; margin-top: 75px; }
  .detail-summary { font-size: 17px; }
  .detail-main { padding: 20px 22px 65px; background: var(--paper); }
  .detail-actions { position: absolute; top: 18px; left: 20px; right: 20px; }
  .close-detail, .save-item { min-height: 42px; padding: 6px 11px; font-size: 14px; }
  .article-header { margin: 45px 0 38px; }
  .article-header h2 { font-size: 53px; }
  .article-byline { margin-top: 22px; }
  .article-body { font-size: 17px; line-height: 1.75; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
