/* ============================================================
   Two Days - weekend discovery
   Palette: cool off-white paper, near-black ink, one cobalt accent.
   Shape scale: cards 16px, controls pill, dialog 20px.
   ============================================================ */

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #ebede8;
  --ink: #14161a;
  --muted: #565d66;
  --line: #dcdfda;
  --accent: #1d3fd6;
  --accent-ink: #ffffff;
  --accent-soft: #e6eafe;
  --radius-card: 16px;
  --radius-control: 999px;
  --radius-dialog: 20px;
  --shadow-card: 0 1px 2px rgba(20, 22, 26, 0.04), 0 14px 34px -22px rgba(20, 22, 26, 0.42);
  --shadow-pop: 0 24px 70px -28px rgba(20, 22, 26, 0.55);
  --ring: 0 0 0 3px rgba(29, 63, 214, 0.32);
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Work Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --max: 1240px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101216;
    --surface: #181b21;
    --surface-2: #20242b;
    --ink: #eef0f2;
    --muted: #a4abb4;
    --line: #2a2f37;
    --accent: #93a3ff;
    --accent-ink: #0d0f14;
    --accent-soft: #1d2542;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -24px rgba(0, 0, 0, 0.75);
    --shadow-pop: 0 28px 80px -30px rgba(0, 0, 0, 0.85);
    --ring: 0 0 0 3px rgba(147, 163, 255, 0.38);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: var(--radius-control);
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

/* ---------------- Header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(10px)) {
  .site-header {
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    backdrop-filter: blur(12px);
  }
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.wordmark-mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--accent);
  position: relative;
}
.wordmark-mark::after {
  content: "";
  position: absolute;
  inset: 5px 5px auto auto;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--paper);
}

.header-dates {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.header-dates-short {
  display: none;
}

/* ---------------- Intro ---------------- */

.intro {
  padding-top: 52px;
  padding-bottom: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 48px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.intro-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.3rem, 4.6vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 14ch;
}

.intro-sub {
  margin: 20px 0 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.intro-collage {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  height: 336px;
}
.intro-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-card);
  background: var(--surface-2);
  filter: saturate(0.92);
}
.collage-a {
  grid-row: span 2;
}
.collage-b {
  grid-column: 2;
  grid-row: 1;
}
.collage-c {
  grid-column: 2;
  grid-row: 2;
}

/* ---------------- Browse ---------------- */

.browse {
  padding-bottom: 64px;
}

.browse-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-bottom: 20px;
}
.browse-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.results-count {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field label,
.field-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="search"],
select {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 0.96rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  appearance: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
input[type="search"]::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[type="search"]:hover,
select:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
input[type="search"]:focus-visible,
select:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--ring);
  outline: none;
}

select {
  padding-right: 42px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.field-saved {
  align-items: stretch;
}
.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 18px;
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.toggle:active {
  transform: translateY(1px);
}
.toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.toggle-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-control);
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
}
.toggle[aria-pressed="true"] .toggle-count {
  background: color-mix(in srgb, var(--accent-ink) 22%, transparent);
  color: var(--accent-ink);
}

/* ---------------- Category chips ---------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 30px;
}
.chip {
  padding: 7px 15px;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, transform 0.12s ease;
}
.chip:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}
.chip:active {
  transform: translateY(1px);
}
.chip.is-active {
  color: var(--accent-ink);
  background: var(--ink);
  border-color: var(--ink);
}

/* ---------------- Day groups and cards ---------------- */

.day-group + .day-group {
  margin-top: 44px;
}
.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.day-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.day-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.event-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}
.event-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-pop);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}

.card-media {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--surface-2);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.94);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.event-card:hover .card-media img {
  transform: scale(1.035);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 18px 18px 18px;
  flex: 1;
}

.card-kicker {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker-sep {
  width: 14px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.card-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--muted);
}

