/* Global Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Design Tokens */
:root {
  /* Colors — Digital Alchemy System */
  --color-surface: #061013;
  --color-primary: #59ee50;
  --color-primary-dark: #45c43d;
  --color-primary-light: #7cfc01;
  --color-text-muted: #607578;
  --color-error: #ff7351;
  --color-error-text: #200500;
  --color-error-border: #802e1a;
  --color-error-red: #ff7351;
  /* Updated Signal Palette */
  --color-accent: #f0b433; /* Electric Amber */
  --color-accent-dark: #d69e2e;
  --color-accent-light: #f7d084;
  --color-magenta: #d157a3; /* Deep Magenta */
  --color-white: #faf9f6;

  /* Platform brand colors — Signal Palette */
  --color-youtube: #ff7351;
  --color-youtube-dark: #cc5a40;
  --color-youtube-hover: #ff9e87;
  --color-spotify: #59ee50;
  --color-spotify-light: #b8f5d0;
  --color-discord: #d157a3;
  --color-discord-dark: #a84683;
  --color-discord-light: #e895c8;
  --color-reddit: #ff7351;
  --color-reddit-dark: #cc5a40;
  --color-reddit-light: #ff9e87;
  --color-linkedin: #f0b433;

  /* Colors — RGB channels */
  --rgb-dark: 6, 16, 19;
  --rgb-primary: 89, 238, 80;
  --rgb-primary-light: 124, 252, 1;
  --rgb-accent: 240, 180, 51;
  --rgb-magenta: 209, 87, 163;
  --rgb-white: 250, 249, 246;
  --rgb-error-red: 255, 115, 81;

  /* Platform brand colors — RGB channels */
  --rgb-youtube: 255, 115, 81;
  --rgb-youtube-dark: 204, 90, 64;
  --rgb-youtube-hover: 255, 158, 135;
  --rgb-spotify: 89, 238, 80;
  --rgb-discord: 209, 87, 163;
  --rgb-reddit: 255, 115, 81;
  --rgb-linkedin: 240, 180, 51;

  /* Gradient (solid neutral) */
  --gradient-bg-1: var(--color-surface);
  --gradient-bg-2: var(--color-surface);
  --gradient-bg-3: var(--color-surface);
  --gradient-bg-4: var(--color-surface);
  --gradient-bg-5: var(--color-surface);

  /* Font families */
  --font-display: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(var(--rgb-dark), 0.08);
  --shadow-md: 0 4px 14px rgba(var(--rgb-dark), 0.1);
  --shadow-lg: 0 8px 24px rgba(var(--rgb-dark), 0.14);
  --shadow-focus: 0 0 0 3px rgba(var(--rgb-primary), 0.15);
  --shadow-focus-error: 0 0 0 3px rgba(var(--rgb-error-red), 0.12);

  /* Text shadows — reusable for white text on gradient */
  --text-shadow-on-gradient: 0 1px 3px rgba(var(--rgb-dark), 0.5), 0 0 16px rgba(var(--rgb-dark), 0.25);
  --text-shadow-subtle: 0 1px 2px rgba(var(--rgb-dark), 0.4);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-pill: 24px;

  /* Animation tokens */
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-snappy: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-entrance: 600ms;
}

/* Base Body Styles */
body {
  font-family: var(--font-system);
  background: linear-gradient(
    165deg,
    var(--gradient-bg-1) 0%,
    var(--gradient-bg-2) 25%,
    var(--gradient-bg-3) 50%,
    var(--gradient-bg-4) 75%,
    var(--gradient-bg-5) 100%
  );
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--color-white);
}

/* Remove background-attachment: fixed on touch/mobile — causes repaint jank and is ignored on iOS Safari */
@media (hover: none) {
  body {
    background-attachment: scroll;
  }
}

/* Common Container Styles */
.container {
  max-width: 1024px;
  margin: 0 auto;
}

/* Links */
a {
  text-decoration: none;
  color: inherit;
}

/* Animation Keyframes */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

/* Loading Spinner */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(var(--rgb-dark), 0.1);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

/* Button Styles */
button {
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out),
              background-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out);
  font-family: inherit;
}

/* Panel */
.panel {
  background: var(--color-surface);
  border: 1.5px solid rgba(var(--rgb-primary), 0.15);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Step Number Badge */
.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(var(--rgb-primary), 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--color-primary);
  border: 2px solid rgba(var(--rgb-primary-light), 0.4);
  font-weight: 600;
  transition: background-color var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out),
              color var(--duration-normal) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

/* Screen-reader only (visually hidden but accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visibility for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }
}

/* ── Site Footer ──────────────────────────────── */
.site-footer {
  background: rgba(var(--rgb-dark), 0.35);
  padding: 32px 20px;
}

.footer-inner {
  max-width: 1024px;
  margin: 0 auto;
  text-align: center;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: rgba(var(--rgb-white), 0.5);
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

/* Ensure 44px minimum touch targets on touch-capable devices */
@media (hover: none), (pointer: coarse) {
  .footer-social {
    width: 44px;
    height: 44px;
  }
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-social:hover {
  color: var(--color-white);
  background: rgba(var(--rgb-white), 0.1);
}

/* Platform-specific footer hover colors */
.footer-social[data-platform="youtube"]:hover {
  color: var(--color-youtube);
  background: rgba(var(--rgb-youtube), 0.12);
}

.footer-social[data-platform="spotify"]:hover {
  color: var(--color-spotify);
  background: rgba(var(--rgb-spotify), 0.12);
}

.footer-social[data-platform="discord"]:hover {
  color: var(--color-discord);
  background: rgba(var(--rgb-discord), 0.12);
}

.footer-social[data-platform="reddit"]:hover {
  color: var(--color-reddit);
  background: rgba(var(--rgb-reddit), 0.12);
}

.footer-social[data-platform="linkedin"]:hover {
  color: var(--color-linkedin);
  background: rgba(var(--rgb-linkedin), 0.12);
}

.footer-social:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary);
  color: var(--color-white);
}

.footer-social:active {
  transform: scale(0.9);
}

.footer-copy {
  font-size: 13px;
  color: rgba(var(--rgb-white), 0.55);
}

.footer-copy a {
  color: rgba(var(--rgb-primary-light), 0.7);
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-copy a:hover {
  color: var(--color-primary-light);
}

@supports (padding: env(safe-area-inset-bottom)) {
  .site-footer {
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }
}

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