:root {
  --ink: #282828;
  --paper: #FFFFFF;
  --beige-50: #F8F4F0;
  --beige-100: #F1E9E2;
  --beige-200: #E5D7CC;
  --beige-400: #CDB7A6;
  --display: 'freight-display-pro', 'Freight Display Pro', Georgia, serif;
  --text: 'freight-text-pro', 'Freight Text Pro', Georgia, serif;
  --sans: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 80px);
  --section: clamp(112px, 11vw, 176px);
  --wide: 1280px;
  --measure: 32em;
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 20px/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, figure, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }
em { font-style: italic; }
cite { font-style: normal; }

:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
::selection { background: var(--beige-200); color: var(--ink); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 30;
  padding: 12px 18px; background: var(--ink); color: var(--paper); font-size: 15px;
}
.skip:focus { top: 16px; }

/* Magazine style: menu, buttons, facts, names */

.header-menu, .topics, .menu-sheet-links, .menu-sheet-foot, .button, .fact, .link, cite, .footer-links {
  font: 600 12.5px/1.4 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Header */

.header { position: sticky; top: 0; z-index: 20; background: var(--paper); }

.header-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 80px; padding: 0 clamp(20px, 3vw, 44px);
}
.header-logo img, img.header-logo { width: 272px; height: auto; }
.header-logo { justify-self: center; }
.header-actions { justify-self: end; display: flex; gap: 16px; }

.header-menu { display: flex; justify-content: center; gap: 56px; padding: 0 0 22px; }
.header-menu a { padding: 6px 0; background: linear-gradient(currentColor, currentColor) 50% 100% / 0 1px no-repeat; transition: background-size 0.4s var(--ease); }
.header-menu a:hover, .header-menu a[aria-current="page"] { background-size: 100% 1px; }

.icon { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 -8px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.icon svg, .menu-sheet-foot svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round;
}
.header-menu-button { display: none; }

/* Menu sheet (phone) */

.menu-sheet {
  width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0 0 40px;
  border: 0; background: var(--paper); color: var(--ink);
  flex-direction: column;
}
.menu-sheet[open] { display: flex; }
.menu-sheet::backdrop { background: var(--paper); }
.menu-sheet .header-bar { padding: 0 20px; }
.menu-sheet-links { display: flex; flex-direction: column; align-items: center; gap: 32px; margin: auto 0; font-size: 14px; }
.menu-sheet-links a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.6em; }
.menu-sheet-foot { display: flex; justify-content: center; gap: 40px; }
.menu-sheet-foot a { display: flex; align-items: center; gap: 10px; }

/* Type */

