/* ===== CSS Variables ===== */
:root {
    --color-primary: #0d9488;
    --color-primary-light: #14b8a6;
    --color-primary-dark: #0f766e;
    --color-primary-bg: #f0fdfa;
    --color-primary-bg-hover: #ccfbf1;

    --color-text: #1e293b;
    --color-text-secondary: #475569;
    --color-text-light: #94a3b8;

    --color-bg: #ffffff;
    --color-bg-alt: #f8fafc;
    --color-border: #e2e8f0;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary-dark);
}

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.nav.scrolled {
    border-bottom-color: var(--color-border);
    box-shadow: var(--shadow-sm);
    background: rgba(255, 255, 255, 0.95);
}

.nav-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.nav-logo:hover {
    color: var(--color-primary-dark);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links a {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
    color: var(--color-primary);
    background: var(--color-primary-bg);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

/* Slideshow background */
.hero-slideshow {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    transform: scale(1.05);
    animation: heroZoom 8s ease-in-out infinite alternate;
}

.hero-slide.active {
    opacity: 1;
}

@keyframes heroZoom {
    from { transform: scale(1.02); }
    to { transform: scale(1.08); }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.92) 0%,
        rgba(255, 255, 255, 0.85) 40%,
        rgba(240, 253, 250, 0.75) 100%
    );
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.hero-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-greeting {
    font-size: 1.5rem;
    color: var(--color-text);
    font-weight: 400;
    margin-bottom: 8px;
}

.hero-name {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 32px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid rgba(13, 148, 136, 0.3);
    background: rgba(255, 255, 255, 0.6);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-bg);
}

.hero-socials {
    display: flex;
    gap: 16px;
}

.hero-socials a {
    color: var(--color-text-secondary);
    transition: color var(--transition), transform var(--transition);
}

.hero-socials a:hover {
    color: var(--color-primary);
    transform: translateY(-2px);
}

.hero-image {
    display: flex;
    justify-content: center;
}

.hero-image-wrapper {
    width: 340px;
    height: 340px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 4px solid rgba(255, 255, 255, 0.8);
    position: relative;
}

.hero-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Sections ===== */
.section {
    padding: 100px 0;
}

.section:nth-child(even) {
    background: var(--color-bg-alt);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    color: var(--color-text);
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin-bottom: 48px;
    line-height: 1.7;
}

.section-divider {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin-top: 64px;
    margin-bottom: 12px;
    padding-top: 48px;
    border-top: 1px solid var(--color-border);
}

/* ===== About ===== */
.about-content {
    margin-top: 32px;
    max-width: 720px;
}

.about-text p {
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    font-size: 1.05rem;
    line-height: 1.8;
}

.about-text a {
    font-weight: 500;
}

.about-text strong {
    color: var(--color-text);
    font-weight: 600;
}

/* ===== Speaking - Featured Talk ===== */
.talk-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
    color: inherit;
    transition: transform var(--transition), box-shadow var(--transition);
}

.talk-featured:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: inherit;
}

.talk-featured-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    position: relative;
    min-height: 280px;
}

.talk-featured-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.4s ease;
}

.talk-featured:hover .talk-featured-gallery img {
    transform: scale(1.03);
}

.talk-featured-gallery .talk-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.talk-featured-gallery .talk-play svg {
    color: #fff;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.talk-featured:hover .talk-featured-gallery .talk-play {
    opacity: 1;
}

.talk-featured-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.talk-featured-content .talk-event {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    display: block;
}

.talk-featured-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.talk-featured-content p {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.talk-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
}

.talk-featured:hover .talk-link {
    color: var(--color-primary-dark);
}

/* ===== Speaking - Other Talks ===== */
.talks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.talk-card {
    display: block;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    color: inherit;
}

.talk-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: inherit;
}

.talk-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
}

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

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

.talk-image .talk-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.talk-image .talk-play svg {
    color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.talk-card:hover .talk-play {
    opacity: 1;
}

.talk-content {
    padding: 24px;
}

.talk-event {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: block;
}

.talk-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--color-text);
}

.talk-content p {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.talk-card:hover .talk-link {
    color: var(--color-primary-dark);
}

/* ===== Awards ===== */
.awards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}

.award-card {
    display: block;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    color: inherit;
    transition: transform var(--transition), box-shadow var(--transition);
}

.award-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: inherit;
}

.award-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

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

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

.award-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    min-height: 100px;
    background: var(--color-bg-alt);
}

.award-logo img {
    max-height: 64px;
    max-width: 80%;
    object-fit: contain;
}

.award-content {
    padding: 24px;
}

.award-year {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--color-primary-bg);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.award-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--color-text);
}

.award-content p {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.award-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
}

.award-card:hover .award-link {
    color: var(--color-primary-dark);
}

/* ===== Writing ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.article-card {
    display: block;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 28px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary-light);
}

.article-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--color-primary-bg);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--color-text);
}

.article-card p {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.article-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
}

.article-card:hover .article-link {
    color: var(--color-primary-dark);
}

/* ===== Gallery ===== */
.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 6px;
    max-width: 680px;
    margin: 0 auto;
    aspect-ratio: 1;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.1s ease, opacity 0.1s ease, box-shadow 0.1s ease;
    will-change: transform, opacity;
}

/* When ANY item in the gallery is hovered, dim all items */
.gallery:hover .gallery-item {
    opacity: 0.4;
    transform: scale(0.96);
}

/* Then un-dim and highlight the hovered item */
.gallery:hover .gallery-item:hover {
    opacity: 1;
    transform: scale(1.4);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.gallery-item.gallery-featured {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-sm);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.15) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--radius-sm);
    pointer-events: none;
}

.gallery:hover .gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h3 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.gallery-overlay p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* ===== Contact ===== */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 8px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition);
}

.contact-card svg {
    color: var(--color-primary);
    flex-shrink: 0;
}

.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary-light);
    color: var(--color-primary);
}

.contact .section-title,
.contact .section-subtitle {
    text-align: center;
    max-width: 100%;
}

.contact .section-subtitle {
    margin-left: auto;
    margin-right: auto;
}

/* ===== Footer ===== */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.footer p {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

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

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

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .talk-featured {
        grid-template-columns: 1fr;
    }

    .talk-featured-gallery {
        min-height: 240px;
    }

    .talk-featured-content {
        padding: 28px;
    }

    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .awards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        padding: 16px 24px;
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero {
        padding: 100px 0 60px;
        min-height: auto;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-content {
        order: 2;
    }

    .hero-image {
        order: 1;
    }

    .hero-subtitle {
        max-width: 100%;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-socials {
        justify-content: center;
    }

    .hero-image-wrapper {
        width: 220px;
        height: 220px;
    }

    .hero-slide {
        object-position: center center;
    }

    .talks-grid {
        grid-template-columns: 1fr;
    }

    .talk-featured-content h3 {
        font-size: 1.1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .awards-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 72px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .gallery {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: auto;
        max-width: 100%;
        aspect-ratio: auto;
    }

    .gallery:hover .gallery-item:hover {
        transform: scale(1.04);
    }

    .gallery-overlay {
        opacity: 1;
    }

    .contact-links {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-card {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-greeting {
        font-size: 1.2rem;
    }

    .hero-name {
        font-size: 1.75rem;
    }

    .hero-image-wrapper {
        width: 200px;
        height: 200px;
    }
}
