/* ============================================
   HABIB COGNITION LAB
   Design: Academic Research · SIU Maroon
   Colors: SIU Official PMS 209C / #6c0633
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Lora:ital,wght@0,400;0,500;1,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ---- CSS Variables ---- */
:root {
  --bg:           #FAF8F4;
  --bg-alt:       #F2EDE9;
  --maroon:       #6c0633;
  --maroon-dark:  #3D0120;
  --maroon-light: #8a0845;
  --gold:         #C4922A;
  --gold-light:   #D9A845;
  --text:         #2C2C2C;
  --text-muted:   #6B6B6B;
  --border:       #E0D4CE;
  --white:        #FFFFFF;
  --serif:        'Playfair Display', Georgia, serif;
  --body:         'Lora', Georgia, serif;
  --sans:         'DM Sans', system-ui, sans-serif;
  --max-w:        1100px;
  --transition:   0.3s ease;
}

/* ---- Dark Mode ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #120009;
    --bg-alt:     #1A000D;
    --text:       #E8E0DC;
    --text-muted: #9A9490;
    --border:     #3A1020;
  }
  body { background: var(--bg); color: var(--text); }
  h1, h2, h3 { color: #E8E0DC !important; }
  h4 { color: var(--gold-light) !important; }
  strong { color: #E8E0DC !important; }
  p { color: var(--text); }
  .hero h1, .hero h2, .hero h3,
  .page-hero h1 { color: var(--white) !important; }
  .service-card p, .about-text p, .section-header p,
  .expertise-item p, .pub-meta, .pub-journal,
  .content-section li, .contact-info p { color: var(--text-muted) !important; }
  a { color: var(--gold-light); }
  a:hover { color: var(--gold); }
  .content-section a, .about-text a,
  .expertise-item a, .pub-card a,
  .contact-info a { color: var(--gold-light) !important; }
  .nav-links a { color: rgba(255,255,255,0.75); }
  .service-card, .about-stat, .credential-item,
  .timeline-item, .contact-form-wrap, .expertise-item,
  .qual-list li, .pub-card, .member-card, .project-card {
    background: #200010 !important;
    border-color: #3A1020 !important;
    color: var(--text);
  }
  .form-group input, .form-group textarea, .form-group select {
    background: #1A000A !important;
    border-color: #3A1020 !important;
    color: var(--text) !important;
  }
  .service-card:hover, .expertise-item:hover,
  .pub-card:hover, .member-card:hover,
  .project-card:hover { background: #2A0018 !important; }
  section:not(.hero):not(.credentials):not(.lab-bar):nth-child(even) {
    background: var(--bg-alt);
  }
  .site-footer { background: #0A0005; }
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 1.0625rem;
  line-height: 1.75; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--maroon); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

/* ---- Typography ---- */
h1, h2, h3, h4 { font-family: var(--serif); color: var(--maroon-dark); line-height: 1.25; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.125rem); font-weight: 600; }
h3 { font-size: clamp(1.1rem, 2vw, 1.375rem); font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; font-family: var(--sans);
     text-transform: uppercase; letter-spacing: 0.1em; color: var(--maroon); }
p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 500; color: var(--maroon-dark); }

/* ---- Layout ---- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }
section { padding: 5rem 0; }
section:not(.hero):not(.credentials):not(.lab-bar):nth-child(even) { background: var(--bg-alt); }

/* ---- Rule Divider ---- */
.rule { width: 3rem; height: 2px; background: var(--maroon); margin: 1.25rem 0 1.75rem; }
.rule--center { margin-left: auto; margin-right: auto; }

/* ---- Navigation ---- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--maroon-dark);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-logo { font-family: var(--serif); font-size: 1.05rem; color: var(--white);
            font-weight: 600; letter-spacing: 0.01em; }
.nav-logo span { color: var(--gold-light); }
.nav-logo:hover { color: var(--white); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { font-family: var(--sans); font-size: 0.85rem; font-weight: 400;
               color: rgba(255,255,255,0.75); letter-spacing: 0.06em;
               text-transform: uppercase; transition: color var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--gold-light); }
.nav-cta { font-family: var(--sans); font-size: 0.82rem; font-weight: 500;
           color: var(--maroon-dark) !important; background: var(--gold-light);
           padding: 0.45rem 1.1rem; border-radius: 3px;
           letter-spacing: 0.04em; text-transform: uppercase; }
.nav-cta:hover { background: var(--gold); color: var(--white) !important; }
.nav-toggle { display: none; flex-direction: column; gap: 5px;
              background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 24px; height: 2px;
                   background: var(--white); transition: var(--transition); }

/* ---- Hero ---- */
section.hero {
  background: var(--maroon-dark) !important;
  padding: 6rem 0 5rem; position: relative; overflow: hidden;
}
section.hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(196,146,42,0.10) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 2rem;
  display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center;
}
.hero-eyebrow { font-family: var(--sans); font-size: 0.78rem; font-weight: 500;
                text-transform: uppercase; letter-spacing: 0.15em;
                color: var(--gold-light); margin-bottom: 1.25rem; }
