:root {
  --bg0: #081018;
  --bg1: #0e1a24;
  --ink: #f2f5f3;
  --muted: #8fa0ab;
  --line: rgba(242, 245, 243, 0.12);
  --accent: #3fd6b0;
  --accent-dim: rgba(63, 214, 176, 0.18);
  --warn: #f0b429;
  --danger: #e85d4c;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-ui: "Outfit", system-ui, sans-serif;
  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-ui);
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(63, 214, 176, 0.18), transparent 55%),
    radial-gradient(900px 600px at -10% 30%, rgba(42, 110, 170, 0.22), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 48%, #122230);
  background-attachment: fixed;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem var(--pad);
}

.logo {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.1rem;
}

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

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--ink);
}

.nav-cta,
.btn {
  font-family: inherit;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-cta {
  background: var(--accent);
  color: #062018;
}

.btn-primary {
  background: var(--accent);
  color: #062018;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.btn:hover,
.nav-cta:hover {
  transform: translateY(-1px);
}

.btn:active,
.nav-cta:active {
  transform: translateY(0);
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 5rem) var(--pad) 3rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  min-height: calc(100vh - 5rem);
}

.brand-mark {
  margin: 0 0 0.75rem;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: 0.95;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  animation: rise 0.8s ease both;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 500;
  line-height: 1.15;
  color: rgba(242, 245, 243, 0.92);
  animation: rise 0.8s ease 0.08s both;
}

.lede {
  margin: 1.1rem 0 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  animation: rise 0.8s ease 0.16s both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
  animation: rise 0.8s ease 0.24s both;
}

.hero-visual {
  min-height: 340px;
  position: relative;
}

.car-plane {
  position: absolute;
  inset: 0;
  border-radius: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, transparent 10%, rgba(8, 16, 24, 0.35) 55%, rgba(8, 16, 24, 0.85)),
    linear-gradient(120deg, #163247, #0c1822 40%, #1a3a3a);
  animation: fadeIn 1s ease both;
}

.car-glow {
  position: absolute;
  width: 70%;
  height: 40%;
  left: 15%;
  top: 28%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(63, 214, 176, 0.35), transparent 70%);
  filter: blur(8px);
  animation: pulse 4.5s ease-in-out infinite;
}

.horizon {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 28%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(63, 214, 176, 0.55), transparent);
}

.battery-orb {
  position: absolute;
  right: 12%;
  bottom: 16%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  background: rgba(8, 16, 24, 0.55);
  box-shadow: 0 0 0 1px rgba(63, 214, 176, 0.35), 0 20px 50px rgba(0, 0, 0, 0.35);
  animation: float 5s ease-in-out infinite;
}

.orb-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
}

.orb-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.connect-panel {
  max-width: var(--max);
  margin: 0 auto 2rem;
  padding: 0 var(--pad);
}

.connect-inner {
  padding: 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 16, 24, 0.35);
  animation: rise 0.45s ease both;
}

.connect-inner h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
}

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

.connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 0.75rem;
}

.hint {
  font-size: 0.9rem;
}

.hint code,
.lede-sm code,
.steps code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  color: var(--accent);
}

.text-link {
  margin-top: 1rem;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.dashboard {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem var(--pad) 3rem;
  animation: rise 0.5s ease both;
}

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

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 600;
}

.dash-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
}

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

.meter-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
  padding: 1.5rem 0 2rem;
  border-bottom: 1px solid var(--line);
}

.meter-ring {
  --p: 78;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  background:
    radial-gradient(closest-side, rgba(8, 16, 24, 0.95) 78%, transparent 79% 100%),
    conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0);
  animation: spinIn 0.9s ease both;
}

.meter-ring strong {
  font-size: 1.8rem;
}

.meter-ring span {
  color: var(--muted);
  font-size: 0.8rem;
}

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

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 600;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.status-block {
  padding: 0;
  border: 0;
  background: transparent;
}

.status-block h3 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-block p {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
}

.cmd-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.muted {
  color: var(--muted) !important;
  font-size: 0.9rem !important;
  margin-top: 0.35rem !important;
  font-weight: 400 !important;
}

.setup {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--pad) 4rem;
}

.setup h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 400;
}

.lede-sm {
  margin: 0.75rem 0 1.5rem;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.55;
}

.steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink);
  line-height: 1.7;
}

.steps li + li {
  margin-top: 0.65rem;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--pad) 2.5rem;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer a {
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: #122230;
  color: var(--ink);
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--line), 0 16px 40px rgba(0, 0, 0, 0.35);
  z-index: 20;
  animation: rise 0.3s ease both;
}

.privacy {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem var(--pad) 4rem;
}

.privacy h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin: 0 0 1rem;
}

.privacy h2 {
  margin-top: 2rem;
  font-size: 1.15rem;
}

.privacy p,
.privacy li {
  color: var(--muted);
  line-height: 1.65;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.05); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes spinIn {
  from { filter: saturate(0.6); transform: scale(0.92); opacity: 0; }
  to { filter: none; transform: scale(1); opacity: 1; }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 2rem;
  }

  .hero-visual {
    min-height: 260px;
    order: -1;
  }

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

  .stat-stack {
    grid-template-columns: 1fr;
  }

  .meter-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav a:not(.nav-cta) {
    display: none;
  }

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

  .dash-head {
    flex-direction: column;
    align-items: start;
  }
}

@media (min-width: 1100px) {
  .hero-visual {
    min-height: 420px;
  }
}
