/* ============================================================
   48H — city weekend timetable
   Dark board aesthetic · condensed grotesque type · lime accent
   ============================================================ */

@font-face {
  font-family: 'Oswald';
  src: url('assets/oswald.ttf') format('truetype-variations');
  font-weight: 200 700;
  font-style: normal;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('assets/space-grotesk.ttf') format('truetype-variations');
  font-weight: 300 700;
  font-style: normal;
}
@font-face {
  font-family: 'DM Sans';
  src: url('assets/dm-sans.ttf') format('truetype-variations');
  font-weight: 100 1000;
  font-style: normal;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/ibm-plex-mono.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

:root {
  --bg: #0c0e0d;
  --bg-2: #121513;
  --surface: #171b19;
  --line: #272c29;
  --line-soft: #1d211f;
  --text: #edefe9;
  --muted: #99a39b;
  --lime: #c8f04b;
  --ink: #0c0e0d;
  --cat-Art: #ff9463;
  --cat-Film: #a3b7ff;
  --cat-Food: #ffc757;
  --cat-Literature: #7cc9ff;
  --cat-Music: #ff85c8;
  --cat-Outdoors: #6fe0ac;
  --cat-Walks: #e39b6b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(237, 239, 233, 0.035) 1px, transparent 1.4px);
  background-size: 26px 26px;
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- focus & skip link ---------- */

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  background: var(--lime);
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 16px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--line);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.topbar p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-left { color: var(--text); }
.topbar-left .live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lime);
  margin-right: 8px;
  vertical-align: 1px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------- masthead ---------- */

.masthead {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: 40px;
  align-items: end;
  padding-top: 52px;
  padding-bottom: 44px;
}
.mast-mark {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: clamp(110px, 17vw, 208px);
  line-height: 0.82;
  letter-spacing: 0.01em;
  user-select: none;
}
.mast-mark .digits { color: var(--text); }
.mast-mark .h { color: var(--lime); }
@supports (-webkit-text-stroke: 2px black) {
  .mast-mark .h { color: var(--bg); -webkit-text-stroke: 3px var(--lime); }
}
.mast-eyebrow {
  margin: 0 0 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lime);
}
.mast-desc {
  margin: 0 0 26px;
  max-width: 56ch;
  font-size: 17px;
  color: var(--text);
}
.mast-desc::first-line { font-weight: 500; }

.mast-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 0;
}
.stat {
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 12px 14px 10px;
}
.stat dt {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat dd {
  margin: 2px 0 0;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 30px;
  line-height: 1.1;
  color: var(--text);
}

/* ---------- ticker ---------- */

.ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--lime);
  color: var(--ink);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-slide 38s linear infinite;
}
.ticker-run {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 9px 0;
  white-space: nowrap;
}
@keyframes ticker-slide { to { transform: translateX(-50%); } }

/* ---------- controls ---------- */

.controls {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.controls-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.field {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 0 14px;
  transition: border-color 0.15s ease;
}
.field:focus-within { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }
.field-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lime);
  white-space: nowrap;
}
.field-search { flex: 1 1 260px; min-width: 220px; }
.field-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15.5px;
  padding: 12px 0;
}
.field-search input::placeholder { color: var(--muted); opacity: 0.85; }
.field-search input:focus { outline: none; }
.field-search input::-webkit-search-cancel-button { filter: invert(0.7); }

.field-select select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23c8f04b' stroke-width='2'/%3E%3C/svg%3E")
    no-repeat right 14px center;
  border: 0;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14.5px;
  padding: 12px 38px 12px 0;
  cursor: pointer;
  min-width: 150px;
}
.field-select select:focus-visible { outline: none; }
.field-select:focus-within { outline: 2px solid var(--lime); outline-offset: 2px; }
.field-select select:focus { outline: none; }