.hero h1 { color: var(--white); margin-bottom: 0.75rem; }
.hero h1 em { font-style: italic; color: var(--gold-light); }
.hero-sub { font-family: var(--body); font-size: 1.125rem;
            color: rgba(255,255,255,0.75); line-height: 1.65;
            margin: 1.5rem 0 2.25rem; max-width: 540px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn { display: inline-block; font-family: var(--sans); font-size: 0.875rem;
       font-weight: 500; letter-spacing: 0.04em; padding: 0.75rem 1.75rem;
       border-radius: 3px; transition: all var(--transition); cursor: pointer; border: none; }
.btn-primary { background: var(--maroon); color: var(--white); }
.btn-primary:hover { background: var(--maroon-light); color: var(--white); transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: var(--gold-light); color: var(--white); transform: translateY(-1px); }
.btn-outline { background: transparent; color: rgba(255,255,255,0.85);
               border: 1px solid rgba(255,255,255,0.3); }
.btn-outline:hover { border-color: var(--gold-light); color: var(--gold-light); }
.btn-dark { background: var(--maroon-dark); color: var(--white); }
.btn-dark:hover { background: var(--maroon); transform: translateY(-1px); }

/* ---- Lab Bar (tagline strip) ---- */
.lab-bar {
  background: var(--maroon);
  padding: 1.25rem 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.lab-bar-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
}
.lab-bar-label { font-family: var(--sans); font-size: 0.72rem; text-transform: uppercase;
                 letter-spacing: 0.12em; color: rgba(255,255,255,0.45); white-space: nowrap; }
.lab-bar-items { display: flex; gap: 2.5rem; align-items: center; flex-wrap: wrap; }
.lab-bar-item { font-family: var(--serif); font-size: 0.9rem; font-style: italic;
                color: rgba(255,255,255,0.85); }

/* ---- Section Headers ---- */
.section-header { margin-bottom: 3rem; }
.section-header h2 { margin-bottom: 0; }
.section-header p { margin-top: 0.75rem; color: var(--text-muted);
                    font-size: 1.0625rem; max-width: 540px; }

/* ---- Service / Feature Cards ---- */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr);
                 gap: 1.5px; background: var(--border); border: 1px solid var(--border); }
.service-card { background: var(--white); padding: 2.5rem; transition: background var(--transition); }
.service-card:hover { background: #FDF8F5; }
.service-icon { font-size: 1.5rem; margin-bottom: 1rem; }
.service-card h3 { font-size: 1.2rem; margin-bottom: 0.75rem; color: var(--maroon-dark); }
.service-card p { color: var(--text-muted); font-size: 0.975rem; line-height: 1.7; }
.service-link { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1.25rem;
                font-family: var(--sans); font-size: 0.82rem; font-weight: 500;
                text-transform: uppercase; letter-spacing: 0.08em; color: var(--maroon); }
.service-link:hover { gap: 0.7rem; color: var(--maroon); }

/* ---- Stats Strip ---- */
section.credentials { background: var(--maroon-dark) !important; color: var(--white); }
.cred-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.cred-item { padding: 1rem 0; }
.cred-number { font-family: var(--serif); font-size: 2.5rem; font-weight: 700;
               color: var(--gold-light); line-height: 1; margin-bottom: 0.4rem; }
.cred-label { font-family: var(--sans); font-size: 0.825rem;
              color: rgba(255,255,255,0.6); line-height: 1.4; }

/* ---- Page Hero (inner pages) ---- */
.page-hero { background: var(--maroon-dark); padding: 3rem 0;
             min-height: 324px; display: flex; align-items: center; }
.page-hero-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; width: 100%; }
.page-hero h1 { color: var(--white); font-size: clamp(1.75rem, 4vw, 2.5rem); }
.page-hero .tagline { color: rgba(255,255,255,0.65); font-size: 1.05rem;
                      margin-top: 0.75rem; max-width: 580px; }

