/* =============================================
   CSS VARIABLES – Light Mode
   ============================================= */
:root {
  --primary: #8B0000;
  --primary-dark: #5C0000;
  --primary-light: #b71c1c;
  --accent: #f8cd30;
  --text-dark: #1a1a1a;
  --text-light: #f0f0f0;
  --text-muted: #666;              /* Light mode muted text */
  --bg-light: #ffffff;
  --bg-offwhite: #f9fafb;
  --bg-dark: #0f0f0f;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --radius: 1rem;
  --transition: 0.3s ease;
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Navbar specific */
  --nav-bg: rgba(255, 255, 255, 0.7);
  --nav-text: #1a1a1a;
  --nav-hover: var(--primary);
}

/* =============================================
   DARK MODE
   ============================================= */
[data-theme="dark"] {
  --text-dark: #f0f0f0;
  --text-light: #cccccc;
  --text-muted: #aaaaaa;          /* improved readability in dark */
  --bg-light: #111111;
  --bg-offwhite: #1a1a1a;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.1);
  --nav-bg: rgba(10, 10, 10, 0.7);
  --nav-text: #f0f0f0;
  --nav-hover: var(--primary-light);
}

/* =============================================
   RESET & GLOBAL
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg-offwhite);
  overflow-x: hidden;
  transition: background 0.4s, color 0.4s;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== NEW: Focus styles for accessibility ===== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ===== NEW: Skip link ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 10000;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  transition: top 0.3s;
}
.skip-link:focus {
  top: 0;
}

/* ===== NEW: Screen reader only ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* =============================================
   HEADER / NAVBAR (Glassmorphism)
   ============================================= */
.premium-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: background 0.4s;
}

.navbar-glass {
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.8rem 0;
  transition: background 0.3s;
}

.navbar-brand .brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  object-fit: cover;
}

.brand-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--nav-text);
  letter-spacing: -0.5px;
}

.nav-premium {
  font-weight: 600;
  color: var(--nav-text) !important;
  padding: 0.6rem 1rem !important;
  border-radius: 12px;
  transition: all 0.3s;
  font-size: 0.95rem;
}

.nav-premium:hover,
.nav-premium.active {
  background: rgba(139,0,0,0.08);
  color: var(--nav-hover) !important;
}

.nav-separator {
  width: 1px;
  height: 28px;
  background: var(--glass-border);
  margin: 0 1rem;
}

/* Dark mode toggle button in header */
.theme-toggle-header {
  background: none;
  border: none;
  color: var(--nav-text);
  font-size: 1.4rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.3s;
  cursor: pointer;
  position: relative;
}

.theme-toggle-header:hover {
  background: rgba(139,0,0,0.1);
  transform: rotate(15deg);
}

.theme-toggle-header .sun-icon,
.theme-toggle-header .moon-icon {
  position: absolute;
  transition: opacity 0.3s, transform 0.3s;
}

[data-theme="light"] .theme-toggle-header .sun-icon {
  opacity: 0;
  transform: scale(0) rotate(180deg);
}

[data-theme="light"] .theme-toggle-header .moon-icon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

[data-theme="dark"] .theme-toggle-header .sun-icon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

[data-theme="dark"] .theme-toggle-header .moon-icon {
  opacity: 0;
  transform: scale(0) rotate(-180deg);
}

.nav-cta {
  background: var(--primary);
  color: white !important;
  border-radius: 30px;
  padding: 0.5rem 1.5rem !important;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
}

.nav-cta:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Toggler for mobile */
.navbar-toggler {
  border: none;
  box-shadow: none;
}

.navbar-toggler:focus {
  box-shadow: none;
}

/* =============================================
   HERO SECTION
   ============================================= */
.premium-hero {
  position: relative;
  height: 100vh;
  min-height: 650px;
  overflow: hidden;
  background: #000;
}

.hero-slideshow-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  z-index: 2;
}

.hero-slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.2) 60%,
    rgba(0,0,0,0.5) 100%
  );
  z-index: 3;
  pointer-events: none;
}

