:root {
  --bg: #07141c;
  --ink: #f4f7fb;
  --muted: #9aafc3;
  --gold: #e7c48c;
  --gold-deep: #c89655;
  --mint: #7dffe1;
  --line: rgba(244, 247, 251, 0.12);
  --card: rgba(12, 28, 40, 0.78);
  --danger: #ffb4b4;
  --hold: #ffc46b;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --status: var(--gold);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Outfit, sans-serif;
  font-weight: 400;
  background: var(--bg);
  line-height: 1.5;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at -10% -10%, rgba(231, 196, 140, 0.18), transparent 60%),
    radial-gradient(800px 500px at 110% 10%, rgba(125, 255, 225, 0.12), transparent 55%),
    linear-gradient(180deg, #07141c 0%, #0b1c28 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244, 247, 251, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 247, 251, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
}

.skip {
  position: absolute;
  left: 16px;
  top: -40px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  z-index: 5;
}

.skip:focus { top: 12px; }

.site-header,
.site-footer,
main {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-family: Syne, sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand em {
  font-style: normal;
  color: var(--gold);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 70%, var(--gold) 0 5px, transparent 6px),
    radial-gradient(circle at 72% 32%, var(--mint) 0 5px, transparent 6px),
    #102433;
  box-shadow: inset 0 0 0 1px var(--line);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 18px;
  width: 18px;
  height: 10px;
  border-top: 2px solid var(--ink);
  border-radius: 40px 40px 0 0;
  transform: rotate(-18deg);
}

.header-note,
.site-footer {
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  margin-top: 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 28px 0 20px;
  animation: rise 0.7s ease both;
}

.hero-compact { grid-template-columns: 1fr; max-width: 720px; }

.kicker {
  margin: 0 0 10px;
  color: var(--gold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
}

h1, h2, h3 { font-family: Syne, sans-serif; line-height: 1.05; margin: 0; }

h1 { font-size: clamp(2.6rem, 5vw, 4.6rem); font-weight: 800; max-width: 11ch; }

.lede {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 46ch;
}

.track-form { margin-top: 28px; }

.track-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.track-row {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(8, 18, 26, 0.8);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}

.track-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  padding: 14px 12px;
  outline: none;
  text-transform: uppercase;
}

.track-row button,
.number-card button {
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  background: linear-gradient(180deg, #f0d7ad, var(--gold-deep));
  color: #1b140c;
  font: inherit;
  font-weight: 700;
  padding: 0 18px;
}

.track-row button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
}

.track-row button span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.track-row button:hover span { transform: translateX(4px); }

.hint { color: var(--muted); font-size: 0.9rem; }

.field-error {
  margin: 0;
  color: var(--danger);
  font-weight: 600;
}

.hero-stage {
  position: relative;
  min-height: 420px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(16, 36, 51, 0.9), rgba(8, 18, 26, 0.72));
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  overflow: hidden;
}

.route-art { width: 100%; height: 100%; display: block; }

.route-guide {
  fill: none;
  stroke: rgba(244, 247, 251, 0.16);
  stroke-width: 3;
}

.route-dash {
  fill: none;
  stroke: url(#route-glow);
  stroke-width: 3;
  stroke-dasharray: 8 12;
  stroke-linecap: round;
  animation: flow 16s linear infinite;
}

.node { fill: var(--gold); }

.node-live {
  fill: var(--mint);
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 1.8s ease-out infinite;
}

.courier { fill: var(--ink); }

.stage-card {
  position: absolute;
  left: 24px;
  bottom: 24px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(7, 20, 28, 0.82);
  box-shadow: inset 0 0 0 1px var(--line);
  backdrop-filter: blur(10px);
}

.stage-card p,
.stage-card span,
.panel-label,
.facts p,
.number-card p,
.when { margin: 0; color: var(--muted); font-size: 0.85rem; }

.stage-card strong { display: block; font-size: 1.25rem; margin: 2px 0; }

.steps { padding: 36px 0 10px; }

.section-head { margin-bottom: 22px; }

.section-head h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); max-width: 16ch; }

.steps ol {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 0;
  margin: 0;
}

.steps li {
  padding: 22px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  animation: rise 0.7s ease both;
}

.steps li:nth-child(2) { animation-delay: 0.08s; }
.steps li:nth-child(3) { animation-delay: 0.16s; }

.steps li span {
  color: var(--gold);
  font-family: Syne, sans-serif;
  font-weight: 700;
}

.steps h3 { margin: 12px 0 8px; font-size: 1.35rem; }

.steps p { margin: 0; color: var(--muted); }

.shipment { padding-top: 12px; animation: rise 0.55s ease both; }

.shipment[data-status="delivered"] { --status: var(--mint); }
.shipment[data-status="on_hold"] { --status: var(--hold); }
.shipment[data-status="in_transit"],
.shipment[data-status="out_for_delivery"] { --status: #9eb7ff; }
.shipment[data-status="processing"] { --status: var(--gold); }

.shipment-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}

