/* ===== Custom Styles (complement Tailwind CDN) ===== */

html {
  scroll-behavior: smooth;
}

body {
  background-color: #ffffff;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html.dark body {
  background-color: #050505;
}

/* Film Grain Texture Overlay */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  opacity: 0.03;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.03),
      rgba(0, 0, 0, 0.03) 1px,
      transparent 1px,
      transparent 2px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.02),
      rgba(0, 0, 0, 0.02) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: multiply;
}

html.dark .grain-overlay {
  opacity: 0.04;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.04),
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 2px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.03),
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: screen;
}

/* Glass Card */
.glass-card {
  background: rgba(0, 0, 0, 0.02);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: background 0.3s ease, border-color 0.3s ease;
}

html.dark .glass-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Radial Glow Backgrounds */
.radial-glow-hero {
  background: radial-gradient(circle at 50% 50%, rgba(60, 131, 246, 0.08) 0%, transparent 70%);
}

html.dark .radial-glow-hero {
  background: radial-gradient(circle at 50% 50%, rgba(60, 131, 246, 0.15) 0%, transparent 70%);
}

.radial-glow-section {
  background: radial-gradient(circle at 50% 0%, rgba(60, 131, 246, 0.04) 0%, transparent 60%);
}

html.dark .radial-glow-section {
  background: radial-gradient(circle at 50% 0%, rgba(60, 131, 246, 0.08) 0%, transparent 60%);
}

/* Hero Fade-Up Animation */
.animate-fade-up {
  animation: fadeUp 0.9s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Reveal Animation */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Screen reader only */
.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;
}

/* No underline on anchor buttons */
a.no-underline {
  text-decoration: none;
}

/* Sub-page content panel */
.text-panel {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 28px 32px;
  text-align: left;
  color: #4b5563;
  line-height: 1.8;
  max-width: 720px;
  margin: 0 auto;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

html.dark .text-panel {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: #9aa4b2;
}

.text-panel p {
  margin: 0 0 16px;
}

.text-panel p:last-child {
  margin-bottom: 0;
}

/* Sub-page hero */
.subpage-hero {
  padding-top: 140px;
  padding-bottom: 48px;
  text-align: center;
}

.subpage-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #111827;
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

html.dark .subpage-hero h1 {
  color: #fff;
}

.subpage-hero p {
  color: #6b7280;
  font-size: clamp(1rem, 2vw, 1.15rem);
  max-width: 600px;
  margin: 0 auto;
  transition: color 0.3s ease;
}

html.dark .subpage-hero p {
  color: #9aa4b2;
}

/* Smooth transitions for nav & footer */
nav, footer {
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Form status tones */
#form-status[data-tone="success"] {
  color: #22c55e;
}

#form-status[data-tone="error"] {
  color: #ef4444;
}

#form-status[data-tone="info"] {
  color: rgba(60, 131, 246, 0.8);
}
