/* ============================================
   NEON NOIR DETECTIVE AGENCY
   A CSS-Only Immersive Experience
   ============================================ */

/* ============================================
   CUSTOM PROPERTIES & THEME SYSTEM
   ============================================ */

:root {
  /* Noir Mode Colors (Default) */
  --bg-noir: #0a0a0f;
  --bg-noir-elevated: #14141f;
  --text-noir: #e0d6c5;
  --text-noir-dim: #a89f91;
  --neon-pink: #ff2a6d;
  --neon-cyan: #00f0ff;
  --neon-purple: #b24bf3;
  --accent-gold: #d4af37;

  /* Day Mode Colors */
  --bg-day: #f8f4e9;
  --bg-day-elevated: #ffffff;
  --text-day: #2e2b28;
  --text-day-dim: #6b6760;
  --accent-day: #2a9d8f;
  --accent-day-alt: #e76f51;

  /* Active Theme Variables (Default to Noir) */
  --bg: var(--bg-noir);
  --bg-elevated: var(--bg-noir-elevated);
  --text: var(--text-noir);
  --text-dim: var(--text-noir-dim);
  --accent: var(--neon-pink);
  --accent-alt: var(--neon-cyan);
  --accent-tertiary: var(--neon-purple);

  /* Spacing & Layout */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;

  /* Animation Timing */
  --transition-fast: 0.2s;
  --transition-medium: 0.4s;
  --transition-slow: 0.6s;
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Account for fixed nav */
}

body {
  font-family: 'Cinzel', serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* ============================================
   ATMOSPHERIC RAIN ANIMATION
   ============================================ */

body::before {
  content: '';
  position: fixed;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: repeating-linear-gradient(
    -20deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.03) 2px,
    rgba(255, 255, 255, 0.03) 3px
  );
  animation: rain-fall 1.2s linear infinite;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

@keyframes rain-fall {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

/* Film Grain Overlay */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 2;
  opacity: 0.4;
  mix-blend-mode: overlay;
}

/* ============================================
   THEME TOGGLE (CHECKBOX HACK)
   ============================================ */

#light-switch {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-btn {
  position: fixed;
  top: 6rem; /* Positioned below nav to prevent overlap */
  right: 2rem;
  z-index: 1000;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-medium) var(--ease-smooth);
  box-shadow: 0 0 20px rgba(255, 42, 109, 0.3),
              inset 0 0 10px rgba(255, 42, 109, 0.1);
}

.toggle-btn:hover,
.toggle-btn:focus-within {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(255, 42, 109, 0.6),
              inset 0 0 15px rgba(255, 42, 109, 0.2);
}

.toggle-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 8px var(--accent));
  transition: transform var(--transition-medium);
}

#light-switch:checked ~ .toggle-btn .toggle-icon {
  transform: rotate(180deg);
}

/* Theme Switch: Day Mode Activated */
#light-switch:checked ~ .page-wrapper,
#light-switch:checked ~ .grain-overlay {
  --bg: var(--bg-day);
  --bg-elevated: var(--bg-day-elevated);
  --text: var(--text-day);
  --text-dim: var(--text-day-dim);
  --accent: var(--accent-day);
  --accent-alt: var(--accent-day-alt);
  --accent-tertiary: var(--accent-day);
}

#light-switch:checked ~ body::before {
  opacity: 0.2;
}

#light-switch:checked ~ .toggle-btn {
  background: var(--bg-day-elevated);
  border-color: var(--accent-day);
  box-shadow: 0 0 20px rgba(42, 157, 143, 0.3),
              inset 0 0 10px rgba(42, 157, 143, 0.1);
}

/* ============================================
   PAGE STRUCTURE
   ============================================ */

.page-wrapper {
  position: relative;
  z-index: 10;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(1rem, 5vw, 3rem);
  min-height: 100vh;
}

/* ============================================
   NEON GLOW TYPOGRAPHY
   ============================================ */

.site-header {
  text-align: center;
  padding: var(--spacing-xl) 0 var(--spacing-lg);
  position: relative;
}

