/* Traffic Jam landing page — tokens mirror the app's dark theme (src/index.css). */

:root {
  --chrome: hsl(228 13% 9%);
  --background: hsl(226 11% 12%);
  --foreground: hsl(222 14% 89%);
  --surface: hsl(225 10% 15%);
  --card: hsl(224 10% 18%);
  --muted: hsl(224 9% 21%);
  --muted-foreground: hsl(224 7% 60%);
  --primary: hsl(219 82% 62%);
  --primary-strong: hsl(219 82% 67%);
  --primary-foreground: hsl(227 28% 10%);
  --border: hsl(225 9% 25%);
  --input: hsl(224 8% 31%);
  --success: hsl(152 44% 68%);
  --warning: hsl(41 74% 70%);
  --danger: hsl(354 70% 74%);
  --brand: #863bff;
  --font-display: "Space Grotesk", "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Avenir Next", Avenir, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

html, body { height: 100%; }

body {
  background: var(--chrome);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: hsl(219 82% 62% / 0.32); }

.window {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--background);
}

/* ── Titlebar ─────────────────────────────────────────────── */

.titlebar {
  flex: none;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
  animation: fade 0.5s ease 0.1s both;
}

.dots { display: flex; gap: 7px; flex: none; }
.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: hsl(224 9% 22%);
  box-shadow: inset 0 0 0 1px hsl(225 9% 28%);
}

.titlebar-name {
  flex: 1;
  text-align: center;
  font: 400 11px/1 var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titlebar-badge {
  flex: none;
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--foreground);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
}

/* ── Content well ─────────────────────────────────────────── */

.well {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--background);
}

/* Ambient capture lanes */

