/* ============================================================
   DEPARTURES - a split-flap weekend board
   Theme: dark, locked. Single accent: signal amber.
   Radius system (documented rule):
   - objects (board, ticket): 12px
   - tiles, inputs, buttons, badges: 2-3px (hard chrome)
   Fonts: Space Grotesk (display/tiles), IBM Plex Mono (board meta),
   Work Sans (reading text).
   ============================================================ */

@font-face {
  font-family: "Space Grotesk";
  src: url("/artifacts/weekend-discovery--v1--s4-whacky--glm-5.3--taste--2026-09-19T02-41-54-739Z/assets/space-grotesk.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/artifacts/weekend-discovery--v1--s4-whacky--glm-5.3--taste--2026-09-19T02-41-54-739Z/assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("/artifacts/weekend-discovery--v1--s4-whacky--glm-5.3--taste--2026-09-19T02-41-54-739Z/assets/work-sans.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --page: #0d0c0a;
  --board: #181613;
  --board-edge: #353026;
  --line: #2b2620;
  --tile-1: #2b261f;
  --tile-2: #1d1a15;
  --tile-3: #141210;
  --ink: #f1e9d8;
  --muted: #a89e88;
  --dim: #958a76;
  --amber: #ffb224;
  --amber-ink: #241a05;
  --amber-deep: #9a6100;
  --stamp: #8a5500;
  --paper: #f4eee0;
  --paper-ink: #26211a;
  --paper-body: #3d372c;
  --paper-muted: #6f675a;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --grot: "Space Grotesk", "Avenir Next", sans-serif;
  --sans: "Work Sans", system-ui, sans-serif;
  --r-object: 12px;
  --r-chrome: 3px;
  --r-tile: 2px;
  --stub: 210px;
}

* { box-sizing: border-box; }

html { scrollbar-color: #3a342b var(--page); }

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--page);
  background-image: radial-gradient(120% 70% at 50% -18%, #1a1712 0%, var(--page) 58%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body.has-dialog { overflow: hidden; }

::selection { background: var(--amber); color: var(--amber-ink); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: var(--r-chrome);
}

[hidden] { display: none !important; }

/* ---------- the board object ---------- */

.board {
  position: relative;
  max-width: 1080px;
  margin: clamp(14px, 4vw, 44px) auto;
  padding: clamp(16px, 3vw, 34px) clamp(14px, 3vw, 34px) clamp(16px, 2.5vw, 26px);
  border: 1px solid var(--board-edge);
  border-radius: var(--r-object);
  background: linear-gradient(#1c1a16, #141210 88%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rivet {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #55503f, #191611 72%);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.05);
}
.rivet-1 { top: 9px; left: 9px; }
.rivet-2 { top: 9px; right: 9px; }
.rivet-3 { bottom: 9px; left: 9px; }
.rivet-4 { bottom: 9px; right: 9px; }

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

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding: 6px 2px 18px;
  border-bottom: 1px solid var(--line);
}

.masthead-brand {
  margin: 0;
  font-family: var(--grot);
  font-weight: 700;
  font-size: clamp(20px, 3.4vw, 33px);
  letter-spacing: 0.05em;
  line-height: 1.3;
}

.masthead-brand .flap-char:first-child {
  background: linear-gradient(#ffbe45, var(--amber) 51%, #d99712);
  color: var(--amber-ink);
}

.masthead-tag {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

.masthead-meta {
  text-align: right;
  flex-shrink: 0;
}

.masthead-dates {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.masthead-count {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink);
}

/* ---------- split-flap tiles ---------- */

.flap-word { display: inline-block; white-space: nowrap; }

.flap-char {
  display: inline-block;
  min-width: 1ch;
  padding: 0.02em 0.13em 0.04em;
  margin-right: 1px;
  border-radius: var(--r-tile);
  background: linear-gradient(var(--tile-1), var(--tile-2) 51%, var(--tile-3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    0 1px 1px rgba(0, 0, 0, 0.35);
}

.flap-char.flipping { color: var(--dim); }

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

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 218px 218px;
  gap: 16px;
  padding: 18px 2px;
  border-bottom: 1px solid var(--line);
}

.field label,
.field-label {
  display: block;
  margin: 0 0 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="search"],
select {
  width: 100%;
  padding: 10px 12px;
  background: #12100d;
  border: 1px solid #3d372c;
  border-radius: var(--r-chrome);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  transition: border-color 0.15s ease;
}

input[type="search"] { height: 42px; }
input[type="search"]::placeholder { color: #8f8574; }

select {
  height: 42px;
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a89e88' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

input[type="search"]:focus,
select:focus { border-color: var(--amber); outline: none; }
input[type="search"]:focus-visible,
select:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.pocket-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: #12100d;
  border: 1px solid #3d372c;
  border-radius: var(--r-chrome);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pocket-word {
  font-family: var(--grot);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.pocket-count {
  margin-left: auto;
  padding: 1px 8px;
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid #3d372c;
  border-radius: var(--r-chrome);
  color: var(--muted);
}

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

.pocket-btn[aria-pressed="true"] .pocket-count {
  border-color: rgba(36, 26, 5, 0.55);
  color: var(--amber-ink);
}

.pocket-btn:active { transform: translateY(1px); }

@media (prefers-reduced-motion: no-preference) {
  .pocket-count.bump { animation: bump 0.32s cubic-bezier(0.3, 1.4, 0.4, 1); }
  @keyframes bump { 40% { transform: scale(1.3); } }
}

/* ---------- day groups and rows ---------- */

.board-body { padding: 4px 0 0; }

.days { list-style: none; margin: 0; padding: 0; }

.day-block { margin: 0; }

.day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 20px 4px 10px;
  border-bottom: 1px solid var(--line);
}

.day-name {
  margin: 0;
  font-family: var(--grot);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.day-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

.day-list { list-style: none; margin: 0; padding: 0; }

.day-list .day-row + .day-row { border-top: 1px solid #232019; }

.day-row.is-saved { box-shadow: inset 3px 0 0 var(--amber); }

.row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 13px 6px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.row:hover { background: rgba(241, 233, 216, 0.03); }
.row:active { transform: translateY(1px); }

.row-time {
  font-family: var(--mono);
  font-size: 19px;
  color: var(--ink);
}

.row-end {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--dim);
}

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

.row-title {
  display: block;
  font-family: var(--grot);
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.row-meta {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.row-cat {
  padding: 2px 7px;
  border: 1px solid #453e30;
  border-radius: var(--r-chrome);
  color: var(--ink);
}

.sep { margin: 0 8px; color: #6b6350; }

.row-saved {
  display: none;
  margin-left: 12px;
  padding: 1px 7px;
  border-radius: var(--r-chrome);
  background: var(--amber);
  color: var(--amber-ink);
  font-size: 10px;
  letter-spacing: 0.15em;
}

.is-saved .row-saved { display: inline-block; }

.row-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.row-price {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
}

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

.row-chev {
  font-size: 24px;
  line-height: 1;
  color: var(--dim);
  transition: transform 0.2s ease, color 0.2s ease;
}

.row:hover .row-chev,
.row:focus-visible .row-chev {
  color: var(--amber);
  transform: translateX(4px);
}

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

.empty {
  padding: 72px 20px 84px;
  text-align: center;
}

.empty-line {
  margin: 0;
  font-family: var(--grot);
  font-weight: 700;
  font-size: clamp(24px, 5vw, 42px);
  letter-spacing: 0.03em;
  line-height: 1.5;
  text-transform: uppercase;
}

.empty-body {
  max-width: 46ch;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 15.5px;
}

.empty-reset {
  margin-top: 26px;
  padding: 12px 24px;
  background: var(--amber);
  border: 0;
  border-radius: var(--r-chrome);
  color: var(--amber-ink);
  font-family: var(--grot);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.empty-reset:hover { background: #ffc14d; }
.empty-reset:active { transform: translateY(1px); }

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

.board-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 20px;
  margin-top: 30px;
  padding: 16px 2px 4px;
  border-top: 1px solid var(--line);
}

.board-foot p {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- ticket (detail dialog) ---------- */

dialog.ticket-dialog {
  border: 0;
  padding: 18px;
  background: transparent;
  width: min(780px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

dialog.ticket-dialog:not([open]) { display: none; }

dialog.ticket-dialog::backdrop {
  background: rgba(6, 5, 4, 0.62);
  backdrop-filter: blur(5px);
}

@media (prefers-reduced-transparency: reduce) {
  dialog.ticket-dialog::backdrop {
    background: rgba(6, 5, 4, 0.92);
    backdrop-filter: none;
  }
}

.ticket {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--stub);
  gap: 0 28px;
  padding: 24px 28px;
  background: linear-gradient(#f8f3e7, var(--paper) 70%);
  border-radius: var(--r-object);
  color: var(--paper-ink);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
}

@media (prefers-reduced-motion: no-preference) {
  dialog[open] .ticket {
    animation: ticket-in 0.34s cubic-bezier(0.2, 1.1, 0.3, 1);
  }
  @keyframes ticket-in {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
  }
}

.ticket-top {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(38, 33, 26, 0.18);
}

.ticket-route {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

.ticket-close {
  padding: 8px 13px;
  background: transparent;
  border: 1px solid rgba(38, 33, 26, 0.35);
  border-radius: var(--r-chrome);
  color: var(--paper-ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ticket-close:hover { background: rgba(38, 33, 26, 0.08); }
.ticket-close:active { transform: translateY(1px); }

.ticket-main { position: relative; padding-top: 18px; }

.ticket-day {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

.ticket-title {
  margin: 0 0 14px;
  font-family: var(--grot);
  font-weight: 700;
  font-size: clamp(25px, 4vw, 33px);
  line-height: 1.15;
}

.ticket-body p {
  max-width: 58ch;
  margin: 0 0 12px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--paper-body);
}

.ticket-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 26px;
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px dashed rgba(38, 33, 26, 0.3);
}

.ticket-facts dt {
  margin: 0 0 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

.ticket-facts dd {
  margin: 0;
  font-family: var(--grot);
  font-weight: 600;
  font-size: 15px;
}

.ticket-stamp {
  position: absolute;
  top: 10px;
  right: 4px;
  padding: 4px 10px;
  border: 2.5px solid var(--stamp);
  border-radius: var(--r-chrome);
  color: var(--stamp);
  font-family: var(--grot);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  transform: rotate(-7deg) scale(1.35);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.ticket.is-saved .ticket-stamp {
  opacity: 1;
  transform: rotate(-7deg) scale(1);
}

.ticket-stub {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 0 4px 26px;
  margin-top: 18px;
  border-left: 2px dashed rgba(38, 33, 26, 0.32);
}

.stub-day {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

.stub-time {
  margin: 0;
  font-family: var(--grot);
  font-weight: 800;
  font-size: 42px;
  line-height: 1;
  color: var(--amber-deep);
}

.stub-end {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--paper-muted);
}

.stub-save {
  width: 100%;
  padding: 12px 10px;
  background: var(--paper-ink);
  border: 1px solid var(--paper-ink);
  border-radius: var(--r-chrome);
  color: var(--paper);
  font-family: var(--grot);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.stub-save[aria-pressed="true"] {
  background: var(--amber-deep);
  border-color: var(--amber-deep);
  color: #fff8ec;
}

.stub-save:active { transform: translateY(1px); }

.barcode {
  height: 44px;
  margin-top: auto;
  background: repeating-linear-gradient(90deg,
    var(--paper-ink) 0 2px, transparent 2px 4px,
    var(--paper-ink) 4px 7px, transparent 7px 9px,
    var(--paper-ink) 9px 10px, transparent 10px 14px);
  opacity: 0.85;
}

.stub-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--paper-muted);
}

.punch {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--page);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.55);
}

.punch-1 { top: -11px; left: calc(100% - var(--stub) - 28px); transform: translateX(-50%); }
.punch-2 { bottom: -11px; left: calc(100% - var(--stub) - 28px); transform: translateX(-50%); }

/* ---------- mobile ---------- */

@media (max-width: 700px) {
  .masthead { flex-direction: column; align-items: flex-start; gap: 12px; }
  .masthead-meta { text-align: left; display: flex; gap: 14px; align-items: baseline; }
  .masthead-dates { margin: 0; }

  .controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .field-search { grid-column: 1 / -1; }

  .row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "time side"
      "main main";
    gap: 8px 14px;
    padding: 13px 4px;
  }
  .row-time { grid-area: time; font-size: 17px; }
  .row-main { grid-area: main; }
  .row-right { grid-area: side; gap: 12px; }
  .row-title { font-size: 14.5px; line-height: 1.7; }
  .row-meta { font-size: 10px; letter-spacing: 0.1em; }
  .row-chev { display: none; }

  .ticket { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .ticket-stamp { display: none; }
  .ticket-stub {
    border-left: 0;
    border-top: 2px dashed rgba(38, 33, 26, 0.32);
    padding: 18px 0 4px;
    margin-top: 16px;
  }
  .punch { display: none; }
  .ticket-facts { grid-template-columns: minmax(0, 1fr); }
}

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

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