/* --- 1. Global Styles & Variables --- */
:root {
    --midnight: #0B2C47;
    --forest: #1F4D2E;
    --wheat: #D4A017;
    --charcoal: #333333;
    --offwhite: #F7F7F5;
    --beige: #F3EEE6;
    --white: #FFFFFF;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-strong: rgba(0, 0, 0, 0.15);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Work Sans', sans-serif;
    background-color: var(--offwhite);
    color: var(--charcoal);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--charcoal);
}

/* --- 2. Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- 3. Header & Navigation (NEW) --- */
header.header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    transition: background-color 300ms ease, box-shadow 300ms ease, backdrop-filter 300ms ease;
    background-color: rgba(11, 44, 71, 0.5);
    -webkit-backdrop-filter: saturate(140%) blur(6px);
    backdrop-filter: saturate(140%) blur(6px);
}
header.header.scrolled {
    background-color: var(--midnight);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.nav-inner { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    height: 64px;
}

.brand { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    color: var(--white); 
}
.brand .logo { 
    width: 36px; 
    height: 36px; 
    border-radius: 8px; 
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--wheat), #f7d97a); 
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.3); 
}
.brand .logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.brand .name { 
    font-family: Montserrat, sans-serif; 
    font-weight: 800; 
    letter-spacing: 0.3px;
    font-size: 1.25rem;
}
.nav-links { 
    display: flex; 
    gap: 26px; 
    align-items: center; 
}
.nav-links a { 
    color: var(--white); 
    position: relative; 
    font-weight: 600; 
    font-size: 0.95rem;
}
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -6px; height: 2px;
    background: rgba(255,255,255,0.0);
    transition: background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
    transform: scaleX(0);
    border-radius: 2px;
}
.nav-links a:hover { 
    text-shadow: 0 0 8px rgba(255,255,255,0.35); 
}
.nav-links a:hover::after { 
    background: rgba(255,255,255,0.75); 
    box-shadow: 0 0 16px rgba(255,255,255,0.5); 
    transform: scaleX(1);
}
.cta-btn {
    background-color: var(--wheat);
    color: var(--midnight);
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.cta-btn:hover {
    background-color: var(--white);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(212, 160, 23, 0.5);
}

.cta-wrapper {
    margin-top: 3rem;
    text-align: center;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 5px;
    z-index: 1001; /* Above nav links */
}

@media (max-width: 820px) {
    .menu-toggle { display: block; }
    .nav-links {
        position: fixed;
        inset: 0;
        background: rgba(11, 44, 71, 0.95); /* Midnight with alpha */
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    }
    .nav-links.is-open {
        transform: translateX(0);
    }
    .nav-links a { font-size: 1.5rem; }
    .nav-links .cta-btn { font-size: 1.2rem; padding: 12px 30px; }
}

/* --- 4. Hero Section --- */
.hero {
    background-color: var(--white);
    text-align: center;
}

/* Transition Delays */
.delay-100 {
    transition-delay: 100ms;
}
.delay-200 {
    transition-delay: 200ms;
}
.delay-300 {
    transition-delay: 300ms;
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--charcoal);
}

.hero p {
    font-size: 1.125rem;
    max-width: 700px;
    margin: 1.5rem auto 0;
    color: #555;
}

/* --- 5. Featured Speakers Section --- */
.featured-speakers {
    background-color: var(--beige);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.featured-card {
    background: var(--white);
    border-radius: 12px;
    border: 3px solid var(--wheat);
    box-shadow: 0 10px 30px var(--shadow);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.featured-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px var(--shadow-strong);
}

.featured-card .img-wrapper {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.featured-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.featured-card:hover img {
    transform: scale(1.05);
}

.featured-card h3 { font-size: 1.5rem; }
.featured-card .title {
    color: var(--forest);
    font-weight: 700;
    margin-top: 0.25rem;
}
.featured-card .bio-short {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.featured-card .session-brief {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    margin-top: 1rem;
}

.featured-card .session-title {
    font-size: 0.85rem;
    color: var(--midnight);
    font-weight: 600;
    display: block;
    line-height: 1.4;
}

/* --- 6. Speaker Details Section --- */
.speaker-details {
    background-color: var(--white);
}

.speaker-profile {
    margin-bottom: 4rem;
    border-radius: 16px;
    background-color: var(--offwhite);
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow);
}

.speaker-profile:last-child {
    margin-bottom: 0;
}

.profile-header {
    background-color: var(--midnight);
    color: var(--white);
    padding: 1.5rem 2rem;
    position: relative;
}

.profile-header:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 2rem;
    width: 50px;
    height: 4px;
    background-color: var(--wheat);
    border-radius: 2px 2px 0 0;
}

.profile-header h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.profile-meta {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 500;
}

.profile-content {
    padding: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.profile-text {
    flex: 1 1 550px;
}

.profile-text p {
    margin-bottom: 1.2rem;
    line-height: 1.7;
}

.session-info {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    background-color: var(--beige);
    border-left: 4px solid var(--wheat);
}

.session-info h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--forest);
}

