/* ---------------------------------------------------------
   Layover — weekend board
   Direction: engineered / departures-board editorial.
   Dark canvas, condensed display type, monospace data role,
   ruled schedule rows, ticket-stub detail panel.
--------------------------------------------------------- */

:root {
  --canvas: #121319;
  --surface: #1a1c24;
  --surface-raised: #21232d;
  --line-solid: #34374380;
  --line-strong: #4a4e5c;
  --text: #f4f1ea;
  --text-muted: #9a9dad;
  --text-faint: #6d7086;
  --accent: #f6c445;
  --accent-ink: #1c1400;
  --accent-soft: #f6c44526;
  --accent-2: #ff6b4a;
  --danger: #ff6b6b;

  --cat-art: #d9b8ff;
  --cat-film: #8ecdff;
  --cat-food: #ff9d76;
  --cat-literature: #b7e6a6;
  --cat-music: #ff9ec7;
  --cat-outdoors: #7fe3c3;
  --cat-walks: #c8c2ff;

  --font-display: "Arial Narrow", "Helvetica Neue", ui-sans-serif, Arial, sans-serif;
  --font-body: -apple-system, "Segoe UI", ui-sans-serif, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", "Courier New", monospace;

  --content-w: 1240px;
  --radius-sm: 4px;
  --radius-md: 10px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 18px;
  font-weight: 700;
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}

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

button,
input,
select {
  font-family: inherit;
}

/* ---------- header ---------- */

.site-header {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 39px,
      #ffffff08 39px,
      #ffffff08 40px
    ),
    var(--canvas);
  border-bottom: 1px solid var(--line-solid);
}

.header-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 64px 32px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: end;
}

.brand {
  max-width: 640px;
}

.kicker {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.wordmark {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: 800;
  font-size: clamp(56px, 9vw, 108px);
  line-height: 0.86;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--text);
}

.tagline {
  margin: 0;
  max-width: 52ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
}

.board-stats {
  display: flex;
  gap: 28px;
  margin: 0;
  padding-bottom: 6px;
}

.board-stats .stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 84px;
  padding-left: 20px;
  border-left: 1px solid var(--line-solid);
}

.board-stats dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.board-stats dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

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

.controls {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--canvas);
  border-bottom: 1px solid var(--line-solid);
}

.controls-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.field-search {
  flex: 1 1 260px;
  min-width: 200px;
}

#search {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px;
  font-size: 15px;
}

#search::placeholder {
  color: var(--text-faint);
}

#search:focus-visible {
  border-color: var(--accent);
}

.field-select {
  flex: 0 0 200px;
}

#filter {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px;
  font-size: 15px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

#filter:focus-visible {
  border-color: var(--accent);
}

.pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pill-icon {
  width: 14px;
  height: 14px;
  color: var(--text-faint);
  transition: color 0.15s ease;
}

.pill-toggle:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

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

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

/* ---------- board ---------- */

.board {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 8px 32px 96px;
}

.day-section {
  margin-top: 40px;
}

.day-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.day-heading .day-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.day-heading .day-rule {
  flex: 1;
  height: 1px;
  background: var(--line-solid);
}

.row-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-solid);
}

.row-item {
  border-bottom: 1px solid var(--line-solid);
}

.row-open {
  width: 100%;
  display: grid;
  grid-template-columns: 128px 1fr auto auto;
  align-items: center;
  gap: 20px;
  padding: 20px 12px;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.row-open::before {
  content: "";
  position: absolute;
  inset: 2px 0;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 0;
}

.row-open:hover::before,
.row-open:focus-visible::before {
  opacity: 1;
}

.row-open > * {
  position: relative;
  z-index: 1;
}

.row-time {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.row-main {
  min-width: 0;
}

.row-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13.5px;
  color: var(--text-muted);
}

.row-meta .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}

.row-meta .cat-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.row-price {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
}

.row-price.is-free {
  color: var(--cat-outdoors);
}

.row-go {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 14px;
  white-space: nowrap;
}

