/* ======================================================
   🧠 Cortical Analysis Lab — Global Website Stylesheet
   ====================================================== */

/* --- Color Palette --- */
:root {
  --red: #B30838;          /* Sacred Heart red */
  --offwhite: #faf7f5;     /* Soft off-white background */
  --text: #222;            /* Main text */
  --gray: #555;            /* Secondary text */
}

/* --- Base Styles --- */
* {
  box-sizing: border-box;
  scroll-behavior: smooth;
  margin: 0;
  padding: 0;
}

/* =====================================================
   🌟 BODY + BACKGROUND WATERMARK
   ===================================================== */

body {
  font-family: "Inter", sans-serif;
  color: var(--text);
  line-height: 1.6;
  padding-top: 80px;
  background-color: var(--offwhite);
  position: relative;
  overflow-x: hidden;
}

/* Background image — desktop version (clean + balanced) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("../assets/Lab%20Website%20Background.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: 0.45;    /* Balanced clarity */
  pointer-events: none;
  z-index: -2;
}

/* Soft veil — DESKTOP ONLY */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.12); /* subtle, not color-shifting */
  backdrop-filter: blur(1.5px);
  z-index: -1;
}

/* =====================================================
   🧭 NAVIGATION BAR
   ===================================================== */

nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(250, 247, 245, 0.9);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  z-index: 1000;
  transition: box-shadow 0.3s ease, background 0.3s ease;
  animation: fadeInNav 0.5s ease forwards;
}

nav.scrolled {
  background: rgba(250, 247, 245, 0.97);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

nav .logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--red) !important;
  text-decoration: none;
}

/* Links */
nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav ul li a {
  color: var(--text) !important;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: var(--red) !important;
}

nav ul li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.3s ease;
}

nav ul li a:hover::after {
  width: 100%;
}

/* Mobile nav button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--red);
  font-size: 1.8rem;
  cursor: pointer;
}

/* =====================================================
   📱 MOBILE FIX — REMOVE TINT & RESTORE TRUE COLORS
   ===================================================== */

@media (max-width: 768px) {

  /* Adjust nav to prevent color shifting */
  nav {
    background: rgba(250, 247, 245, 0.97);
  }

  /* Mobile menu */
  nav ul {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    background: rgba(250, 247, 245, 0.97);
    position: absolute;
    top: 60px;
    right: 0;
    padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }

  nav ul.show {
    display: flex;
  }

  .menu-toggle {
    display: block;
    color: var(--red) !important;
  }

  /* --- CRITICAL FIXES FOR MOBILE COLOR DISTORTION --- */

  /* Reduce background image dominance on mobile */
  body::before {
    opacity: 0.32 !important; /* prevents color washout */
  }

  /* REMOVE white veil entirely — this stops pink/green tint */
  body::after {
    display: none !important;
  }
}

/* =====================================================
   🧠 HEADER
   ===================================================== */

header {
  text-align: center;
  padding: 10rem 2rem 6rem;
}

header h1 {
  color: var(--red);
  font-size: clamp(2rem, 5vw, 3rem);
}

header p {
  max-width: 700px;
  margin: auto;
  font-size: 1.1rem;
  color: var(--gray);
}

/* =====================================================
   📄 CONTENT SECTIONS
   ===================================================== */

section {
  max-width: 900px;
  margin: 4rem auto;
  padding: 0 2rem;
}

/* =====================================================
   🧩 CARDS
   ===================================================== */

.card,
.person-card,
details {
  background: rgba(255, 255, 255, 0);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

/* =====================================================
   👤 PROFILE IMAGE
   ===================================================== */

.person-card img {
  width: 440px;
  height: 440px;
  border-radius: 50%;
  border: 4px solid var(--red);
  object-fit: cover;
  object-position: 60% 25%;
  transform: translateZ(0);
}

@media (min-width: 769px) {
  .person-card img {
    image-rendering: crisp-edges;
  }
}

.card:hover,
.person-card:hover,
details:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

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

footer {
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(2px);
  padding: 2rem;
  text-align: center;
  color: var(--gray);
  font-size: 0.9rem;
}

/* =====================================================
   BUTTONS
   ===================================================== */

button,
a.button {
  background: var(--red);
  color: white;
  border-radius: 8px;
  padding: 0.8rem 1.6rem;
  font-weight: 600;
}

button:hover,
a.button:hover {
  background: #a61c1c;
  transform: translateY(-2px);
}

/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes fadeInNav {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