.neon-heading {
  font-family: 'Nosifer', monospace;
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
  color: #fff;
  text-shadow:
    0 0 5px #fff,
    0 0 10px #fff,
    0 0 20px var(--accent),
    0 0 40px var(--accent),
    0 0 80px var(--accent),
    0 0 120px var(--accent);
  animation: neon-flicker 4s infinite alternate;
  letter-spacing: 0.05em;
}

@keyframes neon-flicker {
  0%, 100% {
    opacity: 1;
    text-shadow:
      0 0 5px #fff,
      0 0 10px #fff,
      0 0 20px var(--accent),
      0 0 40px var(--accent),
      0 0 80px var(--accent),
      0 0 120px var(--accent);
  }
  45% {
    opacity: 0.96;
  }
  50% {
    opacity: 1;
    text-shadow:
      0 0 5px #fff,
      0 0 10px #fff,
      0 0 15px var(--accent),
      0 0 30px var(--accent),
      0 0 60px var(--accent),
      0 0 90px var(--accent);
  }
  55% {
    opacity: 0.98;
  }
}

.tagline {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--text-dim);
  font-style: italic;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  margin-bottom: var(--spacing-md);
}

.header-accent {
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: var(--spacing-md) auto;
  box-shadow: 0 0 10px var(--accent);
}

/* ============================================
   MAIN CONTENT SECTIONS
   ============================================ */

.main-content {
  margin-top: var(--spacing-lg);
}

.intro-text {
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--spacing-xl);
  padding: var(--spacing-md);
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(255, 42, 109, 0.1);
}

.lead {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  line-height: 1.8;
  color: var(--text);
}

.section-title {
  font-family: 'Nosifer', monospace;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--accent-alt);
  text-align: center;
  margin-bottom: var(--spacing-lg);
  text-shadow: 0 0 10px var(--accent-alt);
  letter-spacing: 0.05em;
}

/* ============================================
   CASE FILE INTERACTIONS
   ============================================ */

.case-files {
  margin-bottom: var(--spacing-xl);
}

.case-files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.case-file {
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: var(--spacing-md);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-medium) var(--ease-smooth);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.case-file::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-medium);
  pointer-events: none;
}

.case-file:hover,
.case-file:focus-within {
  transform: translateY(-8px);
  border-color: var(--accent-alt);
  box-shadow: 0 8px 30px rgba(255, 42, 109, 0.4),
              0 0 40px rgba(0, 240, 255, 0.2);
}

.case-file:hover::before,
.case-file:focus-within::before {
  opacity: 0.05;
}

.case-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
  gap: var(--spacing-sm);
}

.case-title {
  font-family: 'Nosifer', monospace;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--accent);
  margin: 0;
  line-height: 1.3;
  flex: 1;
}

.case-number {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 42, 109, 0.1);
  border-radius: 4px;
}

.case-preview {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: var(--spacing-sm);
  font-style: italic;
}

.clue {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height var(--transition-slow) var(--ease-smooth),
              opacity var(--transition-medium) var(--ease-smooth);
  border-top: 1px solid transparent;
  margin-top: var(--spacing-sm);
  padding-top: 0;
}

.case-file:hover .clue,
.case-file:focus-within .clue {
  max-height: 500px;
  opacity: 1;
  border-top-color: var(--accent);
  padding-top: var(--spacing-sm);
}

