@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600&family=Space+Grotesk:wght@400;500;700&display=swap");

:root {
  --surface-0: #f6f0e7;
  --surface-1: rgba(255, 251, 246, 0.92);
  --surface-2: rgba(20, 28, 43, 0.1);
  --surface-3: rgba(255, 255, 255, 0.72);
  --text-0: #172033;
  --text-1: #33415e;
  --text-inverse: #fbf6ef;
  --border: rgba(23, 32, 51, 0.12);
  --blue: #0057d9;
  --gold: #e7c214;
  --success: #0f8e68;
  --danger: #c4473f;
  --shadow: 0 22px 60px rgba(24, 34, 56, 0.12);
  --page-bg:
    radial-gradient(circle at 10% 10%, rgba(231, 194, 20, 0.22), transparent 30%),
    radial-gradient(circle at 90% 0%, rgba(0, 87, 217, 0.18), transparent 32%),
    linear-gradient(180deg, #f7f2ea 0%, #efe6d9 100%);
}

body[data-theme="dark"] {
  --surface-0: #0b1220;
  --surface-1: rgba(10, 17, 30, 0.9);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-3: rgba(22, 31, 48, 0.88);
  --text-0: #f7efe2;
  --text-1: #b7c5de;
  --text-inverse: #09101c;
  --border: rgba(183, 197, 222, 0.12);
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  --page-bg:
    radial-gradient(circle at 15% 15%, rgba(231, 194, 20, 0.16), transparent 28%),
    radial-gradient(circle at 80% 5%, rgba(0, 87, 217, 0.22), transparent 28%),
    linear-gradient(180deg, #09111f 0%, #060b14 100%);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", sans-serif;
  background: var(--page-bg);
  color: var(--text-0);
  position: relative;
}

button,
input,
select,
textarea {
  font: inherit;
}

.background-glow {
  position: fixed;
  inset: auto;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

.background-glow-a {
  top: 3rem;
  right: -7rem;
  background: rgba(0, 87, 217, 0.45);
}

.background-glow-b {
  bottom: 5rem;
  left: -9rem;
  background: rgba(231, 194, 20, 0.35);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 1.2rem));
  margin: 0 auto;
  padding: 1rem 0 3rem;
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 1.5rem;
  padding: 1rem;
  backdrop-filter: blur(20px);
}

.hero-panel {
  padding: 1.4rem;
  display: grid;
  gap: 1rem;
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -50% auto;
  width: 20rem;
  height: 20rem;
  background:
    radial-gradient(circle, rgba(231, 194, 20, 0.28), transparent 55%),
    radial-gradient(circle at 35% 35%, rgba(0, 87, 217, 0.18), transparent 58%);
  transform: rotate(14deg);
}

.hero-copy,
.hero-actions {
  position: relative;
  z-index: 1;
}

.brand-logo {
  width: min(14rem, 55vw);
  height: auto;
  display: block;
  margin-bottom: 0.8rem;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.18));
}

.hero-copy h1,
.section-header h2 {
  margin: 0.2rem 0 0;
  font-family: "Fraunces", serif;
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  max-width: 12ch;
}

.hero-summary,
.supporting-copy {
  margin: 0;
  color: var(--text-1);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.eyebrow,
.label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--text-1);
  margin: 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: clamp(1.45rem, 5vw, 2rem);
}

.primary-button,
.ghost-button {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.8rem 1.1rem;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--blue), #1f7fff);
  color: #fff;
  border-color: transparent;
}

.ghost-button {
  background: var(--surface-3);
  color: var(--text-0);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.location-grid,
.planner-grid {
  display: grid;
  gap: 1rem;
}

.location-card {
  background:
    linear-gradient(135deg, rgba(0, 87, 217, 0.13), transparent),
    linear-gradient(180deg, rgba(231, 194, 20, 0.08), transparent);
  border-radius: 1.2rem;
  border: 1px solid var(--border);
  padding: 1rem;
}

.primary-stat {
  font-size: clamp(1.6rem, 5vw, 2.3rem);
  font-weight: 700;
  margin: 0.35rem 0;
}

.control-stack {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.38rem;
}

.field span {
  font-size: 0.92rem;
  color: var(--text-1);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-0);
  padding: 0.9rem 1rem;
  min-height: 3rem;
}

