/* =========================================================
   Hyperion — Design tokens
   Palette: void purple bg, electric violet accent, ion-lilac text
   Type: Space Grotesk (display) + Inter (body) + JetBrains Mono (code/data)
   ========================================================= */
:root {
  --void: #0a0714;
  --surface: #130b24;
  --surface-2: #1c1233;
  --line: rgba(168, 121, 255, 0.16);
  --primary: #9b5cff;
  --primary-bright: #b47bff;
  --electric: #7c3aed;
  --spark: #e6d9ff;
  --text: #ece6fb;
  --muted: #a996c9;
  --muted-2: #6f5d8f;
  --danger: #ff5c7a;
  --success: #4ade80;
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

img.logo-mark { height: 34px; width: auto; display: block; }

/* ---------- Layout helpers ---------- */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- Navbar (glassmorphism on scroll) ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background 0.35s ease, backdrop-filter 0.35s ease, border-color 0.35s ease, padding 0.35s ease;
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: rgba(19, 11, 36, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

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

.nav-actions { display: flex; gap: 12px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--electric), var(--primary-bright));
  color: #fff;
  box-shadow: 0 0 0 rgba(155, 92, 255, 0);
}

.btn-primary:hover {
  box-shadow: 0 8px 28px -8px rgba(155, 92, 255, 0.65);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--primary); background: rgba(155, 92, 255, 0.08); }

.btn-block { width: 100%; }
.btn-danger { background: rgba(255, 92, 122, 0.12); color: var(--danger); border-color: rgba(255, 92, 122, 0.3); }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 90px;
  overflow: hidden;
}

.hero-bg-gif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  filter: saturate(1.3) brightness(0.8);
  z-index: 0;
}

#lightning-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  mix-blend-mode: screen;
}

.hero-fade {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(10,7,20,0.2) 0%, rgba(10,7,20,0.55) 55%, var(--void) 100%);
}

.hero-inner {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  width: 100%;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--primary-bright);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary-bright);
  box-shadow: 0 0 12px 2px var(--primary-bright);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.hero-title .accent {
  background: linear-gradient(135deg, var(--primary-bright), var(--spark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 480px;
  margin-bottom: 32px;
}

.hero-ctas { display: flex; gap: 14px; margin-bottom: 40px; }

.hero-meta {
  display: flex;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted-2);
}

.hero-meta b { color: var(--spark); font-size: 0.95rem; }

/* ---------- Fake code editor ---------- */
.editor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6), 0 0 60px -20px rgba(124, 58, 237, 0.25);
}

.editor-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.editor-dot { width: 10px; height: 10px; border-radius: 50%; }
.editor-dot.red { background: #ff5c5c; }
.editor-dot.yellow { background: #ffd166; }
.editor-dot.green { background: #4ade80; }
.editor-filename {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.editor-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  min-height: 260px;
  color: var(--text);
  white-space: pre-wrap;
}

.editor-body .line-num {
  color: var(--muted-2);
  display: inline-block;
  width: 22px;
  user-select: none;
}

.editor-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--primary-bright);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.tok-kw { color: #c792ea; }
.tok-fn { color: #82aaff; }
.tok-str { color: #c3e88d; }
.tok-com { color: var(--muted-2); }
.tok-num { color: #f78c6c; }

/* ---------- Sections ---------- */
section { position: relative; padding: 120px 0; }

.section-head {
  max-width: 620px;
  margin-bottom: 56px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--primary-bright);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  display: block;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 600;
  margin-bottom: 14px;
}

.section-desc { color: var(--muted); font-size: 1.02rem; }

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  border-color: rgba(155, 92, 255, 0.5);
  transform: translateY(-3px);
}

.feature-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--electric), var(--primary-bright));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 18px;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  margin-bottom: 8px;
  font-weight: 600;
}

.feature-card p { color: var(--muted); font-size: 0.92rem; }

/* ---------- Showcase ---------- */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.showcase-card {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.showcase-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(155,92,255,0.35), transparent 60%);
}

.showcase-card span {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--spark);
}

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.price-card.featured {
  border-color: var(--primary);
  background: linear-gradient(160deg, rgba(124,58,237,0.14), var(--surface));
  box-shadow: 0 0 60px -20px rgba(124,58,237,0.4);
}