.clue-label {
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.clue p:not(.clue-label) {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: var(--spacing-sm);
}

.case-status {
  font-size: 0.85rem;
  color: var(--accent-alt);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  background: rgba(0, 240, 255, 0.1);
  border-left: 3px solid var(--accent-alt);
  margin-top: var(--spacing-sm);
}

/* ============================================
   ABOUT SECTION
   ============================================ */

.about-agency {
  max-width: 900px;
  margin: var(--spacing-xl) auto;
  padding: var(--spacing-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(255, 42, 109, 0.15);
}

.about-content p {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  margin-bottom: var(--spacing-md);
  line-height: 1.8;
}

.about-motto {
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  font-style: italic;
  color: var(--accent-alt);
  text-align: center;
  padding: var(--spacing-md);
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  margin-top: var(--spacing-md);
  text-shadow: 0 0 10px var(--accent-alt);
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  text-align: center;
  padding: var(--spacing-lg) 0;
  margin-top: var(--spacing-xl);
  border-top: 1px solid var(--accent);
}

.footer-text {
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: var(--text-dim);
  margin-bottom: var(--spacing-sm);
  letter-spacing: 0.1em;
}

.footer-contact {
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  color: var(--text-dim);
}

.contact-detail {
  color: var(--accent);
  font-weight: 600;
  font-family: monospace;
  font-size: 1.1em;
}

/* ============================================
   RESPONSIVE LAYOUT
   ============================================ */

@media (max-width: 768px) {
  .case-files {
    grid-template-columns: 1fr;
  }

  .toggle-btn {
    width: 50px;
    height: 50px;
    top: 5rem; /* Positioned below mobile nav */
    right: 1rem;
  }

  .toggle-icon {
    font-size: 1.5rem;
  }

  .case-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .case-number {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  .neon-heading {
    font-size: 2rem;
  }

  .case-files {
    gap: var(--spacing-sm);
  }

  .case-file {
    padding: var(--spacing-sm);
  }
}

/* ============================================
   ACCESSIBILITY & FOCUS STATES
   ============================================ */

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.toggle-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 6px;
}

.case-file:focus-visible {
  outline: 2px solid var(--accent-alt);
  outline-offset: 4px;
}

/* Make case files keyboard accessible */
.case-file {
  -webkit-tap-highlight-color: transparent;
}

.case-file:focus {
  outline: none;
}

/* ============================================
   REDUCED MOTION SUPPORT
   ============================================ */

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

  body::before {
    animation: none;
    opacity: 0.3;
  }

  .neon-heading {
    animation: none;
  }

  .case-file:hover,
  .case-file:focus-within {
    transform: none;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  body::before,
  .grain-overlay,
  .toggle-btn {
    display: none;
  }

  .neon-heading {
    text-shadow: none;
    color: #000;
  }

  .case-file .clue {
    max-height: none;
    opacity: 1;
  }
}

/* ============================================
   NAVIGATION SYSTEM
   ============================================ */

.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--accent);
  box-shadow: 0 4px 20px rgba(255, 42, 109, 0.2);
  transition: all var(--transition-medium);
}

#light-switch:checked ~ .page-wrapper .main-nav,
#light-switch:checked ~ .main-nav {
  background: rgba(248, 244, 233, 0.95);
  border-bottom-color: var(--accent-day);
  box-shadow: 0 4px 20px rgba(42, 157, 143, 0.2);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 5vw, 3rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Nosifer', monospace;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent);
  letter-spacing: 0.1em;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-size: clamp(0.9rem, 2vw, 1rem);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-medium);
}

.nav-link:hover,
.nav-link:focus {
  color: var(--accent);
  background: rgba(255, 42, 109, 0.1);
}

.nav-link:hover::after,
.nav-link:focus::after {
  width: 80%;
}

/* ============================================
   SECTION STYLING
   ============================================ */

section {
  padding: var(--spacing-xl) 0;
  scroll-margin-top: 80px;
}

.section-intro {
  text-align: center;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-dim);
  font-style: italic;
  max-width: 800px;
  margin: 0 auto var(--spacing-lg);
}

/* ============================================
   HERO SECTION ENHANCEMENTS
   ============================================ */

.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--spacing-xl) + 80px);
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.hero-description {
  margin-top: var(--spacing-sm);
  line-height: 1.8;
}

.hero-cta {
  margin-top: var(--spacing-md);
  font-size: 1.1rem;
  font-weight: 600;
}

/* Inline contextual links */
.inline-link {
  color: var(--accent);
  text-decoration: none;
  position: relative;
  transition: color var(--transition-fast);
  border-bottom: 1px solid transparent;
}

.inline-link:hover {
  color: var(--accent-alt);
  border-bottom-color: var(--accent-alt);
}

.inline-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-alt));
  transition: width var(--transition-medium);
}

.inline-link:hover::after {
  width: 100%;
}

