@font-face {
  font-family: "LTAIdentity";
  src: url("./assets/fonts/LTAIdentity.ttf") format("truetype");
}

@font-face {
  font-family: "Frutiger";
  src: url("./assets/fonts/Frutiger.ttf") format("truetype");
  font-weight: normal;
}

@font-face {
  font-family: "Frutiger";
  src: url("./assets/fonts/Frutiger_bold.ttf") format("truetype");
  font-weight: bold;
}

:root {
  /* Color Palette - Light Theme */
  --bg: #ffffff;
  --bg-offset: #f8fafc; /* light slate background */
  --bg-alt: #f1f5f9; /* slate-100 */
  --surface: #ffffff;
  --surface-alt: #f8fafc;

  /* Brand Colors - Transit Red theme */
  --brand: #dc2626; /* Red-600 */
  --brand-hover: #b91c1c; /* Red-700 */
  --brand-deep: #991b1b; /* Red-800 */
  --brand-light: #fee2e2; /* Red-100 */
  --brand-soft: #fef2f2; /* Red-50 (used for highlights) */
  --border-brand: #fecaca; /* Red-200 */
  --shadow-brand: rgba(220, 38, 38, 0.08);

  /* Neutral scale */
  --ink: #0f172a; /* Slate-900 */
  --ink-medium: #334155; /* Slate-700 */
  --ink-muted: #64748b; /* Slate-500 */

  /* Borders & Shadows */
  --border: #e2e8f0; /* Slate-200 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.08);

  /* Typography & Layout spacing */
  --radius-lg: 0px;
  --radius: 0px;
  --radius-sm: 4px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4.5rem;
  --max-width: 1200px;

  /* Header background */
  --header-bg: rgba(255, 255, 255, 0.88);
}

html.dark {
  /* Color Palette - Dark Theme */
  --bg: #0b0f19;
  --bg-offset: #0f172a;
  --bg-alt: #1e293b;
  --surface: #1e293b;
  --surface-alt: #334155;

  /* Brand Colors - Transit Red theme adjusted for dark mode */
  --brand: #ef4444;
  --brand-hover: #f87171;
  --brand-deep: #b91c1c;
  --brand-light: #450a0a;
  --brand-soft: rgba(239, 68, 68, 0.15);
  --border-brand: #7f1d1d;
  --shadow-brand: rgba(239, 68, 68, 0.2);

  /* Neutral scale */
  --ink: #f8fafc;
  --ink-medium: #cbd5e1;
  --ink-muted: #94a3b8;

  /* Borders & Shadows */
  --border: #334155;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5);

  /* Header specific background */
  --header-bg: rgba(15, 23, 42, 0.88);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  color: var(--ink);
  background-color: var(--bg-offset);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Sticky Header Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  height: 100%;
}

.brand-logo {
  display: block;
  border-radius: 0px;
  object-fit: contain;
}

.header .brand-logo {
  height: 100%;
}

.nav-menu {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  color: var(--ink-medium);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition:
    color 0.2s,
    border-bottom-color 0.2s;
}

.nav-link:hover {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.nav-link.active {
  color: var(--brand);
  font-weight: 700;
  border-bottom-color: var(--brand);
}

/* This CSS makes the player modern, seamless, and mobile-responsive */
.video-container {
  max-width: 480px; /* Smaller default size */
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin: 0 auto; /* Centered */
  background: #000;
  border-radius: 8px; /* Smooth rounded corners */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: max-width 0.4s ease-in-out;
  transition-delay: 0s; /* Instant shrink when leaving hover */
}
.video-container:hover {
  max-width: 854px; /* Expands to standard 480p height width */
  transition-delay: 0.1s; /* Activates after hovering for 1 second */
}
.video-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Page Layout Wrapper */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-xl);
}

.section {
  margin-top: var(--space-xl);
}

/* Headings and Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Frutiger", sans-serif;
  font-weight: bold;
  color: var(--ink);
  line-height: 1.25;
  margin-top: 0;
}

p {
  color: var(--ink-medium);
  margin-top: 0;
}

/* Buttons System */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.35rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    transform 0.15s;
}

.button:active {
  transform: scale(0.98);
}

.button-secondary {
  background-color: transparent;
  color: var(--brand);
  border-color: var(--brand);
}

