@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.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 {
  color-scheme: light dark;
  --page: #f1f0ea;
  --surface: #faf9f4;
  --surface-2: #e4e3dc;
  --ink: #1b1d22;
  --muted: #5c5e63;
  --line: #c9c8c1;
  --accent: #3456d1;
  --accent-ink: #f8f9ff;
  --on-image: #f7f6f1;
  --shadow: rgba(41, 45, 58, 0.15);
  --radius-card: 18px;
  --radius-control: 10px;
  --radius-pill: 999px;
  --max: 1320px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #17191d;
    --surface: #202329;
    --surface-2: #2a2e35;
    --ink: #f0f0ec;
    --muted: #b8bbc2;
    --line: #3c4049;
    --accent: #7792f4;
    --accent-ink: #101526;
    --shadow: rgba(2, 4, 8, 0.38);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

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

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--page);
  transform: translateY(-160%);
}

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

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

.site-header {
  width: min(calc(100% - 48px), var(--max));
  height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

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

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

.hero {
  width: min(calc(100% - 48px), var(--max));
  min-height: calc(100dvh - 96px);
  max-height: 820px;
  margin: 0 auto 96px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(480px, 1.1fr);
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--accent);
  color: var(--accent-ink);
}

.hero-copy {
  align-self: center;
  padding: 56px clamp(36px, 5vw, 76px);
}

.eyebrow {
  margin: 0 0 24px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(54px, 6.2vw, 92px);
  line-height: 0.94;
  letter-spacing: -0.07em;
}

.hero-intro {
  max-width: 470px;
  margin: 30px 0 34px;
  font-size: 18px;
  line-height: 1.45;
}

.primary-link,
.secondary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.primary-link {
  background: var(--accent-ink);
  color: var(--accent);
}

.primary-link:hover {
  transform: translateY(-2px);
}

.primary-link:active,
.secondary-button:active,
.saved-toggle:active,
.open-item:active,
.save-button:active,
.close-detail:active {
  transform: translateY(1px);
}

.hero-visual {
  position: relative;
  min-height: 100%;
  margin: 16px 16px 16px 0;
  overflow: hidden;
  border-radius: calc(var(--radius-card) - 5px);
  background: #303238;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 44%, rgba(13, 18, 34, 0.68));
  pointer-events: none;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.05);
}

.hero-note {
  position: absolute;
  z-index: 1;
  right: 32px;
  bottom: 32px;
  left: 32px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  color: var(--on-image);
}

.hero-note span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-note strong {
  font-size: clamp(28px, 3vw, 44px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-align: right;
}

.browse {
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
  padding: 0 0 120px;
}

.browse-heading {
  max-width: 760px;
  margin-bottom: 38px;
}

.browse-heading h2 {
  margin: 0 0 12px;
  font-size: clamp(44px, 5.5vw, 76px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.browse-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.control-bar {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 0.45fr) auto;
  gap: 12px;
  margin-bottom: 32px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  box-shadow: 0 14px 40px var(--shadow);
  backdrop-filter: blur(16px);
}

.field {
  display: grid;
  gap: 5px;
}

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

.field input,
.field select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--page);
  color: var(--ink);
}

.field input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.saved-toggle {
  align-self: end;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 0 8px 0 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--page);
  color: var(--ink);
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

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

.saved-count {
  min-width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

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

.event-card {
  grid-column: span 6;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 10px 34px var(--shadow);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms ease;
}

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

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

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px var(--shadow);
}

.event-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}

.event-card:nth-child(5n + 1) .event-image,
.event-card:nth-child(5n + 4) .event-image {
  aspect-ratio: 16 / 8;
}

.event-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.event-card:hover .event-image img {
  transform: scale(1.025);
}

.event-saved-flag {
  color: var(--accent);
  font-weight: 700;
}

.event-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px 24px;
  padding: 24px;
}

.event-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.category {
  color: var(--accent);
  font-weight: 700;
}