/* Day mode inline links */
#light-switch:checked ~ .page-wrapper .inline-link {
  color: var(--accent-day);
}

#light-switch:checked ~ .page-wrapper .inline-link:hover {
  color: var(--accent-day-alt);
}

/* ============================================
   IMAGE PLACEHOLDERS
   ============================================ */

.hero-image-placeholder,
.case-image-placeholder,
.evidence-placeholder,
.detective-portrait,
.archive-hero-image,
.archive-evidence-image,
.contact-image-hero {
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-medium);
}

.hero-image-placeholder {
  min-height: 400px;
}

.case-image-placeholder {
  min-height: 200px;
  margin-bottom: var(--spacing-sm);
}

.detective-portrait {
  min-height: 300px;
  aspect-ratio: 1;
}

.placeholder-text,
.portrait-placeholder,
.archive-placeholder,
.contact-placeholder {
  font-family: 'Nosifer', monospace;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--accent);
  text-align: center;
  padding: var(--spacing-md);
  text-shadow: 0 0 10px var(--accent);
}

.evidence-placeholder {
  min-height: 100px;
  margin: var(--spacing-sm) 0;
}

.evidence-placeholder span {
  font-size: 0.9rem;
  color: var(--accent-alt);
}

/* Hover effects for image placeholders */
.hero-image-placeholder:hover,
.case-image-placeholder:hover,
.detective-portrait:hover {
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(255, 42, 109, 0.3);
  border-color: var(--accent-alt);
}

/* ============================================
   CASES SECTION ENHANCEMENTS
   ============================================ */

.cases-section {
  background: linear-gradient(180deg, transparent, rgba(255, 42, 109, 0.02), transparent);
}

.case-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.case-evidence {
  margin-top: var(--spacing-sm);
}

/* ============================================
   ARCHIVE SECTION
   ============================================ */

.archive-section {
  background: var(--bg-elevated);
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
}

.archive-hero-image,
.archive-evidence-image {
  min-height: 300px;
  margin: var(--spacing-lg) auto;
  max-width: 900px;
}

.closed-cases {
  display: grid;
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
}

.closed-case {
  background: var(--bg);
  border: 1px solid var(--accent-alt);
  border-radius: 8px;
  padding: var(--spacing-md);
  position: relative;
  transition: all var(--transition-medium);
}

.closed-case:hover {
  transform: translateX(8px);
  box-shadow: -4px 0 20px rgba(0, 240, 255, 0.3);
}

.closed-stamp {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  font-family: 'Nosifer', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  transform: rotate(15deg);
  box-shadow: 0 4px 10px rgba(255, 42, 109, 0.5);
}

.closed-case-title {
  font-family: 'Nosifer', monospace;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--accent-alt);
  margin-bottom: var(--spacing-xs);
}

.closed-case-number {
  font-size: 0.9rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: var(--spacing-sm);
}

.closed-case-summary {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: var(--spacing-sm);
}

.closed-case-outcome {
  font-size: 0.95rem;
  color: var(--accent-alt);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--accent-alt);
}

/* ============================================
   TEAM SECTION
   ============================================ */

.team-section {
  background: linear-gradient(180deg, transparent, rgba(0, 240, 255, 0.02), transparent);
}

.detectives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.detective-profile {
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: var(--spacing-md);
  text-align: center;
  transition: all var(--transition-medium);
}

.detective-profile:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 30px rgba(255, 42, 109, 0.3);
  border-color: var(--accent-alt);
}

.detective-name {
  font-family: 'Nosifer', monospace;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--accent);
  margin: var(--spacing-sm) 0;
  text-shadow: 0 0 10px var(--accent);
}

.detective-title {
  font-size: 0.9rem;
  color: var(--accent-alt);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-sm);
}

.detective-bio {
  font-size: 0.95rem;
  line-height: 1.7;
  text-align: left;
  margin-bottom: var(--spacing-sm);
}

.detective-specialty {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: left;
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--accent);
}

.team-philosophy {
  max-width: 800px;
  margin: var(--spacing-xl) auto 0;
  text-align: center;
  padding: var(--spacing-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--accent-alt);
  border-radius: 8px;
}

