/* ============================================================
   WayNG — GLOBAL DESIGN SYSTEM
   Urban transport navigation • Responsive • PWA-ready
   Android • iPhone • iPad • Tablet • Windows • macOS • Linux
   ============================================================ */


/* ============================================================
   01. DESIGN TOKENS
   ============================================================ */

:root {
  /* Layout */
  --app-max-width: 1180px;
  --content-max-width: 760px;
  --page-padding: clamp(16px, 4vw, 40px);

  /* Typography */
  --font-display:
    'Outfit',
    'Segoe UI',
    system-ui,
    sans-serif;

  --font-body:
    'DM Sans',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    system-ui,
    sans-serif;

  --font-mono:
    'IBM Plex Mono',
    'Space Mono',
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;

  /* Brand */
  --primary: #0D3B66;
  --primary-dark: #082744;
  --primary-light: #EAF1F7;

  /* Text */
  --ink: #10212D;
  --ink-soft: #60717D;
  --ink-muted: #8A98A2;

  /* Surfaces */
  --paper: #FFFFFF;
  --surface: #F3F6F8;
  --line: #D9E1E7;

  /* Semantic colours */
  --success: #167447;
  --success-bg: #E8F5EE;

  --warning: #A96B08;
  --warning-bg: #FBF0DB;

  --error: #B43D3D;
  --error-bg: #FBEAEA;

  /* Radius */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  /* Shadows */
  --shadow-sm:
    0 2px 6px rgba(13, 59, 102, .06);

  --shadow-md:
    0 8px 24px rgba(13, 59, 102, .10);

  --shadow-lg:
    0 16px 40px rgba(13, 59, 102, .13);

  /* Motion */
  --ease-standard:
    cubic-bezier(.2, .7, .2, 1);
}


/* ============================================================
   02. GLOBAL RESET
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;

  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;

  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;

  overflow-x: hidden;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  touch-action: manipulation;
}

img,
svg {
  max-width: 100%;
}

img {
  display: block;
  height: auto;
}

svg {
  display: block;
}

a {
  color: inherit;
}

::selection {
  background: var(--primary);
  color: white;
}


/* ============================================================
   03. ACCESSIBILITY
   ============================================================ */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;

  background: var(--primary);
  color: white;

  padding: 10px 16px;

  border-radius: 0 0 8px 0;

  z-index: 1000;

  font-weight: 700;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}


/* ============================================================
   04. SHARED LAYOUT
   ============================================================ */

.container,
.app-bar-inner {
  width: min(
    calc(100% - (var(--page-padding) * 2)),
    var(--app-max-width)
  );

  margin-inline: auto;
}

.container {
  padding-block: 20px 32px;
}


/* Keep long Nigerian place names from destroying layouts */

.route-chip,
.recent-item,
.transit-stop,
.option-block,
.info-card,
.stat-card {
  min-width: 0;
}

.journey-title,
.journey-title-row,
.recent-item-main,
.transit-stop-label {
  overflow-wrap: anywhere;
}


/* ============================================================
   05. APP BAR
   ============================================================ */

.app-bar {
  position: relative;

  background: var(--primary);
  color: white;

  padding: 14px 0;

  overflow: hidden;

  box-shadow:
    0 1px 0 rgba(255,255,255,.05);
}

.app-bar::after {
  content: '';

  position: absolute;

  width: 180px;
  height: 180px;

  right: -70px;
  top: -110px;

  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;

  pointer-events: none;
}

.app-bar-inner {
  position: relative;
  z-index: 1;
}


/* Logo */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;

  font-family: var(--font-display);

  font-size: 21px;
  font-weight: 800;

  letter-spacing: -.3px;
}


/* ============================================================
   06. HOME / GREETING
   ============================================================ */

.greeting {
  margin: 28px 0 5px;

  font-family: var(--font-display);

  font-size: 28px;
  font-weight: 700;

  line-height: 1.15;
  letter-spacing: -.7px;

  color: var(--ink);
}


/* ============================================================
   07. SEARCH CARD
   ============================================================ */

.search-card {
  position: relative;

  margin-top: 18px;

  padding: 18px;

  background: var(--paper);

  border: 1px solid var(--line);
  border-radius: var(--radius-lg);

  box-shadow: var(--shadow-md);
}


