@font-face {
  font-family: "DM Serif Display";
  src: url("assets/dm-serif.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-display: swap;
}

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

:root {
  --bg: #f4eddb;
  --surface: #fff9eb;
  --ink: #20201d;
  --muted: #625d53;
  --accent: #c93422;
  --accent-ink: #fff9eb;
  --blue: #274bd6;
  --rule: 2px solid var(--ink);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 25% 20%, rgba(32, 32, 29, 0.035) 0 1px, transparent 1.5px) 0 0 / 9px 9px,
    var(--bg);
  font-family: "Work Sans", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

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

a {
  color: inherit;
}

button {
  color: inherit;
}

button:focus,
a:focus,
input:focus,
select:focus {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

button:active,
.primary-cta:active,
.top-nav a:active,
.site-footer a:active,
.wordmark:active {
  transform: scale(0.97);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: var(--rule);
  background: var(--surface);
  font-family: "IBM Plex Mono", monospace;
  transform: translateY(-160%);
}

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

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  min-height: 64px;
  border-bottom: var(--rule);
  background: var(--bg);
}

.wordmark {
  display: inline-flex;
  min-width: 138px;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  border-right: var(--rule);
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-decoration: none;
  transition: color 160ms var(--ease), background-color 160ms var(--ease), transform 160ms var(--ease);
}

.wordmark span {
  color: var(--accent);
  padding-inline: 3px;
}

.top-nav {
  display: flex;
  align-items: stretch;
}

.top-nav a {
  display: inline-flex;
  min-height: 64px;
  align-items: center;
  gap: 8px;
  padding-inline: 24px;
  border-left: var(--rule);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms var(--ease), background-color 160ms var(--ease), transform 160ms var(--ease);
}

.nav-count {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-ink);
  background: var(--accent);
}

.hero {
  position: relative;
  min-height: calc(100svh - 64px);
  padding: 24px clamp(20px, 4vw, 64px) 0;
  overflow: hidden;
  border-bottom: var(--rule);
}

.hero::before {
  position: absolute;
  z-index: -1;
  width: min(46vw, 650px);
  aspect-ratio: 1;
  right: -7vw;
  top: 8%;
  content: "";
  opacity: 0.6;
  background: radial-gradient(circle, var(--blue) 0 2px, transparent 2.5px) 0 0 / 12px 12px;
  clip-path: circle(50%);
  animation: print-settle 700ms var(--ease) both;
}

.hero-kicker {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: strip-in 500ms var(--ease) both;
}

.hero-title-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-top: clamp(24px, 4vh, 48px);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  color: var(--ink);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(96px, 16.5vw, 238px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.69;
  animation: title-drop 620ms var(--ease) both;
}

h1 span:last-child {
  position: relative;
  left: clamp(24px, 8vw, 120px);
  color: var(--accent);
  text-shadow: 5px 2px 0 var(--blue);
}

.hero-date {
  position: relative;
  z-index: 2;
  margin: 0 0 4px -10vw;
  padding: 12px 16px;
  border: var(--rule);
  background: var(--surface);
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(14px, 1.7vw, 24px);
  font-weight: 600;
  line-height: 1.25;
  transform: rotate(3deg);
  animation: stamp-in 650ms 120ms var(--ease) both;
}

.registration-mark {
  position: absolute;
  z-index: 3;
  top: -12px;
  right: 21%;
  width: 76px;
  height: 76px;
  animation: spin-mark 16s linear infinite;
}

.registration-mark::before,
.registration-mark::after,
.registration-mark span {
  position: absolute;
  content: "";
  background: var(--blue);
}

.registration-mark::before {
  top: 0;
  left: 37px;
  width: 2px;
  height: 76px;
}

.registration-mark::after {
  top: 37px;
  left: 0;
  width: 76px;
  height: 2px;
}

