@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

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

:root {
  color-scheme: light dark;
  --page: #f2f3ef;
  --surface: #e5e7e1;
  --surface-strong: #d9dcd4;
  --text: #171916;
  --muted: #5d625a;
  --line: #b8bdb3;
  --accent: #3157d5;
  --accent-text: #f8f9f5;
  --focus: #3157d5;
  --shadow: rgb(45 54 42 / 18%);
  --header-height: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #151714;
    --surface: #20231f;
    --surface-strong: #2b2f29;
    --text: #f0f2ec;
    --muted: #b8bdb4;
    --line: #454a42;
    --accent: #7893ef;
    --accent-text: #10120f;
    --focus: #9cb0f4;
    --shadow: rgb(0 0 0 / 35%);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.detail-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
  border-radius: 0;
}

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

a {
  color: inherit;
}

button {
  color: inherit;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 10px;
  z-index: 40;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-text);
  transform: translateY(-150%);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 10px clamp(18px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  font-weight: 650;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: var(--accent);
  color: var(--accent-text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: -0.05em;
}

.header-date {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.header-link {
  justify-self: end;
  font-size: 14px;
  font-weight: 600;
  text-underline-offset: 4px;
}

.hero {
  min-height: calc(100dvh - var(--header-height));
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(28px, 5vw, 84px);
  align-items: stretch;
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(36px, 6vh, 72px) clamp(18px, 5vw, 72px) clamp(36px, 6vh, 64px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.hero h1 {
  max-width: 790px;
  margin: 0;
  font-size: clamp(60px, 8vw, 124px);
  font-weight: 520;
  letter-spacing: -0.075em;
  line-height: 0.9;
}

.hero h1 em {
  color: var(--accent);
  font-style: italic;
  font-weight: 420;
  line-height: 1.1;
  padding-bottom: 0.08em;
}

.hero-intro {
  max-width: 540px;
  margin: clamp(26px, 4vh, 44px) 0 28px;
  color: var(--muted);
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.hero-cta,
.message-state button,
.detail-save {
  display: inline-flex;
  min-height: 50px;
  width: max-content;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 12px 18px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease;
}

.hero-cta:hover,
.message-state button:hover,
.detail-save:hover {
  background: color-mix(in srgb, var(--accent) 87%, var(--text));
}

.hero-cta:active,
.message-state button:active,
.detail-save:active,
.open-item:active,
.saved-filter:active,
.detail-close:active {
  transform: translateY(1px);
}

.hero-visual {
  position: relative;
  min-height: 520px;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: var(--surface);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.hero-visual figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}

.browse {
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(72px, 10vw, 150px) clamp(18px, 5vw, 72px) 120px;
}

.browse-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 52px;
}

.browse-heading h2 {
  margin: 0;
  font-size: clamp(46px, 6vw, 90px);
  font-weight: 520;
  letter-spacing: -0.065em;
  line-height: 0.95;
}

.result-summary {
  margin: 20px 0 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.image-disclaimer {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.control-bar {
  position: sticky;
  top: calc(var(--header-height) - 1px);
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(190px, 0.4fr) auto;
  align-items: end;
  gap: 1px;
  margin-bottom: 46px;
  border: 1px solid var(--line);
  background: var(--line);
  box-shadow: 0 18px 35px color-mix(in srgb, var(--shadow) 55%, transparent);
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--page);
}

.field label {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.input-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  outline: 0;
}

.field input::placeholder {
  color: color-mix(in srgb, var(--muted) 86%, transparent);
  opacity: 1;
}

.field:focus-within {
  box-shadow: inset 0 -3px 0 var(--focus);
}

.field input:focus-visible,
.field select:focus-visible {
  outline: 0;
}

.clear-search {
  flex: 0 0 auto;
  padding: 4px 0 4px 12px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.saved-filter {
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border: 0;
  background: var(--page);
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

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

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

.event-grid,
.loading-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 22px;
}

.event-card,
.skeleton {
  grid-column: span 5;
}

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

.event-card {
  position: relative;
  display: flex;
  min-height: 540px;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  animation: card-in 520ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--index) * 45ms);
}

@keyframes card-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.event-media {
  position: relative;
  height: clamp(220px, 27vw, 360px);
  overflow: hidden;
  background: var(--surface-strong);
}

.event-card:nth-child(even) .event-media {
  height: clamp(250px, 30vw, 390px);
}

.event-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.76) contrast(1.04);
  transition: transform 650ms cubic-bezier(0.16, 1, 0.3, 1), filter 300ms ease;
}

.event-card:hover .event-media img,
.event-card:focus-within .event-media img {
  transform: scale(1.025);
  filter: saturate(0.95) contrast(1.02);
}

.event-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(20px, 3vw, 34px);
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 18px;
  margin-bottom: 24px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

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

.event-card h3 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(28px, 3.2vw, 46px);
  font-weight: 520;
  letter-spacing: -0.05em;
  line-height: 1;
}

.event-summary {
  max-width: 54ch;
  margin: 20px 0 30px;
  color: var(--muted);
  font-size: 15px;
}

.open-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: auto;
  padding: 15px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.open-item span:last-child {
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.event-card:hover .open-item,
.open-item:focus-visible {
  color: var(--accent);
}

.loading-grid {
  min-height: 600px;
}

.skeleton {
  min-height: 480px;
  background: var(--surface);
  background-image: linear-gradient(105deg, transparent 30%, color-mix(in srgb, var(--page) 75%, transparent) 48%, transparent 66%);
  background-size: 220% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .skeleton {
    animation: shimmer 1.7s ease-in-out infinite;
  }

  @keyframes shimmer {
    to { background-position-x: -220%; }
  }
}

.message-state {
  min-height: 420px;
  padding: clamp(36px, 7vw, 90px);
  border: 1px solid var(--line);
  background: var(--surface);
}

.message-kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.message-state h3 {
  max-width: 12ch;
  margin: 0 0 20px;
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 520;
  letter-spacing: -0.055em;
  line-height: 1;
}

.message-state > p:not(.message-kicker) {
  max-width: 45ch;
  margin: 0 0 28px;
  color: var(--muted);
}

.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgb(10 12 9 / 58%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.detail-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.detail {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(680px, 100%);
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--page);
  box-shadow: -24px 0 70px var(--shadow);
  transform: translateX(100%);
  pointer-events: none;
  transition: transform 330ms cubic-bezier(0.16, 1, 0.3, 1);
}

.detail.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.detail-topbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 38px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 90%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.detail-topbar p {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.detail-close {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  background: var(--page);
  font-weight: 650;
  cursor: pointer;
}

.detail-image {
  height: min(42vh, 410px);
  margin: 0;
  background: var(--surface);
  overflow: hidden;
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8) contrast(1.03);
}

.detail-main {
  padding: clamp(28px, 6vw, 58px) clamp(18px, 6vw, 58px) 70px;
}

.detail-category {
  margin: 0 0 20px;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.detail h2 {
  margin: 0 0 30px;
  font-size: clamp(42px, 7vw, 68px);
  font-weight: 520;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0 0 38px;
  border: 1px solid var(--line);
  background: var(--line);
}

.detail-facts div {
  min-height: 90px;
  padding: 14px;
  background: var(--page);
}

.detail-facts dt {
  margin-bottom: 9px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

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

.detail-copy {
  margin-bottom: 34px;
}

.detail-copy p {
  max-width: 55ch;
  margin: 0 0 20px;
  font-size: 18px;
  line-height: 1.55;
}

.detail-copy p:last-child {
  padding-left: 18px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.detail-save {
  width: 100%;
}

.detail-save[aria-pressed="true"] {
  background: transparent;
  color: var(--accent);
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 30px;
  align-items: end;
  padding: 36px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

.site-footer p:first-child {
  color: var(--text);
  font-weight: 650;
}

.site-footer a {
  text-underline-offset: 4px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
    gap: 30px;
  }

  .hero h1 {
    font-size: clamp(58px, 9vw, 82px);
  }

  .control-bar {
    grid-template-columns: 1fr 220px;
  }

  .saved-filter {
    grid-column: 1 / -1;
    min-height: 58px;
    justify-content: space-between;
  }
}

@media (max-width: 767px) {
  :root {
    --header-height: 60px;
  }

  html {
    scroll-padding-top: calc(var(--header-height) + 12px);
  }

  .site-header {
    grid-template-columns: 1fr auto;
    min-height: var(--header-height);
    padding: 8px 16px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .header-date {
    font-size: 10px;
  }

  .header-link {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 38px 16px 40px;
  }

  .hero-copy {
    display: block;
  }

  .eyebrow {
    margin-bottom: 18px;
  }

  .hero h1 {
    max-width: 7ch;
    font-size: clamp(56px, 19vw, 74px);
    line-height: 0.9;
  }

  .hero-intro {
    max-width: 34ch;
    margin: 25px 0 24px;
    font-size: 18px;
  }

  .hero-visual {
    min-height: 0;
    aspect-ratio: 4 / 2.9;
  }

  .browse {
    padding: 76px 16px 80px;
  }

  .browse-heading {
    margin-bottom: 34px;
  }

  .browse-heading h2 {
    font-size: clamp(44px, 14vw, 58px);
  }

  .control-bar {
    position: static;
    grid-template-columns: 1fr;
    margin-bottom: 30px;
    box-shadow: none;
  }

  .field {
    padding: 11px 13px;
  }

  .saved-filter {
    grid-column: auto;
    min-height: 58px;
  }

  .event-grid,
  .loading-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .event-card,
  .event-card:nth-child(4n + 1),
  .event-card:nth-child(4n + 4),
  .skeleton,
  .skeleton-wide {
    grid-column: 1;
  }

  .event-card {
    min-height: 0;
  }

  .event-media,
  .event-card:nth-child(even) .event-media {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .event-body {
    padding: 22px;
  }

  .event-card h3 {
    font-size: 34px;
  }

  .event-summary {
    margin-bottom: 26px;
  }

  .detail {
    width: 100%;
  }

  .detail-topbar {
    min-height: 60px;
  }

  .detail-image {
    height: 32vh;
    min-height: 230px;
  }

  .detail-main {
    padding: 28px 18px 54px;
  }

  .detail h2 {
    font-size: 46px;
  }

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

  .detail-facts div {
    min-height: 74px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 30px 16px;
  }
}

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

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

@media (prefers-reduced-transparency: reduce) {
  .site-header,
  .detail-topbar {
    background: var(--page);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
