/* =============================================
   PALETTE: deep navy + warm amber + teal accent
   ============================================= */
:root {
    --bg-base:        #09111c;
    --bg-mid:         #0f1d2e;
    --surface:        rgba(240, 236, 226, 0.87);
    --surface-border: rgba(255, 255, 255, 0.55);
    --surface-shadow: 0 8px 40px rgba(9, 17, 28, 0.22), 0 2px 8px rgba(9, 17, 28, 0.12);
    --surface-dark:   #112036;
    --surface-dark-2: #1a3050;
    --text:           #1e2a38;
    --text-muted:     #5a6a7a;
    --text-light:     #7a8a9a;
    --primary:        #0e2040;
    --secondary:      #1d3d68;
    --accent:         #c89b5a;
    --accent-hover:   #dbb270;
    --accent-glow:    rgba(200, 155, 90, 0.35);
    --accent-2:       #3ab8c8;
    --accent-2-hover: #55cedd;
    --accent-2-glow:  rgba(58, 184, 200, 0.30);
    --link:           #2a9db8;
    --link-hover:     #3ab8c8;
    --card-bg:        rgba(255, 255, 255, 0.97);
    --border:         rgba(200, 155, 90, 0.20);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: linear-gradient(160deg, var(--bg-base) 0%, var(--bg-mid) 100%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Canvas */
#quantum-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Navigation */
nav {
    position: fixed;
    top: 0; width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    padding: 1.5rem 5%;
    box-shadow: 0 2px 20px rgba(9, 17, 28, 0.07);
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border);
}

nav.scrolled {
    padding: 1rem 5%;
    box-shadow: 0 2px 30px rgba(9, 17, 28, 0.13);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.25s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0;
    width: 0; height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.3s ease;
}

.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }

/* Language switcher */
.lang-switcher { display: flex; gap: 0.4rem; align-items: center; }

.lang-btn {
    background: transparent;
    border: 1.5px solid var(--accent);
    color: var(--primary);
    padding: 0.3rem 0.65rem;
    border-radius: 5px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.03em;
}

.lang-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px var(--accent-glow);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.mobile-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.mobile-toggle span { width: 25px; height: 3px; background: var(--primary); transition: all 0.3s ease; }

/* Hero */
.hero {
    margin-top: 100px;
    padding: 4rem 5%;
    min-height: 85vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-content {
    animation: fadeInUp 1s ease;
    width: 100%; max-width: 800px;
    background: var(--surface) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-radius: 22px;
    padding: 2.5rem 3rem !important;
    border: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-subtitle { font-size: 1.3rem; color: var(--text-muted); margin-bottom: 1rem; }

.hero-affiliation { font-size: 1.1rem; color: var(--secondary); margin-bottom: 2rem; line-height: 1.8; }
.hero-affiliation a { color: var(--accent); text-decoration: none; font-weight: 600; transition: color 0.25s ease; }
.hero-affiliation a:hover { color: var(--link-hover); }

.contact-info { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; align-items: center; }
.contact-item { display: flex; align-items: center; gap: 0.8rem; font-size: 1rem; }
.contact-item strong { color: var(--accent); min-width: 80px; }
.contact-item a { color: var(--link); text-decoration: none; transition: color 0.25s ease; }
.contact-item a:hover { color: var(--link-hover); text-decoration: underline; }

.office-hours {
    background: linear-gradient(135deg, var(--surface-dark-2), var(--surface-dark));
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid rgba(58, 184, 200, 0.15);
}

.office-hours h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--accent-hover);
}

.hero-image { position: relative; animation: fadeIn 1.2s ease; margin-bottom: 3rem; }

.shake-hint { text-align: center; margin-top: 1rem; font-size: 0.9rem; color: white; font-style: italic; opacity: 0.7; }

.image-wrapper {
    position: relative;
    width: 280px; height: 280px;
    margin: 0 auto;
    background: transparent;
    border-radius: 50%;
    overflow: hidden;
}

.hero-photo {
    width: 100%; height: 100%;
    box-shadow: 0 20px 60px rgba(9, 17, 28, 0.3), 0 0 0 4px rgba(200,155,90,0.25);
    display: block;
    background: transparent;
    object-fit: cover;
    object-position: center center;
    animation: flipCoin 1.5s ease-in-out 1s;
}

.hero-photo.shake-flip { animation: flipCoin 1.5s ease-in-out; }

@keyframes flipCoin {
    0%   { transform: rotateY(0deg); }
    50%  { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}

/* Sections */
section { padding: 5rem 5%; max-width: 1400px; margin: 0 auto; }

#teaching, #media, #gallery, #profile {
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 24px;
    margin-bottom: 2rem;
    border: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
}

.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px; left: 0;
    width: 60px; height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 2px;
}

/* Teaching */
.teaching-list { list-style: disc; padding-left: 1.5rem; margin-top: 2rem; display: flex; flex-direction: column; gap: 1.8rem; }
.teaching-item { color: var(--text); }
.teaching-code-title { font-size: 1rem; font-weight: 500; color: var(--text); margin-bottom: 0.2rem; }
.teaching-module { font-style: italic; font-size: 0.95rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.teaching-degree { color: var(--link); text-decoration: underline; font-size: 0.95rem; transition: color 0.25s ease; }
.teaching-degree:hover { color: var(--link-hover); }

/* Gallery */
.gallery-container { position: relative; max-width: 100%; margin-top: 3rem; overflow: hidden; }
.gallery-slider { display: flex; transition: transform 0.5s ease; touch-action: pan-y; cursor: grab; user-select: none; }
.gallery-slider:active { cursor: grabbing; }

.gallery-slide { min-width: 100%; position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 16/10; background: var(--secondary); }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gallery-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(9, 17, 28, 0.92), transparent);
    padding: 2rem; color: white;
}