.hero-slide-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-slide-video-wrapper {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;

  background:
    radial-gradient(circle at center,
      rgba(255,255,255,0.06),
      transparent 60%),
    linear-gradient(
      to right,
      #0f0a05 0%,
      #1a120b 20%,
      #2a1b0f 50%,
      #1a120b 80%
      #0f0a05 100%
    );
}

.hero-slide-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  top: 0;
  left: 0;
}

/* Volume button */
.hero-sound-toggle {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  z-index: 50;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.3rem;
  transition: all var(--transition);
  pointer-events: auto;
  border: none;
  outline: none;
}

.hero-sound-toggle:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.1);
}

/* Hero content */
.hero-content-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.hero-text-block {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease 0.3s;
  pointer-events: none;
}

.hero-text-block.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hero-text-inner {
  max-width: 700px;
  color: white;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.1;
  /* Now a div, so styling remains same */
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  font-weight: 400;
}

.hero-cta-group .btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  background: white;
  color: var(--primary);
  border: none;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  pointer-events: auto;
}

.hero-cta-group .btn-hero:hover {
  background: var(--accent);
  color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* Navigation dots */
.hero-dots-container {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
}

.hero-nav-dots {
  display: flex;
  gap: 12px;
}

.hero-nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: 2px solid rgba(255,255,255,0.8);
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}

.hero-nav-dot.active {
  background: white;
  border-color: white;
  transform: scale(1.3);
}

/* Fallback static hero */
.hero-static-fallback {
  position: relative;
  height: 100vh;
  min-height: 650px;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.hero-static-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.2);
}

.hero-static-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.hero-static-title {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

.hero-static-subtitle {
  font-size: 1.3rem;
  margin-bottom: 2rem;
}

.hero-static-cta .btn {
  margin: 0.5rem;
}

/* =============================================
   PREMIUM SECTIONS
   ============================================= */
.premium-section {
  padding: 6rem 0;
  transition: background 0.4s;
}

.bg-secondary {
  background: var(--bg-offwhite);
}

/* Section header */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  background: rgba(139,0,0,0.1);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0.4rem 1.2rem;
  border-radius: 30px;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.15rem;
  max-width: 650px;
  margin: 0 auto;
  color: var(--text-muted);   /* now uses variable */
}

/* =============================================
   CARDS GRID
   ============================================= */
.categories-grid,
.portfolio-grid,
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  justify-items: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

/* Card base */
.category-card,
.team-card,
.feature-card,
.portfolio-card,
.review-card {
  background: var(--bg-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.category-card:hover,
.team-card:hover,
.feature-card:hover,
.portfolio-card:hover,
.review-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

/* Category card */
.category-card-header {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.category-card-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.category-card:hover .category-card-header img {
  transform: scale(1.05);
}

.category-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--primary);
  background: rgba(139,0,0,0.05);
}

.category-card-body {
  padding: 1.8rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.category-title {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  color: var(--text-dark);
}

.category-description {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex: 1;
}

.category-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 600;
  transition: gap 0.3s ease;
  margin-top: auto;
}

.category-link:hover {
  gap: 0.8rem;
  color: var(--primary-dark);
}

/* ===== TEAM CARD - FIX: Faces always visible ===== */
.team-card-img {
  position: relative;
  aspect-ratio: 3 / 4;          /* portrait orientation */
  overflow: hidden;
  background: #f2f2f2;          /* fallback */
}

.team-card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;  /* focus on upper part (face) */
  transition: transform 0.4s ease;
}

.team-card:hover .team-card-img img {
  transform: scale(1.05);
}

.team-card-body {
  padding: 1.5rem;
  text-align: center;
}

.team-name {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
  color: var(--text-dark);
}

.team-role {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.8rem;
}

.team-bio {
  color: var(--text-muted);    /* readable in both modes */
  font-size: 0.95rem;
}

/* Feature card */
.feature-card {
  padding: 2.5rem 2rem;
  text-align: center;
  background: var(--bg-light);
}

.feature-icon-wrapper {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1.2rem;
}