/* ---- Content Sections ---- */
.content-section { padding: 4rem 0; }
.content-section + .content-section { border-top: 1px solid var(--border); }
.content-section h2 { margin-bottom: 1rem; }
.content-section h3 { font-size: 1.2rem; margin-top: 2rem; margin-bottom: 0.6rem;
                      color: var(--maroon-dark); }
.content-section h3:first-child { margin-top: 0; }
.content-section p, .content-section li { color: var(--text-muted); }

/* ---- Expertise / Area Cards ---- */
.expertise-list { display: flex; flex-direction: column; gap: 2.5rem; }
.expertise-item { padding: 2rem 2.5rem; background: var(--white);
                  border-left: 3px solid var(--maroon);
                  box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.expertise-item h3 { margin-top: 0; font-size: 1.2rem;
                     color: var(--maroon-dark); margin-bottom: 0.75rem; }
.expertise-item p { color: var(--text-muted); margin-bottom: 0; }

/* ---- Publications ---- */
.pub-filters { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.pub-filter-btn { font-family: var(--sans); font-size: 0.8rem; font-weight: 500;
                  text-transform: uppercase; letter-spacing: 0.08em; padding: 0.4rem 1rem;
                  border: 1px solid var(--border); border-radius: 2px;
                  background: var(--white); color: var(--text-muted);
                  cursor: pointer; transition: all var(--transition); }
.pub-filter-btn:hover, .pub-filter-btn.active {
  background: var(--maroon); color: var(--white); border-color: var(--maroon); }
.pub-year-group { margin-bottom: 3rem; }
.pub-year-label { font-family: var(--sans); font-size: 0.78rem; font-weight: 500;
                  text-transform: uppercase; letter-spacing: 0.15em; color: var(--maroon);
                  border-bottom: 1px solid var(--border); padding-bottom: 0.5rem;
                  margin-bottom: 1.25rem; }
.pub-card { background: var(--white); border: 1px solid var(--border);
            padding: 1.5rem 1.75rem; margin-bottom: 1rem;
            transition: box-shadow var(--transition); }
.pub-card:hover { box-shadow: 0 4px 20px rgba(108,6,51,0.08); }
.pub-title { font-family: var(--serif); font-size: 1.0rem; font-weight: 600;
             color: var(--maroon-dark); margin-bottom: 0.4rem; line-height: 1.4; }
.pub-title a { color: inherit; }
.pub-title a:hover { color: var(--maroon); }
.pub-authors { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.pub-authors strong { font-weight: 600; color: var(--text); }
.pub-journal { font-size: 0.875rem; font-style: italic; color: var(--text-muted); }
.pub-journal span { font-style: normal; font-weight: 500; color: var(--maroon); }
.pub-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.75rem; }
.pub-tag { font-family: var(--sans); font-size: 0.72rem; font-weight: 500;
           text-transform: uppercase; letter-spacing: 0.06em; padding: 0.2rem 0.6rem;
           background: var(--bg-alt); color: var(--maroon); border-radius: 2px; }

/* ---- Team / Member Cards ---- */
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.member-card { background: var(--white); border: 1px solid var(--border);
               padding: 1.75rem; transition: box-shadow var(--transition); }
.member-card:hover { box-shadow: 0 6px 24px rgba(108,6,51,0.10); }
.member-photo { width: 80px; height: 80px; border-radius: 50%; overflow: hidden;
                background: var(--bg-alt); margin-bottom: 1rem; }
.member-photo img { width: 100%; height: 100%; object-fit: cover; }
.member-photo-placeholder { width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--maroon-light); }
.member-name { font-family: var(--serif); font-size: 1.1rem; font-weight: 600;
               color: var(--maroon-dark); margin-bottom: 0.2rem; }
.member-role { font-family: var(--sans); font-size: 0.8rem; font-weight: 500;
               text-transform: uppercase; letter-spacing: 0.08em;
               color: var(--maroon); margin-bottom: 0.75rem; }
.member-bio { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }
.member-links { display: flex; gap: 0.5rem; margin-top: 1rem; }
.member-link { font-family: var(--sans); font-size: 0.75rem; font-weight: 500;
               text-transform: uppercase; letter-spacing: 0.06em; padding: 0.3rem 0.7rem;
               border: 1px solid var(--border); color: var(--text-muted);
               transition: all var(--transition); }
.member-link:hover { border-color: var(--maroon); color: var(--maroon); }

/* ---- Project Cards ---- */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.project-card { background: var(--white); border: 1px solid var(--border);
                padding: 2rem; transition: box-shadow var(--transition);
                border-top: 3px solid var(--maroon); }
.project-card:hover { box-shadow: 0 8px 32px rgba(108,6,51,0.10); }
.project-status { font-family: var(--sans); font-size: 0.72rem; font-weight: 500;
                  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem; }
.status-active { color: #2A7A3B; }
.status-development { color: var(--maroon); }
.project-card h3 { font-size: 1.2rem; color: var(--maroon-dark); margin-bottom: 0.6rem; }
.project-card p { font-size: 0.95rem; color: var(--text-muted); }
.project-link { display: inline-flex; align-items: center; gap: 0.4rem;
                margin-top: 1.25rem; font-family: var(--sans); font-size: 0.8rem;
                font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em;
                color: var(--maroon); }
.project-link:hover { gap: 0.7rem; color: var(--maroon-light); }

/* ---- Social Icon Links ---- */
.footer-social { display: flex; gap: 1rem; align-items: center; margin-top: 0.75rem; }
.social-icon-link { display: flex; align-items: center; justify-content: center;
                    width: 38px; height: 38px; border-radius: 6px;
                    color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.07);
                    transition: color var(--transition), background var(--transition); }
.social-icon-link:hover { color: var(--gold-light); background: rgba(255,255,255,0.12); }
.social-icon-link svg { display: block; flex-shrink: 0; }

/* ---- Contact Form ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 4rem; align-items: start; }
.contact-info h3 { margin-bottom: 0.5rem; margin-top: 2rem; color: var(--maroon-dark); }
.contact-info h3:first-child { margin-top: 0; }
.contact-info p, .contact-info a { color: var(--text-muted); font-size: 0.975rem; }
.contact-info a:hover { color: var(--maroon); }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-family: var(--sans); font-size: 0.8rem;
                    font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em;
                    color: var(--maroon-dark); margin-bottom: 0.4rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.75rem 1rem; background: var(--white);
  border: 1px solid var(--border); border-radius: 2px; font-family: var(--body);
  font-size: 0.975rem; color: var(--text); transition: border-color var(--transition); appearance: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--maroon); }
.form-group textarea { resize: vertical; min-height: 140px; }

/* ---- Footer ---- */
.site-footer { background: var(--maroon-dark); color: rgba(255,255,255,0.55); padding: 3rem 0 2rem; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start;
              padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.08);
              flex-wrap: wrap; gap: 2rem; }