/* Search fields */

.field {
  position: relative;
  margin-bottom: 12px;
}

.field label {
  display: block;

  margin-bottom: 6px;

  color: var(--ink-soft);

  font-size: 12px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: .5px;
}

.field input {
  width: 100%;
  min-height: 50px;

  padding: 13px 15px;

  background: var(--paper);
  color: var(--ink);

  border: 1.5px solid var(--line);
  border-radius: 11px;

  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;

  transition:
    border-color .15s var(--ease-standard),
    box-shadow .15s var(--ease-standard),
    background .15s var(--ease-standard);
}

.field input::placeholder {
  color: var(--ink-muted);
}

.field input:focus {
  outline: none;

  border-color: var(--primary);

  box-shadow:
    0 0 0 3px rgba(13, 59, 102, .10);
}


/* ============================================================
   08. SWAP BUTTON
   ============================================================ */

.swap-btn {
  width: 44px;
  height: 44px;

  margin: -3px auto 12px;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--paper);
  color: var(--primary);

  border: 2px solid var(--primary);
  border-radius: 50%;

  box-shadow:
    0 3px 10px rgba(13, 59, 102, .12);

  cursor: pointer;

  transition:
    transform .2s var(--ease-standard),
    background .15s ease,
    color .15s ease,
    box-shadow .15s ease;
}

.swap-btn svg {
  width: 18px;
  height: 18px;

  flex: 0 0 auto;
}


/* ============================================================
   09. AUTOCOMPLETE / SUGGESTIONS
   ============================================================ */

.suggestions {
  position: absolute;

  top: 100%;
  left: 0;
  right: 0;

  z-index: 20;

  display: none;

  max-height: 200px;

  margin-top: 4px;

  overflow-y: auto;

  background: var(--paper);

  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);

  box-shadow: var(--shadow-md);
}

.suggestions.active {
  display: block;
}

.suggestion-item {
  padding: 11px 14px;

  cursor: pointer;

  font-size: 15px;

  transition:
    background .12s ease;
}


/* ============================================================
   10. ERROR TEXT
   ============================================================ */

.error-text {
  margin: 8px 0;

  color: var(--error);

  font-size: 14px;
  font-weight: 600;
}


/* ============================================================
   11. PRIMARY BUTTON
   ============================================================ */

.primary-btn {
  width: 100%;
  min-height: 52px;

  margin-top: 5px;
  padding: 14px 16px;

  background: var(--primary);
  color: white;

  border: none;
  border-radius: 11px;

  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 700;

  cursor: pointer;

  box-shadow:
    0 4px 10px rgba(13, 59, 102, .16);

  transition:
    background .15s ease,
    transform .1s ease,
    box-shadow .15s ease;
}


/* ============================================================
   12. HOME SECTIONS
   ============================================================ */

.home-section {
  margin-top: 30px;
}

.home-section h2 {
  margin: 0 0 12px;

  font-family: var(--font-display);

  font-size: 15px;
  font-weight: 700;

  color: var(--ink-soft);
}


/* ============================================================
   13. POPULAR ROUTES
   ============================================================ */

.chip-list {
  display: flex;
  flex-wrap: wrap;

  gap: 8px;
}

.route-chip {
  min-height: 42px;

  padding: 10px 14px;

  background: var(--paper);
  color: var(--ink);

  border: 1px solid var(--line);
  border-radius: 10px;

  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
  white-space: nowrap;

  transition:
    border-color .15s ease,
    background .15s ease,
    transform .15s ease;
}


/* ============================================================
   14. RECENT / SAVED ROUTES
   ============================================================ */

.recent-item {
  min-height: 48px;

  margin-bottom: 8px;
  padding: 13px 15px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  background: var(--surface);

  border-radius: var(--radius-sm);

  cursor: pointer;

  transition:
    background .15s ease,
    transform .15s ease;
}

.recent-item-main {
  font-size: 15px;
  font-weight: 500;
}

.recent-item-time {
  margin-top: 3px;

  color: var(--ink-soft);

  font-family: var(--font-mono);
  font-size: 11px;
}

