/* ===== Design tokens =====
   paper       #FFFFFF  page background
   surface     #F3F6F8  card / section background
   ink         #10151A  primary text
   ink-soft    #5C6873  secondary text
   line        #E1E8EC  hairlines / borders
   accent      #2F5EFF  primary action (signal blue — the app's own color, not a transit line)
   bts         #00A651  BTS leg (real brand color)
   mrt         #1E4C9A  MRT leg (real brand color)
   rail        #E4572E  Airport Rail Link leg (real brand color, used sparingly/functionally)
   transit     #0891B2  walk / bus leg (cool teal, not brand-tied)
*/

:root {
  --paper: #FFFFFF;
  --surface: #F3F6F8;
  --ink: #10151A;
  --ink-soft: #5C6873;
  --ink-faint: #9AA6AD;
  --line: #E1E8EC;
  --accent: #2F5EFF;
  --bts: #00A651;
  --mrt: #1E4C9A;
  --rail: #E4572E;
  --transit: #0891B2;
  --radius: 16px;
  --font: 'Kanit', sans-serif;
  --shadow-sm: 0 1px 2px rgba(16, 21, 26, 0.04), 0 1px 1px rgba(16, 21, 26, 0.03);
  --shadow-md: 0 10px 30px -12px rgba(16, 21, 26, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 56px 20px 40px;
  overflow: hidden;
}

/* subtle transit-line motif — thin cool-toned paths, not a warm glow */


.hero-inner { position: relative; max-width: 480px; margin: 0 auto; }

.eyebrow {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.wordmark {
  font-weight: 700;
  font-size: clamp(38px, 9vw, 54px);
  line-height: 1;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.wordmark .dot { color: var(--bts); }

.tagline {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  max-width: 36ch;
}

/* ===== Planner / search card ===== */
.planner {
  flex: 1;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 20px 60px;
}

.search-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 2px;
}

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

.field input {
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--line);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  padding: 6px 2px 10px;
  outline: none;
  transition: border-color 0.15s ease;
}
.field input:focus { border-bottom-color: var(--accent); }
.field input::placeholder { color: var(--ink-faint); }

.swap-row {
  position: relative;
  height: 22px;
  margin-left: 6px;
  display: flex;
  align-items: center;
}
.rail-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  position: absolute;
  left: -4px;
}
.rail-dot.start { top: -14px; background: var(--bts); }
.rail-dot.end { bottom: -14px; background: var(--rail); }
.rail-line {
  width: 1.5px;
  height: 100%;
  background: var(--line);
}
.swap-btn {
  position: absolute;
  right: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 15px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.swap-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--paper); }

.go-btn {
  margin-top: 16px;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 11px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(47, 94, 255, 0.55);
  transition: filter 0.15s ease, transform 0.1s ease;
}
.go-btn:hover { filter: brightness(1.05); }
.go-btn:active { transform: translateY(1px); }

.form-hint {
  margin: 10px 2px 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--rail);
  min-height: 1em;
}

/* ===== Empty / loading states ===== */
.empty-state, .loading-state {
  margin-top: 40px;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 300;
  font-size: 14.5px;
  padding: 0 10px;
}
.loading-state { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.loader {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Results ===== */
.results { margin-top: 36px; }

.results-head h2 {
  font-weight: 600;
  font-size: 21px;
  margin: 0 0 4px;
  color: var(--ink);
}
.results-sub {
  color: var(--ink-soft);
  font-weight: 300;
  font-size: 13.5px;
  margin: 0 0 22px;
}

/* schematic transit-line diagram — signature element */
.schematic {
  position: relative;
  padding-left: 30px;
}

.leg {
  position: relative;
  padding-bottom: 26px;
}
.leg:last-child { padding-bottom: 6px; }

.leg::before { /* the colored rail segment */
  content: "";
  position: absolute;
  left: -23px;
  top: 6px;
  bottom: -6px;
  width: 3px;
  border-radius: 2px;
  background: var(--seg-color, var(--line));
}
.leg:last-child::before { display: none; }

.leg-node {
  position: absolute;
  left: -28px;
  top: 0;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--seg-color, var(--ink-faint));
  box-shadow: 0 0 0 3px var(--paper);
}

.leg-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--seg-color, var(--ink-soft));
  margin-bottom: 3px;
}

.leg-title {
  font-weight: 500;
  font-size: 15.5px;
  margin: 0 0 2px;
  color: var(--ink);
}

.leg-detail {
  color: var(--ink-soft);
  font-weight: 300;
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0;
}

.leg-meta {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.leg-meta .fare { color: var(--accent); }

/* ticket stub summary — second signature touch */
.ticket-stub {
  margin-top: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
}
.ticket-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-soft);
}
.ticket-row .ticket-value { color: var(--ink); font-size: 15px; font-weight: 500; }
.ticket-row.total .ticket-label { color: var(--ink); font-weight: 600; font-size: 14px; }
.ticket-row.total .ticket-value { color: var(--accent); font-size: 23px; font-weight: 700; }
.ticket-perf {
  height: 1px;
  margin: 12px 0;
  background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px);
}

/* ===== Available routes (quick links) ===== */
.available-routes { margin-top: 34px; }
.available-title {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 10px;
}
.available-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.route-chip {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 15px;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.route-chip:hover { border-color: var(--accent); background: var(--paper); box-shadow: var(--shadow-sm); }
.chip-arrow { color: var(--accent); margin: 0 4px; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 20px 28px;
  text-align: center;
}
.site-footer p {
  max-width: 480px;
  margin: 0 auto;
  color: var(--ink-faint);
  font-weight: 300;
  font-size: 11.5px;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .loader { animation: none; }
}