.card-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.card-foot {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.price {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}
.saved-flag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: var(--radius-control);
  padding: 3px 8px;
}
.event-card.is-saved {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  font-family: var(--font-body);
  font-size: 0.93rem;
  font-weight: 600;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 86%, var(--ink));
}
.btn-primary[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.btn-small {
  height: 38px;
  padding: 0 16px;
  margin-left: auto;
  font-size: 0.86rem;
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}
.btn-small:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-quiet {
  height: 40px;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}
.btn-quiet:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ---------------- Featured first card ---------------- */

@media (min-width: 1000px) {
  .event-card.is-featured {
    grid-column: span 2;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }
  .event-card.is-featured .card-media {
    aspect-ratio: auto;
    height: 100%;
    min-height: 300px;
  }
  .event-card.is-featured .card-body {
    padding: 26px 26px 26px;
    gap: 12px;
  }
  .event-card.is-featured .card-title {
    font-size: 1.5rem;
  }
}

/* ---------------- Empty state ---------------- */

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  padding: 56px 28px;
  text-align: center;
  background: var(--surface);
}
.empty-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
}
.empty-body {
  margin: 0 auto 22px;
  max-width: 40ch;
  color: var(--muted);
}

/* ---------------- Footer ---------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 48px;
}
.footer-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
}
.footer-brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.footer-note {
  margin: 0;
  max-width: 64ch;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}
.footer-dates {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------------- Detail dialog ---------------- */

.detail-dialog {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-dialog);
  background: var(--surface);
  color: var(--ink);
  width: min(760px, calc(100% - 32px));
  max-height: min(90dvh, 900px);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.detail-dialog::backdrop {
  background: rgba(10, 12, 16, 0.55);
}
@supports (backdrop-filter: blur(3px)) {
  .detail-dialog::backdrop {
    backdrop-filter: blur(3px);
  }
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  max-height: inherit;
}
.detail-media {
  background: var(--surface-2);
  min-height: 100%;
}
.detail-media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  filter: saturate(0.94);
}

.detail-content {
  padding: 24px 26px 26px;
  overflow-y: auto;
  max-height: inherit;
}
.detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.detail-kicker {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.detail-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.detail-when,
.detail-where {
  margin: 0 0 4px;
  font-size: 0.95rem;
  color: var(--ink);
}
.detail-where {
  color: var(--muted);
}
.detail-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.fact {
  min-width: 0;
}
.fact dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.fact dd {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 600;
}
.detail-body p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.62;
  max-width: 60ch;
}
.detail-body p:first-child {
  color: var(--ink);
  font-size: 1rem;
}
.detail-actions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ---------------- Motion ---------------- */

@media (prefers-reduced-motion: no-preference) {
  .intro-copy > *,
  .intro-collage {
    animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .intro-collage {
    animation-delay: 0.08s;
  }
  .intro-title {
    animation-delay: 0.04s;
  }
  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(16px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .detail-dialog[open] {
    animation: dialogIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes dialogIn {
    from {
      opacity: 0;
      transform: translateY(10px) scale(0.985);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .event-card:hover,
  .event-card:hover .card-media img {
    transform: none;
  }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 980px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 40px;
  }
  .intro-title {
    max-width: 16ch;
  }
  .intro-collage {
    height: 230px;
  }
  .toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .field-search {
    grid-column: 1 / -1;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 760px) {
  .container {
    padding: 0 16px;
  }
  .header-dates-full {
    display: none;
  }
  .header-dates-short {
    display: inline;
  }
  .detail {
    grid-template-columns: 1fr;
  }
  .detail-media img {
    min-height: 180px;
    max-height: 200px;
  }
  .detail-content {
    padding: 20px 18px 24px;
  }
  .detail-facts {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .intro-title {
    font-size: clamp(2.05rem, 9vw, 2.5rem);
    line-height: 1.05;
  }
  .intro-collage {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: 190px;
  }
  .toolbar {
    grid-template-columns: 1fr;
  }
  .field-search {
    grid-column: auto;
  }
  .browse-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .chip {
    flex: 0 0 auto;
  }
  .detail-dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: none;
    border-radius: 0;
  }
  .detail {
    height: 100dvh;
    overflow-y: auto;
    display: block;
  }
  .detail-media img {
    min-height: 200px;
    max-height: 220px;
  }
  .detail-content {
    overflow: visible;
    max-height: none;
  }
}
