/* Shared tokens + cross-surface nav chrome (landing, docs, studio, listener) */

:root {
  --bg-0:        oklch(0.14 0.02 260);
  --bg-1:        oklch(0.18 0.025 260);
  --bg-glass:    oklch(0.22 0.03 260 / 0.55);
  --bg-glass-2:  oklch(0.26 0.035 260 / 0.42);
  --line:        oklch(0.95 0.02 240 / 0.08);
  --line-strong: oklch(0.95 0.02 240 / 0.16);
  --fg:          oklch(0.97 0.01 240);
  --fg-dim:      oklch(0.78 0.02 250);
  --fg-faint:    oklch(0.58 0.02 250);
  --accent-cyan: oklch(0.82 0.15 215);
  --accent-mag:  oklch(0.75 0.19 320);
  --accent-lime: oklch(0.88 0.16 140);
  --aurora-1:    oklch(0.55 0.22 215 / 0.55);
  --aurora-2:    oklch(0.52 0.24 320 / 0.45);
  --aurora-3:    oklch(0.58 0.20 280 / 0.4);
  --shadow-lg:   0 24px 64px -16px oklch(0 0 0 / 0.6);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html, body {
  min-height: 100%;
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--fg);
  background: var(--bg-0);
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ambient aurora */
.aurora {
  position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  filter: blur(90px) saturate(1.2);
  opacity: 0.75;
}
.aurora::before, .aurora::after, .aurora > span {
  content: ""; position: absolute; border-radius: 50%;
}
.aurora::before {
  width: 46vw; height: 46vw;
  background: radial-gradient(circle, var(--aurora-1) 0%, transparent 65%);
  top: -10%; left: -10%;
  animation: drift1 28s ease-in-out infinite alternate;
}
.aurora::after {
  width: 52vw; height: 52vw;
  background: radial-gradient(circle, var(--aurora-2) 0%, transparent 65%);
  bottom: -15%; right: -10%;
  animation: drift2 34s ease-in-out infinite alternate;
}
.aurora > span {
  width: 40vw; height: 40vw;
  background: radial-gradient(circle, var(--aurora-3) 0%, transparent 65%);
  top: 35%; left: 40%;
  animation: drift3 40s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(15vw, 10vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-10vw, -8vh) scale(0.9); } }
@keyframes drift3 { to { transform: translate(-8vw, 6vh) scale(1.2); } }

.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ═══ CROSS-SURFACE NAV ═══ */
.surface-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 32px;
  background: oklch(0.14 0.02 260 / 0.55);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}

/* brand wordmark — the "home" affordance, deliberately quiet */
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg-dim);
  padding: 6px 4px 6px 0;
  transition: color 0.16s;
  position: relative;
}
.brand:hover { color: var(--fg); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); filter: saturate(1.4); }
.brand-mark {
  width: 18px; height: 18px; border-radius: 5px;
  background:
    conic-gradient(from 140deg, var(--accent-cyan), var(--accent-mag), var(--accent-lime), var(--accent-cyan));
  box-shadow: 0 0 16px oklch(0.82 0.15 215 / 0.4), inset 0 0 0 1px oklch(1 0 0 / 0.12);
  transition: transform 0.25s cubic-bezier(.4,1.6,.5,1), filter 0.25s;
  flex: none;
}

/* hint pill that only appears on brand hover — tells people it goes home */
.brand::after {
  content: "← home";
  position: absolute;
  left: calc(100% + 4px); top: 50%;
  transform: translateY(-50%) translateX(-4px);
  font-family: var(--mono); font-size: 10px;
  color: var(--fg-faint);
  letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
.brand:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }

/* in-surface tab switcher */
.app-switch {
  display: flex; align-items: center; gap: 2px;
  padding: 3px;
  background: oklch(1 0 0 / 0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-left: 16px;
}
.app-switch a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--fg-faint);
  border-radius: 999px;
  transition: all 0.14s;
  letter-spacing: -0.005em;
}
.app-switch a:hover { color: var(--fg-dim); }
.app-switch a.active {
  color: var(--fg);
  background: oklch(1 0 0 / 0.06);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.app-switch a .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-lime);
  box-shadow: 0 0 8px var(--accent-lime);
}

.nav-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
}
.nav-link {
  font-size: 13px;
  color: var(--fg-dim);
  transition: color 0.14s;
}
.nav-link:hover { color: var(--fg); }
