/* ==========================================================================
   base.css — design tokens, reset and primitives shared by index + os
   ========================================================================== */

:root {
  /* Brand palette */
  --void:        #050208;
  --void-2:      #0a0513;
  --ink:         #0f0a1c;
  --violet:      #a855f7;
  --violet-lt:   #c084fc;
  --violet-dk:   #7c3aed;
  --magenta:     #ec4899;
  --cyan:        #22d3ee;
  --amber:       #fbbf24;

  /* Text — all tested for WCAG AA on --void */
  --text:        #ece9f5;  /* 16.2:1 */
  --muted:       #aca6c2;  /*  8.1:1 */
  --dim:         #837c98;  /*  4.8:1 */

  /* Surfaces */
  --glass:       rgba(255, 255, 255, 0.038);
  --glass-hi:    rgba(255, 255, 255, 0.07);
  --line:        rgba(168, 85, 247, 0.20);
  --line-soft:   rgba(255, 255, 255, 0.09);

  /* Type */
  --font-display: "Space Grotesk", "Poppins", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Space + shape */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 28px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.85);
  --ring: 0 0 0 2px var(--void), 0 0 0 4px var(--violet-lt);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.28s;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background-color: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

img, picture, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--violet-lt); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--text); }

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--violet); color: #fff; }

/* Keyboard focus — visible everywhere, never on mouse click */
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

/* --- Accessibility utilities ------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 0.5rem; left: 50%;
  translate: -50% -180%;
  z-index: 10000;
  padding: 0.7rem 1.25rem;
  background: var(--violet);
  color: #14061f;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  transition: translate 0.2s var(--ease);
}
.skip-link:focus { translate: -50% 0; }

/* --- Starfield: pure CSS, zero requests, zero JS ---------------------- */

.starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-repeat: repeat;
  background-image:
    radial-gradient(1.4px 1.4px at 20px 30px,  rgba(232, 226, 255, 0.75) 50%, transparent 51%),
    radial-gradient(1px 1px at 140px 90px,     rgba(192, 132, 252, 0.55) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 90px 210px, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
    radial-gradient(1px 1px at 230px 160px,    rgba(236, 72, 153, 0.40) 50%, transparent 51%);
  background-size: 300px 300px, 260px 260px, 340px 340px, 420px 420px;
  opacity: 0.85;
}

.starfield::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70ch 45ch at 12% 22%, rgba(124, 58, 237, 0.20), transparent 70%),
    radial-gradient(60ch 40ch at 88% 8%,  rgba(236, 72, 153, 0.12), transparent 70%);
}

/* --- Primitives -------------------------------------------------------- */

.glass {
  background: linear-gradient(140deg, var(--glass), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

/* Minimum 44px touch targets on anything tappable */
.tap { min-width: 44px; min-height: 44px; }

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