.button-nav {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.button-white {
  background-color: #ffffff;
  color: var(--brand);
  border-color: #ffffff;
}

.button-outline-white {
  background-color: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.button-discord {
  background-color: #5865f2;
  border-color: #5865f2;
  color: #ffffff;
}

/* Hero Banner (Full Width) */
.hero-banner {
  position: relative;
  width: 100%;
  height: 500px;
  color: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  margin-top: 0;
}

.hero-image-container-fullscreen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-image-fullscreen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-scrim {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.85) 0%,
    rgba(15, 23, 42, 0.4) 100%
  );
  z-index: 2;
}

.hero-banner-content {
  position: relative;
  z-index: 3;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-banner-content h1 {
  color: #ffffff;
  font-size: 2.85rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.03em;
  max-width: 36rem;
}

.hero-banner-content .hero-description {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.15rem;
  max-width: 36rem;
}

.hero-badge {
  align-self: flex-start;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 0.35rem 0.85rem;
  border-radius: 0px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.hero-actions .button {
  width: 190px;
  justify-content: center;
}

/* Showcase Status */
.showcase-status {
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-medium);
}

.showcase-status i {
  color: var(--brand);
  font-size: 1.1rem;
}

/* Showcase Stats Grid */
.showcase-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin: 0.75rem 0 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.showcase-stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.showcase-stat-item .stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.showcase-stat-item .stat-label i {
  color: var(--brand);
  font-size: 0.85rem;
}

.showcase-stat-item .stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  font-family: "Frutiger", "Inter", sans-serif;
}

/* Section Header (Centered) */
.section-header-centered {
  text-align: center;
  max-width: 42rem;
  margin: 0 auto var(--space-lg);
}