.muted {
  color: var(--ink-soft);
  font-size: 14px;
}


/* ============================================================
   15. JOURNEY VIEW
   ============================================================ */

.back-btn {
  min-height: 44px;

  display: inline-flex;
  align-items: center;

  gap: 6px;

  padding: 10px 0 4px;

  background: none;
  color: var(--primary);

  border: none;

  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;

  cursor: pointer;
}

.journey-title-row {
  display: flex;

  justify-content: space-between;
  align-items: flex-start;

  gap: 12px;

  margin-bottom: 20px;
}

.journey-title {
  margin: 0;

  font-family: var(--font-display);

  font-size: 22px;
  font-weight: 700;

  letter-spacing: -.2px;
}


/* ============================================================
   16. FAVORITE BUTTON
   ============================================================ */

.favorite-btn {
  width: 44px;
  height: 44px;

  flex: 0 0 44px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  background: none;
  color: var(--warning);

  border: none;

  font-size: 26px;
  line-height: 1;

  cursor: pointer;

  border-radius: 50%;

  transition:
    transform .15s var(--ease-standard),
    background .15s ease;
}


/* ============================================================
   17. STATUS
   ============================================================ */

.status-badge {
  display: flex;
  align-items: center;

  gap: 8px;

  margin-bottom: 8px;

  font-size: 15px;
  font-weight: 700;
}

.status-badge.direct {
  color: var(--success);
}

.status-badge.transfer {
  color: var(--warning);
}


/* ============================================================
   18. JOURNEY CONTENT
   ============================================================ */

.section-title {
  margin: 22px 0 10px;

  color: var(--ink);

  font-family: var(--font-display);

  font-size: 14px;
  font-weight: 700;
}

.info-card {
  padding: 13px 15px;

  background: var(--surface);

  border-radius: var(--radius-sm);

  font-size: 15px;
}

.driver-quote {
  padding: 6px 0;

  color: var(--primary);

  font-size: 17px;
  font-style: italic;
  font-weight: 600;
}

.notes-text {
  color: var(--ink-soft);

  font-size: 14px;
  line-height: 1.6;
}


/* ============================================================
   19. UNKNOWN STATE
   ============================================================ */

.unknown-state {
  padding: 48px 20px;

  text-align: center;
}

.unknown-state p {
  max-width: 320px;

  margin: 0 auto 22px;

  color: var(--ink-soft);

  font-size: 16px;
}


/* ============================================================
   20. BADGES
   ============================================================ */

.mode-badge {
  display: inline-flex;
  align-items: center;

  gap: 6px;

  margin-bottom: 10px;
  padding: 7px 13px;

  background: var(--surface);

  border-radius: 20px;

  font-size: 13px;
  font-weight: 700;
}

.verified-badge {
  width: fit-content;

  display: flex;
  align-items: center;

  gap: 6px;

  padding: 6px 10px;

  background: var(--success-bg);
  color: var(--success);

  border-radius: 6px;

  font-family: var(--font-mono);
  font-size: 12.5px;
}


/* ============================================================
   21. SIGNATURE WAYNG TRANSIT LINE
   ============================================================ */

.transit-line {
  position: relative;

  margin: 8px 0 12px;
  padding-left: 34px;
}

.transit-line::before {
  content: '';

  position: absolute;

  left: 7px;
  top: 12px;
  bottom: 12px;

  width: 3px;

  background: var(--primary);

  border-radius: 99px;
}

.transit-stop {
  position: relative;

  padding: 5px 0 26px;
}

.transit-stop:last-child {
  padding-bottom: 4px;
}

.transit-stop::before {
  display: none;
}

.transit-stop::after {
  content: '';

  position: absolute;

  left: -33px;
  top: 6px;

  width: 11px;
  height: 11px;

  box-sizing: content-box;

  background: var(--paper);

  border: 3px solid var(--primary);
  border-radius: 50%;
}

.transit-stop.terminal::after {
  left: -35px;
  top: 4px;

  width: 14px;
  height: 14px;

  background: var(--primary);

  border: 3px solid var(--primary);
}

.transit-stop-label {
  font-family: var(--font-display);

  font-size: 16px;
  font-weight: 600;

  letter-spacing: -.15px;
}

