/* base.css — 2030 design system: dark dimensional base, luminous accents,
   geometric display type, glass surfaces, tasteful motion.
   Clarity comes first; the drama is in the materials, not the layout. */

:root {
  /* ─── Surfaces ──────────────────────────────────────────── */
  --bg-0:           #07070b;                       /* deepest — page bg base */
  --bg-1:           #0e0f17;                       /* cards / panels */
  --bg-2:           #181a26;                       /* elevated / inputs */
  --bg-3:           #20232f;                       /* hover surface */

  --hairline:       rgba(255, 255, 255, 0.07);
  --hairline-strong:rgba(255, 255, 255, 0.14);

  --glass-bg:       linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012));
  --glass-bg-hover: linear-gradient(180deg, rgba(255,255,255,0.060), rgba(255,255,255,0.020));

  /* ─── Accents — electric cyan + plasma violet ───────────── */
  --accent-1:       #5ef0ff;                       /* cyan */
  --accent-1-soft:  rgba(94, 240, 255, 0.14);
  --accent-1-glow:  rgba(94, 240, 255, 0.35);
  --accent-2:       #b78cff;                       /* violet */
  --accent-2-soft:  rgba(183, 140, 255, 0.14);
  --accent-grad:    linear-gradient(135deg, #5ef0ff 0%, #b78cff 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(94,240,255,0.18), rgba(183,140,255,0.18));

  /* ─── Text ──────────────────────────────────────────────── */
  --text-1:         #f1f4fb;                       /* AAA on bg-0 (14.8:1) */
  --text-2:         #b9bfd1;                       /* AAA on bg-0 (~10.5:1) */
  --text-3:         #9aa1b5;                       /* AAA-small on bg-0 (~7.2:1) — bumped from #7a8197 in CP4 */

  /* ─── State ─────────────────────────────────────────────── */
  --danger:         #ff6b8a;
  --good:           #5cf2a8;

  /* ─── Type ──────────────────────────────────────────────── */
  --display:        "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body:           "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;

  --t-xs:   11px;
  --t-sm:   13px;
  --t-base: 15px;
  --t-lg:   18px;
  --t-xl:   22px;
  --t-2xl:  30px;
  --t-3xl:  42px;

  /* ─── Motion ────────────────────────────────────────────── */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --motion-fast: 180ms;
  --motion-base: 260ms;
  --motion-slow: 480ms;

  /* ─── Legacy aliases — existing CSS files reference these.
        They now point at the dark theme so pages we haven't fully
        restyled yet still render coherently. The semantic-named tokens
        above are what the polished CP1 pages use. ─────────── */
  --cream:      var(--bg-0);
  --cream-2:    var(--bg-1);
  --gold:       var(--accent-1);
  --gold-soft:  var(--accent-1-soft);
  --text:       var(--text-1);
  /* --text-2 already exists above with the dark-theme value (#b9bfd1). */
  --muted:      var(--text-3);
  --border:     var(--hairline);
  --card:       var(--bg-1);
  --card-2:     var(--bg-2);
  --serif:      var(--display);
  --sans:       var(--body);
}

/* ─── Reset / globals ─────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }     /* CP4: belt-and-braces — keep wide glows from causing horizontal scroll on narrow phones */
body {
  font-family: var(--body);
  font-size: var(--t-base);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;

  /* Dimensional base: two soft accent glows over a deep near-black.
     Fixed so it doesn't tile or scroll-jank on mobile. */
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(94, 240, 255, 0.10), transparent 60%),
    radial-gradient(900px 700px at 100% 110%, rgba(183, 140, 255, 0.12), transparent 55%),
    var(--bg-0);
  background-attachment: fixed;
}

::selection { background: var(--accent-1-soft); color: var(--text-1); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-1);
  margin: 0;
}

.brand {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.03em;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-1);
  font-family: var(--body);
  font-size: var(--t-sm); font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out);
}
.btn:hover { background: var(--glass-bg-hover); border-color: var(--text-3); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
}
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }

.btn.primary {
  background: var(--accent-grad);
  color: #06080d;
  border-color: transparent;
  font-weight: 700;
  box-shadow:
    0 0 0 1px rgba(94,240,255,0.30) inset,
    0 8px 24px rgba(94,240,255,0.18),
    0 1px 0 rgba(255,255,255,0.30) inset;
}
.btn.primary:hover {
  filter: brightness(1.05);
  box-shadow:
    0 0 0 1px rgba(94,240,255,0.50) inset,
    0 10px 32px rgba(94,240,255,0.32),
    0 1px 0 rgba(255,255,255,0.40) inset;
}

.btn.ghost { background: transparent; }

.btn.danger {
  color: var(--danger);
  border-color: rgba(255, 107, 138, 0.45);
}
.btn.danger:hover {
  background: rgba(255, 107, 138, 0.08);
  border-color: var(--danger);
}

/* ─── Inputs ──────────────────────────────────────────────── */
.input, input.input, textarea.input, select.input {
  display: block; width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--bg-2);
  color: var(--text-1);
  font-family: var(--body);
  font-size: var(--t-base);
  transition:
    border-color var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out);
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--hairline-strong); }
.input:focus {
  outline: none;
  border-color: var(--accent-1);
  background: var(--bg-3);
  box-shadow: 0 0 0 4px var(--accent-1-soft);
}
textarea.input { resize: vertical; min-height: 96px; line-height: 1.5; }

label.field {
  display: block; margin-top: 16px;
  font-family: var(--body);
  font-size: var(--t-xs); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
}
label.field .input, label.field input, label.field textarea, label.field select {
  margin-top: 6px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/* ─── Error pill ──────────────────────────────────────────── */
.err {
  margin-top: 12px;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(255, 107, 138, 0.10);
  color: var(--danger);
  border: 1px solid rgba(255, 107, 138, 0.30);
  font-family: var(--body); font-size: var(--t-sm);
}
.err[hidden] { display: none; }

/* ─── Glass surface utility ──────────────────────────────── */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 24px 60px rgba(0, 0, 0, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.4);
}

/* ─── Motion primitives ──────────────────────────────────── */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-1-glow); }
  50%      { box-shadow: 0 0 24px 0 var(--accent-1-glow); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