.saved-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 16px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.saved-toggle svg {
  width: 15px; height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.saved-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  border: 1px solid currentColor;
  padding: 1px 7px;
  border-radius: 999px;
}
.saved-toggle[aria-pressed="true"] {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
}
.saved-toggle[aria-pressed="true"] svg { fill: var(--ink); stroke: var(--ink); }
.saved-toggle[aria-pressed="true"]:focus-visible { outline-color: var(--text); }

.result-count {
  margin: 0 0 0 auto;
  align-self: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- day sections & rows ---------- */

.board { padding-top: 44px; padding-bottom: 72px; }
.day { margin-bottom: 64px; }
.day:last-child { margin-bottom: 0; }

.day-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--lime);
  padding-bottom: 10px;
  margin-bottom: 4px;
}
.day-title {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.day-title .date-chip { color: var(--lime); }
.day-count {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.row {
  display: grid;
  grid-template-columns: 122px 1fr auto;
  gap: 22px;
  align-items: start;
  padding: 22px 18px 24px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.row:hover { background: var(--bg-2); }
.row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--lime);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.18s ease;
}
.row:hover::before, .row:focus-within::before { transform: scaleY(1); }

[data-cat="Art"]      { --c: var(--cat-Art); }
[data-cat="Film"]     { --c: var(--cat-Film); }
[data-cat="Food"]     { --c: var(--cat-Food); }
[data-cat="Literature"] { --c: var(--cat-Literature); }
[data-cat="Music"]    { --c: var(--cat-Music); }
[data-cat="Outdoors"] { --c: var(--cat-Outdoors); }
[data-cat="Walks"]    { --c: var(--cat-Walks); }

.row-when { padding-top: 4px; }
.t-start {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 30px;
  line-height: 1;
  color: var(--text);
}
.t-end {
  display: block;
  margin-top: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.t-end b { color: var(--lime); font-weight: 400; }

.cat-tag {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c, var(--muted));
  border: 1px solid currentColor;
  padding: 3px 9px 2px;
  margin-bottom: 10px;
}

.row-main { min-width: 0; }
.row-title { margin: 0 0 8px; font-size: 0; }
.open-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0.005em;
  color: var(--text);
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: color 0.12s ease;
}
.open-btn:hover { color: var(--lime); }
.row-summary {
  margin: 0 0 12px;
  max-width: 64ch;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}
.row-meta {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.row-meta .sep { color: var(--lime); padding: 0 6px; }
.row-meta .price-free { color: var(--lime); }

.row-star {
  width: 44px; height: 44px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
  margin-top: 4px;
}
.row-star svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.row-star:hover { border-color: var(--lime); color: var(--lime); }
.row-star[aria-pressed="true"] {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
}
.row-star[aria-pressed="true"] svg { fill: var(--ink); stroke: var(--ink); }

/* ---------- empty state ---------- */

.empty {
  border: 1px dashed var(--line);
  padding: 72px 24px 64px;
  text-align: center;
  margin-top: 8px;
}
.empty-big {
  margin: 0 0 14px;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(44px, 8vw, 76px);
  line-height: 1;
  letter-spacing: 0.04em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--line);
}
@supports not (-webkit-text-stroke: 1px black) { .empty-big { color: var(--line); } }
.empty-text { margin: 0 auto 26px; max-width: 46ch; color: var(--muted); font-size: 15.5px; }
.empty-reset {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--lime);
  border: 1px solid var(--lime);
  padding: 13px 22px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.empty-reset:hover { background: var(--text); border-color: var(--text); }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  padding-bottom: 40px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.footer strong { color: var(--lime); font-weight: 400; }

/* ---------- detail panel ---------- */

.detail-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
}
.detail-layer[hidden] { display: none; }
.detail-scrim {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 6, 0.74);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.detail-layer.open .detail-scrim { opacity: 1; }

.detail-panel {
  position: relative;
  width: min(600px, 100%);
  height: 100%;
  background: var(--bg-2);
  border-left: 1px solid var(--lime);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(103%);
  transition: transform 0.32s cubic-bezier(0.22, 0.9, 0.28, 1);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
}
.detail-layer.open .detail-panel { transform: translateX(0); }

