:root {
  --bg: #0b0f14;
  --bg-2: #0f1419;
  --surface: #151d29;
  --surface-2: #1a2332;
  --border: #263247;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --accent: #6366f1;
  --accent-2: #818cf8;
  --warm: #f5b942;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 16px;
  --max: 1120px;
  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 1.25rem; margin-left: auto; align-items: center; }
.nav-links a { color: var(--muted); font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links .btn { color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { background: var(--accent-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent-2); background: rgba(99, 102, 241, 0.08); }
.btn.small { padding: 0.45rem 0.85rem; font-size: 0.875rem; }
.btn.danger { background: transparent; border-color: rgba(239, 68, 68, 0.4); color: var(--danger); }
.btn.danger:hover { background: rgba(239, 68, 68, 0.1); }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 4rem;
  background:
    radial-gradient(600px 400px at 85% 20%, rgba(99, 102, 241, 0.18), transparent 70%),
    radial-gradient(500px 300px at 10% 90%, rgba(245, 185, 66, 0.08), transparent 70%);
}
.hero .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm);
  margin-bottom: 1rem;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.hero h1 em { font-style: normal; color: var(--accent-2); }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; margin-bottom: 2rem; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero .note { margin-top: 1.25rem; font-size: 0.875rem; color: var(--muted); }

/* CSS handheld illustration */
.device {
  justify-self: center;
  width: 280px;
  padding: 22px 20px 30px;
  border-radius: 22px 22px 36px 36px;
  background: linear-gradient(160deg, #2a3242, #1a202b);
  border: 1px solid #39445a;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.device .screen {
  background: #0a0d12;
  border-radius: 8px;
  padding: 10px;
  border: 6px solid #0d1016;
  aspect-ratio: 4 / 3;
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
  font-size: 10.5px;
  line-height: 1.5;
  color: #cfd8e6;
  display: flex;
  flex-direction: column;
}
.device .screen .title { color: var(--warm); font-weight: 700; margin-bottom: 6px; }
.device .screen .row { padding: 1px 6px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device .screen .row.sel { background: var(--accent); color: #fff; }
.device .screen .bar { margin-top: auto; height: 6px; background: #1f2633; border-radius: 3px; overflow: hidden; }
.device .screen .bar span { display: block; height: 100%; width: 68%; background: var(--success); animation: load 3.2s ease-in-out infinite; }
@keyframes load { 0% { width: 8%; } 80%, 100% { width: 100%; } }
.device .controls { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; padding: 0 8px; }
.dpad { position: relative; width: 66px; height: 66px; }
.dpad::before, .dpad::after { content: ""; position: absolute; background: #0f131a; border-radius: 4px; }
.dpad::before { left: 22px; top: 0; width: 22px; height: 66px; }
.dpad::after { top: 22px; left: 0; width: 66px; height: 22px; }
.abxy { display: grid; grid-template-columns: repeat(3, 20px); grid-template-rows: repeat(3, 20px); }
.abxy i { width: 20px; height: 20px; border-radius: 50%; background: #0f131a; }
.abxy i:nth-child(1) { grid-area: 1 / 2; }
.abxy i:nth-child(2) { grid-area: 2 / 1; }
.abxy i:nth-child(3) { grid-area: 2 / 3; background: var(--accent); }
.abxy i:nth-child(4) { grid-area: 3 / 2; }

/* ---------- Sections ---------- */
section { padding: 4.5rem 0; scroll-margin-top: 64px; }
section.alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
.section-head p { color: var(--muted); font-size: 1.05rem; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; counter-reset: step; }
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-2);
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 1rem;
}
.step h3 { font-size: 1.1rem; }
.step p { color: var(--muted); font-size: 0.95rem; margin: 0; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.feature .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(245, 185, 66, 0.12);
  color: var(--warm);
  margin-bottom: 1rem;
}
.feature .icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.1rem; }
.feature p { color: var(--muted); font-size: 0.95rem; margin: 0; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { position: relative; padding: 0.6rem 0 0.6rem 2rem; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.checklist li strong { display: block; }
.checklist li span { color: var(--muted); font-size: 0.95rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.panel h3 { font-size: 1.15rem; }

.download-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(400px 160px at 0% 0%, rgba(99, 102, 241, 0.18), transparent 70%),
    var(--surface);
}
.download-btn { padding: 0.9rem 1.5rem; font-size: 1.05rem; }
.download-btn svg { width: 20px; height: 20px; }
.download-meta { margin: 0; color: var(--muted); font-size: 0.9rem; }
.install-steps { padding-left: 1.2rem; margin: 0 0 1.25rem; color: var(--muted); }
.install-steps li { padding: 0.3rem 0; }
.install-steps strong { color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text);
}

/* FAQ */
.faq { max-width: 780px; }
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-2); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 0.75rem 0 0; }

.cta-band {
  text-align: center;
  padding: 3.5rem 1.5rem;
  border-radius: 24px;
  background:
    radial-gradient(500px 200px at 50% 0%, rgba(99, 102, 241, 0.25), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
}
.cta-band h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.cta-band p { color: var(--muted); max-width: 520px; margin: 0 auto 1.5rem; }
.cta-band .ctas { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75rem; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 2rem 0; color: var(--muted); font-size: 0.9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
footer a { color: var(--muted); }

/* ---------- Account page ---------- */
.account { padding: 3rem 0 5rem; min-height: calc(100vh - 64px - 90px); }
.auth-card {
  max-width: 420px;
  margin: 2rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.auth-card h1 { font-size: 1.6rem; }
.tabs { display: flex; gap: 0.5rem; margin: 1.25rem 0; }
.tab {
  flex: 1;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  margin-bottom: 1rem;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
form .btn { width: 100%; }
.msg { padding: 0.75rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.msg.err { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.msg.ok { background: rgba(34, 197, 94, 0.15); color: var(--success); }

.dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 2rem; }
.dash-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0; }
.dash-head .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.stat { display: flex; gap: 2rem; margin-bottom: 1.25rem; }
.stat div strong { display: block; font-family: var(--font-display); font-size: 1.6rem; }
.stat div span { color: var(--muted); font-size: 0.85rem; }

.list { list-style: none; padding: 0; margin: 0; }
.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--border);
}
.list li .meta { min-width: 0; }
.list li .meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li .meta span { color: var(--muted); font-size: 0.85rem; }
.list li .row-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.empty { color: var(--muted); padding: 1rem 0; border-top: 1px solid var(--border); }

.system-group { margin-bottom: 1rem; }
.system-group h4 { margin: 1rem 0 0.25rem; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--warm); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap, .split, .dash-grid { grid-template-columns: 1fr; }
  .device { width: 240px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links a:not(.btn) { display: none; }
  .hero { padding: 3rem 0; }
  .steps, .grid-3 { grid-template-columns: 1fr; }
  section { padding: 3.25rem 0; }
  .list li { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .device .screen .bar span { animation: none; }
}