.philosophy-heading {
  font-family: 'Nosifer', monospace;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--accent-alt);
  margin-bottom: var(--spacing-md);
  text-shadow: 0 0 10px var(--accent-alt);
}

.philosophy-quote {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-style: italic;
  line-height: 1.8;
  color: var(--text);
  margin: var(--spacing-md) 0;
  padding: var(--spacing-md);
  border-left: 3px solid var(--accent-alt);
}

.philosophy-author {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: var(--spacing-sm);
}

.philosophy-cta {
  margin-top: var(--spacing-md);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

/* ============================================
   CONTACT SECTION
   ============================================ */

.contact-section {
  background: var(--bg-elevated);
  border-top: 1px solid var(--accent);
}

.contact-image-hero {
  min-height: 300px;
  margin: var(--spacing-lg) auto;
  max-width: 900px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
}

.contact-method {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: var(--spacing-md);
  transition: all var(--transition-medium);
}

.contact-method:hover {
  border-color: var(--accent-alt);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.contact-heading {
  font-family: 'Nosifer', monospace;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  color: var(--accent);
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 0 8px var(--accent);
}

.contact-detail {
  font-size: 1rem;
  margin-bottom: var(--spacing-sm);
}

.contact-info {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.highlight {
  color: var(--accent-alt);
  font-weight: 600;
  font-family: monospace;
  font-size: 1.1em;
}

.contact-disclaimer {
  max-width: 800px;
  margin: var(--spacing-lg) auto 0;
  padding: var(--spacing-md);
  background: rgba(255, 42, 109, 0.05);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============================================
   ENHANCED FOOTER
   ============================================ */

.footer-tagline {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: var(--accent-alt);
  font-style: italic;
  margin: var(--spacing-sm) 0;
  text-shadow: 0 0 8px var(--accent-alt);
}

.footer-copyright {
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  color: var(--text-dim);
  margin-top: var(--spacing-sm);
}

/* ============================================
   ENHANCED RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .nav-menu {
    gap: 0.5rem;
  }

  .nav-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }

  .hero-content {
    grid-template-columns: 1fr;
  }

  .case-files-grid {
    grid-template-columns: 1fr;
  }

  .detectives-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .detective-bio,
  .detective-specialty {
    text-align: center;
  }

  section {
    padding: var(--spacing-md) 0;
  }
}

@media (max-width: 480px) {
  .nav-container {
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-link {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }

  .closed-stamp {
    position: static;
    transform: none;
    display: inline-block;
    margin-bottom: var(--spacing-sm);
  }
}

/* ============================================
   ADVANCED CSS-ONLY FEATURES
   ============================================ */

/* ====== 1. TYPEWRITER EFFECT ====== */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--neon-pink);
  white-space: nowrap;
  letter-spacing: 0.05em;
  display: inline-block;
  width: 0;
  animation:
    typing 3.5s steps(31, end) 0.5s 1 normal forwards,
    blink-cursor 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 34ch; }
}

@keyframes blink-cursor {
  from, to { border-color: transparent; }
  50% { border-color: var(--neon-pink); }
}

/* ====== 2. GLITCH EFFECT ON CASE TITLES ====== */
.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.case-file:hover .glitch::before {
  animation: glitch-1 0.3s infinite;
  color: var(--neon-cyan);
  z-index: -1;
  opacity: 0.8;
}

.case-file:hover .glitch::after {
  animation: glitch-2 0.3s infinite;
  color: var(--neon-pink);
  z-index: -2;
  opacity: 0.8;
}

@keyframes glitch-1 {
  0% { transform: translate(0); clip-path: inset(40% 0 40% 0); }
  20% { transform: translate(-2px, 2px); clip-path: inset(20% 0 60% 0); }
  40% { transform: translate(-2px, -2px); clip-path: inset(60% 0 20% 0); }
  60% { transform: translate(2px, 2px); clip-path: inset(10% 0 70% 0); }
  80% { transform: translate(2px, -2px); clip-path: inset(70% 0 10% 0); }
  100% { transform: translate(0); clip-path: inset(40% 0 40% 0); }
}

@keyframes glitch-2 {
  0% { transform: translate(0); clip-path: inset(20% 0 60% 0); }
  20% { transform: translate(2px, -2px); clip-path: inset(60% 0 20% 0); }
  40% { transform: translate(2px, 2px); clip-path: inset(10% 0 70% 0); }
  60% { transform: translate(-2px, -2px); clip-path: inset(70% 0 10% 0); }
  80% { transform: translate(-2px, 2px); clip-path: inset(40% 0 40% 0); }
  100% { transform: translate(0); clip-path: inset(20% 0 60% 0); }
}

/* ====== 3. CSS-ONLY IMAGE CAROUSEL ====== */
.carousel-control {
  display: none;
}

.evidence-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.carousel-slides {
  display: flex;
  width: 200%;
  transition: transform 0.6s var(--ease-smooth);
}

.carousel-slide {
  width: 50%;
  flex-shrink: 0;
}

.case-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Carousel Navigation Dots */
.carousel-nav {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: all var(--transition-medium);
}

.carousel-dot:hover {
  background: rgba(255, 42, 109, 0.5);
  transform: scale(1.2);
}

/* Carousel Slide Control Logic */
#case1-slide1:checked ~ .evidence-carousel .carousel-slides,
#case2-slide1:checked ~ .evidence-carousel .carousel-slides,
#case3-slide1:checked ~ .evidence-carousel .carousel-slides,
#case4-slide1:checked ~ .evidence-carousel .carousel-slides {
  transform: translateX(0%);
}

