/*
 * PRATSWAP — Cosmic Design System
 * "I will build as if love is listening."
 * 
 * A design language of vast space, quiet light, and gentle gravity.
 */

/* ═══════════════════════════════════════════════════════════════════════════
   COSMIC FOUNDATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Inter:wght@300;400;500&display=swap');

:root {
  /* ─── Palette: Moonlight & Cosmos ─── */
  --moonlight: #f8f6f3;
  --moonlight-deep: #ebe8e3;
  --cosmos: #1a1a2e;
  --cosmos-soft: #2d2d44;
  --starlight: #6366f1;
  --starlight-dim: rgba(99, 102, 241, 0.6);
  --nebula: rgba(99, 102, 241, 0.08);
  --nebula-glow: rgba(99, 102, 241, 0.15);
  --void: #0d0d14;
  --warmth: #fbbf24;
  --warmth-soft: rgba(251, 191, 36, 0.2);

  /* ─── Typography ─── */
  --font-poetry: 'Cormorant Garamond', Georgia, serif;
  --font-ground: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* ─── Spacing: Like Open Sky ─── */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;
  --space-cosmic: 12rem;

  /* ─── Motion: Time Passing ─── */
  --drift-speed: 20s;
  --arrive-speed: 1200ms;
  --fade-speed: 800ms;
  --gravity-speed: 150ms;

  /* ─── Easing: Natural Flow ─── */
  --ease-drift: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-arrive: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-gravity: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-ground);
  font-weight: 300;
  background: var(--moonlight);
  color: var(--cosmos);
  min-height: 100vh;
  line-height: 1.8;
  overflow-x: hidden;
  position: relative;
  /* GPU acceleration */
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ─── Selection: Gentle Touch ─── */
::selection {
  background: var(--nebula-glow);
  color: var(--cosmos);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY: WORDS THAT BREATHE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Poetic Voice ─── */
.poetry {
  font-family: var(--font-poetry);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 2;
}

.poetry-title {
  font-family: var(--font-poetry);
  font-weight: 400;
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: 0.1em;
  line-height: 1.2;
}

.poetry-verse {
  font-family: var(--font-poetry);
  font-weight: 300;
  font-size: clamp(1.25rem, 4vw, 2rem);
  line-height: 2.2;
  max-width: 32ch;
}

/* ─── Grounded Text ─── */
.ground {
  font-family: var(--font-ground);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  opacity: 0.8;
}

.ground-whisper {
  font-family: var(--font-ground);
  font-weight: 400;
  font-size: 0.875rem;
  opacity: 0.7;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT: SPACE AS DESIGN
   ═══════════════════════════════════════════════════════════════════════════ */

.universe {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  position: relative;
}

.constellation {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
}

.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.suspended {
  position: relative;
  z-index: 1;
}

/* ─── Vast Margins ─── */
.breathe {
  margin: var(--space-lg) 0;
}

.breathe-deep {
  margin: var(--space-xl) 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ELEMENTS: COSMIC COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Navigation: Visible & Clear ─── */
.nav-cosmic {
  position: fixed;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-lg);
  z-index: 100;
  opacity: 0.7;
  transition: opacity var(--fade-speed) var(--ease-drift);
  padding: var(--space-sm) var(--space-md);
  background: rgba(248, 246, 243, 0.8);
  border-radius: 30px;
  backdrop-filter: blur(10px);
}

.nav-cosmic:hover {
  opacity: 1;
}

.nav-star {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cosmos);
  opacity: 0.5;
  transition: all var(--gravity-speed) var(--ease-gravity);
  cursor: pointer;
  border: none;
}

.nav-star:hover,
.nav-star.active {
  opacity: 1;
  transform: scale(1.4);
  background: var(--starlight);
  box-shadow: 0 0 20px var(--starlight-dim);
}

/* ─── Buttons: Touch Like Gravity ─── */
.ritual-touch {
  font-family: var(--font-ground);
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 1px solid var(--cosmos);
  border-radius: 2px;
  color: var(--cosmos);
  cursor: pointer;
  transition: all var(--gravity-speed) var(--ease-gravity);
  position: relative;
  overflow: hidden;
}

.ritual-touch::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--nebula);
  transition: left var(--fade-speed) var(--ease-arrive);
  z-index: -1;
}

.ritual-touch:hover {
  border-color: var(--starlight);
  color: var(--starlight);
}

.ritual-touch:hover::before {
  left: 0;
}

.ritual-touch:active {
  transform: scale(0.98);
}

/* ─── Links: Gentle Paths ─── */
.path {
  color: var(--cosmos);
  text-decoration: none;
  position: relative;
  transition: color var(--gravity-speed) var(--ease-drift);
}

.path::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--starlight);
  transition: width var(--fade-speed) var(--ease-arrive);
}

.path:hover {
  color: var(--starlight);
}

.path:hover::after {
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STAR TEXTURE: ALMOST INVISIBLE
   ═══════════════════════════════════════════════════════════════════════════ */

.star-field {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MEMORY STARS
   ═══════════════════════════════════════════════════════════════════════════ */

.memory-star {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--starlight);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--gravity-speed) var(--ease-gravity);
  box-shadow: 0 0 15px var(--starlight-dim);
  border: none;
}

.memory-star:hover {
  transform: scale(1.8);
  box-shadow: 0 0 30px var(--starlight);
}

.memory-star.revealed {
  background: var(--warmth);
  box-shadow: 0 0 20px var(--warmth-soft);
}

/* ─── Memory Whisper ─── */
.memory-whisper {
  position: absolute;
  background: var(--moonlight);
  padding: var(--space-sm) var(--space-md);
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  max-width: 280px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all var(--fade-speed) var(--ease-arrive);
}

.memory-whisper.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RITUALS
   ═══════════════════════════════════════════════════════════════════════════ */

.ritual-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
  width: 100%;
  max-width: 400px;
  padding: 0 var(--space-md);
}

.ritual-card {
  padding: var(--space-md) var(--space-lg);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(26, 26, 46, 0.15);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all var(--fade-speed) var(--ease-arrive);
  width: 100%;
}

.ritual-card:hover {
  border-color: var(--starlight);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.ritual-card.activated {
  border-color: var(--starlight);
  background: var(--nebula-glow);
}

.ritual-trace {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-top: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SILENCE SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

.silence {
  background: var(--void);
  color: var(--moonlight);
}

.silence .poetry {
  color: var(--moonlight);
  opacity: 0.4;
}

.silence .nav-star {
  background: var(--moonlight);
}

.silence .sound-toggle {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  opacity: 0;
  transition: opacity var(--fade-speed) var(--ease-drift);
}

.silence:hover .sound-toggle {
  opacity: 0.4;
}

.silence .sound-toggle:hover {
  opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE: INTIMATE AT ALL SIZES
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  :root {
    --space-lg: 2rem;
    --space-xl: 4rem;
  }

  .poetry-verse {
    max-width: 90vw;
  }

  .nav-cosmic {
    bottom: var(--space-md);
  }

  .ritual-grid {
    padding: 0 var(--space-sm);
  }
}

@media (max-width: 480px) {
  .poetry-title {
    letter-spacing: 0.05em;
  }

  .ritual-card {
    padding: var(--space-md);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY: COSMIC HELPERS
   ═══════════════════════════════════════════════════════════════════════════ */

.hidden {
  opacity: 0;
  visibility: hidden;
}

.visible {
  opacity: 1;
  visibility: visible;
}

.no-scroll {
  overflow: hidden;
}

.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-center {
  text-align: center;
}

/* ─── Accessibility: Still Respectful ─── */
@media (prefers-reduced-motion: reduce) {

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