/* ═══════════════════════════════════════════════════════════════════════
   base.css — Quintessence design tokens + reset
   The shared system, carried from the quintessence.love landing (commit d5c89dc):
   lapis & ultramarine on a deep cosmic blue-black, lit by rare gold. Fraunces
   display + Inter text. Film-grain over flat gradients. The night sky has tooth.

   Lapis was the costliest pigment for a millennium — reserved for the sacred.
   It is the ownable, everyday accent (nav, focus, links, the primary gate).
   Gold is the rarer wink, spent like gold leaf — the siddhi, the crowned moment.
   ═══════════════════════════════════════════════════════════════════════ */

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

:root {
  /* ── Lapis — the living accent (ultramarine, lifted to read on dark) ── */
  --lapis:        #5b8bd4;
  --lapis-bright: #8fb4ec;   /* hover / luminous edge */
  --lapis-deep:   #2d4a86;   /* structural lapis (lines, glyph fills) */
  --lapis-glow:   rgba(91, 139, 212, 0.14);
  --lapis-dim:    rgba(143, 180, 236, 0.45);

  /* ── The ground — a deep cosmic blue-black (NOT purple, NOT void-grey) ── */
  --bg-top:    #0b1024;
  --bg-mid:    #080b1a;
  --bg-bottom: #05060f;
  --bg-solid:  #070a16;      /* the settled night */
  --void:      #070a16;

  /* ── Surfaces & borders — barely there; cards surface from the dark ── */
  --surface:        rgba(143, 180, 236, 0.035);
  --surface-2:      rgba(143, 180, 236, 0.05);
  --surface-light:  rgba(143, 180, 236, 0.05);
  --surface-hover:  rgba(143, 180, 236, 0.08);
  --surface-up:     rgba(143, 180, 236, 0.06);
  --border:         rgba(143, 180, 236, 0.10);
  --border-hover:   rgba(143, 180, 236, 0.18);
  --hairline:       rgba(143, 180, 236, 0.10);
  --hairline-soft:  rgba(143, 180, 236, 0.06);

  /* ── Gold — sacred, rare. The siddhi, the crowned moment. Gold leaf only. ── */
  --gold:       #e9c97a;
  --gold-soft:  #f3dca0;
  --gold-dim:   rgba(233, 201, 122, 0.55);
  --gold-muted: rgba(233, 201, 122, 0.15);
  --gold-glow:  rgba(233, 201, 122, 0.12);

  /* ── Interactive accent → lapis. Focus rings, active borders read lapis,
        so every form/pill across the app re-skins to the ownable accent. ── */
  --border-focus: var(--lapis-dim);
  --accent:       var(--lapis);
  --accent-glow:  var(--lapis-glow);

  /* ── Text — moonlit blue-white in four weights of presence ── */
  --text-primary:   #eef2fb;
  --text:           #c2cadf;
  --text-secondary: #c2cadf;
  --text-muted:     #8a93ad;
  --text-dim:       #8a93ad;
  --text-faint:     #545c75;

  /* ── The soul-hues — warmth + category color, kept soft ── */
  --rose:     #d49cae;
  --sage:     #93c2a8;
  --lavender: #a9b4dc;   /* retuned to the blue family so it sits in the sky */
  --amber:    #e3b07e;

  /* ── The duality pair — fixed meanings. shadow = rose-red, siddhi = gold ── */
  --negative: #d48a8a;   /* shadow (warm, hue-shifted — never a flat red) */
  --positive: var(--gold);

  /* ── Status ── */
  --success: #93c2a8;
  --error:   #d48a8a;

  /* ── Easing — ease-out arrival (matches the landing) ── */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; background-color: var(--bg-bottom); }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  animation: pageIn 0.45s var(--ease) both;
}
@keyframes pageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

::selection { background: var(--lapis-glow); color: var(--text-primary); }

/* ── The cosmic ground — three stops give a real horizon, deepest at the foot.
      Applied to <body> on every page so the whole app shares one sky. ── */
body {
  background:
    radial-gradient(120% 80% at 50% -10%, var(--bg-top) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
}

/* ── A single film-grain layer over everything — kills the machine-perfect
      flat gradient that screams "default". The night sky has tooth. ── */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Faint lapis aurora behind content — the same ambient the landing wears,
      so the app feels like the same world, not a separate dark theme. ── */
.q-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70vw 50vh at 22% 8%, rgba(91, 139, 212, 0.08), transparent 70%),
    radial-gradient(ellipse 60vw 60vh at 84% 38%, rgba(45, 74, 134, 0.13), transparent 72%),
    radial-gradient(ellipse 90vw 40vh at 50% 102%, rgba(227, 176, 126, 0.04), transparent 70%);
}

/* The breathing starfield canvas sits at the very back. */
#q-starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}