.section-tag {
  display: inline-block;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.section-header-centered h2 {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-lead {
  font-size: 1.05rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* Showcase Section */
.showcase-card {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.showcase-image-side {
  position: relative;
  min-height: 18rem;
  height: 100%;
}

.showcase-card + .showcase-card {
  margin-top: var(--space-md);
}

.showcase-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-credit {
  position: absolute;
  bottom: 0.85rem;
  left: 0.85rem;
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0px;
  font-weight: 500;
}

.showcase-content-side {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-sm);
}

.showcase-content-side h3 {
  font-size: 1.65rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.showcase-content-side p {
  font-size: 1rem;
  color: var(--ink-medium);
  line-height: 1.6;
}

.feature-bullets {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 0.5rem 0 1rem;
}

.bullet-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.bullet-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0px;
  background-color: var(--brand-soft);
  color: var(--brand);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.bullet-text h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.15rem 0;
}

.bullet-text p {
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.4;
  margin: 0;
}

/* Benefits Section */
.benefits-section {
  background-color: var(--brand-soft);
  border: 1px solid var(--border-brand);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  max-width: 1060px;
  margin: 0 auto;
}

.benefit-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem var(--space-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.benefit-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0px;
  background-color: var(--brand-light);
  color: var(--brand);
  font-size: 1.25rem;
}

.benefit-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.benefit-card p {
  font-size: 0.9rem;
  color: var(--ink-medium);
  line-height: 1.5;
  margin: 0;
}

/* Red Background Call To Action Banner */
.cta-banner {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
  border-radius: var(--radius-lg);
  color: #ffffff;
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  box-shadow: 0 10px 30px var(--shadow-brand);
}

.cta-banner-content {
  max-width: 44rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

.cta-banner h2 {
  color: #ffffff;
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
}

.cta-banner-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* Footer Section */
.footer {
  background-color: var(--ink);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  margin-top: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.footer-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.footer-brand-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-brand-column .brand {
  color: #ffffff;
}

.footer-tagline {
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
  max-width: 20rem;
}

.footer-links-column h3 {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.78rem;
}

.footer-bottom p {
  margin: 0;
  color: #64748b;
}

.footer-disclaimer {
  font-style: italic;
}

/* Animations */
.fade-in {
  opacity: 1;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .showcase-card {
    grid-template-columns: 1fr;
  }

  .showcase-image-side {
    min-height: 18rem;
  }

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

@media (max-width: 768px) {
  .header-container {
    position: relative;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 var(--space-md);
  }

  .header-container .brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 44px;
    display: flex;
    align-items: center;
  }

  .nav-menu,
  .header-actions {
    display: none;
  }

  /* Make containers flush with screen edges on mobile */
  .page {
    padding: 0 0 var(--space-xl);
  }

  .section {
    margin-top: var(--space-lg);
    margin-left: 0;
    margin-right: 0;
  }

  .showcase-card {
    grid-template-columns: 1fr;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .showcase-stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .showcase-image-side {
    min-height: 14rem;
  }

  /* Benefits Section edge-to-edge flush */
  .benefits-section {
    border-left: none;
    border-right: none;
    padding: var(--space-lg) var(--space-md);
  }

  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .benefit-card {
    border-left: none;
    border-right: none;
  }

  /* CTA Banner flush edit */
  .cta-banner {
    border-left: none;
    border-right: none;
  }

  /* Footer flush edit */
  .footer {
    border-left: none;
    border-right: none;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
  }

  /* Hero Banner mobile responsive rules */
  .hero-banner {
    height: auto;
    padding: var(--space-xl) var(--space-sm);
  }

  .hero-scrim {
    background: rgba(15, 23, 42, 0.75);
  }

  .hero-banner-content {
    align-items: center;
    text-align: center;
    padding: 0 var(--space-sm);
  }

  .hero-banner-content h1 {
    font-size: 2.15rem;
  }

  .hero-banner-content .hero-description {
    font-size: 1.05rem;
  }

  .hero-actions {
    justify-content: center;
  }
}

/* Carousel Controls */
.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  padding: 0;
  border-radius: 0px;
}

.carousel-control.prev {
  left: 0.75rem;
}

.carousel-control.next {
  right: 0.75rem;
}

/* Carousel Indicators */
.carousel-indicators {
  position: absolute;
  bottom: 2.5rem; /* Raised slightly to prevent overlapping the platform preview label */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.35rem;
  z-index: 5;
}

.indicator {
  width: 0.5rem;
  height: 0.5rem;
  background-color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  border-radius: 0px;
  border: none;
  padding: 0;
  display: block;
}

.indicator.active {
  background-color: #ffffff;
  width: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    animation: none;
    opacity: 1;
    transform: none;
  }

  * {
    transition: none !important;
  }
}

/* Portal Shared Controls */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 420px;
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.form-group {
  margin-bottom: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-medium);
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  background: var(--bg);
  color: var(--ink);
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--brand);
}

.portal-btn {
  width: 100%;
  background-color: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand);
  padding: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.portal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.feedback-msg {
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: var(--space-sm);
  font-weight: 500;
  display: none;
}

.feedback-error {
  background-color: #fee2e2;
  color: #b91c1c;
  border-left: 4px solid #ef4444;
  display: block;
}

.feedback-success {
  background-color: #dcfce7;
  color: #15803d;
  border-left: 4px solid #22c55e;
  display: block;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top: 2px solid var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Mobile Side Drawer CSS */
.drawer-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  z-index: 1002;
}

.drawer-toggle-btn:hover {
  color: var(--brand);
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 1010;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: var(--space-md) var(--space-lg);
  border-right: 1px solid var(--border);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1005;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}

.drawer-close-btn {
  background: none;
  border: none;
  color: var(--ink-medium);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.drawer-close-btn:hover {
  color: var(--brand);
}

.mobile-drawer-menu {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.drawer-nav-link {
  color: var(--ink-medium);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  padding: 0.5rem 0;
  border-left: 3px solid transparent;
  padding-left: 0.75rem;
  transition:
    color 0.2s,
    border-left-color 0.2s;
}

.drawer-nav-link:hover,
.drawer-nav-link.active {
  color: var(--brand);
  border-left-color: var(--brand);
  font-weight: 700;
}

.mobile-drawer-actions {
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.button-drawer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
}

@media (max-width: 768px) {
  .drawer-toggle-btn {
    display: flex;
  }
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--brand);
  color: #ffffff !important;
  padding: 0.5rem 1rem;
  z-index: 9999;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #ffffff;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 10px;
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* Custom Focus Ring for Links and Buttons */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
select:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

/* Map Copyright Overlay */
.map-copyright-overlay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-medium);
  padding: 6px 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 10;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.copyright-logo {
  height: 16px;
  width: auto;
  display: block;
}


/* ==========================================================================
   MTI SLEEK TRAIN LOADING OVERLAY STYLING
   ========================================================================== */
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg, #ffffff);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  overflow: hidden;
}

#page-loader.inactive {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Synchronous bypass style rule */
html.skip-loader #page-loader {
  display: none !important;
}

.mti-loader-container {
  max-width: 600px;
  width: 100%;
  padding: 2rem;
  box-sizing: border-box;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mti-loader-logo {
  height: 48px;
  width: auto;
  margin-bottom: 2.5rem;
  object-fit: contain;
}

/* Track Section */
.mti-loader-tracks {
  width: 100%;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.mti-track-wrapper {
  position: relative;
  width: 100%;
  height: 56px;
  background-color: transparent;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.mti-rail-line {
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--border) 0px,
    var(--border) 3px,
    transparent 3px,
    transparent 16px
  ); /* ties */
  border-bottom: 2px solid var(--ink-muted); /* ballast */
}
.mti-rail-line::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--ink-medium); /* rail top */
}

