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

:root {
  --ink: #0b1220;
  --ink-soft: #243044;
  --muted: #66768a;
  --line: rgba(11, 18, 32, 0.1);
  --paper: #e8eef5;
  --paper-2: #d7e1ec;
  --amber: #f59e0b;
  --amber-deep: #d97706;
  --teal: #0e7490;
  --white: #f8fbff;
  --danger: #dc2626;
  --shadow: 0 18px 40px rgba(11, 18, 32, 0.08);
  --radius: 18px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'Manrope', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 8% -10%, rgba(245, 158, 11, 0.16), transparent 60%),
    radial-gradient(700px 420px at 100% 0%, rgba(14, 116, 144, 0.18), transparent 55%),
    linear-gradient(180deg, #edf3f9 0%, #e4ecf5 45%, #d9e4f0 100%);
}

.page-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(16, 24, 32, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 32, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  backdrop-filter: blur(14px);
  background: rgba(232, 238, 245, 0.84);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, background 0.25s;
}

.topbar.scrolled {
  border-bottom-color: var(--line);
  background: rgba(232, 238, 245, 0.95);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--amber);
  box-shadow: 10px 0 0 var(--teal);
  transform: rotate(45deg);
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-text span { color: var(--amber-deep); }

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-nav > a:not(.btn) {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.7rem 1.15rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-solid {
  background: var(--ink);
  color: var(--white);
}

.btn-solid:hover { background: #1c2834; }

.btn-ghost {
  background: transparent;
  border-color: rgba(16, 24, 32, 0.18);
  color: var(--ink);
}

.btn-ghost:hover { border-color: var(--ink); }

.hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 2.5rem;
  text-align: left;
  animation: rise 0.7s ease both;
}

.hero-kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1rem;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin-bottom: 1.1rem;
  max-width: 16ch;
}

.hero-brand span {
  color: var(--amber-deep);
  display: inline;
}

.hero-lead {
  max-width: 34rem;
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin-bottom: 1.6rem;
}

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

.hero-route {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 420px;
  opacity: 0.85;
}

.route-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 6px rgba(15, 118, 110, 0.15);
  flex-shrink: 0;
}

.route-dot.end {
  background: var(--amber);
  box-shadow: 0 0 0 6px rgba(217, 119, 6, 0.15);
}

.route-line {
  flex: 1;
  height: 2px;
  margin: 0 0.35rem;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  position: relative;
  overflow: hidden;
}

.route-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  transform: translateX(-100%);
  animation: dash 2.4s ease-in-out infinite;
}

.listings-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
}

.section-head p {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1.4rem;
  backdrop-filter: blur(8px);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.filter-field.grow { min-width: 160px; }

.filter-field label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-field input,
.filter-field select {
  width: 100%;
  border: 1px solid rgba(16, 24, 32, 0.14);
  background: var(--white);
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 0.5rem;
}

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

.listing-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: rise 0.45s ease both;
}

.listing-card:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 22px 44px rgba(16, 24, 32, 0.12);
}

.listing-card:nth-child(2) { animation-delay: 0.04s; }
.listing-card:nth-child(3) { animation-delay: 0.08s; }
.listing-card:nth-child(4) { animation-delay: 0.12s; }
.listing-card:nth-child(5) { animation-delay: 0.16s; }
.listing-card:nth-child(6) { animation-delay: 0.2s; }

.card-media {
  position: relative;
  height: 148px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(217, 119, 6, 0.18)),
    var(--paper-2);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-badges {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: rgba(16, 24, 32, 0.78);
  color: #fff;
}

.badge.urgent { background: var(--danger); }
.badge.featured { background: var(--amber-deep); }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 1rem 1.1rem;
  flex: 1;
}

.card-route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.45rem;
  align-items: center;
}

.route-city {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.route-city small {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.route-city.to { text-align: right; }

.route-arrow {
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  position: relative;
}

.route-arrow::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--amber);
  border-top: 2px solid var(--amber);
  transform: translateY(-50%) rotate(45deg);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.card-price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.card-price.ask {
  font-size: 0.88rem;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--muted);
}

.card-cta {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--teal);
}

.skeleton {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, #d7e1ec 25%, #eaf0f7 50%, #d7e1ec 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  min-height: 300px;
}

.empty-state,
.error-state {
  text-align: center;
  padding: 3rem 1rem;
  border: 1px dashed rgba(16, 24, 32, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.55);
}

.empty-state strong,
.error-state strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.empty-state p,
.error-state p {
  color: var(--muted);
  margin-bottom: 1rem;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(16, 24, 32, 0.14);
  background: var(--white);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}

.page-btn.active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 1.5rem 3rem;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

.footer-brand p {
  margin-top: 0.45rem;
  color: var(--muted);
  max-width: 28rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-soft);
}

.footer-links a:hover { color: var(--teal); }

.footer-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-note a { color: var(--teal); font-weight: 700; }

.app-banner {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.18);
  align-items: center;
  gap: 0.75rem;
}

.app-banner.visible { display: flex; }

.app-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  flex-shrink: 0;
}

.app-banner-body { flex: 1; min-width: 0; }

.app-banner-title {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.app-banner-sub {
  color: #94A3B8;
  font-size: 0.75rem;
  margin-top: 0.15rem;
  line-height: 1.3;
}

.app-banner-cta {
  flex-shrink: 0;
  background: var(--amber);
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  white-space: nowrap;
}

.app-banner-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #94A3B8;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
}

.app-banner-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

body.app-banner-open { padding-bottom: 76px; }

@media (min-width: 641px) {
  .app-banner { display: none !important; }
  body.app-banner-open { padding-bottom: 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dash {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 980px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filter-actions {
    grid-column: 1 / -1;
  }
  .listings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar { padding: 0.85rem 1rem; }
  .hero { padding: 3.2rem 1rem 2rem; }
  .listings-section { padding: 0.5rem 1rem 3rem; }
  .filters { grid-template-columns: 1fr; }
  .listings-grid { grid-template-columns: 1fr; }
  .filter-actions { width: 100%; }
  .filter-actions .btn { flex: 1; }
}
