/* ============================================================
   THE EXTINCTION MIRROR — Design System
   NID Gandhinagar · Butterfly Conservation AR Experience
   ============================================================ */

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


/* ============================================================
   COLOUR TOKENS
   ============================================================ */
:root {
  /* Backgrounds */
  --color-void:            #0A0A08;
  --color-deep:            #111110;
  --color-surface:         rgba(255, 253, 248, 0.06);
  --color-surface-raised:  rgba(255, 253, 248, 0.10);

  /* Borders */
  --color-border:          rgba(255, 253, 248, 0.12);
  --color-border-strong:   rgba(255, 253, 248, 0.25);

  /* Foreground */
  --color-cream:           #F5F0E8;
  --color-cream-muted:     rgba(245, 240, 232, 0.60);
  --color-cream-dim:       rgba(245, 240, 232, 0.35);

  /* Accent */
  --color-gold:            #C9A84C;
  --color-gold-glow:       rgba(201, 168, 76, 0.30);
  --color-amber:           #E8925A;

  /* Nature */
  --color-forest:          #1B3A2D;
  --color-forest-light:    #2D6A4F;
}


/* ============================================================
   SPACING — 8pt grid
   ============================================================ */
:root {
  --space-1:   8px;
  --space-2:  16px;
  --space-3:  24px;
  --space-4:  32px;
  --space-5:  40px;
  --space-6:  48px;
  --space-7:  56px;
  --space-8:  64px;
  --space-9:  72px;
  --space-10: 80px;
}


/* ============================================================
   MOTION TOKENS
   ============================================================ */
:root {
  --ease-out:       cubic-bezier(0.16, 1, 0.30, 1);
  --ease-in-out:    cubic-bezier(0.87, 0, 0.13, 1);

  --duration-fast:    300ms;
  --duration-base:    600ms;
  --duration-slow:    900ms;
  --duration-breathe: 4000ms;
}


/* ============================================================
   COMPONENT TOKENS
   ============================================================ */
:root {
  --radius-sm:   8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-pill: 100px;

  --blur-glass:       blur(20px) saturate(180%);

  --shadow-glow-gold: 0 0 40px rgba(201, 168, 76, 0.20);
}


/* ============================================================
   GLOBAL RESET
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--color-void);
  color: var(--color-cream);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow: hidden;

  /* Smooth font rendering */
  -webkit-font-smoothing:  antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}


/* ============================================================
   GLASS SURFACE COMPONENTS
   ============================================================ */

/* Base frosted glass panel */
.glass {
  background:            var(--color-surface);
  backdrop-filter:       var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border:                1px solid var(--color-border);
  border-radius:         var(--radius-md);
}

/* Slightly elevated glass — modals, cards */
.glass-raised {
  background:            var(--color-surface-raised);
  backdrop-filter:       var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border:                1px solid var(--color-border-strong);
  border-radius:         var(--radius-md);
  box-shadow:            0 8px 32px rgba(0, 0, 0, 0.45),
                         inset 0 1px 0 rgba(255, 253, 248, 0.08);
}


/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */

/* Display — Cormorant Garamond, for titles and headlines */
.text-display {
  font-family:    'Cormorant Garamond', Georgia, serif;
  font-weight:    300;
  font-style:     italic;
  line-height:    1.15;
  letter-spacing: 0.01em;
  color:          var(--color-cream);
}

/* UI text — DM Sans, for instructions, buttons, labels */
.text-ui {
  font-family:    'DM Sans', system-ui, sans-serif;
  font-weight:    400;
  line-height:    1.6;
  letter-spacing: 0;
  color:          var(--color-cream-muted);
}

/* Label — small uppercase DM Sans, for metadata, tags, step counters */
.text-label {
  font-family:    'DM Sans', system-ui, sans-serif;
  font-weight:    500;
  font-size:      11px;
  line-height:    1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:          var(--color-cream-dim);
}


/* ============================================================
   ANIMATION KEYFRAMES
   ============================================================ */

@keyframes fadeUpIn {
  from {
    opacity:   0;
    transform: translateY(16px);
  }
  to {
    opacity:   1;
    transform: translateY(0);
  }
}

@keyframes fadeDownOut {
  from {
    opacity:   1;
    transform: translateY(0);
  }
  to {
    opacity:   0;
    transform: translateY(16px);
  }
}

@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: scale(1);    }
  50%       { opacity: 1;    transform: scale(1.03); }
}

@keyframes goldPulse {
  0%, 100% { box-shadow: var(--shadow-glow-gold); }
  50%       { box-shadow: 0 0 60px rgba(201, 168, 76, 0.40); }
}


/* ============================================================
   ENTRANCE / EXIT UTILITY CLASSES
   ============================================================ */

/* Fade up — primary entrance animation */
.fade-up {
  animation:
    fadeUpIn
    var(--duration-base)
    var(--ease-out)
    both;
}

/* Fade down — exit (add class to trigger) */
.fade-down {
  animation:
    fadeDownOut
    var(--duration-base)
    var(--ease-in-out)
    both;
}

/* Stagger helpers — add to children inside a .fade-up parent */
.fade-up > * + * { animation-delay: 80ms;  }
.fade-up > * + * + * { animation-delay: 160ms; }
.fade-up > * + * + * + * { animation-delay: 240ms; }


/* ============================================================
   CONTINUOUS AMBIENT ANIMATIONS
   ============================================================ */

/* Soft breathing pulse — for ambient UI elements */
.animate-breathe {
  animation:
    breathe
    var(--duration-breathe)
    var(--ease-in-out)
    infinite;
}

/* Gold glow pulse — for CTAs and highlighted states */
.animate-gold-pulse {
  animation:
    goldPulse
    var(--duration-breathe)
    var(--ease-in-out)
    infinite;
}


/* ============================================================
   SCROLLBAR (hidden, preserves scroll functionality)
   ============================================================ */
::-webkit-scrollbar          { width: 0; height: 0; }
::-webkit-scrollbar-track    { background: transparent; }
::-webkit-scrollbar-thumb    { background: transparent; }
* { scrollbar-width: none; }


/* ============================================================
   SELECTION
   ============================================================ */
::selection {
  background: var(--color-gold-glow);
  color:      var(--color-cream);
}