/* Train container and image settings */
.mti-train-consist {
  display: inline-flex;
  align-items: flex-end;
  position: absolute;
  left: 0;
  bottom: 8px;
  will-change: left;
  width: max-content;
}

.mti-train-image {
  height: 44px;
  width: auto;
  display: block;
}

/* Direction travel keyframes using container-relative spacing */
.mti-train-consist.ltr {
  animation: mti-travel-ltr linear infinite;
}
.mti-train-consist.rtl {
  animation: mti-travel-rtl linear infinite;
}

@keyframes mti-travel-ltr {
  0% {
    left: 0;
    transform: translateX(-100%);
  }
  100% {
    left: 100%;
    transform: translateX(0);
  }
}

@keyframes mti-travel-rtl {
  0% {
    left: 100%;
    transform: translateX(0);
  }
  100% {
    left: 0;
    transform: translateX(-100%);
  }
}

/* Progress Text & Messages */
.mti-loader-status {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.mti-loader-text {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* Stroudley Font Face */
@font-face {
  font-family: "Stroudley";
  src: url("./assets/fonts/Stroudley_W01_Regular.ttf") format("truetype");
  font-weight: normal;
}

/* Custom Stroudley font usage for legend headers */
.mti-legend-tab-text,
.mti-legend-header {
  font-family: "Stroudley", "Inter", sans-serif !important;
  font-weight: normal;
}

/* LTA identity for Line names and station codes only */
.mti-capsule,
.mti-line-badge,
.mti-line-name {
  font-family: "LTAIdentity", "Inter", sans-serif !important;
}

/* Legend Overlay Styling */
.mti-map-legend-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.05);
  z-index: 10;
  display: flex;
  align-items: stretch;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
  height: 145px;
  overflow: hidden;
  transition: background-color 0.2s, border-color 0.2s;
}

html.dark .mti-map-legend-overlay {
  background-color: #1e293b;
  border-top-color: #334155;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
}

.mti-legend-powered {
  position: absolute;
  bottom: 6px;
  left: 105px;
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-muted);
  opacity: 0.8;
  z-index: 12;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mti-legend-tab {
  background-color: #27272a;
  color: #ffffff;
  width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mti-legend-tab-text {
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.mti-legend-scroll-container {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 10px 1.5rem;
  overflow-x: auto;
  flex: 1;
  box-sizing: border-box;
  scrollbar-width: thin;
}

.mti-legend-scroll-container::-webkit-scrollbar {
  height: 4px;
}
.mti-legend-scroll-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.mti-legend-section {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  flex-shrink: 0;
  gap: 6px;
}

.mti-legend-header {
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: bold;
  text-transform: uppercase;
  margin: 0;
}

.mti-legend-divider {
  width: 1px;
  background-color: var(--border);
  height: 80%;
  align-self: center;
  flex-shrink: 0;
}
html.dark .mti-legend-divider {
  background-color: #334155;
}

.mti-legend-diagram-container {
  display: flex;
  align-items: center;
  height: 100%;
}

.mti-legend-station-code-spec {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  position: relative;
  margin-top: -6px;
}

.mti-spec-line-colour {
  font-size: 9px;
  color: var(--ink-muted);
  font-weight: 600;
  line-height: 1;
}

.mti-spec-arrow-top {
  font-size: 8px;
  color: var(--ink-muted);
  line-height: 0.8;
  margin-bottom: 2px;
}

.mti-spec-capsule {
  background-color: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 9px;
  line-height: 1.2;
}

.mti-spec-arrows-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--ink-muted);
  line-height: 1;
  margin-top: -1px;
}
.mti-spec-arrows-bottom span {
  font-size: 8px;
  letter-spacing: -0.5px;
}