.event-title {
  margin: 0;
  font-size: clamp(24px, 2.3vw, 34px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.event-summary {
  grid-column: 1 / -1;
  max-width: 60ch;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.event-price {
  align-self: start;
  margin: 3px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 600;
}

.open-item {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 0 0 3px;
  border: 0;
  border-bottom: 2px solid var(--accent);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.loading-grid .skeleton {
  grid-column: span 4;
  min-height: 430px;
  border-radius: var(--radius-card);
  background: var(--surface-2);
}

@media (prefers-reduced-motion: no-preference) {
  .loading-grid .skeleton {
    background: linear-gradient(100deg, var(--surface-2) 35%, var(--surface) 50%, var(--surface-2) 65%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
  }

  .hero-copy > * {
    animation: rise-in 650ms both cubic-bezier(0.16, 1, 0.3, 1);
  }

  .hero-copy > :nth-child(2) { animation-delay: 70ms; }
  .hero-copy > :nth-child(3) { animation-delay: 140ms; }
  .hero-copy > :nth-child(4) { animation-delay: 210ms; }

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

  @keyframes rise-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

.empty-state,
.error-state {
  padding: clamp(46px, 8vw, 100px) 24px;
  border-radius: var(--radius-card);
  background: var(--surface);
  text-align: center;
}

.empty-state h3,
.error-state h3 {
  margin: 5px 0 10px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.empty-state p,
.error-state p {
  max-width: 470px;
  margin: 0 auto 24px;
  color: var(--muted);
}

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

.secondary-button {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--page);
}

footer {
  width: min(calc(100% - 48px), var(--max));
  min-height: 180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

footer p:first-child {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.detail-dialog {
  width: min(1080px, calc(100% - 40px));
  max-height: min(900px, calc(100dvh - 40px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 32px 100px rgba(8, 11, 18, 0.44);
}

.detail-dialog::backdrop {
  background: rgba(10, 12, 17, 0.72);
  backdrop-filter: blur(7px);
}

.detail-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(430px, 1.15fr);
  max-height: inherit;
  overflow: auto;
}

.detail-image {
  position: sticky;
  top: 0;
  min-height: min(820px, calc(100dvh - 40px));
  overflow: hidden;
  background: var(--surface-2);
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 56px;
}

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

.close-detail {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--page);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.detail-panel h2 {
  margin: 0 0 24px;
  font-size: clamp(42px, 5vw, 70px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.detail-body-copy {
  margin: 0 0 38px;
  font-size: 18px;
  line-height: 1.6;
  white-space: pre-line;
}

.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 0 0 38px;
  padding: 28px;
  border-radius: var(--radius-card);
  background: var(--page);
}

.detail-facts div {
  min-width: 0;
}

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

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

.save-button {
  width: 100%;
  min-height: 54px;
  padding: 0 24px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}

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

@media (max-width: 900px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr 1fr;
  }

  .hero-copy {
    padding: 44px 32px;
  }

  h1 {
    font-size: clamp(48px, 7vw, 66px);
  }

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

@media (max-width: 767px) {
  .site-header {
    width: calc(100% - 32px);
    height: 64px;
    grid-template-columns: 1fr auto;
  }

  .weekend-label {
    justify-self: end;
    font-size: 10px;
  }

  .header-link {
    display: none;
  }

  .hero {
    width: calc(100% - 24px);
    min-height: 680px;
    max-height: none;
    margin-bottom: 64px;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .hero-copy {
    padding: 36px 24px 30px;
  }

  .eyebrow {
    margin-bottom: 18px;
    font-size: 10px;
  }

  h1 {
    font-size: clamp(47px, 13.6vw, 60px);
  }

  .hero-intro {
    margin: 20px 0 24px;
    font-size: 16px;
  }

  .hero-visual {
    min-height: 285px;
    margin: 0 10px 10px;
  }

  .hero-note {
    right: 18px;
    bottom: 18px;
    left: 18px;
  }

  .hero-note strong {
    font-size: 27px;
  }

  .browse {
    width: calc(100% - 32px);
    padding-bottom: 72px;
  }

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

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

  .control-bar {
    position: static;
    grid-template-columns: 1fr 1fr;
    padding: 10px;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .saved-toggle {
    gap: 8px;
    padding-left: 12px;
    font-size: 13px;
  }

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

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

  .event-card:nth-child(n) .event-image {
    aspect-ratio: 16 / 9;
  }

  .event-body {
    padding: 20px;
  }

  .event-title {
    font-size: 27px;
  }

  footer {
    width: calc(100% - 32px);
    min-height: 220px;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 7px;
  }

  footer p {
    margin: 0;
  }

  .detail-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 12px);
    margin: auto 0 0;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
  }

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

  .detail-image {
    position: relative;
    min-height: 240px;
    max-height: 280px;
  }

  .detail-panel {
    padding: 24px 20px 32px;
  }

  .detail-topline {
    margin-bottom: 30px;
  }

  .detail-panel h2 {
    font-size: 42px;
  }

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

  .detail-facts {
    gap: 20px 14px;
    padding: 20px;
  }
}

@media (max-width: 370px) {
  .control-bar {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: 1;
  }
}

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

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

@media (prefers-reduced-transparency: reduce) {
  .control-bar,
  .detail-dialog::backdrop {
    backdrop-filter: none;
  }

  .control-bar {
    background: var(--surface);
  }
}