.transit-stop-sub {
  margin-top: 3px;

  color: var(--ink-soft);

  font-size: 12.5px;
  font-weight: 500;
}


/* ============================================================
   22. JOURNEY STATS
   ============================================================ */

.stats-row {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 12px;
}

.stat-card {
  padding: 15px;

  background: var(--surface);

  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-card-label {
  margin-bottom: 7px;

  color: var(--ink-soft);

  font-family: var(--font-body);

  font-size: 11.5px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: .55px;
}

.stat-card-value {
  color: var(--primary);

  font-family: var(--font-display);

  font-size: 22px;
  font-weight: 600;

  letter-spacing: -.7px;

  font-variant-numeric: tabular-nums;
}

.stat-card-sub {
  margin-top: 4px;

  color: var(--ink-soft);

  font-size: 12px;
}


/* ============================================================
   23. MULTI-OPTION ROUTES
   ============================================================ */

.options-intro {
  margin-bottom: 16px;

  color: var(--ink-soft);

  font-size: 14px;
}

.options-grid {
  display: grid;

  grid-template-columns: 1fr;

  gap: 20px;
}

.option-block {
  padding: 18px;

  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}

.rank-label {
  display: inline-flex;
  align-items: center;

  gap: 5px;

  margin-bottom: 14px;

  color: var(--ink-soft);

  font-size: 12px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: .4px;
}

.rank-label.top {
  color: var(--success);
}


/* ============================================================
   24. VERY SMALL PHONES
   ============================================================ */

@media (max-width: 359px) {

  :root {
    --page-padding: 14px;
  }

  .container,
  .app-bar-inner {
    width: calc(100% - 28px);
  }

  .greeting {
    font-size: 25px;
  }

  .search-card {
    padding: 15px;
  }

  .stats-row {
    gap: 8px;
  }

  .stat-card {
    padding: 13px;
  }

  .stat-card-value {
    font-size: 20px;
  }

  .route-chip {
    padding-inline: 12px;
  }

  .journey-title {
    font-size: 20px;
  }
}


/* ============================================================
   25. LARGE PHONES
   ============================================================ */

@media (min-width: 390px) {

  .container {
    padding-block: 24px 36px;
  }

  .greeting {
    font-size: 29px;
  }
}


/* ============================================================
   26. TABLETS
   ============================================================ */

@media (min-width: 600px) {

  :root {
    --page-padding: 24px;
  }

  .container {
    padding-block: 28px 40px;
  }

  .greeting {
    font-size: 31px;
  }

  .search-card {
    padding: 22px;
  }

  .chip-list {
    display: grid;

    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 10px;
  }

  .route-chip {
    min-width: 0;
    text-align: center;
  }

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


/* ============================================================
   27. TABLET LANDSCAPE / SMALL LAPTOP
   ============================================================ */

@media (min-width: 768px) {

  :root {
    --page-padding: 28px;
  }

  .container {
    padding-block: 32px 44px;
  }

  .greeting {
    font-size: 33px;
  }

  .search-card {
    padding: 24px;
  }

  .stats-row {
    gap: 14px;
  }

  .options-grid {
    gap: 18px;
  }
}


/* ============================================================
   28. LAPTOP / DESKTOP
   ============================================================ */

@media (min-width: 900px) {

  :root {
    --page-padding: 32px;
  }

  body {
    background: var(--surface);
  }

  .app-bar {
    box-shadow: var(--shadow-sm);
  }

  /*
    Header can breathe across the desktop screen.
    Main content stays narrower for readability.
  */

  .app-bar-inner {
    width: min(
      calc(100% - (var(--page-padding) * 2)),
      var(--app-max-width)
    );
  }

  .container {
    width: min(
      calc(100% - (var(--page-padding) * 2)),
      var(--content-max-width)
    );

    padding-block: 36px 48px;
  }

  .greeting {
    font-size: 35px;
  }

  .search-card {
    padding: 26px;
  }

  /*
    Desktop application surface.
    This prevents WayNG from looking like a stretched
    mobile website on large screens.
  */

  #home-view .container,
  #journey-view .container {
    margin-top: 24px;
    margin-bottom: 24px;

    background: var(--paper);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-md);
  }

  .chip-list {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

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


/* ============================================================
   29. WIDE DESKTOP
   ============================================================ */

@media (min-width: 1200px) {

  :root {
    --page-padding: 40px;
  }

  .container {
    width: min(
      calc(100% - (var(--page-padding) * 2)),
      820px
    );
  }

  .greeting {
    font-size: 38px;
  }

  .search-card {
    padding: 28px;
  }

  .chip-list {
    grid-template-columns:
      repeat(4, minmax(0, 1fr));
  }
}


/* ============================================================
   30. ULTRA-WIDE MONITORS
   ============================================================ */

@media (min-width: 1600px) {

  .container {
    max-width: 860px;
  }

  .app-bar-inner {
    max-width: 1280px;
  }
}


/* ============================================================
   31. MOUSE / TRACKPAD
   Hover is enhancement only.
   Nothing essential depends on hover.
   ============================================================ */

@media (hover: hover) and (pointer: fine) {

  .swap-btn:hover {
    background: var(--primary);
    color: white;

    transform: rotate(180deg);

    box-shadow:
      0 5px 14px rgba(13, 59, 102, .18);
  }

  .suggestion-item:hover,
  .suggestion-item.highlighted {
    background: var(--primary-light);
  }

  .primary-btn:hover {
    background: var(--primary-dark);

    transform: translateY(-1px);

    box-shadow:
      0 6px 16px rgba(13, 59, 102, .20);
  }

  .route-chip:hover {
    background: var(--primary-light);

    border-color: var(--primary);

    transform: translateY(-1px);
  }

  .recent-item:hover {
    background: var(--primary-light);

    transform: translateY(-1px);
  }

  .favorite-btn:hover {
    background: var(--primary-light);

    transform: scale(1.08);
  }
}


/* ============================================================
   32. TOUCH DEVICES
   ============================================================ */

@media (hover: none) and (pointer: coarse) {

  .route-chip,
  .recent-item,
  .primary-btn,
  .swap-btn,
  .favorite-btn,
  .back-btn {
    -webkit-tap-highlight-color: transparent;
  }

  .route-chip:active {
    transform: translateY(1px);
  }

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

    box-shadow:
      0 2px 6px rgba(13, 59, 102, .12);
  }

  .recent-item:active {
    background: var(--primary-light);
  }

  .swap-btn:active {
    transform: scale(.95);
  }

  .favorite-btn:active {
    transform: scale(.94);
  }
}


/* ============================================================
   33. LANDSCAPE PHONES
   ============================================================ */

@media (orientation: landscape) and (max-height: 500px) {

  .container {
    padding-top: 18px;
    padding-bottom: 24px;
  }

  .greeting {
    margin-top: 18px;
  }

  .search-card {
    margin-top: 14px;
  }

  .home-section {
    margin-top: 22px;
  }
}


/* ============================================================
   34. SAFE AREA
   iPhone / iPad / modern edge-to-edge displays
   ============================================================ */

@supports (padding: env(safe-area-inset-top)) {

  .app-bar {
    padding-top:
      max(
        14px,
        env(safe-area-inset-top)
      );
  }

  .app-bar-inner {
    padding-left:
      max(
        0px,
        env(safe-area-inset-left)
      );

    padding-right:
      max(
        0px,
        env(safe-area-inset-right)
      );
  }

  .container {
    padding-left:
      max(
        0px,
        env(safe-area-inset-left)
      );

    padding-right:
      max(
        0px,
        env(safe-area-inset-right)
      );
  }
}


/* ============================================================
   35. REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: .001ms !important;

    scroll-behavior: auto !important;
  }

  .route-chip,
  .recent-item,
  .primary-btn,
  .swap-btn,
  .favorite-btn {
    transform: none !important;
  }
}


/* ============================================================
   36. PRINT
   ============================================================ */

@media print {

  body {
    background: white;
  }

  .app-bar {
    box-shadow: none;
  }

  #home-view .container,
  #journey-view .container {
    max-width: none;

    margin: 0;

    box-shadow: none;
  }

  .primary-btn,
  .swap-btn,
  .favorite-btn,
  .back-btn {
    display: none;
  }
}