:root {
  --paper: #e4e2dc;
  --paper-2: #d8d6cf;
  --ink: #161616;
  --ink-2: #4a4a47;
  --red: #d42a1e;
  --blue: #1f4e9c;
  --yellow: #f2c12e;
  --rule: 10px;
  --gutter: clamp(16px, 3vw, 40px);
  --max: 1360px;
  --sans: "Jost", "Futura", "Century Gothic", sans-serif;
  --num: "Barlow Condensed", "DIN Condensed", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.55 var(--sans);
}
/* body copy keeps its capitals; headings and labels follow Bayer's single alphabet */
p, .dates, .steps p, .footer { text-transform: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 2; }

/* ---------- masthead ---------- */
.masthead, main > section, .footer__inner { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
body { overflow-x: hidden; }
.masthead__bar {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 14px 0 10px; font-weight: 500; font-size: 15px;
  border-bottom: var(--rule) solid var(--ink);
}
.masthead__title {
  margin: 0; padding: 0.02em 0 0;
  font-weight: 800; letter-spacing: -0.045em; line-height: 0.82;
  font-size: min(14vw, 204px);
  border-bottom: var(--rule) solid var(--ink);
  padding-bottom: 0.06em;
  white-space: nowrap;
}
.masthead__word { font-family: "Righteous", var(--sans); font-weight: 400; letter-spacing: -0.02em; text-transform: none; }
.masthead__year { font-weight: 400; }

/* ---------- opening ---------- */
.opening {
  padding: 40px 0 72px;
  display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 0.95fr); gap: var(--gutter);
  align-items: start;
}
.spine {
  writing-mode: vertical-rl; transform: rotate(180deg);
  margin: 0; justify-self: start;
  font-weight: 700; font-size: 28px; letter-spacing: 0.01em; line-height: 1;
  text-transform: lowercase; white-space: pre;
  border-left: 3px solid var(--ink); padding-left: 10px;
}
.lede { font-weight: 700; font-size: clamp(32px, 4vw, 52px); line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 28px; max-width: 13ch; }
.opening__text p { max-width: 54ch; margin: 0 0 16px; color: var(--ink-2); }
.opening__cover { margin: 0; box-shadow: 14px 14px 0 var(--ink); }