#case1-slide2:checked ~ .evidence-carousel .carousel-slides,
#case2-slide2:checked ~ .evidence-carousel .carousel-slides,
#case3-slide2:checked ~ .evidence-carousel .carousel-slides,
#case4-slide2:checked ~ .evidence-carousel .carousel-slides {
  transform: translateX(-50%);
}

/* Active Dot Highlighting */
#case1-slide1:checked ~ .evidence-carousel .carousel-nav .carousel-dot:nth-child(1),
#case2-slide1:checked ~ .evidence-carousel .carousel-nav .carousel-dot:nth-child(1),
#case3-slide1:checked ~ .evidence-carousel .carousel-nav .carousel-dot:nth-child(1),
#case4-slide1:checked ~ .evidence-carousel .carousel-nav .carousel-dot:nth-child(1),
#case1-slide2:checked ~ .evidence-carousel .carousel-nav .carousel-dot:nth-child(2),
#case2-slide2:checked ~ .evidence-carousel .carousel-nav .carousel-dot:nth-child(2),
#case3-slide2:checked ~ .evidence-carousel .carousel-nav .carousel-dot:nth-child(2),
#case4-slide2:checked ~ .evidence-carousel .carousel-nav .carousel-dot:nth-child(2) {
  background: var(--accent);
  box-shadow: 0 0 15px var(--accent);
  transform: scale(1.3);
}

/* ====== 4. 3D FLIP CARDS FOR DETECTIVE PROFILES ====== */
.detective-card {
  perspective: 1000px;
  width: 100%;
  height: 500px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.detective-card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px;
  padding: var(--spacing-md);
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  box-shadow: 0 4px 20px rgba(255, 42, 109, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.card-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg) 100%);
}

.portrait-image {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 20px var(--accent);
  margin-bottom: var(--spacing-md);
}

.flip-hint {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
  animation: pulse-hint 2s ease-in-out infinite;
}

@keyframes pulse-hint {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.achievements-list {
  list-style: none;
  text-align: left;
  margin: var(--spacing-md) 0;
  width: 100%;
}

.achievements-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 42, 109, 0.2);
  font-size: 0.9rem;
}

.achievements-list li:last-child {
  border-bottom: none;
}

.specialty-badge {
  margin-top: auto;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ====== 5. PULSING STATUS INDICATORS ====== */
.status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.5rem;
  animation: pulse-status 2s ease-in-out infinite;
}

.status-active {
  background: #ffcc00;
  box-shadow: 0 0 10px #ffcc00;
}