.gallery-caption { font-size: 1.2rem; font-weight: 500; }

.gallery-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border: none; width: 50px; height: 50px;
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--primary);
    transition: all 0.3s ease; z-index: 10;
    box-shadow: 0 4px 15px rgba(9, 17, 28, 0.15);
}

.gallery-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(9, 17, 28, 0.2);
    color: var(--accent-2);
}

.gallery-nav:active { transform: translateY(-50%) scale(0.95); }
.gallery-prev { left: 20px; }
.gallery-next { right: 20px; }

.gallery-dots { display: flex; justify-content: center; gap: 12px; margin-top: 2rem; }

.gallery-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--text-light); opacity: 0.3;
    cursor: pointer; transition: all 0.3s ease; border: none; padding: 0;
}

.gallery-dot.active { opacity: 1; background: var(--accent); transform: scale(1.2); box-shadow: 0 0 8px var(--accent-glow); }
.gallery-dot:hover { opacity: 0.6; transform: scale(1.1); }

/* Media */
.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
    align-items: stretch;
}

.media-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(9, 17, 28, 0.10);
    transition: all 0.4s ease;
    border: 1px solid rgba(200, 155, 90, 0.10);
    display: flex;
    flex-direction: column;
}

.media-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    flex-shrink: 0;
}

.media-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.media-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 44px rgba(9, 17, 28, 0.18);
    border-color: rgba(58, 184, 200, 0.20);
}

.profile-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 1.2rem 3rem;
    border-radius: 4px;
    box-shadow: 0 0 24px rgba(200,155,90,0.15);
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, gap 0.3s ease;
}

.profile-banner-btn:hover {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: var(--bg-base);
    box-shadow: 0 0 40px rgba(200,155,90,0.35);
    gap: 1.6rem;
}

.profile-banner-arrow {
    font-size: 1.8rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.profile-banner-btn:hover .profile-banner-arrow {
    transform: translateX(6px);
}

.media-iframe-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: var(--primary);
}

.media-iframe-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}
.media-type { font-size: 0.85rem; font-weight: 700; color: var(--accent-2); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }

.media-title { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; color: var(--primary); margin-bottom: 1rem; line-height: 1.3; }
.media-description { color: var(--text-muted); margin-bottom: 1.5rem; }

.media-link {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white; text-decoration: none;
    border-radius: 8px; font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.media-link:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 18px var(--accent-glow);
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-2));
}

/* Profile */
.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; margin-top: 2rem; }

.profile-card {
    background: rgba(255, 255, 255, 0.70);
    border-radius: 16px; padding: 2rem;
    border: 1px solid rgba(200, 155, 90, 0.18);
    box-shadow: 0 3px 18px rgba(9, 17, 28, 0.07);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.profile-card:hover {
    box-shadow: 0 8px 28px rgba(9, 17, 28, 0.12);
    border-color: rgba(58, 184, 200, 0.28);
}

.profile-card-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem; font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.2rem; padding-bottom: 0.6rem;
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, var(--accent), var(--accent-2)) 1;
}

.profile-card ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }

.profile-card ul li {
    padding-left: 1.1rem; position: relative;
    color: var(--text); font-size: 0.97rem; line-height: 1.55;
}

.profile-card ul li::before {
    content: '';
    position: absolute; left: 0; top: 0.55em;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.profile-subsection { margin-top: 1.2rem; }

.profile-subsection-title {
    font-weight: 700; font-size: 0.92rem;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--accent-2); margin-bottom: 0.6rem;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary), var(--surface-dark));
    color: white; padding: 3rem 5%; margin-top: 5rem;
    border-top: 1px solid rgba(58, 184, 200, 0.15);
}

.footer-container { max-width: 1400px; margin: 0 auto; text-align: center; }
.footer-text { margin-bottom: 1rem; opacity: 0.8; }

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@media (max-width: 968px) {
    .fade-in { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 968px) {
    .nav-links {
        position: fixed; top: 80px; left: -100%;
        width: 100%; height: calc(100vh - 80px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column; align-items: center; justify-content: center;
        gap: 2rem; transition: left 0.3s ease;
    }
    .nav-links.active { left: 0; }
    .mobile-toggle { display: flex; }
    .mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(8px, 8px); }
    .mobile-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }
    .hero-title { font-size: 3rem; }
    .section-title { font-size: 2.5rem; }
    .media-grid { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
}

@media (min-width: 969px) and (max-width: 1200px) {
    .media-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    nav { padding: 1rem 5%; }
    .logo { font-size: 1.5rem; }
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .section-title { font-size: 2rem; }
    .gallery-nav { width: 40px; height: 40px; font-size: 1.2rem; }
    .gallery-prev { left: 10px; }
    .gallery-next { right: 10px; }
    .gallery-overlay { padding: 1.5rem; }
    .gallery-caption { font-size: 1rem; }
    section { padding: 3rem 5%; }
    .hero-content { padding: 2rem 1.5rem !important; }
}