.display {
  font: 500 clamp(46px, 5.6vw, 84px)/1.02 var(--display);
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.display span, .title span { display: block; }

.title {
  font: 500 clamp(38px, 4vw, 60px)/1.06 var(--display);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.standfirst { font-size: clamp(20px, 1.6vw, 24px); line-height: 1.5; text-wrap: balance; }
.body { max-width: var(--measure); text-wrap: pretty; }

.quote {
  font: italic 500 clamp(32px, 3.3vw, 50px)/1.16 var(--display);
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.link {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.6em;
  text-decoration-color: var(--beige-400);
  transition: text-decoration-color 0.3s;
}
.link:hover { text-decoration-color: currentColor; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 40px;
  border: 0; border-radius: 0;
  background: var(--ink); color: var(--paper);
  cursor: pointer;
  transition: background-color 0.3s;
}
.button:hover { background: #000; }

/* Closing */

.closing {
  display: flex; flex-direction: column; align-items: center;
  padding: var(--section) var(--gutter);
  background: var(--beige-50); text-align: center;
}
.closing .display { max-width: 12em; }
.closing .body { margin-top: 32px; }
.closing .button { margin-top: 48px; }
.closing .link { margin-top: 28px; }

/* Footer */

.footer {
  display: flex; flex-direction: column; align-items: center; gap: 32px;
  padding: 88px var(--gutter) 40px;
  text-align: center;
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 48px; }
.footer-links a:hover, .footer-email:hover { text-decoration: underline; text-decoration-color: var(--beige-400); text-underline-offset: 0.4em; text-decoration-thickness: 1px; }
.footer-email { font-size: 20px; }
.footer-base {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  width: 100%; margin-top: 56px; padding-top: 28px;
  border-top: 1px solid var(--beige-100);
  font-size: 15px; line-height: 1;
}
.footer-base img { width: 141px; height: auto; }

/* Reveal */

.js .reveal { opacity: 0; transition: opacity 1.1s var(--ease); }
.js .reveal.is-visible { opacity: 1; }

/* Page head */

.page-head {
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(72px, 7vw, 112px) var(--gutter) clamp(56px, 5vw, 80px);
  text-align: center;
}
.page-head .standfirst { max-width: 26em; margin-top: 24px; }

/* Lead story */

.lead {
  max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto;
  padding: 0 var(--gutter) var(--section);
}
.lead-photo { display: block; overflow: hidden; }
.lead-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 38%; transition: scale 1.2s var(--ease); }
.lead-photo:hover img { scale: 1.02; }
.lead-text {
  display: grid; grid-template-columns: 7fr 5fr; column-gap: clamp(48px, 7vw, 120px); align-items: start;
  margin-top: clamp(40px, 4vw, 56px);
}
.lead-text .title { max-width: 12em; }
.lead-text .body { margin-top: 6px; }
.lead-text .link { display: inline-block; margin-top: 28px; }

.title a, .story-title a, .index-name { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.5s var(--ease); }
.title a:hover, .story-title a:hover, .index-list a:hover .index-name { background-size: 100% 1px; }

/* More stories, then the index */

.shelf { padding: var(--section) var(--gutter); background: var(--beige-100); }

.stories {
  display: grid; grid-template-columns: repeat(3, 1fr); column-gap: clamp(32px, 3.4vw, 48px);
  max-width: var(--wide); margin: 0 auto;
}
.story { display: flex; flex-direction: column; min-width: 0; }
.story-photo { display: block; overflow: hidden; }
.story-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: scale 1.2s var(--ease); }
.story-photo:hover img { scale: 1.02; }
.story-title { margin-top: 28px; font: 500 clamp(26px, 2.1vw, 31px)/1.14 var(--display); letter-spacing: -0.005em; text-wrap: balance; }
.story-excerpt { margin-top: 14px; font-size: 18px; line-height: 1.55; text-wrap: pretty; }

.index { max-width: var(--wide); margin: clamp(112px, 10vw, 160px) auto 0; }
.index-title { font: 500 clamp(32px, 3vw, 44px)/1.1 var(--display); letter-spacing: -0.008em; }
.topics { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: 18px; }
.topics a { padding: 6px 0; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.4s var(--ease); }
.topics a:hover, .topics a[aria-current="page"] { background-size: 100% 1px; }
.index-list { columns: 2 20em; column-gap: clamp(48px, 6vw, 96px); margin-top: 28px; }
.index-list li { break-inside: avoid; }
.index-list a { display: block; padding: 12px 0; }
.index-name { font: 500 22px/1.3 var(--display); letter-spacing: -0.003em; text-wrap: pretty; }

/* Tablet and phone */

@media (max-width: 1100px) {
  .header-menu { gap: 36px; }
}

@media (max-width: 900px) {
  .header-menu, .icon-desktop { display: none; }
  .header-menu-button { display: grid; justify-self: start; }
  .header-bar { height: 64px; padding: 0 20px; }
  .header-logo img, img.header-logo { width: 198px; }
  .header { border-bottom: 1px solid var(--beige-100); }

  .lead { padding-inline: 0; }
  .lead-text { grid-template-columns: 1fr; row-gap: 20px; padding: 0 var(--gutter); }

  .shelf { padding-inline: 0; }
  .stories {
    display: flex; gap: 16px;
    padding: 0 var(--gutter) 4px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
    overscroll-behavior-x: contain; scrollbar-width: none;
  }
  .stories::-webkit-scrollbar { display: none; }
  .story { flex: 0 0 min(80%, 440px); scroll-snap-align: start; }
  .story-title { margin-top: 24px; }
  .index { padding: 0 var(--gutter); }
}

@media (max-width: 640px) {
  :root { --section: 96px; }
  body { font-size: 18px; }
  .display { font-size: 44px; }
  .title { font-size: 36px; }
  .button { align-self: stretch; }

  .page-head { padding-top: 64px; padding-bottom: 48px; }
  .page-head .standfirst { margin-top: 20px; }
  .lead-photo img { aspect-ratio: 4 / 3; }
  .lead-text { margin-top: 32px; }
  .lead-text .title { font-size: 34px; }
  .story-title { font-size: 26px; }
  .index { margin-top: 96px; }
  .index-title { font-size: 32px; }
  .topics { justify-content: space-between; column-gap: 12px; }
  .index-list { margin-top: 20px; }
  .index-list a { padding: 10px 0; }
  .index-name { font-size: 21px; }

  .footer { padding-top: 80px; }
  .footer-links { flex-direction: column; gap: 18px; }
  .footer-base { flex-direction: column; gap: 16px; margin-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transition: none; }
  .header-menu a, .topics a, .button, .link, .lead-photo img, .story-photo img, .title a, .story-title a, .index-name { transition: none; }
}
