/* Kiosk — the weekend board */

@font-face {
  font-family: "Overpass";
  src: url("assets/overpass.ttf") format("truetype-variations"),
       url("assets/overpass.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Overpass Mono";
  src: url("assets/overpass-mono.ttf") format("truetype-variations"),
       url("assets/overpass-mono.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f3f2ee;
  --panel: #fbfaf7;
  --ink: #161a18;
  --ink-2: #565b54;
  --hairline: #d8d6cd;
  --rail: #cfcdc2;
  --accent: #f0511e;
  --accent-ink: #b23308;
  --mono: "Overpass Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Overpass", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
html.locked { overflow: hidden; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}

::selection { background: var(--accent); color: #fff; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { left: 12px; }

.icon { width: 1em; height: 1em; flex: none; }

/* ---------- Masthead ---------- */

.masthead {
  border-bottom: 3px solid var(--ink);
  position: relative;
}
.masthead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  border-bottom: 1px solid var(--ink);
}
.masthead-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 32px 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.wordmark {
  font-size: 58px;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.wordmark::before {
  content: "";
  width: 16px;
  height: 16px;
  background: var(--accent);
  align-self: center;
  flex: none;
}
.promise {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 16.5px;
  max-width: 46ch;
}
.dateboard {
  display: flex;
  align-items: stretch;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  border-radius: 2px;
  overflow: hidden;
  flex: none;
}
.dateboard-cell {
  padding: 12px 16px;
  white-space: nowrap;
}
.dateboard-cell + .dateboard-cell { border-left: 1px solid rgba(243, 242, 238, 0.28); }
.dateboard-arrow {
  display: flex;
  align-items: center;
  padding: 0 4px;
  color: var(--accent);
}
.dateboard-year {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-left: 1px solid rgba(243, 242, 238, 0.28);
  color: rgba(243, 242, 238, 0.72);
}

/* ---------- Controls ---------- */

.controls-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 32px 8px;
}
.controls {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.control { display: flex; flex-direction: column; gap: 6px; }
.control-search { flex: 1 1 280px; }
.control-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-2);
}
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 0 12px;
  transition: border-color 0.15s ease-out;
}
.search-box:focus-within { border-color: var(--accent-ink); }
.search-box .icon { color: var(--ink-2); font-size: 17px; }
#search {
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 10px 0;
  width: 100%;
  min-width: 0;
}
#search::placeholder { color: #6f7369; }
#search { caret-color: var(--accent-ink); }
#search:focus { outline: none; }
#search::-webkit-search-cancel-button { -webkit-appearance: none; }

.select-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}
.select-box:focus-within { border-color: var(--accent-ink); }
#filter {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 10px 38px 10px 12px;
  min-width: 168px;
  cursor: pointer;
}
.select-caret {
  position: absolute;
  right: 12px;
  font-size: 15px;
  color: var(--ink);
  pointer-events: none;
}

.saved-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
}
.saved-toggle .icon { font-size: 16px; }
.saved-toggle:hover { border-color: var(--accent-ink); }
.saved-toggle[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.saved-toggle[aria-pressed="true"] .icon { color: var(--accent); }
.saved-count {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--accent);
  color: #fff;
  padding: 1px 7px;
  border-radius: 2px;
}
.count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
  padding-bottom: 12px;
  white-space: nowrap;
}

/* ---------- Board ---------- */