.lanes {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  -webkit-mask-image: radial-gradient(130% 100% at 50% 46%, transparent 23%, #000 74%);
  mask-image: radial-gradient(130% 100% at 50% 46%, transparent 23%, #000 74%);
}

.lane { position: relative; overflow: hidden; }

.lane-divider { background: var(--border); opacity: 0.45; }

.lane-tag {
  position: absolute;
  top: 18px;
  left: 24px;
  z-index: 2;
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  background: hsl(225 10% 15% / 0.85);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 9px;
}
.lane-h2 .lane-tag { left: auto; right: 24px; }

.lane-track {
  display: flex;
  flex-direction: column;
  will-change: transform;
  animation: drift-up 95s linear infinite;
}
.lane-track-rev { animation: drift-down 120s linear infinite; }

@keyframes drift-up { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes drift-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }

.row {
  display: grid;
  align-items: baseline;
  gap: 12px;
  padding: 7px 24px;
  font: 400 11.5px/1.4 var(--font-mono);
  white-space: nowrap;
  color: hsl(224 7% 60% / 0.42);
}
.lane-h1 .row { grid-template-columns: 5ch 1fr 3ch 7ch; }
.lane-h2 .row { grid-template-columns: 13ch 1fr 3ch 7ch; }

.m { font-weight: 500; }
.m-get { color: hsl(219 62% 66% / 0.55); }
.m-post { color: hsl(152 38% 58% / 0.55); }
.m-put { color: hsl(41 62% 60% / 0.55); }

.p { overflow: hidden; text-overflow: ellipsis; }

.st { text-align: right; }
.st-2 { color: hsl(224 7% 60% / 0.5); }
.st-3 { color: hsl(41 62% 62% / 0.6); }
.st-4 { color: hsl(354 62% 68% / 0.6); }

.d { text-align: right; font-variant-numeric: tabular-nums; }

.row.drift .st, .row.drift .d { color: hsl(41 74% 70% / 0.75); }
.delta { margin-left: 8px; font-size: 10px; color: hsl(41 74% 70% / 0.8); }

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
  padding: 32px 24px;
  max-width: 860px;
}

.hero > * { animation: rise 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.hero > :nth-child(1) { animation-delay: 0.05s; }
.hero > :nth-child(2) { animation-delay: 0.12s; }
.hero > :nth-child(3) { animation-delay: 0.2s; }
.hero > :nth-child(4) { animation-delay: 0.28s; }
.hero > :nth-child(5) { animation-delay: 0.36s; }
.hero > :nth-child(6) { animation-delay: 0.4s; }

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.kicker .pkg { text-transform: none; letter-spacing: 0.04em; color: hsl(222 14% 89% / 0.82); }
.kicker-sep { opacity: 0.45; }
.bolt { width: 13px; height: 13px; flex: none; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 9.5vw, 6.6rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--foreground);
}

.caret {
  display: inline-block;
  width: 0.055em;
  height: 0.72em;
  margin-left: 0.1em;
  background: var(--primary);
  transform: translateY(0.06em);
  animation: blink 1.15s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.lede {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--muted-foreground);
  max-width: 58ch;
}

/* ── Actions ──────────────────────────────────────────────── */

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.btn-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.btn-label { font: 600 15px/1.1 var(--font-display); letter-spacing: -0.01em; }
.btn-meta { font: 400 10.5px/1.2 var(--font-mono); letter-spacing: 0.02em; opacity: 0.72; }

.btn-icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  min-width: 272px;
}
.btn-primary .btn-meta { opacity: 0.78; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-primary:hover .icon-download { transform: translateY(2px); }
.btn-primary[data-state="loading"] { cursor: progress; }
.btn-primary[aria-disabled="true"] { cursor: default; }
.btn-primary.is-unavailable { background: var(--muted); color: var(--muted-foreground); }

.spinner {
  display: none;
  width: 17px;
  height: 17px;
  flex: none;
  border-radius: 50%;
  border: 2px solid hsl(227 28% 10% / 0.3);
  border-top-color: var(--primary-foreground);
  animation: spin 0.7s linear infinite;
}
.btn-primary[data-state="loading"] .spinner { display: block; }
.btn-primary[data-state="loading"] .icon-download { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-outline {
  border-color: var(--border);
  background: transparent;
  color: var(--foreground);
}
.btn-outline:hover { background: var(--surface); border-color: var(--input); }
.btn-outline:hover .icon-arrow { transform: translateX(3px); }

.asset-note {
  font: 400 11px/1.5 var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
}

.asset-others {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  font: 400 11px/1.5 var(--font-mono);
  color: hsl(224 7% 60% / 0.8);
}
.asset-others a {
  color: var(--foreground);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: border-color 0.15s ease;
}
.asset-others a:hover { border-color: var(--primary); }
.asset-others a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Statusbar ────────────────────────────────────────────── */

.statusbar {
  flex: none;
  height: 30px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: var(--chrome);
  border-top: 1px solid var(--border);
  font: 400 11px/1 var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
  animation: fade 0.5s ease 0.2s both;
}

.seg {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}
.seg:first-child { border-left: none; }
.seg b { font-weight: 500; color: var(--foreground); font-variant-numeric: tabular-nums; }
.seg .warn { color: var(--warning); }

.spacer { flex: 1; }
.dim { color: hsl(224 7% 60% / 0.65); }

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.statusbar.is-live .pulse { background: var(--success); animation: pulse 2.2s ease-out infinite; }
.statusbar.is-error .pulse { background: var(--warning); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 hsl(152 44% 68% / 0.45); }
  70% { box-shadow: 0 0 0 7px hsl(152 44% 68% / 0); }
  100% { box-shadow: 0 0 0 0 hsl(152 44% 68% / 0); }
}

/* ── Motion ───────────────────────────────────────────────── */

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

@media (prefers-reduced-motion: reduce) {
  .lane-track, .caret, .pulse, .spinner,
  .hero > *, .titlebar, .statusbar { animation: none; }
  .btn, .btn-icon, .asset-others a { transition: none; }
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 900px) {
  .lanes { grid-template-columns: 1fr; }
  .lane-h2, .lane-divider { display: none; }
  .seg-hide-md { display: none; }
}

@media (max-width: 700px) {
  .actions { flex-direction: column; width: 100%; max-width: 340px; }
  .btn { width: 100%; }
  .btn-primary { min-width: 0; }
  .seg-hide-sm { display: none; }
  .lede { font-size: 14.5px; }
}

@media (max-width: 460px) {
  .seg-hide-xs { display: none; }
  .titlebar-name { font-size: 10px; }
  .kicker { letter-spacing: 0.1em; }
}
