/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange:  #FF6900;
  --orange2: #ff8c3a;
  --bg:      #080810;
  --surface: rgba(255,255,255,.04);
  --border:  rgba(255,255,255,.08);
  --text:    #f2f2f4;
  --muted:   rgba(242,242,244,.45);
  --green:   #22c55e;
  --red:     #ef4444;
  --blue:    #3b82f6;
  --radius:  18px;
}

html { scroll-behavior: smooth; cursor: none; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ── Three.js Canvas ────────────────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Loading Screen ─────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.loader-ring {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255,105,0,.2);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.loader-inner p {
  font-size: .88rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: .5px;
}

/* ── Custom Cursor ──────────────────────────────────────── */
#cursor {
  position: fixed;
  width: 8px; height: 8px;
  background: var(--orange);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .15s, height .15s, background .2s;
}
#cursor-follower {
  position: fixed;
  width: 36px; height: 36px;
  border: 1px solid rgba(255,105,0,.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform .12s ease, width .3s, height .3s, border-color .3s;
}
body:has(.model-card:hover) #cursor-follower,
body:has(.btn-main:hover) #cursor-follower {
  width: 56px; height: 56px;
  border-color: var(--orange);
}

/* ── Nav ────────────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: rgba(8,8,16,.6);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1rem; letter-spacing: -.3px;
}
.nav-logo-mark {
  width: 34px; height: 34px;
  background: var(--orange);
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: .85rem; font-weight: 900; color: #fff;
}
.nav-status {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.dot.disconnected { background: var(--red); }
.dot.connected    { background: var(--green); animation: blink 1.4s infinite; }
.dot.searching    { background: var(--blue);  animation: blink .7s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── Panels (full-height sections) ─────────────────────── */
.panel {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px 40px 80px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ── HERO ───────────────────────────────────────────────── */
#s-hero {
  align-items: flex-start;
  max-width: 100%;
  padding-left: clamp(24px, 8vw, 120px);
}
.hero-inner { max-width: 820px; }

.hero-tag {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--orange);
  border: 1px solid rgba(255,105,0,.3);
  background: rgba(255,105,0,.08);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 28px;
}

.hero-title {
  font-size: clamp(3.5rem, 11vw, 10rem);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -3px;
  perspective: 1000px;
  margin-bottom: 28px;
}
.hero-line {
  display: block;
  transform-style: preserve-3d;
}
/* individual chars (injected by JS) */
.hero-title .char {
  display: inline-block;
  transform-style: preserve-3d;
  will-change: transform, opacity;
}

.accent { color: var(--orange); }

.hero-sub {
  font-size: clamp(.95rem, 1.6vw, 1.15rem);
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 500px;
}

.hero-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--orange);
  color: #fff;
  font-weight: 700; font-size: .95rem;
  padding: 14px 28px;
  border-radius: 12px;
  text-decoration: none;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 0 0 rgba(255,105,0,0);
}
.hero-cta:hover {
  background: var(--orange2);
  box-shadow: 0 6px 28px rgba(255,105,0,.45);
  transform: translateY(-2px);
}
.hero-cta svg { transition: transform .2s; }
.hero-cta:hover svg { transform: translateX(4px); }

.scroll-hint {
  position: absolute;
  bottom: 40px; left: clamp(24px, 8vw, 120px);
  display: flex; align-items: center; gap: 14px;
  font-size: .75rem; color: var(--muted); letter-spacing: 1px;
  text-transform: uppercase;
}
.scroll-line-anim {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, transparent, var(--orange));
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100%{opacity:.3; transform:scaleY(.6)} 50%{opacity:1;transform:scaleY(1)} }

/* ── MODELS ─────────────────────────────────────────────── */
#s-models { gap: 48px; max-width: 1100px; }

.section-head { display: flex; flex-direction: column; gap: 6px; }
.section-num {
  font-size: .75rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--orange);
}
.section-title {
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 900; letter-spacing: -1.5px; line-height: 1.05;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.model-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  display: flex; flex-direction: column; gap: 14px;
  overflow: hidden;
  transition: border-color .3s;
  will-change: transform;
  transform-style: preserve-3d;
  /* JS handles per-card 3D tilt via inline style */
}
.model-card.featured {
  border-color: rgba(255,105,0,.45);
  background: linear-gradient(140deg, rgba(255,105,0,.09) 0%, var(--surface) 60%);
}
.model-card:hover { border-color: rgba(255,105,0,.6); }