@media (max-width: 768px) {
    .profile-header {
        padding: 1.2rem;
    }
    
    .profile-content {
        padding: 1.5rem;
    }
    
    .profile-header h3 {
        font-size: 1.5rem;
    }
    
    .profile-meta {
        font-size: 1rem;
    }
}

/* --- 7. Modal --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    max-width: 700px;
    width: 90%;
    display: flex;
    gap: 2rem;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.is-open .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #eee;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.modal-close:hover {
    background-color: #ddd;
    transform: rotate(90deg);
}

.modal-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.modal-bio h2 {
    font-size: 2rem;
    color: var(--midnight);
}
.modal-bio .title {
    font-weight: 700;
    color: var(--forest);
    margin-top: 0.25rem;
}
.modal-bio p {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #444;
}
.modal-socials {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}
.modal-socials a {
    font-size: 1.5rem;
    color: var(--charcoal);
    transition: color 0.3s ease, transform 0.3s ease;
}

.modal-socials a:hover {
    color: var(--forest);
    transform: scale(1.1);
}

/* --- 8. Responsive Design Adjustments --- */
@media (max-width: 1024px) {
    .featured-grid { grid-template-columns: repeat(2, 1fr); }
    .speakers-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .section-title { font-size: 2rem; }
    .hero h1 { font-size: 2.5rem; }
    .featured-grid { grid-template-columns: 1fr; }
    .speakers-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem 1rem;}
    .speaker-card .img-wrapper { width: 120px; height: 120px; }
    
    .modal-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-top: 3rem;
        max-height: 80vh;
        overflow-y: auto;
    }
    .modal-socials { justify-content: center; }
}

@media (max-width: 480px) {
        .container { padding: 0 1rem; }
        .speakers-grid { grid-template-columns: repeat(2, 1fr); }
        .speaker-card .img-wrapper { width: 100px; height: 100px; }
}

/* Footer */
    footer {
      background: var(--midnight);
      color: rgba(255,255,255,0.9);
      padding: 40px 0;
    }
    
    .copyright-text {
      margin-bottom: 8px;
    }
    
    .footer-address {
      margin: 0;
      font-size: 14px;
      opacity: 0.8;
    }
    .footer-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 30px;
    }
    @media (min-width: 768px) {
      .footer-grid {
        grid-template-columns: 1fr auto;
      }
    }
    .footer-links {
      display: flex;
      flex-wrap: wrap;
      gap: 14px;
      align-items: center;
    }
    .social-links {
      display: flex;
      gap: 20px;
      margin-top: 10px;
    }
    .social-link {
      width: 24px;
      height: 24px;
      color: rgba(255,255,255,0.6);
      transition: transform 0.2s ease, color 0.2s ease;
    }
    .social-link:hover {
      color: var(--white);
      transform: translateY(-2px);
    }

    /* Utilities */
    .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; }
  
    /* Additional optimizations for speakers.css */

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -50px;
    left: 15px;
    background: var(--wheat);
    color: var(--midnight);
    padding: 8px 15px;
    border-radius: 4px;
    z-index: 2000;
    transition: top 0.3s ease;
    font-weight: 600;
}

.skip-link:focus {
    top: 15px;
    outline: 2px solid var(--forest);
}

.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Picture element normalization */
picture {
    display: block;
    width: 100%;
    height: 100%;
}

/* Optimize animation performance */
.fade-in {
    will-change: opacity, transform;
}

/* Performance optimization for transitions */
@media (prefers-reduced-motion: reduce) {
    .fade-in, 
    .cta-btn, 
    .featured-card,
    .featured-card img,
    .nav-links a::after,
    .social-link {
        transition: none !important;
        transform: none !important;
        will-change: auto !important;
    }
}

/* Print styles */
@media print {
    header, footer, .cta-wrapper {
        display: none;
    }
    
    body {
        padding-top: 0;
    }
    
    .speaker-profile {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 2rem;
        border: 1px solid #ddd;
        box-shadow: none;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    .profile-header {
        background-color: #eee !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .session-info {
        background-color: #f8f8f8 !important;
        border-left: 2px solid #000;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}