/* ============================================
   THE ASYLUM — Main Stylesheet
   jeffkazzee.neocities.org
   Whimsygothic Cyber Ghost Aesthetic
   ============================================ */

/* === CSS RESET === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* === CSS CUSTOM PROPERTIES === */
:root {
  /* === FOUNDATIONS === */
  --void-black: #0a0608;
  --deep-aubergine: #1a0a14;
  --midnight-teal: #0a1a1f;
  --crypt-gray: #1f1a1c;

  /* === SURFACES === */
  --weathered-stone: #2a2226;
  --iron-dark: #3a3236;
  --iron-light: #4a4246;

  /* === TEXT === */
  --bone-white: #f0ebe3;
  --aged-paper: #d4cfc7;
  --faded-script: #9a958d;

  /* === ACCENTS === */
  --spectral-gold: #d4af37;
  --tarnished-gold: #b8962f;
  --candle-flame: #ff9f43;

  /* === SUPERNATURAL === */
  --ectoplasm: #7fff7f;
  --ectoplasm-dim: #4a994a;
  --phantasm-blue: #7faaff;
  --blood-moon: #8b0000;
  --spectral-purple: #9f7fff;

  /* === EFFECTS === */
  --fog-white: rgba(240, 235, 227, 0.03);
  --fog-dense: rgba(240, 235, 227, 0.08);
  --shadow-color: rgba(10, 6, 8, 0.8);
  --glow-gold: rgba(212, 175, 55, 0.4);
  --glow-green: rgba(127, 255, 127, 0.3);

  /* === GRADIENTS === */
  --gradient-void: linear-gradient(
    180deg,
    var(--void-black) 0%,
    var(--deep-aubergine) 50%,
    var(--midnight-teal) 100%
  );

  --gradient-fog: linear-gradient(
    180deg,
    transparent 0%,
    var(--fog-dense) 50%,
    transparent 100%
  );

  --gradient-gold: linear-gradient(
    135deg,
    var(--spectral-gold) 0%,
    var(--candle-flame) 100%
  );

  /* === GLOW EFFECTS === */
  --glow-text-gold: 0 0 10px var(--glow-gold),
                    0 0 20px var(--glow-gold),
                    0 0 30px var(--glow-gold);

  --glow-text-green: 0 0 10px var(--glow-green),
                     0 0 20px var(--glow-green);

  /* === TYPOGRAPHY === */
  --font-display: 'Cinzel Decorative', 'Cinzel', serif;
  --font-heading: 'Cinzel', serif;
  --font-body: 'Crimson Pro', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-accent: 'UnifrakturMaguntia', cursive;

  /* === TYPE SCALE (Fluid) === */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.925rem + 0.375vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.375rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.625rem);
  --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2.25rem);
  --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 3rem);
  --text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 4rem);
  --text-5xl: clamp(3rem, 2.25rem + 3.75vw, 5.5rem);

  /* === LINE HEIGHTS === */
  --leading-none: 1;
  --leading-tight: 1.2;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* === LETTER SPACING === */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.05em;
  --tracking-wider: 0.1em;
  --tracking-widest: 0.2em;

  /* === SPACING (4px base) === */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* === SEMANTIC SPACING === */
  --content-padding: var(--space-6);
  --section-gap: var(--space-16);
  --card-padding: var(--space-6);
  --card-gap: var(--space-6);

  /* === MAX WIDTHS === */
  --max-width-prose: 65ch;
  --max-width-content: 1200px;
  --max-width-wide: 1400px;

  /* === BORDERS === */
  --border-subtle: 1px solid var(--iron-dark);
  --border-medium: 1px solid var(--iron-light);
  --border-strong: 2px solid var(--spectral-gold);

  /* === SHADOWS === */
  --shadow-sm: 0 1px 2px var(--shadow-color);
  --shadow-md: 0 4px 6px var(--shadow-color);
  --shadow-lg: 0 10px 15px var(--shadow-color);
  --shadow-xl: 0 20px 25px var(--shadow-color);

  /* === TRANSITIONS === */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
  --transition-dramatic: 1000ms ease;

  /* === Z-INDEX SCALE === */
  --z-base: 0;
  --z-above: 10;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-gate: 1000;

  /* === BORDER RADIUS === */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-full: 9999px;
}

/* === BASE STYLES === */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--bone-white);
  background: var(--gradient-void);
  background-attachment: fixed;
}

/* === HEADINGS === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wide);
  color: var(--bone-white);
}

h1 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  letter-spacing: var(--tracking-wider);
}

h2 {
  font-size: var(--text-2xl);
  text-transform: uppercase;
}

h3 {
  font-size: var(--text-xl);
}

h4 {
  font-size: var(--text-lg);
}

h5, h6 {
  font-size: var(--text-base);
}

/* === LINKS === */
a {
  color: var(--spectral-gold);
  transition: color var(--transition-normal), text-shadow var(--transition-normal);
}

a:hover {
  color: var(--candle-flame);
  text-shadow: var(--glow-text-gold);
}

a:visited {
  color: var(--tarnished-gold);
}

/* === FOCUS STATES === */
:focus-visible {
  outline: 2px solid var(--spectral-gold);
  outline-offset: 4px;
}

/* === SELECTION === */
::selection {
  background: var(--spectral-gold);
  color: var(--void-black);
}

/* === UTILITY CLASSES === */

/* Screen reader only */
.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;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-tooltip);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--void-black);
  background: var(--spectral-gold);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* Alpine.js cloak */
[x-cloak] {
  display: none !important;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width-content);
  margin-inline: auto;
  padding-inline: var(--content-padding);
}

.container--wide {
  max-width: var(--max-width-wide);
}

.container--prose {
  max-width: var(--max-width-prose);
}

/* Content sections */
.section {
  padding-block: var(--section-gap);
}

/* === 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;
  }
}
