@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

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

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

:root {
  --ink: #171713;
  --paper: #f6f1e7;
  --white: #fffdf8;
  --orange: #ff5c35;
  --orange-dark: #a52d10;
  --blue: #2447e6;
  --blue-dark: #1732ad;
  --lime: #d6ee43;
  --lavender: #cbbcff;
  --muted: #665f54;
  --line: #211f1b;
  --focus: #005fcc;
  --shadow: 7px 7px 0 var(--ink);
  --radius: 0;
  --header-height: 92px;
  --max-width: 1320px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body.dialog-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  touch-action: manipulation;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 12px 16px;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
}

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

.site-header {
  width: min(calc(100% - 64px), var(--max-width));
  min-height: var(--header-height);
  margin: 0 auto;
  border-bottom: 2px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
}

.wordmark {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 900;
  line-height: .8;
  letter-spacing: -.05em;
}

.wordmark-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--orange);
  border: 2px solid var(--ink);
  font-family: "DM Serif", Georgia, serif;
  font-size: 30px;
  line-height: 1;
  transform: rotate(-4deg);
}

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

.issue {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: .04em;
}

.issue span {
  color: var(--muted);
  text-transform: uppercase;
}

.issue strong {
  padding: 9px 12px;
  background: var(--ink);
  color: var(--white);
  font-weight: 400;
}

main,
footer {
  width: min(calc(100% - 64px), var(--max-width));
  margin-inline: auto;
}

.hero {
  min-height: 610px;
  padding: 56px 0 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(440px, .88fr);
  gap: clamp(40px, 8vw, 112px);
  align-items: center;
}

.eyebrow,
.section-index,
.detail-kicker,
.detail-date,
.result-bar,
.category-tag,
.card-number,
.detail-art-category,
.detail-art-day {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
}

.eyebrow span {
  width: 10px;
  height: 10px;
  background: var(--orange);
  border-radius: 50%;
  box-shadow: 14px 0 0 var(--blue);
  margin-right: 14px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: clamp(64px, 7vw, 106px);
  font-weight: 900;
  letter-spacing: -.075em;
  line-height: .85;
  text-wrap: balance;
}

h1 em {
  color: var(--orange-dark);
  font-family: "DM Serif", Georgia, serif;
  font-weight: 400;
}

.hero-intro {
  max-width: 530px;
  margin: 32px 0;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.5;
}

.jump-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--ink);
  font-weight: 800;
  text-decoration: none;
  transition: gap 180ms ease;
}

.jump-link:hover {
  gap: 18px;
}

.jump-link svg {
  width: 19px;
  height: 19px;
}

.hero-poster {
  position: relative;
  width: min(100%, 500px);
  aspect-ratio: 5 / 5.25;
  justify-self: end;
  overflow: hidden;
  background: var(--blue);
  border: 2px solid var(--ink);
  box-shadow: 12px 12px 0 var(--lime);
  color: var(--white);
}

.poster-label {
  position: absolute;
  z-index: 2;
  top: 20px;
  right: 20px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.25;
  text-align: right;
}

.poster-circle {
  position: absolute;
  top: 16%;
  left: -8%;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid var(--ink);
}

.poster-type {
  position: absolute;
  z-index: 1;
  right: 8%;
  bottom: 10%;
  font-size: clamp(74px, 7vw, 112px);
  font-weight: 900;
  letter-spacing: -.085em;
  line-height: .68;
  text-align: right;
}

.poster-foot {
  position: absolute;
  z-index: 2;
  bottom: 12px;
  left: 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: .12em;
}

.browse {
  padding: 72px 0 104px;
  border-top: 2px solid var(--line);
}

.browse-heading {
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: end;
}

.section-index {
  margin: 0 0 12px;
  color: var(--blue-dark);
}

.browse h2 {
  margin: 0;
  font-size: clamp(46px, 5vw, 72px);
  line-height: .95;
  letter-spacing: -.06em;
}

.browse-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.controls {
  position: relative;
  z-index: 2;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(270px, 1fr) minmax(190px, .42fr) auto;
  gap: 12px;
  align-items: end;
  background: var(--ink);
  color: var(--white);
}