.feature-title {
  font-size: 1.25rem;
  margin-bottom: 0.8rem;
  color: var(--text-dark);
}

.feature-description {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Portfolio card */
.portfolio-card-img-wrap {
  position: relative;
  overflow: hidden;
  height: 240px;
}

.portfolio-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-card:hover .portfolio-card-img-wrap img {
  transform: scale(1.08);
}

.portfolio-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(139,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-card:hover .portfolio-card-overlay {
  opacity: 1;
}

.portfolio-card-overlay .btn {
  background: white;
  color: var(--primary);
  font-weight: 600;
  border-radius: 30px;
  padding: 0.6rem 1.5rem;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portfolio-card-overlay .btn:hover {
  background: var(--accent);
  color: #000;
}

.portfolio-card-body {
  padding: 1.5rem;
}

.portfolio-category {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  font-weight: 600;
}

.portfolio-title {
  margin-top: 0.3rem;
  font-size: 1.2rem;
  color: var(--text-dark);
}

/* Review card */
.review-card {
  padding: 2rem;
}

.review-stars i {
  color: #f8cd30;
  font-size: 1.2rem;
  margin-right: 2px;
}

.review-text {
  font-style: italic;
  color: var(--text-muted);    /* dynamic color for dark mode */
  margin: 1rem 0;
  flex: 1;
  font-size: 1rem;
  line-height: 1.7;
  position: relative;
}

.review-text::before {
  content: open-quote;
  font-size: 3rem;
  color: var(--primary);
  opacity: 0.2;
  position: absolute;
  left: -0.5rem;
  top: -1rem;
}

.reviewer-info {
  border-top: 1px solid #eee;
  padding-top: 1rem;
  margin-top: 1rem;
}

[data-theme="dark"] .reviewer-info {
  border-top-color: #333;
}

.reviewer-name {
  font-weight: 700;
  color: var(--text-dark);
  display: block;
}

.reviewer-position {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 0.75rem 1.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(139,0,0,0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(139,0,0,0.4);
  transform: translateY(-2px);
}

.btn-outline-light {
  border: 2px solid white;
  color: white;
  background: transparent;
  border-radius: 30px;
  padding: 0.65rem 1.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-outline-light:hover {
  background: white;
  color: var(--primary);
}

/* =============================================
   3D SCROLL ANIMATION (with reduced motion respect)
   ============================================= */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===== NEW: Respect user motion preferences ===== */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal,
  .scroll-reveal.revealed,
  .hero-text-block,
  .hero-text-block.active,
  .category-card:hover,
  .team-card:hover,
  .feature-card:hover,
  .portfolio-card:hover,
  .review-card:hover,
  .hero-sound-toggle:hover,
  .btn-primary:hover,
  .btn-outline-light:hover,
  .nav-cta:hover,
  .category-link:hover,
  .portfolio-card-overlay,
  .category-card-header img,
  .team-card-img img,
  .portfolio-card-img-wrap img {
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  .hero-sound-toggle {
    transition: none;
  }
}

/* =============================================
   GLASS PANEL ENHANCEMENT
   ============================================= */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  /* subtle inner highlight */
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.15), var(--glass-shadow);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 992px) {
  .hero-title, .hero-static-title {
    font-size: 2.5rem;
  }
  .section-title {
    font-size: 2.2rem;
  }
  .container {
    padding: 0 1.5rem;
  }
}

@media (max-width: 768px) {
  .hero-title, .hero-static-title {
    font-size: 2rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .premium-section {
    padding: 4rem 0;
  }
  .section-title {
    font-size: 1.8rem;
  }
  .hero-sound-toggle {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  .team-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-separator {
    display: none;
  }
  .navbar-collapse {
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    padding: 1rem;
    border-radius: 0 0 20px 20px;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 1rem;
  }
  .hero-text-inner {
    text-align: center;
  }
  .hero-cta-group .btn-hero {
    width: 100%;
    justify-content: center;
  }
  .hero-static-cta .btn {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
    text-align: center;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .portfolio-grid,
  .categories-grid,
  .reviews-grid {
    grid-template-columns: 1fr;
  }
}