/* HWSec-CSIC — Estilo Visual Premium (Refined Tech & Readability)
   Actualizado: Menú móvil compacto (no pantalla completa) y ajustes previos.
*/

:root {
  /* Paleta de colores (Modo Claro) */
  --bg: #fbfbfd;
  --bg-alt: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #86868b;
  --accent: #0f4c81; 
  --accent-hover: #00325a;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(0, 0, 0, 0.05);
  --solid-content-bg: #ffffff; /* Fondo sólido para lectura perfecta */
  
  /* Sombras y Bordes */
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.08);
  
  /* Malla y Atmósfera (AJUSTADO: Más suave y pálido) */
  --grid-color: rgba(0, 0, 0, 0.025); /* Malla muy sutil */
  --spot-1: rgba(0, 102, 204, 0.09);  /* Azul suave (9%) */
  --spot-2: rgba(88, 86, 214, 0.09);  /* Violeta suave (9%) */
  --spot-3: rgba(0, 180, 216, 0.07);  /* Cian muy suave (7%) */
  
  /* Layout */
  --container: 1080px;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Variables Modo Oscuro */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050505;
    --bg-alt: #1c1c1e;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --accent: #a0c9ff; 
    --accent-hover: #d2e4ff;
    --card-bg: rgba(28, 28, 30, 0.8);
    --card-border: rgba(255, 255, 255, 0.1);
    --solid-content-bg: #1c1c1e; /* Fondo sólido oscuro */
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.5);
    
    /* Ajustes Fondo Oscuro */
    --grid-color: rgba(255, 255, 255, 0.03);
    --spot-1: rgba(41, 151, 255, 0.12);
    --spot-2: rgba(94, 92, 230, 0.12);
    --spot-3: rgba(41, 151, 255, 0.08);
  }
}

body.theme-light {
  --bg: #fbfbfd;
  --bg-alt: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #86868b;
  --accent: #0066cc;
  --accent-hover: #0077ed;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(0, 0, 0, 0.05);
  --solid-content-bg: #ffffff;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.08);
  --grid-color: rgba(0, 0, 0, 0.025);
  --spot-1: rgba(0, 102, 204, 0.09);
  --spot-2: rgba(88, 86, 214, 0.09);
  --spot-3: rgba(0, 180, 216, 0.07);
  color-scheme: light;
}

body.dark-theme {
  --bg: #050505;
  --bg-alt: #1c1c1e;
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --accent: #2997ff;
  --accent-hover: #47a6ff;
  --card-bg: rgba(28, 28, 30, 0.8);
  --card-border: rgba(255, 255, 255, 0.1);
  --solid-content-bg: #1c1c1e;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.5);
  --grid-color: rgba(255, 255, 255, 0.03);
  --spot-1: rgba(41, 151, 255, 0.12);
  --spot-2: rgba(94, 92, 230, 0.12);
  --spot-3: rgba(41, 151, 255, 0.08);
  color-scheme: dark;
}

/* =========================================
   Base & Reset
   ========================================= */
* { box-sizing: border-box; }

html { 
  scroll-behavior: smooth; 
}

body {
  margin: 0;
  font-family: var(--font-stack);
  font-size: 17px;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  background-color: var(--bg);
  
  /* --- FONDO DINÁMICO (Malla + Atmósfera) --- */
  background-image: 
    /* Malla (Grid) */
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px),
    /* Luces de Atmósfera */
    radial-gradient(at 0% 0%, var(--spot-1) 0px, transparent 60%),
    radial-gradient(at 100% 0%, var(--spot-2) 0px, transparent 60%),
    radial-gradient(at 50% 100%, var(--spot-3) 0px, transparent 60%);

  /* Parallax: La malla se mueve (scroll), las luces flotan (fixed) */
  background-attachment: scroll, scroll, fixed, fixed, fixed;
  
  background-size: 
    40px 40px, /* Tamaño celda malla */
    40px 40px, 
    100% 100%, 
    100% 100%,
    100% 100%;

  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

::selection {
  background: var(--accent);
  color: #fff;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
/* a:hover { color: var(--accent); } */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--ink-2); border-radius: 5px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink); }