.field label {
  display: block;
  margin: 0 0 7px 2px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

.input-wrap svg,
.select-wrap svg {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-wrap svg {
  left: 15px;
}

.select-wrap svg {
  right: 14px;
}

input,
select {
  width: 100%;
  min-height: 54px;
  border: 2px solid transparent;
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
}

input {
  padding: 12px 16px 12px 50px;
}

select {
  padding: 12px 46px 12px 16px;
  appearance: none;
  cursor: pointer;
}

input::placeholder {
  color: #6e6a61;
  opacity: 1;
}

input:focus,
select:focus {
  border-color: var(--lime);
  outline: 3px solid var(--lime);
  outline-offset: 1px;
}

.saved-toggle {
  min-width: 168px;
  min-height: 54px;
  padding: 10px 13px;
  border: 2px solid var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font-weight: 800;
  transition: background-color 160ms ease, color 160ms ease;
}

.saved-toggle:hover {
  background: rgba(255, 255, 255, .12);
}

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

.saved-toggle svg {
  width: 20px;
  height: 20px;
}

.saved-toggle[aria-pressed="true"] svg,
.save-item[aria-pressed="true"] svg {
  fill: currentColor;
}

.saved-count {
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 99px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

.result-bar {
  min-height: 52px;
  padding: 0 2px;
  border-bottom: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.result-bar p {
  margin: 0;
  color: var(--ink);
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-left: 2px solid var(--line);
}

.event-card {
  --card-accent: var(--orange);
  position: relative;
  min-height: 322px;
  padding: 26px 28px 24px;
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--white);
  transition: background-color 180ms ease;
}

.event-card:hover,
.event-card:focus-within {
  background: #fff9ec;
}

.event-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 7px;
  height: 100%;
  background: var(--card-accent);
}

.event-card[data-category="Music"] { --card-accent: #ff5c35; }
.event-card[data-category="Art"] { --card-accent: #2447e6; }
.event-card[data-category="Food"] { --card-accent: #bdde22; }
.event-card[data-category="Film"] { --card-accent: #926dff; }
.event-card[data-category="Literature"] { --card-accent: #ef9cb3; }
.event-card[data-category="Outdoors"] { --card-accent: #25a271; }
.event-card[data-category="Walks"] { --card-accent: #efb730; }

.event-card[data-category="Art"] .category-tag {
  color: var(--white);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.category-tag {
  padding: 5px 8px;
  border: 1px solid var(--line);
  background: var(--card-accent);
}

.card-number {
  color: var(--muted);
}

.event-card h3 {
  max-width: 560px;
  margin: 24px 0 14px;
  font-family: "DM Serif", Georgia, serif;
  font-size: clamp(29px, 2.5vw, 38px);
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.card-summary {
  max-width: 560px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.card-bottom {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid #b9b2a6;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  line-height: 1.45;
}

.card-meta strong {
  color: var(--ink);
  font-weight: 700;
}

.open-item {
  min-height: 46px;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  transition: background-color 160ms ease, color 160ms ease;
}

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

.open-item svg {
  width: 18px;
  height: 18px;
  transition: transform 160ms ease;
}

.open-item:hover svg {
  transform: translateX(3px);
}

.card-saved {
  position: absolute;
  top: 24px;
  right: 64px;
  width: 22px;
  height: 22px;
  color: var(--blue-dark);
  fill: currentColor;
}

.empty-state {
  min-height: 330px;
  padding: 64px;
  border: 2px solid var(--line);
  border-top: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 36px;
  align-items: center;
  background: var(--lavender);
}

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

.empty-mark {
  font-family: "DM Serif", Georgia, serif;
  font-size: 120px;
  line-height: .8;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: -.03em;
}

.empty-state p {
  margin: 0 0 20px;
}

.reset-button {
  min-height: 48px;
  padding: 10px 18px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  font-weight: 800;
}

footer {
  min-height: 250px;
  padding: 48px 0 64px;
  border-top: 2px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 40px;
  align-items: start;
}

.footer-brand {
  color: var(--orange-dark);
  font-size: clamp(38px, 5vw, 72px);
  font-weight: 900;
  letter-spacing: -.07em;
  line-height: 1;
}

footer p {
  margin: 0;
}

.footer-meta {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  line-height: 1.7;
  text-transform: uppercase;
}

.detail-dialog {
  width: min(1040px, calc(100% - 48px));
  max-width: none;
  height: min(760px, calc(100dvh - 48px));
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  box-shadow: 14px 14px 0 rgba(23, 23, 19, .3);
}

.detail-dialog::backdrop {
  background: rgba(23, 23, 19, .72);
  backdrop-filter: blur(2px);
}

.detail-dialog[open] {
  animation: dialog-in 220ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.detail-layout {
  height: 100%;
  display: grid;
  grid-template-columns: 35% 65%;
}

.detail-art {
  position: relative;
  overflow: hidden;
  border-right: 2px solid var(--ink);
  background: var(--art-color, var(--orange));
  color: var(--art-ink, var(--ink));
}

.detail-art::before,
.detail-art::after {
  content: "";
  position: absolute;
  border: 2px solid var(--ink);
  background: var(--paper);
}

.detail-art::before {
  width: 300px;
  height: 300px;
  left: -120px;
  bottom: 80px;
  border-radius: 50%;
}

.detail-art::after {
  width: 90px;
  height: 180px;
  right: 32px;
  top: 28%;
  transform: rotate(18deg);
  background: var(--blue);
}

.detail-art-day {
  position: absolute;
  z-index: 1;
  top: 28px;
  left: 28px;
}

.detail-art-number {
  position: absolute;
  z-index: 2;
  left: 18px;
  bottom: -45px;
  font-family: "DM Serif", Georgia, serif;
  font-size: 260px;
  line-height: 1;
  letter-spacing: -.08em;
}

.detail-art-category {
  position: absolute;
  z-index: 2;
  right: 24px;
  bottom: 28px;
  writing-mode: vertical-rl;
}

.detail-content {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.detail-topbar {
  min-height: 72px;
  padding: 0 28px;
  border-bottom: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.close-detail {
  min-width: 92px;
  min-height: 46px;
  padding: 8px 0 8px 14px;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
}

.close-detail svg {
  width: 22px;
  height: 22px;
}

.detail-scroll {
  min-height: 0;
  padding: 42px clamp(28px, 5vw, 64px) 48px;
  overflow-y: auto;
}

.detail-date {
  margin: 0 0 18px;
  color: var(--blue-dark);
}

.detail-title {
  max-width: 680px;
  margin: 0 0 28px;
  font-family: "DM Serif", Georgia, serif;
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 400;
  line-height: .96;
  letter-spacing: -.04em;
  text-wrap: balance;
}

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

.detail-body p {
  margin: 0 0 16px;
}

.detail-body p + p {
  padding: 16px 0 0 24px;
  border-left: 4px solid var(--art-color, var(--orange));
  font-size: 16px;
  font-weight: 600;
}

.detail-facts {
  margin: 36px 0 0;
  border-top: 2px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-facts div {
  padding: 16px 10px 16px 0;
  border-bottom: 1px solid #b9b2a6;
}

.detail-facts div:nth-child(odd) {
  border-right: 1px solid #b9b2a6;
}

.detail-facts div:nth-child(even) {
  padding-left: 20px;
}

.detail-facts dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.detail-facts dd {
  margin: 0;
  font-weight: 700;
}

.detail-actions {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.detail-actions p {
  max-width: 200px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.save-item {
  min-height: 54px;
  padding: 12px 20px;
  border: 2px solid var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--lime);
  cursor: pointer;
  font-weight: 800;
  transition: box-shadow 150ms ease, transform 150ms ease;
}

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

.save-item[aria-pressed="true"] {
  background: var(--ink);
  color: var(--white);
}

.save-item svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 900px) {
  :root { --header-height: 80px; }

  .site-header,
  main,
  footer {
    width: min(calc(100% - 40px), var(--max-width));
  }

  .header-note { display: none; }

  .hero {
    grid-template-columns: 1fr .75fr;
    gap: 36px;
    min-height: 520px;
  }

  .poster-type { font-size: 68px; }

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

  .saved-toggle { grid-column: 1 / -1; }

  .detail-layout { grid-template-columns: 29% 71%; }
}

@media (max-width: 680px) {
  :root { --header-height: 72px; }

  .site-header,
  main,
  footer {
    width: calc(100% - 32px);
  }

  .site-header {
    grid-template-columns: 1fr auto;
    gap: 16px;
  }

  .wordmark-mark {
    width: 38px;
    height: 38px;
    font-size: 26px;
  }

  .issue span { display: none; }
  .issue strong { padding: 7px 8px; font-size: 9px; }

  .hero {
    min-height: 0;
    padding: 40px 0 54px;
    display: block;
  }

  .eyebrow { margin-bottom: 20px; }

  h1 {
    font-size: clamp(55px, 16.4vw, 68px);
    line-height: .88;
  }

  .hero-intro {
    margin: 26px 0 24px;
    font-size: 17px;
  }

  .hero-poster {
    width: calc(100% - 10px);
    margin-top: 46px;
    aspect-ratio: 5 / 4;
    box-shadow: 9px 9px 0 var(--lime);
  }

  .poster-type {
    bottom: 13%;
    font-size: clamp(64px, 20vw, 82px);
  }

  .poster-circle {
    top: 10%;
    width: 68%;
  }

  .browse { padding: 52px 0 72px; }

  .browse-heading {
    margin-bottom: 28px;
    display: block;
  }

  .browse h2 { font-size: 48px; }

  .browse-note {
    margin-top: 18px;
    max-width: 330px;
  }

  .controls {
    margin-inline: -16px;
    padding: 16px;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .saved-toggle { grid-column: auto; }

  .result-bar {
    min-height: 58px;
    align-items: center;
  }

  .result-bar > span { display: none; }

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

  .event-card {
    min-height: 348px;
    padding: 24px 20px 22px 24px;
  }

  .event-card h3 {
    margin-top: 22px;
    font-size: 32px;
  }

  .card-bottom {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .open-item {
    width: 100%;
    justify-content: space-between;
  }

  .card-saved { right: 56px; }

  .empty-state {
    min-height: 360px;
    padding: 36px 24px;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .empty-mark { font-size: 88px; }

  footer {
    min-height: 300px;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .detail-dialog {
    width: 100%;
    height: 100dvh;
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  .detail-layout { display: block; }
  .detail-art { display: none; }

  .detail-content { height: 100dvh; }

  .detail-topbar {
    min-height: calc(68px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 20px 0;
  }

  .detail-scroll {
    padding: 34px 20px calc(40px + env(safe-area-inset-bottom));
  }

  .detail-title {
    font-size: clamp(42px, 13vw, 54px);
    line-height: .98;
  }

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

  .detail-facts { grid-template-columns: 1fr; }

  .detail-facts div:nth-child(odd) { border-right: 0; }

  .detail-facts div:nth-child(even) { padding-left: 0; }

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

  .save-item { justify-content: center; }

  .detail-actions p { max-width: none; }
}

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

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