.registration-mark span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.registration-mark span:nth-child(1) { inset: 9px auto auto 9px; }
.registration-mark span:nth-child(2) { inset: 9px 9px auto auto; }
.registration-mark span:nth-child(3) { inset: auto auto 9px 9px; }
.registration-mark span:nth-child(4) { inset: auto 9px 9px auto; }

.hero-bottom {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(340px, 1fr);
  gap: clamp(32px, 7vw, 112px);
  align-items: end;
  max-width: 1180px;
  margin: clamp(48px, 7vh, 96px) auto 80px;
}

.hero-intro {
  max-width: 48ch;
  margin-bottom: 0;
  font-size: clamp(18px, 1.6vw, 23px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-cta,
.shuffle-button {
  min-height: 52px;
  padding: 13px 22px;
  border: var(--rule);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background-color 180ms var(--ease), color 180ms var(--ease);
}

.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 6px 6px 0 var(--ink);
  text-decoration: none;
}

.shuffle-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  cursor: pointer;
}

.shuffle-glyph {
  color: var(--blue);
  font-size: 18px;
}

.shuffle-button.is-dealing .shuffle-glyph {
  animation: deal-spin 180ms steps(3, end) 3;
}

.hero-ticker {
  width: calc(100% + clamp(40px, 8vw, 128px));
  margin-left: calc(clamp(20px, 4vw, 64px) * -1);
  overflow: hidden;
  border-top: var(--rule);
  background: var(--ink);
  color: var(--bg);
  transform: rotate(-0.5deg);
}

.ticker-track {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 20px;
  min-height: 48px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  animation: ticker 28s linear infinite;
}

.ticker-track i {
  color: var(--accent);
  font-style: normal;
}

.chain-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(0, 1.35fr);
  gap: clamp(32px, 7vw, 112px);
  min-height: 420px;
  padding: 112px clamp(20px, 6vw, 96px) 96px;
  border-bottom: var(--rule);
  background: var(--surface);
}

.section-index {
  position: absolute;
  top: 16px;
  right: 24px;
  color: var(--accent);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(72px, 10vw, 150px);
  line-height: 0.8;
  opacity: 0.18;
}

.eyebrow {
  margin-bottom: 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 20px;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(48px, 6.2vw, 90px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.chain-heading p:last-child {
  max-width: 39ch;
  color: var(--muted);
}

.chain-track {
  display: flex;
  min-width: 0;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding: 8px 8px 16px;
  scrollbar-color: var(--accent) var(--bg);
}

.chain-empty {
  display: flex;
  width: 100%;
  min-height: 190px;
  align-items: center;
  justify-content: center;
  gap: 24px;
  border: 2px dashed var(--muted);
  padding: 32px;
}

.chain-empty p {
  max-width: 31ch;
  margin: 0;
  color: var(--muted);
}

.empty-domino {
  position: relative;
  display: block;
  width: 56px;
  height: 108px;
  flex: 0 0 auto;
  border: var(--rule);
}

.empty-domino::before,
.empty-domino i {
  position: absolute;
  content: "";
}

.empty-domino::before {
  top: 52px;
  left: 0;
  width: 100%;
  border-top: var(--rule);
}

.empty-domino i {
  top: 22px;
  left: 22px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 54px 0 var(--blue);
}

.chain-card {
  position: relative;
  display: flex;
  width: 172px;
  min-width: 172px;
  min-height: 204px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: var(--rule);
  background: var(--bg);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms var(--ease), color 180ms var(--ease), background-color 180ms var(--ease);
}

.chain-card + .chain-card {
  margin-left: -2px;
}

.chain-card:nth-child(even) {
  background: var(--blue);
  color: #fff9eb;
}

.chain-card .chain-number {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 56px;
  line-height: 0.8;
}

.chain-card .chain-title {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
}

.chain-card .chain-time {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.board-section {
  position: relative;
  padding: 128px clamp(20px, 4vw, 64px) 144px;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(32, 32, 29, 0.12) 50%, transparent calc(50% + 1px)),
    var(--bg);
}

.board-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
  max-width: 1312px;
  margin: 0 auto 64px;
}

.board-head h2 {
  margin-bottom: 0;
}

.board-note {
  margin: 0;
  padding-left: 20px;
  border-left: 5px solid var(--blue);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
}

.controls {
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) minmax(220px, 0.7fr) auto;
  max-width: 1312px;
  margin: 0 auto;
  border: var(--rule);
  background: var(--surface);
  box-shadow: 8px 8px 0 var(--ink);
}