.price-tag {
  position: absolute;
  top: -12px; right: 24px;
  background: linear-gradient(135deg, var(--electric), var(--primary-bright));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.price-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.price-amount { font-family: var(--font-display); font-size: 2.4rem; font-weight: 600; }
.price-amount span { font-size: 0.95rem; color: var(--muted); font-weight: 500; }

.price-features { display: flex; flex-direction: column; gap: 10px; }
.price-features li { color: var(--muted); font-size: 0.9rem; display: flex; gap: 8px; }
.price-features li::before { content: "✓"; color: var(--primary-bright); font-weight: 700; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  color: var(--muted-2);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =========================================================
   Auth pages (login / register)
   ========================================================= */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(124,58,237,0.18), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(155,92,255,0.14), transparent 45%),
    var(--void);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
}

.auth-sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-input-wrap { position: relative; }

.field input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.94rem;
  transition: border-color 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
}

.field input.invalid { border-color: var(--danger); }
.field input.valid { border-color: var(--success); }

.field-hint {
  font-size: 0.76rem;
  margin-top: 6px;
  color: var(--muted-2);
}

.field-hint.error { color: var(--danger); }
.field-hint.ok { color: var(--success); }

.toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 4px;
}

.strength-meter {
  height: 5px;
  border-radius: 3px;
  background: var(--surface-2);
  margin-top: 8px;
  overflow: hidden;
}

.strength-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.25s ease, background 0.25s ease;
  background: var(--danger);
}

.turnstile-wrap { margin: 20px 0; display: flex; justify-content: center; }

.auth-footer {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 20px;
}

.form-error {
  background: rgba(255, 92, 122, 0.1);
  border: 1px solid rgba(255, 92, 122, 0.3);
  color: var(--danger);
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.form-error:empty { display: none; }

/* =========================================================
   Dashboard
   ========================================================= */
.dash-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.dash-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}

.dash-nav { display: flex; flex-direction: column; gap: 4px; }

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.dash-nav-item:hover { background: var(--surface-2); color: var(--text); }

.dash-nav-item.active {
  background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(155,92,255,0.12));
  color: var(--spark);
}

.dash-plan-badge {
  margin-top: auto;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}

.dash-plan-badge b { color: var(--spark); display: block; font-size: 0.95rem; margin-bottom: 2px; }

.dash-main {
  padding: 32px 40px;
  max-width: 1100px;
}

.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.dash-welcome {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.dash-welcome span { color: var(--primary-bright); }

/* Pages — no inline display:none anywhere; visibility controlled
   purely through this class so specificity can never be overridden
   by an element-level style attribute. */
.page { display: none; }
.page.active { display: block; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.card + .card { margin-top: 20px; }

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 16px;
}

/* Game grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.game-tile {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.game-tile.selected {
  border-color: var(--primary);
  background: linear-gradient(160deg, rgba(124,58,237,0.22), var(--surface-2));
  color: var(--spark);
}

.game-tile-icon { font-size: 1.4rem; }

/* Executor / command builder */
.executor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-row { margin-bottom: 16px; }

.form-row label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-row select,
.form-row input {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
}

.param-fields { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }

.history-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.85rem;
}

.history-item .hist-cmd { font-family: var(--font-mono); color: var(--spark); }
.history-item .hist-meta { color: var(--muted-2); font-size: 0.76rem; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted-2);
  font-size: 0.9rem;
}

/* Paywall */
.paywall {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.paywall-inner { max-width: 440px; }

.paywall-icon { font-size: 2.6rem; margin-bottom: 18px; }
.paywall-title { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 10px; }
.paywall-sub { color: var(--muted); margin-bottom: 28px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 0.88rem;
  z-index: 999;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(74, 222, 128, 0.4); }
.toast.error { border-color: rgba(255, 92, 122, 0.4); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .feature-grid, .showcase-grid, .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-shell { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
  .executor-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .feature-grid, .showcase-grid, .pricing-grid, .game-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Focus visibility ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--primary-bright);
  outline-offset: 2px;
}
