:root {
  --ink: #0b0b0b;
  --paper: #f2f0e9;
  --red: #e61b23;
  --blue: #0d5fa8;
  --yellow: #ffd91a;
  --line: 3px solid var(--ink);
  --max: 1500px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

a:focus-visible,
button:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  left: 1rem;
  top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--yellow);
  border: var(--line);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: stretch;
  border-bottom: var(--line);
  background: var(--paper);
}

.identity,
.language {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem;
  text-decoration: none;
}

.identity {
  flex-wrap: wrap;
}

.identity span {
  font-family: "Courier New", monospace;
}

.language {
  justify-content: center;
  min-width: max-content;
  padding-inline: 1rem;
  border-left: var(--line);
  background: var(--yellow);
  font-weight: 800;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  overflow-x: auto;
  border-left: var(--line);
}

.main-nav a {
  display: grid;
  place-items: center;
  min-width: max-content;
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.main-nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

.main-nav a.is-context:not([aria-current="page"]) {
  background: var(--yellow);
  text-decoration: none;
}

main,
footer {
  max-width: var(--max);
  margin: auto;
}

main > section,
.case-detail {
  padding: clamp(2rem, 5vw, 6rem) clamp(1rem, 4vw, 4rem);
  border-bottom: var(--line);
}

.hero,
.page-hero {
  display: flex;
  flex-direction: column;
}

.eyebrow,
.meta,
.crumb {
  margin: 0 0 1rem;
  font: 700 0.78rem/1.4 "Courier New", monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  max-width: 70rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5.75rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

h2 {
  margin: 0 0 2rem;
  font-size: clamp(1.75rem, 2.6vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h3 {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 1.8vw, 1.85rem);
  line-height: 1.1;
}

p {
  line-height: 1.55;
}

.lede {
  margin: 2rem 0 0;
  max-width: 56rem;
  font-size: clamp(1.2rem, 2.2vw, 2rem);
  line-height: 1.25;
}

.availability {
  align-self: flex-start;
  margin-top: 3rem;
  padding: 0.65rem 0.8rem;
  border: var(--line);
  background: var(--yellow);
  font: 700 0.8rem "Courier New", monospace;
  text-transform: uppercase;
}

.door-grid,
.case-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  border-top: var(--line);
  border-left: var(--line);
}

.door,
.case-card,
.info-block {
  grid-column: span 4;
  min-height: 300px;
  padding: clamp(1rem, 2.5vw, 2.5rem);
  border-right: var(--line);
  border-bottom: var(--line);
}

.door,
.case-card {
  display: flex;
  flex-direction: column;
}

.door {
  min-height: 410px;
}

.card-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  color: inherit;
  text-decoration: none;
}

.card-link:hover .arrow-link,
.card-link:focus-visible .arrow-link {
  text-decoration: underline;
}

.arrow-link,
.source-link {
  font-weight: 800;
}

.portal-doors {
  margin-top: 2.5rem;
}

.portal-doors .door {
  grid-column: span 6;
}

.red,
.tone-1 {
  background: var(--red);
  color: white;
}

.yellow,
.tone-2 {
  background: var(--yellow);
}

.blue,
.tone-3 {
  background: var(--blue);
  color: white;
}

.tone-4 {
  background: white;
}

.case-card:nth-child(1) {
  grid-column: span 5;
}

.case-card:nth-child(2) {
  grid-column: span 3;
}

.case-card:nth-child(3) {
  grid-column: span 4;
}

.case-card:nth-child(n + 4) {
  grid-column: span 6;
}

.case-detail dl {
  margin-top: 4rem;
  border-top: var(--line);
}

.case-detail dl div {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 3fr;
  gap: 2rem;
  padding: 1.5rem 0;
  border-bottom: var(--line);
}

dt {
  font: 800 0.78rem "Courier New", monospace;
  text-transform: uppercase;
}

dd {
  margin: 0;
  max-width: 55rem;
  font-size: 1.15rem;
  line-height: 1.5;
}

.cta {
  background: var(--ink);
  color: var(--paper);
}

.button {
  display: inline-block;
  padding: 1rem 1.2rem;
  border: 3px solid currentColor;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.prose p {
  max-width: 55rem;
  font-size: 1.2rem;
}

footer {
  display: flex;
  justify-content: flex-end;
  gap: 2rem;
  padding: 2rem 1rem;
  background: var(--paper);
  font: 700 0.76rem "Courier New", monospace;
  text-transform: uppercase;
}

footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

body.portal {
  background: var(--paper);
}

body.portal header {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  header {
    position: static;
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    border-top: var(--line);
    border-left: 0;
  }

  .door,
  .case-card,
  .case-card:nth-child(n),
  .info-block,
  .portal-doors .door {
    grid-column: span 12;
    min-height: auto;
  }

  .door {
    min-height: 280px;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: clamp(2.25rem, 11vw, 3.25rem);
  }

  .case-detail dl div {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .identity span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