.control {
  padding: 16px 18px;
}

.control + .control,
.saved-toggle {
  border-left: var(--rule);
}

.control label {
  display: block;
  margin-bottom: 7px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-wrap span {
  color: var(--blue);
  font-size: 24px;
  line-height: 1;
}

.control input,
.control select {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

.control input::placeholder {
  color: #716a5e;
  opacity: 1;
}

.control input:focus,
.control select:focus {
  border-bottom-color: var(--blue);
  outline-offset: 2px;
}

.saved-toggle {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 10px;
  align-items: center;
  min-width: 188px;
  min-height: 100%;
  padding: 16px 20px;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  background: var(--surface);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 180ms var(--ease), background-color 180ms var(--ease), transform 180ms var(--ease);
}

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

.saved-symbol {
  font-size: 24px;
  line-height: 1;
}

.saved-toggle[aria-pressed="true"] .saved-symbol {
  color: var(--surface);
}

.saved-count {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.result-line {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: 1312px;
  margin: 36px auto 18px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.registration-key {
  white-space: nowrap;
}

.registration-key i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.registration-key i:nth-of-type(2) {
  margin-left: 10px;
  background: var(--blue);
}

.event-list {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px 20px;
  max-width: 1312px;
  margin: 0 auto;
}

.event-tile {
  position: relative;
  grid-column: span 6;
  min-height: 330px;
  overflow: hidden;
  border: var(--rule);
  background: var(--surface);
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), background-color 200ms var(--ease);
}

.event-tile:nth-child(5n + 1),
.event-tile:nth-child(5n + 4) {
  grid-column: span 7;
}

.event-tile:nth-child(5n + 2),
.event-tile:nth-child(5n + 5) {
  grid-column: span 5;
}

.event-tile:nth-child(5n + 3) {
  grid-column: 3 / span 8;
}

.event-tile::after {
  position: absolute;
  z-index: 0;
  right: -28px;
  bottom: -52px;
  content: attr(data-number);
  color: rgba(235, 77, 54, 0.1);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 200px;
  line-height: 1;
  pointer-events: none;
}

.event-tile.sunday::after {
  color: rgba(39, 75, 214, 0.1);
}

.event-tile.is-deal-target {
  z-index: 2;
  background: #e9edff;
  box-shadow: 12px 12px 0 var(--blue);
  transform: translate(-4px, -4px);
}

.event-tile.is-saved .tile-corner {
  color: var(--accent-ink);
  background: var(--accent);
}

.tile-open {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 326px;
  grid-template-columns: 118px minmax(0, 1fr);
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.tile-open:focus,
.tile-open:focus-visible {
  outline-offset: -7px;
}

.tile-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px 12px;
  border-right: var(--rule);
  background: var(--ink);
  color: var(--bg);
}

.sunday .tile-side {
  background: var(--blue);
  color: #fff9eb;
}

.tile-day {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.tile-number {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 68px;
  line-height: 0.8;
}

.tile-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 24px clamp(20px, 3vw, 40px) 28px;
}

.tile-topline,
.tile-bottomline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tile-category {
  color: var(--accent);
}

.sunday .tile-category {
  color: var(--blue);
}

.tile-time {
  white-space: nowrap;
}

.tile-title {
  max-width: 17ch;
  margin: 24px 0 20px;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(34px, 3.5vw, 54px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.tile-summary {
  max-width: 55ch;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.tile-neighborhood {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-arrow {
  color: var(--accent);
  font-size: 22px;
}

.tile-corner {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-bottom: var(--rule);
  border-left: var(--rule);
  background: var(--surface);
  font-size: 19px;
  line-height: 1;
  pointer-events: none;
}

.empty-state {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  max-width: 900px;
  margin: 56px auto 0;
  padding: 36px;
  border: var(--rule);
  background: var(--surface);
  box-shadow: 10px 10px 0 var(--ink);
}

.empty-state[hidden] {
  display: none;
}

.empty-print {
  color: var(--accent);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 180px;
  line-height: 0.8;
  text-align: center;
  text-shadow: 6px 3px 0 var(--blue);
}

.empty-state h3 {
  margin-bottom: 10px;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.empty-state p:not(.eyebrow) {
  color: var(--muted);
}

.empty-state button {
  min-height: 48px;
  padding: 11px 18px;
  border: var(--rule);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), background-color 160ms var(--ease);
}

.field-notes {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: clamp(64px, 10vw, 160px);
  padding: 144px clamp(20px, 8vw, 128px);
  overflow: hidden;
  color: var(--bg);
  background: var(--ink);
}

.field-notes::before {
  position: absolute;
  width: 380px;
  height: 380px;
  top: -140px;
  right: 16%;
  border: 3px solid var(--blue);
  border-radius: 50%;
  content: "";
}

.notes-copy {
  position: relative;
  z-index: 1;
}

.notes-copy h2 {
  max-width: 11ch;
  color: var(--accent);
}

.notes-copy > p:last-child {
  max-width: 58ch;
  color: #e3dccb;
}

.notes-stamp {
  position: absolute;
  right: 4vw;
  bottom: 30px;
  padding: 16px 20px;
  border: 4px double var(--accent);
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-align: center;
  transform: rotate(-8deg);
}

.weekend-facts {
  position: relative;
  z-index: 1;
  align-self: center;
  margin: 0;
  border-top: 1px solid #777164;
}

.weekend-facts div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  min-height: 90px;
  padding: 16px 0;
  border-bottom: 1px solid #777164;
}

.weekend-facts dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.weekend-facts dd {
  margin: 0;
  color: var(--surface);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 48px;
  line-height: 1;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 96px;
  padding: 20px clamp(20px, 4vw, 64px);
  border-top: var(--rule);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding-inline: 10px;
  font-weight: 600;
  transition: color 160ms var(--ease), background-color 160ms var(--ease), transform 160ms var(--ease);
}

.detail-dialog {
  width: min(1080px, calc(100% - 40px));
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 3px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 16px 16px 0 var(--accent);
}

.detail-dialog::backdrop {
  background: rgba(32, 32, 29, 0.77);
  backdrop-filter: blur(2px);
}

.detail-shell {
  position: relative;
  display: grid;
  grid-template-columns: 100px minmax(0, 1.3fr) minmax(260px, 0.7fr);
  min-height: 620px;
}

.dialog-close {
  position: sticky;
  z-index: 4;
  top: 14px;
  left: calc(100% - 62px);
  display: grid;
  width: 48px;
  height: 48px;
  margin: 14px 14px -62px auto;
  place-items: center;
  border: var(--rule);
  border-radius: 50%;
  background: var(--surface);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: color 160ms var(--ease), background-color 160ms var(--ease), transform 160ms var(--ease);
}

.detail-day {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--blue);
  color: #fff9eb;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.detail-day.saturday {
  background: var(--ink);
}

.detail-main {
  padding: 64px clamp(28px, 5vw, 72px) 48px;
}

.detail-category {
  margin-bottom: 18px;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-main h2 {
  font-size: clamp(50px, 6vw, 84px);
}

.detail-body {
  max-width: 58ch;
  font-size: 18px;
  line-height: 1.65;
}

.detail-body p:last-child {
  margin-bottom: 0;
  padding-top: 22px;
  border-top: 2px solid var(--ink);
  font-weight: 550;
}

.detail-actions {
  margin-top: 42px;
}

.save-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border: var(--rule);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 6px 6px 0 var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), color 180ms var(--ease), background-color 180ms var(--ease);
}

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

.save-button span:first-child {
  font-size: 22px;
  line-height: 1;
}

.save-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.detail-facts {
  margin: 0;
  padding: 92px 28px 40px;
  border-left: var(--rule);
  background:
    radial-gradient(circle, rgba(39, 75, 214, 0.3) 0 1.5px, transparent 2px) 0 0 / 10px 10px,
    #e8e1cf;
}

.detail-facts div {
  padding: 16px 0;
  border-bottom: 2px solid var(--ink);
}

.detail-facts dt {
  margin-bottom: 4px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-facts dd {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

@keyframes title-drop {
  from { opacity: 0; transform: translateY(-32px) rotate(-1deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes strip-in {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes stamp-in {
  from { opacity: 0; transform: scale(1.35) rotate(8deg); }
  to { opacity: 1; transform: scale(1) rotate(3deg); }
}

@keyframes print-settle {
  from { opacity: 0; transform: scale(1.2); }
  to { opacity: 0.6; transform: scale(1); }
}

@keyframes spin-mark {
  to { transform: rotate(360deg); }
}

@keyframes ticker {
  to { transform: translateX(-50%); }
}

@keyframes deal-spin {
  to { transform: rotate(120deg); }
}

@media (hover: hover) and (pointer: fine) {
  .wordmark:hover,
  .top-nav a:hover {
    color: var(--accent-ink);
    background: var(--ink);
  }

  .primary-cta:hover {
    box-shadow: 10px 10px 0 var(--ink);
    transform: translate(-2px, -2px);
  }

  .shuffle-button:hover {
    color: var(--surface);
    background: var(--blue);
    transform: translateY(-2px);
  }

  .chain-card:hover {
    z-index: 2;
    color: var(--surface);
    background: var(--accent);
    transform: translateY(-6px) rotate(-1deg);
  }

  .saved-toggle:hover {
    color: var(--surface);
    background: var(--ink);
  }

  .event-tile:hover {
    z-index: 2;
    box-shadow: 10px 10px 0 var(--ink);
    transform: translate(-3px, -3px);
  }

  .event-tile:hover .tile-arrow {
    color: var(--blue);
    transform: translate(3px, -3px);
  }

  .empty-state button:hover {
    box-shadow: 5px 5px 0 var(--ink);
    transform: translate(-2px, -2px);
  }

  .site-footer a:hover {
    color: var(--ink);
    background: var(--surface);
    text-decoration: none;
  }

  .dialog-close:hover {
    color: var(--surface);
    background: var(--ink);
    transform: rotate(5deg);
  }

  .save-button:hover {
    box-shadow: 9px 9px 0 var(--ink);
    transform: translate(-2px, -2px);
  }
}

@media (max-width: 900px) {
  .top-nav {
    max-width: calc(100% - 88px);
    overflow-x: auto;
  }

  .top-nav a {
    flex: 0 0 auto;
    padding-inline: 18px;
  }

  .wordmark {
    min-width: 88px;
  }

  .hero-bottom,
  .chain-section,
  .field-notes {
    grid-template-columns: 1fr;
  }

  .hero-bottom {
    max-width: 650px;
  }

  .chain-section {
    gap: 40px;
  }

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

  .saved-toggle {
    grid-column: 1 / -1;
    min-height: 60px;
    border-top: var(--rule);
    border-left: 0;
  }

  .event-tile,
  .event-tile:nth-child(5n + 1),
  .event-tile:nth-child(5n + 2),
  .event-tile:nth-child(5n + 3),
  .event-tile:nth-child(5n + 4),
  .event-tile:nth-child(5n + 5) {
    grid-column: span 12;
  }

  .detail-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .detail-facts {
    grid-column: 1 / -1;
    padding: 32px;
    border-top: var(--rule);
    border-left: 0;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .site-header {
    min-height: 58px;
  }

  .wordmark,
  .top-nav a {
    min-height: 58px;
  }

  .top-nav {
    max-width: calc(100% - 78px);
  }

  .wordmark {
    min-width: 78px;
    font-size: 12px;
  }

  .top-nav a {
    padding-inline: 14px;
    font-size: 11px;
  }

  .hero {
    min-height: auto;
    padding-top: 20px;
  }

  .hero-kicker span:last-child {
    display: none;
  }

  .hero-title-wrap {
    display: block;
    margin-top: 54px;
  }

  h1 {
    font-size: clamp(76px, 24vw, 104px);
    line-height: 0.74;
  }

  h1 span:last-child {
    left: 10px;
    text-shadow: 3px 2px 0 var(--blue);
  }

  .hero-date {
    position: absolute;
    right: 0;
    bottom: -56px;
    margin: 0;
    font-size: 12px;
  }

  .registration-mark {
    top: -48px;
    right: 4px;
    width: 56px;
    height: 56px;
  }

  .registration-mark::before {
    left: 27px;
    height: 56px;
  }

  .registration-mark::after {
    top: 27px;
    width: 56px;
  }

  .registration-mark span {
    width: 11px;
    height: 11px;
  }

  .hero-bottom {
    gap: 28px;
    margin: 102px auto 64px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-cta,
  .shuffle-button {
    width: 100%;
    justify-content: center;
  }

  .chain-section {
    padding-block: 80px 72px;
  }

  h2 {
    font-size: clamp(44px, 15vw, 64px);
  }

  .chain-track {
    margin-inline: -8px;
  }

  .chain-empty {
    min-height: 180px;
    align-items: flex-start;
    flex-direction: column;
  }

  .board-section {
    padding-block: 96px 104px;
    background: var(--bg);
  }

  .board-head {
    grid-template-columns: 1fr;
    margin-bottom: 40px;
  }

  .controls {
    display: block;
    box-shadow: 6px 6px 0 var(--ink);
  }

  .control + .control,
  .saved-toggle {
    width: 100%;
    border-top: var(--rule);
    border-left: 0;
  }

  .saved-toggle {
    min-height: 62px;
  }

  .result-line {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 32px;
  }

  .event-list {
    gap: 18px;
  }

  .event-tile,
  .tile-open {
    min-height: 400px;
  }

  .tile-open {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .tile-side {
    padding: 18px 8px;
  }

  .tile-number {
    font-size: 46px;
  }

  .tile-content {
    padding: 22px 18px 24px;
  }

  .tile-topline,
  .tile-bottomline {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .tile-title {
    margin-block: 22px 16px;
    font-size: clamp(34px, 10vw, 44px);
  }

  .tile-summary {
    font-size: 15px;
  }

  .tile-corner {
    width: 34px;
    height: 34px;
  }

  .empty-state {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 22px;
  }

  .empty-print {
    font-size: 120px;
    text-align: left;
  }

  .field-notes {
    gap: 72px;
    padding-block: 104px 136px;
  }

  .notes-stamp {
    right: 20px;
    bottom: 20px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 28px;
  }

  .detail-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    box-shadow: 8px 8px 0 var(--accent);
  }

  .detail-shell {
    display: block;
  }

  .detail-day {
    min-height: 54px;
    justify-content: flex-start;
    padding: 16px 70px 16px 20px;
    writing-mode: horizontal-tb;
    transform: none;
  }

  .detail-main {
    padding: 38px 20px 36px;
  }

  .detail-main h2 {
    font-size: clamp(44px, 14vw, 62px);
  }

  .detail-body {
    font-size: 16px;
  }

  .save-button {
    width: 100%;
    justify-content: center;
  }

  .detail-facts {
    padding: 28px 20px;
  }

  .dialog-close {
    top: 10px;
    margin: 10px 10px -58px auto;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
