/* ============================================================
   MEET POINT — HoosAI ✕ BNSF Railway
   dispatcher console — ink + glass, Barlow Condensed / Inter /
   Fraunces italic / JetBrains Mono
   ============================================================ */

:root {
  --ink: #06070A;
  --ink-2: #0B0D12;
  --text: #E9ECF2;
  --muted: rgba(233, 236, 242, 0.56);
  --faint: rgba(233, 236, 242, 0.32);
  --line: rgba(233, 236, 242, 0.10);
  --line-bright: rgba(233, 236, 242, 0.24);
  --glass: rgba(255, 255, 255, 0.035);
  --glass-2: rgba(255, 255, 255, 0.06);
  --accent: #F35D0A;
  --accent-soft: rgba(243, 93, 10, 0.16);
  --warn: #F2B705;
  --warn-soft: rgba(242, 183, 5, 0.14);
  --danger: #FF4D4D;
  --danger-soft: rgba(255, 77, 77, 0.14);
  --good: #4FD17A;
  --disp: "Barlow Condensed", sans-serif;
  --body: "Inter", sans-serif;
  --serif: "Fraunces", serif;
  --mono: "JetBrains Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* the hidden attribute must always win, even over classes that set their own display */
[hidden]{ display:none !important; }


html, body { overflow-x: hidden; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

.wrap { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }

.mono { font-family: var(--mono); }

em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--muted); }

h1, h2, h3, h4, h5 { font-family: var(--disp); text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.05; font-weight: 700; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

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

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--disp);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 5px;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  white-space: normal;
  text-align: center;
}
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; width: 100%; }
.btn-accent:hover { background: #ff6f1f; transform: translateY(-1px); }
.btn-accent:disabled {
  background: var(--glass);
  border-color: var(--line);
  color: var(--faint);
  cursor: not-allowed;
  transform: none;
}

/* ---------- logo lockup ---------- */
.brand-badge { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.brand-badge img { display: block; height: 19px; width: auto; }

/* ============================================================
   HEADER
   ============================================================ */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 7, 10, 0.86);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.head-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  flex-wrap: wrap;
}
.lockup {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.lockup-x { color: var(--accent); font-size: 13px; }

.head-title {
  display: flex;
  flex-direction: column;
  margin-right: auto;
}
.head-title-main {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.head-title-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-top: 2px;
}

.head-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  border: 1px solid var(--line);
  background: var(--glass);
  border-radius: 5px;
  padding: 7px 14px;
}
.clock-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--faint);
}
.clock-time {
  font-size: 17px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ============================================================
   CONSOLE TOP — subdivision id + stats
   ============================================================ */
.console-top { padding: 28px 0 8px; }
.sub-id { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.sub-name {
  font-family: var(--disp);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.01em;
}
.sub-meta {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat-tile {
  padding: 18px 18px 18px 0;
  border-right: 1px solid var(--line);
}
.stat-tile:nth-child(2) { padding-left: 18px; }
.stat-tile:nth-child(3) { padding-left: 18px; }
.stat-tile:nth-child(4) { padding-left: 18px; border-right: none; }
.stat-tile b {
  display: block;
  font-family: var(--disp);
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  color: var(--text);
}
.stat-tile span { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }

/* ============================================================
   PANELS — shared card shell
   ============================================================ */
.panel {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 10px;
  backdrop-filter: blur(14px) saturate(150%);
  padding: clamp(18px, 3vw, 30px);
}
.panel-head { margin-bottom: 20px; }
.panel-head h2 { font-size: clamp(20px, 2.6vw, 26px); }
.panel-sub { margin-top: 6px; font-size: 13.5px; color: var(--muted); }

/* ============================================================
   BOARD
   ============================================================ */
.board-section { padding: 22px 0; }

.board-track {
  position: relative;
  padding: 0 50px;
  margin-top: 6px;
}
.board-inner {
  position: relative;
  height: 780px;
}

.rail-pair {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 10px;
  transform: translateY(-50%);
}
.rail-pair::before,
.rail-pair::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line-bright);
}
.rail-pair::before { top: 0; }
.rail-pair::after { top: 8px; }

.scale-tick {
  position: absolute;
  top: calc(50% - 8px);
  width: 1px;
  height: 16px;
  background: var(--line);
  transform: translateX(-50%);
}

.cp-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  transform: translateX(-50%);
}
.cp-mark .cp-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--line);
}
.cp-mark .cp-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cp-mark.lbl-top .cp-label { top: 0; }
.cp-mark.lbl-bottom .cp-label { bottom: 0; }
.cp-label b {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text);
}
.cp-label small {
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.train-mark {
  position: absolute;
  transform: translateX(-50%);
  width: 106px;
  padding: 7px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--glass-2);
  backdrop-filter: blur(8px);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  border-left: 3px solid var(--faint);
}
/* Fixed, generous per-tier spacing (each row reserves ~110px, comfortably
   more than the tallest rendered marker at any breakpoint) so a row can
   never vertically collide with its neighbor, up to 3 trains per lane —
   the max this dataset can ever cluster in one direction. Identical at
   every breakpoint so there is only one set of numbers to reason about. */