.footer-brand { font-family: var(--serif); font-size: 1.1rem; color: var(--white); margin-bottom: 0.4rem; }
.footer-brand span { color: var(--gold-light); }
.footer-tagline { font-size: 0.85rem; color: rgba(255,255,255,0.4); max-width: 280px; line-height: 1.5; }
.footer-nav { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--sans); font-size: 0.72rem; text-transform: uppercase;
                 letter-spacing: 0.12em; color: rgba(255,255,255,0.4); margin-bottom: 0.75rem; font-weight: 500; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.footer-col a { font-size: 0.875rem; color: rgba(255,255,255,0.55); }
.footer-col a:hover { color: var(--gold-light); }
.footer-bottom { padding-top: 1.5rem; display: flex; justify-content: space-between;
                 align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-bottom p { font-size: 0.8rem; color: rgba(255,255,255,0.3); }
.footer-bottom a { color: rgba(255,255,255,0.3); }
.footer-bottom a:hover { color: var(--gold-light); }

/* ---- Animations ---- */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .cred-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--maroon-dark); padding: 1rem 2rem 1.5rem;
    gap: 0.75rem; border-top: 1px solid rgba(255,255,255,0.08);
  }
  .nav-toggle { display: flex; }
  .nav-cta { display: none; }
  section { padding: 3.5rem 0; }
  .cred-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: 1fr; }
  .footer-nav { flex-direction: column; gap: 1.5rem; }
}
