*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--text); background: radial-gradient(1200px 600px at 70% -10%, #1a1f3a 0%, transparent 60%), var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 30px; } h2 { font-size: 16px; }
p { margin: 0 0 8px; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.link { color: var(--accent-2); font-size: 13px; }

/* Ambient glow blobs behind everything */
.glow { position: fixed; z-index: -1; border-radius: 50%; filter: blur(90px); opacity: 0.35; pointer-events: none; }
.glow-a { width: 520px; height: 520px; left: -160px; top: -120px; background: #5b4bff; }
.glow-b { width: 460px; height: 460px; right: -140px; bottom: -160px; background: #1a8fb8; }

.page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }
body.landing .page { max-width: none; padding: 0; }

/* Nav */
.nav {
  height: var(--nav-h); display: flex; align-items: center; gap: 28px; padding: 0 24px;
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px);
  background: rgba(9, 12, 19, 0.7); border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark { width: 14px; height: 14px; border-radius: 4px; background: var(--accent-grad); box-shadow: 0 0 18px rgba(139, 124, 255, 0.7); }
.brand-lg { font-size: 22px; }
.nav-links { display: flex; gap: 6px; }
.nav-links a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-name { font-weight: 500; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-grad); font-weight: 700; font-size: 13px; color: #0b0d14; }
.nav-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg); }
.nav-links a { position: relative; }
.nav-toggle { position: relative; }
.nav-menu { display: contents; }
.nav-toggle { display: none; margin-left: auto; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); cursor: pointer; place-items: center; }
.nav-toggle .nav-icon-close, .nav.open .nav-toggle .nav-icon-open { display: none; }
.nav.open .nav-toggle .nav-icon-close { display: block; }
@media (max-width: 860px) {
  .nav { gap: 12px; padding: 0 16px; }
  .nav-toggle { display: grid; }
  .nav-menu {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; gap: 10px;
    padding: 12px 16px 16px; background: rgba(9, 12, 19, 0.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(14px); box-shadow: var(--shadow);
  }
  .nav.open .nav-menu { display: flex; }
  .nav-links { flex-direction: column; gap: 2px; }
  .nav-links a { padding: 12px; font-size: 16px; }
  .nav-user { margin-left: 0; padding-top: 12px; border-top: 1px solid var(--border); }
  .nav-user form { margin-left: auto; }
}

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.field-off { opacity: 0.45; }
.field-off input, .field-off textarea { cursor: not-allowed; }
input[type="text"], input[type="password"], input[type="email"], textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.2); }
textarea { resize: vertical; }
.form-error { color: var(--danger); font-size: 13px; margin: -4px 0 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-sm); padding: 10px 16px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-grad); border: none; color: #0b0d14; box-shadow: 0 6px 20px rgba(139, 124, 255, 0.3); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* Layout helpers */
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid-main { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .grid-main { grid-template-columns: 1fr; } }
.hero { margin: 8px 0 22px; }
.hero h1 { background: linear-gradient(90deg, #fff, #b9c0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