/* =========================================
   Header & Navegación
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--card-border);
  transition: transform 0.3s ease;
}

.site-header.hidden { transform: translateY(-100%); }

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}

.brand { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  font-weight: 600; 
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.brand img { border-radius: 6px; }

.site-nav {
  margin-left: auto;
}

.site-nav ul { 
  list-style: none; 
  display: flex; 
  gap: 28px; 
  margin: 0; 
  padding: 0; 
}
.site-nav a { 
  font-size: 14px; 
  color: var(--ink-2); 
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}
.site-nav a:hover, .site-nav a.active { 
  color: var(--ink); 
}
.site-nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--ink);
  transition: width 0.3s ease;
}
.site-nav a:hover::after { width: 100%; }

.theme-toggle,
.menu-toggle {
  display: none;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 18px;
}

.theme-toggle:hover {
  background: var(--card-bg);
  transform: translateY(-1px);
}

.theme-toggle-icon {
  line-height: 1;
}

.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;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  padding: 0;
}

/* Mobile navigation: show toggle on small screens */
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:8px; background: transparent; border: 1px solid var(--card-border); margin-left:8px; }
  .site-nav {
    display: none !important;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--card-border);
    padding: 0 16px;
    box-shadow: var(--shadow-sm);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
    transition: max-height 280ms cubic-bezier(.2,.9,.2,1), opacity 200ms ease, transform 280ms cubic-bezier(.2,.9,.2,1), visibility 0s linear 280ms, padding 280ms cubic-bezier(.2,.9,.2,1);
  }
  .site-nav.open {
    display: flex !important;
    max-height: 320px;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    padding: 12px 16px;
    transition: max-height 320ms cubic-bezier(.2,.9,.2,1), opacity 220ms ease, transform 320ms cubic-bezier(.2,.9,.2,1), visibility 0s, padding 320ms cubic-bezier(.2,.9,.2,1);
  }
  .site-nav ul { flex-direction: column; gap: 8px; }
}

/* Burger -> X animation */
.burger { display:inline-block; width:20px; height:16px; position:relative; }
.burger .bar { display:block; position:absolute; left:0; right:0; height:2px; background: currentColor; border-radius:2px; transition: transform 260ms cubic-bezier(.2,.9,.2,1), opacity 160ms ease; }
.burger .bar1 { top:0; }
.burger .bar2 { top:50%; transform: translateY(-50%); }
.burger .bar3 { bottom:0; }
.menu-toggle.open .bar1 { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open .bar2 { opacity: 0; transform: scaleX(0.2); }
.menu-toggle.open .bar3 { transform: translateY(-7px) rotate(-45deg); }

/* =========================================
   Hero Section
   ========================================= */
.hero {
  position: relative;
  background: #000;
  color: #fff;
  overflow: hidden;
  padding: 140px 0 100px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../assets/images/bg-1600.png");
  background-size: cover;
  background-position: center;
  opacity: 0.5;
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(10px) scale(0.995); transition: opacity 480ms cubic-bezier(.2,.9,.2,1), transform 480ms cubic-bezier(.2,.9,.2,1); will-change: opacity, transform; }
.reveal.revealed { opacity: 1; transform: translateY(0) scale(1); }

/* Buttons polish */
.btn { transition: transform 180ms cubic-bezier(.2,.9,.2,1), box-shadow 180ms ease, background-color 180ms ease; }
.btn:active { transform: translateY(1px) scale(0.997); }
.btn.primary { box-shadow: 0 6px 18px rgba(16,124,255,0.12); }
.btn.ghost { background: transparent; border: 1px solid var(--card-border); }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal, .btn, .site-nav { transition: none !important; }
}

.hero-inner {
  position: relative;
  text-align: center;
  z-index: 2;
}

.headline {
  margin: 0 auto 24px;
  max-width: 920px;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, #a1c4fd 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subhead {
  margin: 0 auto 48px;
  max-width: 720px;
  color: rgba(255,255,255,0.85);
  font-size: clamp(20px, 2.5vw, 24px);
  line-height: 1.4;
  font-weight: 400;
}

.kicker {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.cta { display: flex; gap: 16px; justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 980px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  text-align: center;
}
.btn.primary {
  background: var(--accent);
  color: white;
  border: 1px solid transparent;
}
.btn.primary:hover {
  background: var(--accent-hover);
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 102, 204, 0.4);
}
.btn:not(.primary) {
  background: rgba(255,255,255,0.15);
  color: white;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn:not(.primary):hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.03);
}

/* =========================================
   Secciones Generales
   ========================================= */
.section { padding: 60px 0; }

.section-title {
  font-size: 42px;
  font-weight: 600;
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}
.section-subtitle {
  font-size: 24px;
  font-weight: 600;
  margin: 40px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
}

/* Banderas */
img.flag {
  height: 24px;
  width: auto;
  margin-left: 12px;
  vertical-align: middle;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  border-radius: 2px;
  display: inline-block;
}