.shipment h1 { max-width: 14ch; font-size: clamp(2.4rem, 5vw, 4.2rem); }

.shipment .lede strong { color: var(--ink); }

.number-card,
.recipient,
.facts dl,
.map-panel,
.timeline-panel {
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}

.number-card {
  min-width: min(100%, 320px);
  padding: 18px;
  border-radius: 22px;
}

.number-card strong {
  display: block;
  margin: 6px 0 12px;
  font-family: Syne, sans-serif;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.number-card button { min-height: 40px; padding: 0 14px; }

.banner {
  margin: 22px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(231, 196, 140, 0.12);
  box-shadow: inset 0 0 0 1px rgba(231, 196, 140, 0.28);
}

.banner-hold { background: rgba(255, 196, 107, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 196, 107, 0.35); }
.banner-done { background: rgba(125, 255, 225, 0.1); box-shadow: inset 0 0 0 1px rgba(125, 255, 225, 0.28); }

.facts {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 16px;
  margin-top: 22px;
}

.recipient {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
}

.avatar {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #143044;
  color: var(--gold);
  font-family: Syne, sans-serif;
  font-weight: 700;
}

.recipient strong,
.facts dd { display: block; margin: 0; font-size: 1.05rem; }

.recipient span { color: var(--muted); font-size: 0.92rem; }

.facts dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin: 0;
  padding: 18px;
  border-radius: 22px;
}

.facts dt { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
.facts dd { margin: 2px 0 0; }

.progress {
  margin-top: 22px;
  height: 8px;
  border-radius: 999px;
  background: rgba(244, 247, 251, 0.08);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--status));
  animation: fill 1s ease both;
}

.progress-label { color: var(--muted); font-size: 0.88rem; margin: 8px 0 0; }

.journey {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  margin-top: 18px;
}

.map-panel,
.timeline-panel {
  border-radius: 28px;
  padding: 18px;
  min-height: 440px;
}

.route-map {
  height: 460px;
  border-radius: 20px;
  overflow: hidden;
  background: #d5dde6;
}

.route-map.leaflet-container,
.route-map.leaflet-container * {
  box-sizing: content-box;
}

.leaflet-container img {
  max-width: none !important;
  max-height: none !important;
}

.route-map[hidden],
.route-board[hidden] { display: none; }

.route-board ol,
.timeline {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.route-board ol {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 8px;
}

.route-board li {
  position: relative;
  flex: 1 0 140px;
  padding-top: 28px;
}

.route-board li::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(244, 247, 251, 0.16);
}

.route-board li.is-completed::before,
.route-board li.is-current::before { background: var(--gold); }

.station,
.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #24384a;
  box-shadow: 0 0 0 4px rgba(244, 247, 251, 0.05);
}

.station {
  position: absolute;
  top: 2px;
  left: 0;
}

.route-board strong,
.timeline h2 { display: block; font-size: 1rem; margin: 0; }

.route-board em,
.where { color: var(--muted); font-style: normal; font-size: 0.88rem; }

.is-completed .station,
.is-completed .dot,
.is-current .station,
.is-current .dot { background: var(--gold); }

.is-current .station,
.is-current .dot {
  background: var(--mint);
  animation: pulse 1.8s ease-out infinite;
}

.timeline { position: relative; }

.timeline li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  padding-bottom: 22px;
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: rgba(244, 247, 251, 0.12);
}

.timeline li:last-child::before { display: none; }
.timeline li.is-completed::before { background: rgba(231, 196, 140, 0.7); }

.timeline .dot { margin-top: 4px; }

.note {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(125, 255, 225, 0.08);
  color: var(--ink);
}

.again { margin-top: 22px; }
.again a { color: var(--gold); }

.route-pin { background: transparent; border: 0; }
.route-pin span {
  display: block;
  width: 14px;
  height: 14px;
  margin: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(231, 196, 140, 0.25);
}
.route-pin.is-current span {
  background: var(--mint);
  box-shadow: 0 0 0 6px rgba(125, 255, 225, 0.28);
  animation: pulse 1.8s ease-out infinite;
}
.route-pin.is-upcoming span { background: #8aa0b8; }

.leaflet-popup-content-wrapper,
.leaflet-popup-tip { background: #102433; color: var(--ink); }

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

@keyframes flow {
  to { stroke-dashoffset: -240; }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(125, 255, 225, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(125, 255, 225, 0); }
}

@keyframes fill { from { transform: scaleX(0); transform-origin: left; } }

@media (max-width: 900px) {
  .hero,
  .steps ol,
  .facts,
  .journey,
  .shipment-hero { grid-template-columns: 1fr; display: grid; }
  .shipment-hero { align-items: start; }
  h1 { max-width: none; }
  .header-note { display: none; }
  .hero-stage { min-height: 300px; }
}

@media (max-width: 640px) {
  .track-row { flex-direction: column; }
  .track-row button { min-height: 48px; }
  .facts dl { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