.train-mark.lane-e { top: 256px; }
.train-mark.lane-e.stack { top: 146px; }
.train-mark.lane-e.stack2 { top: 36px; }
.train-mark.lane-w { top: 410px; }
.train-mark.lane-w.stack { top: 520px; }
.train-mark.lane-w.stack2 { top: 630px; }
.train-mark:hover { border-color: var(--line-bright); background: var(--glass); }
.train-mark.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }

.train-mark.prio-1 { border-left-color: var(--accent); }
.train-mark.prio-2 { border-left-color: #7FA8D9; }
.train-mark.prio-3 { border-left-color: #B58A55; }
.train-mark.prio-4 { border-left-color: var(--faint); }

.train-mark.is-holding { opacity: 0.6; border-style: dashed; }
.train-mark.is-proceeding { border-color: var(--line-bright); }
.train-mark.is-restricted { border-color: var(--warn); }

.tm-row1 { display: flex; align-items: baseline; gap: 5px; }
.tm-arrow { color: var(--accent); font-size: 11px; }
.tm-id { font-size: 11.5px; font-weight: 500; }
.tm-class { font-family: var(--disp); font-size: 9.5px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.tm-meta { font-size: 9px; letter-spacing: 0.01em; color: var(--faint); line-height: 1.35; }

.board-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.board-legend span { display: inline-flex; align-items: center; gap: 6px; }
.board-legend .sep { color: var(--faint); }
.board-legend .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.board-legend .dot.prio-1 { background: var(--accent); }
.board-legend .dot.prio-2 { background: #7FA8D9; }
.board-legend .dot.prio-3 { background: #B58A55; }
.board-legend .dot.prio-4 { background: var(--faint); }
.board-legend .glyph { color: var(--faint); font-size: 12px; }

.train-inspector {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.train-inspector b { color: var(--text); }

/* ============================================================
   CONSOLE GRID — conflicts + trick sheet
   ============================================================ */
.console-grid-section { padding: 6px 0 60px; }
.console-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 22px;
  align-items: start;
}

/* ---------- conflicts ---------- */
.conflicts-list { display: flex; flex-direction: column; gap: 14px; }

.empty-note { font-size: 13.5px; color: var(--muted); padding: 10px 2px; }
.empty-note.is-clear { color: var(--good); }

.conflict-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink-2);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.conflict-card.is-open { border-color: var(--line-bright); }
.conflict-card.is-resolved { opacity: 0.72; }

.conflict-head {
  position: relative;
  width: 100%;
  display: block;
  padding: 16px 44px 16px 18px;
  text-align: left;
}
.conflict-head:disabled { cursor: default; }
.conflict-head-main { display: flex; flex-direction: column; gap: 8px; }
.conflict-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  display: inline-block;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--accent-soft);
  background: rgba(243, 93, 10, 0.07);
  color: var(--accent);
}
.conflict-tag.tag-cascade { border-color: rgba(255, 77, 77, 0.35); background: var(--danger-soft); color: var(--danger); }
.conflict-tag.tag-resolved { border-color: var(--line); background: transparent; color: var(--faint); }

.conflict-head-main h3 { font-size: 19px; letter-spacing: 0.01em; }
.conflict-head-main p { font-size: 13px; color: var(--muted); max-width: 60ch; }
.conflict-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.conflict-chevron {
  position: absolute;
  top: 16px;
  right: 18px;
  font-family: var(--disp);
  font-size: 20px;
  color: var(--faint);
  line-height: 1;
}

.resolution-summary {
  padding: 12px 18px 16px;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.resolution-summary b { color: var(--text); }
.mini-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 100px;
  margin-left: 4px;
}
.mini-badge.mini-good { background: rgba(79, 209, 122, 0.14); color: var(--good); }
.mini-badge.mini-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- AI panel ---------- */
.ai-panel {
  padding: 4px 18px 20px;
  border-top: 1px solid var(--line);
}
.ai-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 0 6px;
}
.ai-spark { color: var(--accent); font-size: 16px; line-height: 1; margin-top: 2px; }
.ai-panel-head h4 { font-size: 15px; letter-spacing: 0.04em; }
.ai-panel-head p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }

.options-wrap { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

.option-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--glass);
}
.option-card.is-recommended { border-color: rgba(243, 93, 10, 0.4); background: var(--accent-soft); }
.option-card.is-disabled { opacity: 0.6; }
.option-card.is-cascade { border-color: rgba(255, 77, 77, 0.32); }

.option-top { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.option-rank {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 22px;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-bright);
  flex: none;
  width: 30px;
  line-height: 1.3;
}
.option-copy { flex: 1 1 220px; }
.option-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.badge {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border-radius: 100px;
  display: inline-block;
}
.badge-accent { background: var(--accent); color: #fff; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--glass-2); color: var(--faint); }

.option-copy h5 { font-size: 15.5px; letter-spacing: 0.01em; text-transform: none; font-family: var(--body); font-weight: 600; }
.option-note { margin-top: 5px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }

.option-delay { flex: none; text-align: right; margin-left: auto; }
.option-delay b { display: block; font-family: var(--disp); font-size: 26px; color: var(--text); line-height: 1; }
.option-delay span { display: block; margin-top: 4px; font-size: 9.5px; letter-spacing: 0.08em; color: var(--faint); }

.option-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.option-row.capacity-row.is-bad { border-color: rgba(242, 183, 5, 0.4); color: var(--warn); }
.option-row span.mono { color: var(--muted); letter-spacing: 0.01em; }
.option-row.capacity-row.is-bad span.mono { color: var(--warn); }

.cascade-alert {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 77, 77, 0.4);
  background: var(--danger-soft);
  border-radius: 6px;
}
.cascade-icon { color: var(--danger); font-size: 16px; flex: none; }
.cascade-alert b { color: var(--danger); font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--disp); }
.cascade-alert p { margin-top: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }

.option-actions { margin-top: 14px; }

/* ---------- trick sheet ---------- */
.log-list { display: flex; flex-direction: column; gap: 2px; max-height: 640px; overflow-y: auto; }
.log-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.log-entry:last-child { border-bottom: none; }
.log-ts { color: var(--accent); font-size: 11.5px; letter-spacing: 0.04em; }
.log-text { color: var(--muted); line-height: 1.55; }
.log-entry.kind-good .log-ts { color: var(--good); }
.log-entry.kind-warn .log-ts { color: var(--warn); }
.log-entry.kind-cascade { background: var(--danger-soft); border-radius: 6px; padding: 12px 10px; }
.log-entry.kind-cascade .log-ts { color: var(--danger); }
.log-entry.kind-cascade .log-text { color: var(--text); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-foot { border-top: 1px solid var(--line); padding: 34px 0 44px; }
.foot-lockup {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.foot-lockup span { color: var(--accent); }
.site-foot p { margin-top: 12px; max-width: 720px; font-size: 12px; color: var(--faint); line-height: 1.7; }

/* ============================================================
   MOBILE — no horizontal scroll anywhere; everything stacks
   ============================================================ */
@media (max-width: 900px) {
  .console-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .head-row { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 0; }
  .head-title { margin-right: 0; }
  .head-clock { align-self: flex-start; flex-direction: row; align-items: center; gap: 8px; }
  .clock-time { margin-top: 0; }

  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stat-tile { border-right: none; border-bottom: 1px solid var(--line); padding: 14px 0 14px 0; }
  .stat-tile:nth-child(odd) { border-right: 1px solid var(--line); padding-right: 14px; }
  .stat-tile:nth-child(even) { padding-left: 14px; }
  .stat-tile:nth-child(3), .stat-tile:nth-child(4) { border-bottom: none; }

  .board-track { padding: 0 30px; }
  .train-mark { width: 82px; padding: 6px 5px; }
  .tm-id { font-size: 10px; }
  .tm-class { font-size: 8.5px; }
  .tm-meta { font-size: 8px; }
  .cp-mark .cp-label { white-space: normal; max-width: 76px; }
  .cp-label b { font-size: 10.5px; }
  .cp-label small { font-size: 8.5px; }

  .option-top { flex-direction: column; }
  .option-delay { text-align: left; margin-left: 0; }
  .option-rank { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