.lead {
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 840px;
  margin-bottom: 30px;
}

/* =========================================
   Tarjetas & Componentes UI
   ========================================= */
.grid { display: grid; gap: 32px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(0,102,204,0.3);
}
.card h3 { font-size: 22px; font-weight: 600; margin: 0 0 12px; }
.card p { color: var(--ink-2); font-size: 16px; line-height: 1.5; }

/* =========================================
   Equipo (Team)
   ========================================= */
.team { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.team-member {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}
.team-member:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  background: var(--card-bg);
  border-color: var(--accent);
}

.team-member .avatar {
  width: 140px;
  height: 140px;
  margin: 0 0 16px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.team-member .avatar img { width: 100%; height: 100%; object-fit: cover; }

.team-member h4 { 
  font-size: 18px; font-weight: 600; margin: 0 0 4px; color: var(--ink);
  min-height: 48px; display: flex; align-items: center; justify-content: center; line-height: 1.3;
}
.team-member .role { font-size: 14px; color: var(--ink-2); margin-bottom: 8px; font-weight: 500; }

.badges { margin-bottom: 16px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.chip.role-chip {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;
  padding: 4px 8px; border-radius: 6px; background: var(--bg-alt); color: var(--ink-2); border: 1px solid var(--card-border);
}
.role-permanent { color: #0066cc; background: rgba(0,102,204,0.08); border-color: rgba(0,102,204,0.15); }
.role-phd { color: #2d8a56; background: rgba(45,138,86,0.08); border-color: rgba(45,138,86,0.15); }

.team-member .links {
  margin-top: auto; width: 100%; display: flex; justify-content: center; align-items: center; gap: 16px;
  padding-top: 12px; border-top: 1px solid var(--card-border);
}
.team-member .links a { display: block; opacity: 0.6; transition: opacity 0.2s, transform 0.2s; line-height: 0; }
.team-member .links a:hover { opacity: 1; transform: scale(1.15); }
.team-member .links img { width: 24px; height: 24px; }

/* Filtros */
.team-controls { margin-bottom: 40px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.pill {
  background: var(--bg-alt); border: 1px solid transparent; padding: 8px 18px; border-radius: 99px;
  font-size: 14px; font-weight: 500; cursor: pointer; color: var(--ink-2); transition: all 0.2s ease;
}
.pill:hover { background: #eaeaec; color: var(--ink); }
.pill.active { background: var(--ink); color: var(--bg); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }

/* =========================================
   Publicaciones & Buscador
   ========================================= */
ul.pubs, .pubs ul { list-style: none; padding: 0; margin: 0; }
.pubs li { margin-bottom: 20px; }

.pub-card {
  display: block; background: var(--card-bg); padding: 24px; border-radius: var(--radius-sm);
  border: 1px solid transparent; transition: background 0.2s, transform 0.2s; position: relative; z-index: 1;
}
.pub-card:hover {
  background: var(--card-bg); border-color: rgba(0,102,204,0.2);
  box-shadow: var(--shadow-sm); transform: translateY(-2px);
}

.journal-name { color: var(--accent); font-weight: 600; font-style: italic; }

.pub-actions { margin-top: 16px; display: flex; gap: 12px; }
.pub-actions button {
  background: var(--card-bg); /* Fondo adaptativo para modo oscuro/claro */
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 20px; padding: 6px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s ease;
}
.pub-actions button:hover {
  background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0,102,204,0.25);
}

.pub-actions button.is-copied {
  background: #1f7a3a;
  border-color: #1f7a3a;
  color: #fff;
}

.pub-actions button.is-copied:hover {
  background: #1f7a3a;
  border-color: #1f7a3a;
}

.pubs-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }
.pubs-controls input[type="search"] {
  appearance: none; flex: 1; min-width: 200px; max-width: 480px;
  background: #eaeaec; border: 1px solid transparent; border-radius: 12px;
  padding: 0 16px; height: 44px; font-size: 16px; color: var(--ink);
  transition: all 0.2s ease; outline: none; z-index: 2;
}
.pubs-controls input[type="search"]:focus {
  background: var(--card-bg); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.15);
}

#pubs-sort {
  appearance: none; background: var(--card-bg); border: 1px solid #d1d1d6;
  border-radius: 12px; padding: 0 20px; height: 44px; font-size: 14px;
  font-weight: 600; color: var(--ink); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; transition: all 0.2s ease; white-space: nowrap;
}
#pubs-sort:hover { background: #eaeaec; border-color: #c7c7cc; }
#pubs-sort:active { background: #d1d1d6; transform: scale(0.98); }

/* =========================================
   Proyectos
   ========================================= */
details { border-bottom: 1px solid var(--card-border); margin-bottom: 0; background: transparent; padding: 0; box-shadow: none; }
summary {
  padding: 24px 0; font-weight: 600; font-size: 18px; list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; color: var(--ink); transition: color 0.2s; position: relative; z-index: 1;
}
summary:hover { color: var(--accent); }
summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+"; font-weight: 300; font-size: 24px; margin-left: 12px;
  color: var(--ink-2); transition: transform 0.3s ease, color 0.3s;
}
details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
details[open] summary { color: var(--accent); }

.details-content {
  padding-bottom: 32px; color: var(--ink-2); font-size: 16px; line-height: 1.6;
  background: var(--solid-content-bg); /* Fondo sólido */
  border-radius: var(--radius-sm); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}

.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap td { padding: 12px 0; vertical-align: top; border-bottom: 1px solid var(--card-border); }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap td:first-child { width: 160px; font-weight: 600; color: var(--ink); padding-right: 20px; }

/* =========================================
   Contacto & Footer
   ========================================= */
.contact { text-align: center; max-width: 800px; margin: 0 auto; }
.contact .section-title { margin-bottom: 32px; }
.contact p { margin-bottom: 48px; }

.site-footer {
  background: var(--bg-alt); padding: 80px 0 40px; margin-top: 100px;
  text-align: center; font-size: 13px; color: var(--ink-2);
  border-top: 1px solid var(--card-border); position: relative; z-index: 10;
}
.partner {
  max-width: 340px; height: auto; display: block; margin: 0 auto;
  opacity: 0.8; filter: grayscale(100%); transition: all 0.3s ease;
}
.partner:hover { opacity: 1; filter: grayscale(0%); transform: scale(1.02); }

/* =========================================
   Utilidades & Móvil
   ========================================= */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 20px; top: 20px; background: white; z-index: 2000; padding: 10px; }