.board {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 32px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 64px;
  align-items: start;
}
.day-head {
  border-top: 3px solid var(--ink);
  padding-top: 14px;
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.day-name {
  font-size: 23px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.day-date { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.day-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
}

.day-stops { list-style: none; }

.stop {
  position: relative;
  padding: 20px 8px 22px 46px;
  border-bottom: 1px solid var(--hairline);
  animation: stop-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
@keyframes stop-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
/* rail segment */
.stop::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--rail);
  transition: background 0.2s ease-out;
}
.day-stops .stop:first-child::after { top: 34px; }
.day-stops .stop:last-child::after { bottom: auto; height: 40px; }
/* node dot */
.stop::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 34px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--line, var(--ink));
  box-shadow: 0 0 0 3.5px var(--paper);
  transition: background 0.2s ease-out, box-shadow 0.2s ease-out;
}
.stop.saved::after { background: var(--accent); }
.stop.saved::before { background: var(--accent); box-shadow: 0 0 0 3.5px var(--paper), 0 0 0 5px var(--accent); }
.stop.just-saved::before { animation: node-pulse 0.35s ease-out; }
@keyframes node-pulse {
  0% { transform: scale(1); }
  55% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.stop-time {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--ink-2);
}
.stop-title { margin-top: 4px; }
.stop-title button {
  font: inherit;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.25;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  text-decoration: underline transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.15s ease-out;
}
.stop-title button:hover,
.stop-title button:focus-visible { text-decoration-color: var(--accent); }
.stop-meta { margin-top: 5px; font-size: 14.5px; color: var(--ink-2); }
.stop-chips {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chip {
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 2px;
  border: 1px solid var(--hairline);
  color: var(--ink-2);
  background: var(--panel);
  white-space: nowrap;
}
.chip-line {
  --line: var(--ink);
  --line-ink: var(--ink);
  color: var(--line-ink);
  border-color: color-mix(in srgb, var(--line) 45%, transparent);
  background: color-mix(in srgb, var(--line) 11%, var(--panel));
}
.chip-price.free { color: #1f6b34; border-color: #b5d4bd; background: #eaf3ec; font-weight: 700; }
.chip-saved {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}
.chip-saved .icon { font-size: 12px; }

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

.empty {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}
.empty-inner {
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--ink);
  background: var(--panel);
  padding: 52px 40px 56px;
  text-align: center;
}
.empty-title {
  font-size: 26px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.empty-copy {
  margin: 12px auto 24px;
  color: var(--ink-2);
  max-width: 52ch;
}
.empty-reset {
  font: inherit;
  font-weight: 650;
  color: var(--paper);
  background: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.15s ease-out;
}
.empty-reset:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* ---------- Colophon ---------- */

.colophon {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 32px 40px;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
}

/* ---------- Detail panel ---------- */

.overlay { position: fixed; inset: 0; z-index: 40; }
.scrim {
  position: absolute;
  inset: 0;
  background: rgba(22, 26, 24, 0.44);
  animation: fade-in 0.25s ease-out both;
  border: 0;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.detail {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(468px, 94vw);
  background: var(--panel);
  border-left: 1px solid var(--ink);
  box-shadow: -20px 0 52px rgba(22, 26, 24, 0.22);
  padding: 26px 34px 34px;
  overflow-y: auto;
  animation: panel-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateX(48px); }
  to { opacity: 1; transform: none; }
}

.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.detail-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.line-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line, var(--ink));
  flex: none;
}
.detail-close {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 7px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease-out, color 0.15s ease-out;
}
.detail-close:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.detail-close .icon { font-size: 14px; }

.detail-title {
  font-size: 31px;
  font-weight: 750;
  line-height: 1.14;
  letter-spacing: -0.01em;
  outline: none;
}
.detail-when {
  margin-top: 12px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 15px;
  font-weight: 600;
}
.detail-time { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--ink-2); }

.detail-facts {
  margin-top: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr;
  gap: 12px;
}
.fact dt {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-2);
}
.fact dd { margin-top: 3px; font-size: 14.5px; font-weight: 550; }
.fact dd .fact-sub { display: block; font-size: 13px; color: var(--ink-2); font-weight: 450; }

.detail-summary { margin-top: 20px; font-size: 17px; line-height: 1.6; }
.detail-notes {
  margin-top: 18px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 15px 17px;
}
.notes-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.detail-notes-body p { font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.detail-notes-body p + p { margin-top: 8px; }

.save {
  margin-top: 22px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  border-radius: 2px;
  padding: 13px 18px;
  cursor: pointer;
  background: var(--accent-ink);
  border: 1.5px solid var(--accent-ink);
  color: #fff;
  transition: background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
}
.save:hover { background: #9a2c07; border-color: #9a2c07; }
.save .icon { font-size: 16px; }
.save[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.save[aria-pressed="true"] .icon { color: var(--accent); }
.save[aria-pressed="true"]:hover { background: #000; }

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

@media (max-width: 960px) {
  .board { grid-template-columns: 1fr; column-gap: 0; }
  .masthead-inner, .controls-wrap, .board, .empty, .colophon { padding-left: 20px; padding-right: 20px; }
  .wordmark { font-size: 44px; }
  .count { padding-bottom: 0; margin-left: 0; width: 100%; }
  .detail {
    width: 100%;
    border-left: 0;
    padding: 20px 22px 28px;
    animation-name: sheet-in;
  }
  @keyframes sheet-in {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: none; }
  }
  .detail-facts { grid-template-columns: 1fr 1fr; }
  .detail-facts .fact:first-child { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .masthead-inner { padding-top: 28px; }
  .wordmark { font-size: 40px; }
  .dateboard { font-size: 12.5px; }
  .dateboard-cell, .dateboard-year { padding: 10px 11px; }
  .detail-title { font-size: 26px; }
}

/* ---------- Reduced motion ---------- */

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

/* ---------- Scrollbar ---------- */

@media (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: #b9b7ac transparent; }
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-thumb { background: #b9b7ac; border: 3px solid var(--paper); border-radius: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
}
