/* ============================================
   BASE CSS — Neon Digital
   Design tokens, reset, typography, layout,
   cursor, scroll reveal, entrance, responsive
   ============================================ */

/* ----- Custom Properties ----- */

:root {
  /* Backgrounds */
  --bg: #111827;
  --bg-mid: #1e1b4b;
  --bg-alt: #0f172a;

  /* Surfaces & Borders */
  --surface: #1e293b;
  --border: #334155;

  /* Accents */
  --accent-fill: #a78bfa;
  --accent-text: #c4b5fd;
  --cyan: #22d3ee;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Typography */
  --font-serif: 'Instrument Serif', serif;
  --font-sans: 'Inter', system-ui, sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 6rem;
  --space-2xl: 10rem;

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Duration */
  --duration-fast: 0.2s;
  --duration-normal: 0.4s;
  --duration-slow: 0.8s;
}

/* ----- Reset & Base ----- */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: linear-gradient(145deg, var(--bg) 0%, var(--bg-mid) 40%, var(--bg-alt) 100%);
  min-height: 100vh;
  background-attachment: fixed;
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: 1.6;
}

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

h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  font-weight: 400;
  color: var(--text-primary);
}

h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
}

h3 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  color: var(--text-secondary);
  max-width: 65ch;
}

.accent-text {
  color: var(--accent-text);
  text-shadow: 0 0 30px rgba(167, 139, 250, 0.2);
}

a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--accent-text);
  text-shadow: 0 0 12px rgba(167, 139, 250, 0.15);
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

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

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* ----- Custom Cursor ----- */

.cursor-glow {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--accent-text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  box-shadow:
    0 0 20px rgba(167, 139, 250, 0.4),
    0 0 40px rgba(167, 139, 250, 0.1);
  transition: opacity var(--duration-fast);
}

@media (hover: none), (pointer: coarse) {
  .cursor-glow {
    display: none;
  }
}

/* ----- Scroll Reveal ----- */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ----- Entrance Animation ----- */

.curtain {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.curtain-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  opacity: 0;
}

.curtain-logo img {
  filter: drop-shadow(0 0 20px rgba(167, 139, 250, 0.4));
}

.curtain-wordmark {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.curtain-wordmark-light {
  font-weight: 300;
  color: var(--text-secondary);
}

@keyframes curtainLogoIn {
  to {
    opacity: 1;
  }
}

@keyframes curtainLogoOut {
  to {
    opacity: 0;
  }
}

@keyframes curtainWipe {
  to {
    transform: translateY(-100%);
  }
}

.curtain.logo-in .curtain-logo {
  animation: curtainLogoIn 0.5s var(--ease-out) forwards;
}

.curtain.logo-out .curtain-logo {
  animation: curtainLogoOut 0.3s ease forwards;
}

.curtain.wipe {
  animation: curtainWipe 0.6s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

/* ----- Responsive ----- */

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: var(--space-lg) 0;
  }

  h1 {
    font-size: clamp(2rem, 5vw, 3rem);
  }
}

/* ----- Reduced Motion ----- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .curtain {
    display: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