.to-top {
  position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: var(--bg);
  width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 900; display: flex; 
  align-items: center; justify-content: center; font-size: 20px; transition: transform 0.2s;
}
.to-top:hover { transform: scale(1.1); }

@media (max-width: 960px) {
  .theme-toggle { display: inline-flex; }
  .menu-toggle { display: inline-flex; }
  .site-nav { 
    position: absolute; top: 60px; left: 0; right: 0; background: var(--bg);
    height: auto; /* Altura automática */
    padding: 24px 24px; display: none;
    flex-direction: column; border-bottom: 1px solid var(--card-border);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15); /* Sombra para profundidad */
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; font-size: 22px; gap: 24px; }
  .section-title { font-size: 32px; }
  .headline { font-size: 40px; }
  .team-member { flex-direction: column; text-align: center; } 
  .team-member .links { justify-content: center; }
}

@media (max-width: 600px) {
  .team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-member .avatar { width: 96px; height: 96px; }
  .team-member h4 { min-height: 40px; font-size: 16px; }
}

/* --- Page Load Transition --- */
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

main {
    animation: pageFadeIn 0.5s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

/* --- Polished Hover Animations --- */
/* Target your primary interactive elements */
.btn, a.inline-flex, article.group {
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.2, 1), 
                box-shadow 0.3s ease, 
                border-color 0.3s ease !important;
}

/* Add a subtle lift and Sapphire glow to cards on hover */
article.group:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(15, 76, 129, 0.15);
}

/* Make button hovers snappier */
a.inline-flex:hover {
    transform: translateY(-2px);
}

/* --- Fix Burger Menu Reveal --- */
#primary-nav.open {
    display: flex !important;
}

/* --- Bright Emerald Hover Animation for Top Bar --- */
.nav-link {
    position: relative;
    color: #dae2fd; /* Light text so it's easy to read */
}

.nav-link:hover {
    color: #4edea3 !important; /* Emerald Green */
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: #4edea3; /* Emerald Green underline */
    transition: width 0.3s ease;
}

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

/* --- Make Burger Icon Highly Visible --- */
.menu-toggle {
    color: #dae2fd !important; /* Light text color */
    transition: color 0.3s ease;
}

.menu-toggle:hover {
    color: #4edea3 !important; /* Emerald green on hover */
}

/* --- Fix Burger Menu Click Area --- */
.menu-toggle * {
    pointer-events: none;
}

/* --- Automatically hide empty team links (CORRECTED) --- */
article a[href="#"] {
    display: none !important;
}