.mti-capsule {
  color: #ffffff;
  font-size: 9px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 9px;
  border: 1px solid #ffffff;
  display: inline-block;
  line-height: 1.2;
}

.mti-connector-bar {
  width: 12px;
  height: 4px;
  background-color: #3b82f6;
}

.mti-legend-interchange-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  height: 100%;
}

.mti-interchange-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.mti-interchange-badges {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mti-interchange-badges.tap-out {
  gap: 0;
}

.mti-interchange-label {
  font-size: 9px;
  color: var(--ink-muted);
  font-weight: 600;
}

.mti-legend-lines-grid {
  display: grid;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  gap: 4px 12px;
  align-content: start;
  margin-top: 4px;
}

.mti-line-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mti-line-badge {
  color: #ffffff;
  font-size: 9px;
  font-weight: bold;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  border: 1px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.mti-line-name {
  font-size: 11px;
  font-weight: bold;
  color: var(--ink-medium);
  white-space: nowrap;
}
html.dark .mti-line-name {
  color: #e2e8f0;
}

.mti-line-dots {
  display: flex;
  gap: 2px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
}

.mti-legend-other-modes-grid {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  gap: 6px 12px;
  align-content: start;
  margin-top: 4px;
}

.mti-other-mode-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mti-mode-icon-wrapper {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #18181b;
  font-size: 12px;
  flex-shrink: 0;
}
html.dark .mti-mode-icon-wrapper {
  color: #f4f4f5;
}

.mti-mode-icon-wrapper.bus {
  color: #10b981;
}

.mti-mode-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

.mti-legend-right-section {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  border-left: 1px solid var(--border);
  padding: 10px 1.5rem;
  width: 260px;
  flex-shrink: 0;
  box-sizing: border-box;
}
html.dark .mti-legend-right-section {
  border-left-color: #334155;
}

.mti-legend-feedback-btn {
  background-color: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s, transform 0.15s;
  width: 100%;
  justify-content: center;
  outline: none;
}

.mti-legend-feedback-btn:hover {
  background-color: var(--brand-hover);
}

.mti-legend-feedback-btn:active {
  transform: scale(0.98);
}

.mti-legend-copyright-block {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: flex-end;
  margin-top: 6px;
}

.mti-legend-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.mti-legend-logo-img.light-logo {
  display: block;
}
.mti-legend-logo-img.dark-logo {
  display: none;
}
html.dark .mti-legend-logo-img.light-logo {
  display: none;
}
html.dark .mti-legend-logo-img.dark-logo {
  display: block;
}

.mti-legend-copyright-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
  line-height: 1.2;
}

.mti-legend-code {
  font-size: 9px;
  color: var(--ink-muted);
  font-weight: 700;
}

/* Modal Styling */
.mti-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mti-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mti-modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
  border-radius: var(--radius-sm);
  color: var(--ink);
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mti-modal-overlay.open .mti-modal-content {
  transform: translateY(0);
}

/* Make sure the viewer container leaves space for the legend overlay */
.viewer-wrapper {
  padding-bottom: 145px;
  box-sizing: border-box;
}

/* Custom Interchange & Station Code Capsule Style matching map style exactly */
.mti-legend-interchange-capsule {
  display: inline-flex;
  height: 22px;
  border: 1.5px solid #ffffff;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  background-color: transparent;
  vertical-align: middle;
}

.mti-legend-interchange-segment {
  width: 46px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: 'LTAIdentity', 'Inter', sans-serif !important;
  font-size: 10px;
  font-weight: bold;
  box-sizing: border-box;
}

.mti-legend-interchange-segment:not(:last-child) {
  border-right: 1.5px solid #ffffff;
}