.panel-top {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.panel-kicker {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--lime);
}
.panel-close {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.panel-close:hover { border-color: var(--lime); color: var(--lime); }
.panel-close .kbd {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 2px 5px;
}

.duo {
  position: relative;
  margin: 0;
  background: var(--lime);
  height: 190px;
  overflow: hidden;
}
.duo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
  filter: grayscale(1) contrast(1.12) brightness(0.92);
}
.duo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 14, 13, 0.42), rgba(12, 14, 13, 0) 45%, rgba(12, 14, 13, 0.5));
}
.duo figcaption {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(12, 14, 13, 0.72);
  padding: 4px 8px;
}

.panel-body { padding: 26px 26px 34px; }
.panel-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.day-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 3px 9px 2px;
}
.day-chip b { color: var(--lime); font-weight: 400; }

.detail-title {
  margin: 0 0 18px;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.12;
  letter-spacing: 0.01em;
  color: var(--text);
}
.detail-time {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}
.detail-time .clock {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 34px;
  line-height: 1;
  color: var(--text);
}
.detail-time .dash { color: var(--lime); font-family: 'Oswald', sans-serif; font-size: 34px; line-height: 1; }
.detail-date {
  margin: 0 0 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-price {
  display: inline-block;
  margin-bottom: 24px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
  color: var(--lime);
}
.detail-price small {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-left: 8px;
  font-weight: 400;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 28px;
}
.fact {
  border: 1px solid var(--line-soft);
  background: var(--bg);
  padding: 12px 14px;
}
.fact dt {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
}
.fact dd {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
}

.detail-summary {
  margin: 0 0 14px;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text);
}
.access-note {
  border-left: 3px solid var(--lime);
  background: var(--bg);
  padding: 16px 18px;
  margin: 22px 0 0;
}
.access-note h3 {
  margin: 0 0 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--lime);
}
.access-note p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }

.panel-foot {
  position: sticky;
  bottom: 0;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding: 14px 26px 16px;
  margin-top: 34px;
}
.save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--lime);
  background: var(--bg);
  color: var(--lime);
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 16px 12px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.save-btn svg {
  width: 17px; height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  flex: none;
}
.save-btn:hover { background: rgba(200, 240, 75, 0.12); }
.save-btn[aria-pressed="true"] {
  background: var(--lime);
  color: var(--ink);
}
.save-btn[aria-pressed="true"] svg { fill: var(--ink); stroke: var(--ink); }
.save-btn[aria-pressed="true"]:focus-visible { outline-color: var(--text); }

body.modal-open { overflow: hidden; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .wrap { padding: 0 18px; }
  .topbar { padding: 10px 18px; }
  .topbar-right { display: none; }
  .masthead {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 34px;
    padding-bottom: 34px;
  }
  .mast-mark { font-size: clamp(96px, 26vw, 150px); }
  .mast-stats { grid-template-columns: repeat(2, 1fr); }
  .controls { position: static; }
  .controls-row { flex-wrap: wrap; }
  .field-search { flex: 1 1 100%; }
  .result-count { margin-left: 0; flex-basis: 100%; order: 5; }
  .day { margin-bottom: 44px; }
  .day-title { font-size: 26px; }
  .board { padding-top: 30px; }
}

@media (max-width: 640px) {
  .row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "when star" "main main";
    gap: 6px 14px;
    padding: 18px 14px 20px;
  }
  .row-when {
    grid-area: when;
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding-top: 0;
  }
  .t-start { font-size: 26px; }
  .t-end { margin-top: 0; }
  .row-star { grid-area: star; width: 42px; height: 42px; margin-top: 0; }
  .row-main { grid-area: main; }
  .open-btn { font-size: 18.5px; }
  .facts { grid-template-columns: 1fr; }
  .panel-body { padding: 22px 18px 26px; }
  .panel-foot { padding: 12px 18px 14px; }
  .panel-top { padding: 12px 18px; }
  .detail-panel { border-left: 0; }
  .duo { height: 150px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