.status-following {
  background: #00ccff;
  box-shadow: 0 0 10px #00ccff;
}

.status-urgent {
  background: #ff2a6d;
  box-shadow: 0 0 10px #ff2a6d;
}

@keyframes pulse-status {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

/* ====== 6. ANIMATED STATISTICS BAR ====== */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md);
  background: rgba(255, 42, 109, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 42, 109, 0.2);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: reveal-stat 0.8s ease-out backwards;
}

.stat-item:nth-child(1) { animation-delay: 0.2s; }
.stat-item:nth-child(2) { animation-delay: 0.4s; }
.stat-item:nth-child(3) { animation-delay: 0.6s; }

.stat-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 15px var(--accent);
  font-family: 'Nosifer', monospace;
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@keyframes reveal-stat {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====== 7. ANIMATED NEON BORDERS (Case Files) ====== */
.case-file {
  position: relative;
  overflow: visible;
}

.case-file::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg,
    var(--neon-pink),
    var(--neon-cyan),
    var(--neon-purple),
    var(--neon-pink)
  );
  background-size: 300% 300%;
  border-radius: 8px;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-medium);
  animation: neon-rotate 4s linear infinite;
}

.case-file:hover::before {
  opacity: 0.6;
}

@keyframes neon-rotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ====== 8. PARALLAX EFFECT (Hero Section) ====== */
.hero-section {
  position: relative;
  overflow: hidden;
}

.hero-image-placeholder {
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  transition: transform 0.3s ease-out;
}

/* ====== 9. SMOOTH REVEAL ANIMATIONS ====== */
.section-title,
.section-intro,
.case-file,
.detective-card,
.closed-case {
  animation: fade-in-up 0.8s ease-out backwards;
}

.case-file:nth-child(1) { animation-delay: 0.1s; }
.case-file:nth-child(2) { animation-delay: 0.2s; }
.case-file:nth-child(3) { animation-delay: 0.3s; }
.case-file:nth-child(4) { animation-delay: 0.4s; }

.detective-card:nth-child(1) { animation-delay: 0.1s; }
.detective-card:nth-child(2) { animation-delay: 0.3s; }
.detective-card:nth-child(3) { animation-delay: 0.5s; }

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====== 10. ENHANCED TRANSITIONS & POLISH ====== */
.case-title,
.detective-name,
.nav-link {
  transition: all var(--transition-medium) var(--ease-smooth);
}

.case-file:hover .case-title {
  color: var(--accent);
  transform: translateX(5px);
}

/* Smooth Image Loading */
.case-image,
.portrait-image {
  opacity: 0;
  animation: fade-in 0.6s ease-out forwards;
}

@keyframes fade-in {
  to { opacity: 1; }
}

/* Day Mode Adjustments for New Elements */
#light-switch:checked ~ .page-wrapper .stats-bar {
  background: rgba(42, 157, 143, 0.05);
  border-color: rgba(42, 157, 143, 0.2);
}

#light-switch:checked ~ .page-wrapper .stat-number {
  color: var(--accent-day);
  text-shadow: 0 0 15px var(--accent-day);
}

#light-switch:checked ~ .page-wrapper .status-indicator {
  filter: brightness(0.8);
}

#light-switch:checked ~ .page-wrapper .specialty-badge {
  background: var(--accent-day);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .stats-bar {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .stat-number {
    font-size: 2rem;
  }

  .detective-card {
    height: 450px;
  }

  .portrait-image {
    width: 150px;
    height: 150px;
  }

  .typewriter {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
  }

  .carousel-dot {
    width: 10px;
    height: 10px;
  }

  .achievements-list li {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .detective-card {
    height: 400px;
  }

  .card-front,
  .card-back {
    padding: var(--spacing-sm);
  }

  .achievements-list {
    font-size: 0.75rem;
  }

  .specialty-badge {
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .typewriter,
  .glitch::before,
  .glitch::after,
  .carousel-slides,
  .card-inner,
  .stat-item,
  .case-file,
  .detective-card {
    animation: none !important;
    transition: none !important;
  }

  .detective-card:hover .card-inner {
    transform: none;
  }
}
