/* ============================================================
   Negaxy Studio — base.css
   Design tokens, reset, typography, global background, a11y utilities.
   Direction v2 "Neon Arcade": candy-neon accents on near-black,
   Unbounded display type, gradient mesh + grain texture.
   Source of truth: design-system/negaxy-studio/MASTER.md
   ============================================================ */

:root {
  /* Colors — Neon Arcade palette (dark theme is the only theme) */
  --color-bg: #0A0A1F;
  --color-bg-deep: #060614;
  --color-card: rgba(255, 255, 255, 0.04);
  --color-muted: rgba(255, 255, 255, 0.07);
  --color-fg: #EDEDFA;
  --color-fg-muted: #A3A8C7;
  --color-primary: #8B5CF6;   /* electric violet */
  --color-secondary: #22D3EE; /* neon cyan */
  --color-cta: #FF3D8A;       /* hot pink */
  --color-amber: #FFB02E;
  --color-border: rgba(255, 255, 255, 0.10);
  --color-border-strong: rgba(139, 92, 246, 0.55);
  --color-destructive: #EF4444;
  --color-ring: #22D3EE;

  /* Gradients — candy neon */
  --gradient-cta: linear-gradient(100deg, #FF3D8A 0%, #FF7A3D 55%, #FFB02E 100%);
  --gradient-text: linear-gradient(95deg, #22D3EE 0%, #8B5CF6 45%, #FF3D8A 100%);
  --gradient-mesh:
    radial-gradient(42% 38% at 12% 18%, rgba(139, 92, 246, 0.32), transparent 70%),
    radial-gradient(36% 34% at 88% 12%, rgba(34, 211, 238, 0.16), transparent 70%),
    radial-gradient(44% 40% at 82% 78%, rgba(255, 61, 138, 0.20), transparent 70%),
    radial-gradient(30% 28% at 30% 92%, rgba(255, 176, 46, 0.10), transparent 70%);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px; /* section rhythm on mobile; bumped on desktop */

  /* Elevation — neon glow over shadow */
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.6);
  --glow-violet: 0 0 40px rgba(139, 92, 246, 0.35);
  --glow-pink: 0 0 40px rgba(255, 61, 138, 0.35);
  --glow-cyan: 0 0 32px rgba(34, 211, 238, 0.3);

  /* Typography */
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;

  /* Layout */
  --container-max: 1160px;
  --navbar-height: 72px;
  --radius-card: 20px;
  --radius-input: 12px;
  --radius-pill: 999px;
}

@media (min-width: 1024px) {
  :root { --space-3xl: 108px; }
}

/* ---------- Reset ---------- */

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

* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100dvh;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--color-secondary); }

button { font: inherit; }

/* Anchored sections stop below the sticky navbar */
[id] { scroll-margin-top: calc(var(--navbar-height) + 24px); }

/* ---------- Global texture: film grain over everything ---------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.05;
  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.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Typography ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.01em;
  font-weight: 700;
}

h3 { font-size: 1.15rem; font-weight: 600; }

p { max-width: 65ch; }

/* Gradient-inked display text */
.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Small technical label — eyebrows, tags, meta */
.label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

/* ---------- Layout helpers ---------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.section { padding-block: var(--space-3xl); }

.section-head { margin-bottom: var(--space-2xl); }

.section-head .label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

/* Neon spark that precedes section labels */
.label::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--gradient-cta);
  display: inline-block;
}

.section-head p {
  color: var(--color-fg-muted);
  margin-top: var(--space-md);
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  z-index: 100;
  background: var(--color-primary);
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: var(--radius-input);
  font-weight: 600;
  text-decoration: none;
  transition: top 200ms ease;
}

.skip-link:focus { top: var(--space-md); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Scroll-reveal (activated by js/site-interactions.js) ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 320ms ease-out, transform 320ms ease-out;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Reduced motion: kill decorative animation, keep content ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal { opacity: 1; transform: none; }
}