.row-open:hover .row-go,
.row-open:focus-visible .row-go {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.row-saved-mark {
  color: var(--accent);
  margin-left: 6px;
}

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

.empty-state {
  max-width: var(--content-w);
  margin: 40px auto 96px;
  padding: 0 32px;
  text-align: left;
}

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

.empty-title {
  font-family: var(--font-display);
  font-stretch: condensed;
  font-size: 32px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.empty-copy {
  color: var(--text-muted);
  margin: 0 0 18px;
  max-width: 48ch;
}

.reset-btn {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.reset-btn:hover {
  filter: brightness(1.05);
}

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

.site-footer {
  border-top: 1px solid var(--line-solid);
  padding: 32px;
  max-width: var(--content-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
}

.footer-wordmark {
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 18px;
  margin: 0;
  color: var(--text-muted);
}

.footer-note {
  margin: 0;
  font-size: 13px;
  color: var(--text-faint);
  max-width: 60ch;
}

/* ---------- detail dialog ---------- */

.detail-dialog {
  border: none;
  padding: 0;
  margin: 0;
  position: fixed;
  inset: 0 0 0 auto;
  height: 100%;
  width: min(560px, 100%);
  max-width: 100%;
  max-height: 100%;
  background: var(--surface);
  color: var(--text);
  box-shadow: -24px 0 60px #00000066;
}

.detail-dialog::backdrop {
  background: #08090ccc;
}

.detail-dialog[open] {
  display: block;
  animation: slide-in 0.22s ease-out;
}

@keyframes slide-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.stub {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.stub-perforation {
  height: 14px;
  flex: none;
  background: radial-gradient(circle, var(--canvas) 3.5px, transparent 3.6px);
  background-size: 20px 14px;
  background-position: 0 0;
}

.stub-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 0;
}

.stub-eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.close-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 7px 14px 7px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.close-btn svg {
  width: 11px;
  height: 11px;
}

.close-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.stub-title {
  margin: 14px 28px 20px;
  font-family: var(--font-display);
  font-stretch: condensed;
  font-weight: 800;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.stub-body {
  padding: 0 28px 8px;
  flex: 1 0 auto;
}

.stub-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  margin: 0 0 24px;
  padding: 20px;
  background: var(--surface-raised);
  border-radius: var(--radius-md);
}

.stub-facts dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 4px;
}

.stub-facts dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.stub-divider {
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--line-strong) 0,
    var(--line-strong) 6px,
    transparent 6px,
    transparent 12px
  );
  margin: 0 0 24px;
}

.stub-copy p {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
}

.stub-subhead {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.detail-accessibility {
  color: var(--text-muted) !important;
  font-size: 14.5px !important;
}

.stub-actions {
  flex: none;
  padding: 20px 28px 28px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--surface) 60%, transparent);
}

.save-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.save-icon {
  width: 16px;
  height: 16px;
  color: var(--text-faint);
}

.save-btn:hover {
  border-color: var(--accent);
}

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

.save-btn[aria-pressed="true"] .save-icon {
  color: var(--accent-ink);
}

/* ---------- category dot colors ---------- */

.dot-art { background: var(--cat-art); }
.dot-film { background: var(--cat-film); }
.dot-food { background: var(--cat-food); }
.dot-literature { background: var(--cat-literature); }
.dot-music { background: var(--cat-music); }
.dot-outdoors { background: var(--cat-outdoors); }
.dot-walks { background: var(--cat-walks); }

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

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: 1fr;
    padding: 40px 20px 28px;
    gap: 24px;
  }

  .board-stats {
    padding-left: 0;
  }

  .controls-inner {
    padding: 14px 20px;
  }

  .field-select {
    flex: 1 1 160px;
  }

  .board {
    padding: 8px 20px 72px;
  }

  .row-open {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "time go"
      "main main";
    row-gap: 12px;
    padding: 18px 14px;
  }

  .row-time {
    grid-area: time;
    font-size: 15px;
  }

  .row-go {
    grid-area: go;
    justify-self: end;
  }

  .row-main {
    grid-area: main;
  }

  .row-price {
    display: none;
  }

  .site-footer {
    padding: 24px 20px;
  }

  .empty-state {
    padding: 0 20px;
  }

  .detail-dialog {
    width: 100%;
  }

  .stub-title {
    margin-left: 20px;
    margin-right: 20px;
  }

  .stub-head {
    padding-left: 20px;
    padding-right: 20px;
  }

  .stub-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .stub-actions {
    padding-left: 20px;
    padding-right: 20px;
  }

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

@media (max-width: 480px) {
  .wordmark {
    font-size: clamp(44px, 14vw, 64px);
  }

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

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