.card-glow {
  position: absolute;
  inset: -60%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,105,0,.12) 0%, transparent 65%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s;
}
.model-card:hover .card-glow { opacity: 1; }

.card-num {
  font-size: .7rem; font-weight: 700; color: var(--muted);
  letter-spacing: 1px;
}
.card-emoji { font-size: 2.2rem; line-height: 1; }
.card-text h3 {
  font-size: .95rem; font-weight: 600; line-height: 1.3; margin-bottom: 4px;
}
.card-text p { font-size: .78rem; color: var(--muted); }

.card-badge {
  position: absolute; top: 16px; right: 16px;
  background: var(--orange); color: #fff;
  font-size: .62rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .8px; padding: 3px 8px; border-radius: 999px;
}
.card-arrow {
  position: absolute; bottom: 18px; right: 20px;
  font-size: 1.1rem; color: var(--muted);
  transition: color .2s, transform .2s;
}
.model-card:hover .card-arrow { color: var(--orange); transform: translateX(4px); }

/* ── CONNECT ────────────────────────────────────────────── */
#s-connect {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 6vw, 80px);
  flex-wrap: wrap;
  max-width: 1100px;
}

/* Sonar rings */
.rings-wrap {
  position: relative;
  width: 240px; height: 240px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,105,0,.35);
}
.r1 { width: 80px;  height: 80px;  animation: sonar 3s ease-out infinite; }
.r2 { width: 140px; height: 140px; animation: sonar 3s ease-out infinite .9s; }
.r3 { width: 200px; height: 200px; animation: sonar 3s ease-out infinite 1.8s; }
@keyframes sonar {
  0%   { transform: scale(.8); opacity: .7; }
  100% { transform: scale(1.5); opacity: 0; }
}
.ring-core {
  width: 64px; height: 64px;
  background: radial-gradient(circle, rgba(255,105,0,.25), rgba(255,105,0,.05));
  border: 1px solid rgba(255,105,0,.5);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.6rem;
  z-index: 2;
  animation: coreGlow 2s ease-in-out infinite;
}
@keyframes coreGlow {
  0%,100% { box-shadow: 0 0 12px rgba(255,105,0,.3); }
  50%     { box-shadow: 0 0 36px rgba(255,105,0,.7); }
}

/* Panel */
.conn-panel {
  display: flex; flex-direction: column;
  gap: 18px;
  width: 100%; max-width: 420px;
}
.connect-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900; letter-spacing: -1px; line-height: 1.1;
}
.stat-rows { display: flex; flex-direction: column; gap: 8px; }
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .88rem; color: var(--muted);
}
.stat-val { font-weight: 600; color: var(--text); }

.btn-main {
  padding: 15px 24px;
  background: var(--orange);
  color: #fff; font-weight: 700; font-size: .95rem;
  border: none; border-radius: 12px; cursor: none;
  transition: background .2s, box-shadow .2s, transform .1s;
  display: flex; align-items: center; justify-content: center;
  gap: 10px; min-height: 52px;
}
.btn-main:hover {
  background: var(--orange2);
  box-shadow: 0 6px 28px rgba(255,105,0,.4);
}
.btn-main:active { transform: scale(.97); }
.btn-main:disabled { opacity: .5; cursor: not-allowed; }

.btn-sec {
  padding: 12px 24px;
  background: transparent;
  color: var(--red); font-weight: 600; font-size: .88rem;
  border: 1px solid var(--red); border-radius: 12px;
  cursor: none; transition: background .2s;
}
.btn-sec:hover { background: rgba(239,68,68,.08); }

.hint-txt { font-size: .73rem; color: var(--muted); margin-top: -4px; }

/* Connected state */
.connected-panel { text-align: center; align-items: center; }
.conn-check { font-size: 3rem; filter: drop-shadow(0 0 16px rgba(34,197,94,.5)); }
.connected-panel h2 { font-size: 2rem; font-weight: 800; }
.conn-dev-name { font-size: 1.1rem; font-weight: 700; color: var(--green); }
.conn-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; width: 100%;
}
.cg-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.cg-cell span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.cg-cell strong { font-size: .9rem; }

/* Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 28px;
  color: var(--muted); font-size: .78rem;
  border-top: 1px solid var(--border);
}

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(30,30,40,.95);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px; border-radius: 999px;
  font-size: .88rem; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  opacity: 0; pointer-events: none; z-index: 9000;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 700px) {
  #nav { padding: 12px 18px; }
  .panel { padding: 90px 18px 60px; }
  #s-hero { padding-left: 18px; }
  .scroll-hint { left: 18px; }
  .hero-title { letter-spacing: -1.5px; }
  #s-connect { flex-direction: column; align-items: flex-start; }
  .rings-wrap { width: 180px; height: 180px; }
  .model-grid { grid-template-columns: 1fr 1fr; }
  html { cursor: auto; }
  #cursor, #cursor-follower { display: none; }
}


:root {
  --orange: #FF6900;
  --orange-dark: #e05a00;
  --bg: #0d0d0f;
  --surface: #16181c;
  --surface2: #1e2026;
  --border: #2a2d35;
  --text: #f0f0f0;
  --text-muted: #888;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background blur blobs ── */
.bg-blur {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(255,105,0,.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 80% 80%, rgba(59,130,246,.08) 0%, transparent 70%);
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(13,13,15,.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.3px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .85rem;
  color: var(--text-muted);
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.disconnected { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot.connected    { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 1.5s infinite; }
.dot.searching    { background: var(--blue); box-shadow: 0 0 6px var(--blue); animation: pulse .8s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

/* ── Main ── */
main {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

/* ── Hero ── */
.hero {
  text-align: center;
  margin-bottom: 56px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.5px;
  margin-bottom: 18px;
}

.accent { color: var(--orange); }

.subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Scooter Cards ── */
.scooter-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 48px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .2s, transform .2s;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: rgba(255,105,0,.4);
  transform: translateY(-2px);
}

.card.active-model {
  border-color: var(--orange);
  background: linear-gradient(135deg, rgba(255,105,0,.08), var(--surface));
}

.card-icon { font-size: 1.8rem; }

.card-info h3 {
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.card-info p {
  font-size: .75rem;
  color: var(--text-muted);
}

.card-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--orange);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: 999px;
}

/* ── Connect Panel ── */
.connect-panel {
  display: flex;
  justify-content: center;
}

.panel-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 40px 36px;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.panel-icon {
  font-size: 2.8rem;
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(255,105,0,.3));
}

.panel-icon.success {
  filter: drop-shadow(0 0 16px rgba(34,197,94,.4));
}

.panel-box h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.panel-box > p {
  color: var(--text-muted);
  font-size: .92rem;
  line-height: 1.55;
}

/* ── Info Rows ── */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 16px;
  background: var(--surface2);
  border-radius: 10px;
  font-size: .88rem;
  color: var(--text-muted);
  gap: 12px;
}

.info-value {
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

/* ── Buttons ── */
.btn-connect {
  margin-top: 6px;
  width: 100%;
  padding: 14px 24px;
  background: var(--orange);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s, transform .1s, box-shadow .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
}

.btn-connect:hover  { background: var(--orange-dark); box-shadow: 0 4px 20px rgba(255,105,0,.35); }
.btn-connect:active { transform: scale(.97); }
.btn-connect:disabled { opacity: .5; cursor: not-allowed; }

.btn-disconnect {
  width: 100%;
  padding: 12px 24px;
  background: transparent;
  color: var(--red);
  font-size: .9rem;
  font-weight: 600;
  border: 1px solid var(--red);
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s;
}
.btn-disconnect:hover { background: rgba(239,68,68,.08); }

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Hint ── */
.hint {
  font-size: .75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: -4px;
}

/* ── Connected Info Grid ── */
.device-name-display {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.info-tile {
  background: var(--surface2);
  border-radius: 12px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.tile-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.tile-value {
  font-size: 1rem;
  font-weight: 700;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: .8rem;
  border-top: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  header { padding: 12px 16px; }
  main   { padding: 40px 16px 60px; }
  .panel-box { padding: 28px 20px; }
  .scooter-cards { grid-template-columns: 1fr 1fr; }
}