.button-row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.location-request-card {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: 1.1rem;
  background:
    linear-gradient(135deg, rgba(0, 87, 217, 0.16), transparent),
    var(--surface-3);
  border: 1px solid var(--border);
}

.location-request-card strong {
  font-size: 1.08rem;
}

.location-request-card.hidden {
  display: none;
}

.nearby-stations {
  margin-top: 0.75rem;
}

.nearby-station-button {
  cursor: pointer;
  color: var(--text-0);
}

.sync-badge {
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(15, 142, 104, 0.12);
  color: var(--success);
  border: 1px solid rgba(15, 142, 104, 0.2);
  font-size: 0.82rem;
  white-space: nowrap;
}

.sync-badge.error {
  background: rgba(196, 71, 63, 0.12);
  color: var(--danger);
  border-color: rgba(196, 71, 63, 0.24);
}

.map-frame {
  position: relative;
  border-radius: 1.3rem;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(0, 87, 217, 0.06), transparent),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 70px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 70px);
  overflow: hidden;
  min-height: 20rem;
  aspect-ratio: 16 / 10;
}

.map-frame svg {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
}

.map-station {
  cursor: pointer;
}

.map-label {
  font-size: 12px;
  font-weight: 500;
  fill: var(--text-0);
}

.map-toolbar {
  display: grid;
  gap: 0.8rem;
}

.map-note {
  max-width: 34rem;
}

.map-button-row {
  justify-content: flex-start;
}

.map-button {
  padding: 0.7rem 0.9rem;
  min-width: 5.4rem;
}

.downtown-inset {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.compact-header {
  margin-bottom: 0.75rem;
}

.compact-header h2 {
  font-size: clamp(1.2rem, 4vw, 1.55rem);
}

.inset-frame {
  min-height: 16rem;
  aspect-ratio: 16 / 10;
}

.departures-grid,
.alerts-list {
  display: grid;
  gap: 1rem;
}

.departure-card,
.alert-card {
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface-3);
  overflow: hidden;
}

.departure-top {
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.route-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.route-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.departure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.time-block {
  padding: 0.9rem;
  border-radius: 1rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
}

.time-block strong {
  display: block;
  font-size: 1.2rem;
  margin-top: 0.25rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill {
  border-radius: 999px;
  padding: 0.34rem 0.62rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface-1);
}

.pill.delay {
  color: var(--danger);
}

.pill.ok {
  color: var(--success);
}

.trip-select {
  width: 100%;
}

.stop-list {
  display: grid;
  gap: 0.55rem;
  padding: 0 1rem 1rem;
}

.stop-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.stop-row:last-child {
  border-bottom: 0;
}

.stop-row strong {
  display: block;
}

.stop-row span {
  color: var(--text-1);
  font-size: 0.84rem;
}

.alert-card {
  padding: 1rem;
  display: grid;
  gap: 0.65rem;
}

.alert-card header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.alert-card h3 {
  margin: 0;
  font-size: 1.02rem;
}

.severity {
  border-radius: 999px;
  padding: 0.34rem 0.62rem;
  font-size: 0.74rem;
  border: 1px solid var(--border);
}

.severity.delay {
  color: #a76100;
  background: rgba(231, 194, 20, 0.14);
}

.severity.service-disruption {
  color: var(--danger);
  background: rgba(196, 71, 63, 0.12);
}

.severity.notice {
  color: var(--blue);
  background: rgba(0, 87, 217, 0.12);
}

.planner-result,
.override-result,
.empty-state {
  border: 1px dashed var(--border);
  border-radius: 1rem;
  padding: 1rem;
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.04);
}

.plan-leg {
  border-radius: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface-3);
  margin-top: 0.8rem;
}

.plan-leg strong {
  display: block;
  margin-bottom: 0.2rem;
}

@media (min-width: 720px) {
  .hero-panel {
    grid-template-columns: 1.6fr 1fr;
    align-items: end;
  }

  .location-grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }

  .planner-grid {
    grid-template-columns: 1.1fr 1fr;
  }

  .departures-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-toolbar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .map-button-row {
    justify-content: flex-end;
  }
}