/* ---------- downloads ---------- */
.downloads { display: grid; gap: 12px; margin-top: 34px; max-width: 520px; }
.downloads--row { grid-template-columns: 1fr 1fr; }
.dl {
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 20px; text-decoration: none;
  border: 3px solid var(--ink); background: transparent;
  transition: background-color .15s, color .15s;
}
.dl__name { font-weight: 700; font-size: 21px; line-height: 1.2; }
.dl__meta { font-size: 14px; text-transform: none; color: var(--ink-2); }
.dl:hover { background: var(--ink); color: var(--paper); }
.dl:hover .dl__meta { color: var(--paper-2); }
.dl--main { background: var(--red); border-color: var(--red); color: #fff; }
.dl--main .dl__meta { color: #fbe3e0; }
.dl--main:hover { background: var(--ink); border-color: var(--ink); }
.dl--yellow { background: var(--yellow); border-color: var(--yellow); }
.dl--yellow:hover { border-color: var(--ink); }

/* ---------- sections ---------- */
section + section { border-top: var(--rule) solid var(--ink); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gutter); align-items: end; margin-bottom: 32px; }
.section-head h2, .planner h2, .dessau h2 {
  margin: 0; font-weight: 800; font-size: clamp(40px, 6vw, 84px); line-height: 0.9; letter-spacing: -0.035em;
}
.section-head p { margin: 0; max-width: 46ch; color: var(--ink-2); }

.months, .inside, .home, .planner, .dessau { padding: 56px 0 72px; }

/* ---------- month viewer ---------- */
.months__tabs { display: grid; grid-template-columns: repeat(12, 1fr); border: 3px solid var(--ink); margin-bottom: 28px; }
.tab {
  appearance: none; border: 0; border-right: 3px solid var(--ink); background: transparent; color: var(--ink);
  font: 600 clamp(18px, 2.4vw, 34px)/1 var(--num); padding: 14px 0 12px; cursor: pointer;
}
.tab:last-child { border-right: 0; }
.tab:hover { background: var(--paper-2); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.months__stage { display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr); gap: calc(var(--gutter) * 1.5); align-items: start; }
.months__page { margin: 0; background: #fff; box-shadow: 14px 14px 0 var(--ink); }
.months__page img { transition: opacity .2s; }
.months__page img.is-loading { opacity: .35; }
.months__side { position: sticky; top: 28px; }
.months__top { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; }
.months__nav { display: flex; }
.months__nav button {
  appearance: none; width: 52px; height: 52px; padding: 0; cursor: pointer;
  border: 3px solid var(--ink); background: transparent; color: var(--ink);
  display: grid; place-items: center; transition: background-color .15s, color .15s;
}
.months__nav button + button { border-left: 0; }
.months__nav button:hover { background: var(--ink); color: var(--paper); }
.months__nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 3; }
.months__name { margin: 0; font-weight: 800; font-size: clamp(44px, 7vw, 104px); line-height: .85; letter-spacing: -0.04em; text-transform: lowercase; }
.dates { list-style: none; margin: 0 0 24px; padding: 0; border-top: 3px solid var(--ink); }
.dates li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid #a9a7a1; }
.dates .n { font: 600 34px/1 var(--num); display: flex; align-items: center; gap: 8px; }
.dates .who { font-weight: 500; font-size: 19px; }
.dates .sub { display: block; font-size: 15px; color: var(--ink-2); }
.dates .empty { display: block; padding: 12px 0; color: var(--ink-2); }
.dot { display: inline-block; width: 10px; height: 10px; background: var(--blue); border-radius: 50%; flex: none; }
.dot--m { background: var(--red); border-radius: 0; }
.legend { font-size: 15px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.legend .dot--m { margin-left: 14px; }

/* ---------- inside ---------- */
.pages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gutter) calc(var(--gutter) * 0.75); }
.pages figure { margin: 0; }
.pages img { background: #fff; box-shadow: 0 0 0 1px rgba(22, 22, 22, .16); }
.pages figcaption { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; padding-top: 8px; border-top: 3px solid var(--ink); font-weight: 500; font-size: 16px; line-height: 1.2; }
.pages__n { font: 600 22px/1 var(--num); }

/* ---------- home printing ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 3px solid var(--ink); }
.steps li { padding: 28px 24px 8px 0; }
.steps li + li { padding-left: 24px; border-left: 3px solid var(--ink); }
.steps h3 { margin: 18px 0 8px; font-weight: 700; font-size: 30px; line-height: 1; }
.steps p { margin: 0; color: var(--ink-2); font-size: 16.5px; max-width: 30ch; }
.shape { display: block; width: 56px; height: 56px; }
.shape--circle { background: var(--red); border-radius: 50%; }
.shape--triangle { background: var(--yellow); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.shape--square { background: var(--blue); }
.shape--bar { background: linear-gradient(var(--ink), var(--ink)) center / 100% 28px no-repeat; }

/* ---------- planner ---------- */
.planner { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: calc(var(--gutter) * 1.5); align-items: center; }
.planner__img { margin: 0; background: #fff; box-shadow: 14px 14px 0 var(--yellow); }
.planner__text p { max-width: 46ch; color: var(--ink-2); margin: 24px 0 0; }

/* ---------- dessau ---------- */
.dessau h2 { max-width: 12ch; margin-bottom: 32px; }
.dessau__cols { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--gutter) * 1.5); }
.dessau__cols p { margin: 0; max-width: 52ch; }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: var(--paper); padding: 40px var(--gutter) 48px; }
.footer p { margin: 0 0 8px; }
.footer a { color: var(--yellow); }
.footer__small { font-size: 14px; color: #a9a7a1; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .masthead__bar span:last-child { display: none; }
  .opening { grid-template-columns: 1fr; padding-top: 28px; }
  .spine { display: none; }
  .opening__cover { max-width: 460px; }
  .section-head, .months__stage, .planner, .dessau__cols { grid-template-columns: 1fr; }
  .months__tabs { grid-template-columns: repeat(6, 1fr); }
  .months__side { position: static; }
  .pages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tab:nth-child(6) { border-right: 0; }
  .tab:nth-child(-n+6) { border-bottom: 3px solid var(--ink); }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(3) { padding-left: 0; border-left: 0; }
  .steps li:nth-child(n+3) { border-top: 3px solid var(--ink); }
  .downloads--row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .opening__cover, .months__page { box-shadow: 8px 8px 0 var(--ink); }
  .planner__img { box-shadow: 8px 8px 0 var(--yellow); }
  body { font-size: 17px; }
  .pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .months__nav button { width: 44px; height: 44px; }
  :root { --rule: 7px; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding-left: 0; border-left: 0; }
  .steps li + li { border-top: 3px solid var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
