/* --- Variables --- */
:root {
    --bg-light: #F8F4F3;
    --bg-white: #FFFFFF;
    --bg-dark: #070707;
    --text-dark: #000000;
    --text-light: #FFFFFF;
    --text-grey: #666666;
    --accent-orange: #F39C12;
    --border-radius: 30px;
    --btn-radius: 30px;
    --transition: 0.3s ease;
}

/* --- Global Reset & Typography --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
    overflow-x: clip;
    width: 100%;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    line-height: 1.6;
    overflow-x: clip;
    width: 100%;
}
h1, h2, h3, h4 {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    font-weight: 700;
    line-height: 1.2;
}
.page-title, .section-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- Alternating Background Utilities --- */
.bg-beige { background-color: var(--bg-light); color: var(--text-dark); }
.bg-white { background-color: var(--bg-white); color: var(--text-dark); }
.bg-black { background-color: var(--bg-dark); color: var(--text-light); }

/* Force text colors inside dark sections */
.bg-black h1, .bg-black h2, .bg-black h3, .bg-black h4, .bg-black p, .bg-black .section-title { color: var(--text-light); }
.bg-black .project-card, .bg-black .expertise-card, .bg-black .research-card { color: var(--text-dark); }
.bg-black .project-card h3, .bg-black .project-card p { color: var(--text-dark); }

/* Layout Utilities */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.pt-large { padding-top: 100px; }
.pb-large { padding-bottom: 100px; }
.mt-spacer { margin-top: 40px; }
.mb-spacer { margin-bottom: 40px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-large { font-size: 1.2rem; margin-bottom: 15px; }

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--btn-radius);
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
}
.btn-black {
    background-color: var(--text-dark);
    color: var(--text-light);
    border: 2px solid var(--text-dark);
}
.btn-black:hover {
    background-color: transparent;
    color: var(--text-dark);
}
.btn-small { padding: 10px 20px; font-size: 0.8rem; border-radius: var(--btn-radius); }

.bg-black .btn-black { border-color: var(--text-light); }
.bg-black .btn-black:hover {
    background-color: var(--text-light);
    color: var(--bg-dark);
}

.section-title { font-size: 2.5rem; margin-bottom: 40px; letter-spacing: -0.5px; }
.highlight { border-bottom: 3px solid var(--accent-orange); }
.link-underline { font-size: 1.1rem; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }

/* Custom Accents */
.highlight-underline {
    text-decoration: underline;
    text-decoration-color: var(--accent-orange);
    text-decoration-thickness: 3px;
    text-underline-offset: 3px;
    font-weight: inherit;
}

/* --- Header (Sticky & Frosted Glass) --- */
.pt-medium { padding-top: 12px; }
.pb-medium { padding-bottom: 24px; }

.site-header { 
    padding: 15px 0; 
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(248, 244, 243, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05); 
}
.site-header .header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.back-to-home {
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    font-size: 0.95rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform: translateY(2px);
}
.back-to-home.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.logo { font-weight: 500; font-size: 1.2rem; letter-spacing: 1px; }

/* --- Breadcrumb Navigation --- */
.breadcrumb {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-grey);
    margin-bottom: 24px;
}
.breadcrumb a {
    text-decoration: underline;
    text-underline-offset: 4px;
    color: var(--text-dark);
}
.breadcrumb a:hover {
    color: var(--text-grey);
}

/* --- Flush Accordion (No Background, Just Borders) --- */
.accordion-flush {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(0,0,0,0.15) !important;
    margin-bottom: 0 !important;
    padding: 4px 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.accordion-flush .study-accordion-summary {
    background: transparent !important;
    border: none !important;
    padding: 8px 0 !important; /* Minimized gap */
}
.accordion-flush .study-accordion-summary:hover {
    background: transparent !important;
}
.accordion-flush .study-accordion-body {
    background: transparent !important;
    border: none !important;
    padding: 0 0 16px 0 !important; /* Minimized gap */
}
.accordion-flush[open] .study-accordion-summary {
    background-color: transparent !important;
}
.accordion-flush .summary-title {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
@media (max-width: 768px) {
    .accordion-flush .summary-title {
        font-size: 0.88rem !important;
    }
}

/* --- Hero Section (Grid Layout) --- */
.hero.pt-large { padding-top: 15px; }
.hero { 
    display: grid; 
    grid-template-columns: 1.2fr 1fr; 
    grid-template-areas: 
        "title image" 
        "bio image"; 
    align-items: center; 
    gap: 20px 50px; 
}
.hero-title { grid-area: title; font-size: 3.5rem; margin-bottom: 0; font-weight: 900; }
.hero-bio-action { grid-area: bio; max-width: 600px; }
.hero-bio { margin-bottom: 30px; }
.hero-bio p { font-size: 1.1rem; margin-bottom: 15px; }
.hero-image { 
    grid-area: image; 
    justify-self: end; 
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.blob-img {
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1 / 1;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    object-fit: cover;
    background-color: #e0e0e0;
}

/* --- Passion Section --- */
.passion-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; font-size: 1.1rem; }

/* --- Projects Carousel --- */
.carousel-wrapper { 
    position: relative; 
    margin-top: -8px;
    margin-left: -4px;
    margin-right: -4px;
}
.carousel-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 30px;
    padding: 20px 4px 16px 4px;
    scroll-padding-left: 4px;
    scroll-padding-right: 4px;
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
    .carousel-container:has(.project-card:hover) {
        scroll-snap-type: none;
    }
}
.carousel-container::-webkit-scrollbar { display: none; }

.project-card {
    flex: 0 0 320px;
    width: 320px;
    min-width: 320px;
    background-color: var(--bg-light); 
    scroll-snap-align: start;
    scroll-snap-stop: normal;
    border-radius: 30px; 
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    transition: transform 0.3s ease; 
    will-change: transform;
    transform: translateZ(0);
}
.project-card:last-child {
    scroll-snap-align: end;
}
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
    .project-card:hover {
        transform: translateY(-5px); 
        box-shadow: none; 
    }
}

/* Explicitly disable hover effect for cards on mobile and tablet view */
@media (max-width: 1024px), (hover: none), (pointer: coarse) {
    .project-card,
    .project-card:hover,
    #project-carousel .project-card,
    #project-carousel .project-card:hover {
        box-shadow: none !important;
        transform: none !important;
    }
    .study-card:hover,
    .research-card:hover {
        transform: none !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
    }
}
.project-card img {
    width: 100%;
    aspect-ratio: 1 / 1; 
    height: auto;
    object-fit: cover;
    background-color: #f0f0f0;
    display: block;
}
.project-info {
    padding: 20px 32px 36px 32px;
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left;
}
.project-info h3 { 
    font-size: 1.25rem; 
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-bottom: 12px;
    color: var(--text-dark);
    line-height: 1.3;
}
.project-info p { 
    font-size: 0.92rem; 
    color: var(--text-grey); 
    margin-bottom: 26px; 
    line-height: 1.6;
    flex: 1;
}
.project-info .btn {
    align-self: flex-start;
    padding: 10px 22px;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-radius: var(--btn-radius);
}

.carousel-controls { 
    display: flex; 
    justify-content: flex-end; 
    align-items: center;
    gap: 16px; 
    margin-top: -2px; 
    margin-right: 10px;
    padding-bottom: 6px;
}
.carousel-hint {
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text-grey);
    user-select: none;
    letter-spacing: 0.2px;
}
.carousel-arrows {
    display: flex;
    align-items: center;
    gap: 12px;
}
.carousel-controls button { 
    background: none; 
    border: none; 
    cursor: pointer; 
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 50%;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.carousel-controls button:hover:not(:disabled) {
    opacity: 0.6;
}
.carousel-controls button:disabled,
.carousel-controls button.disabled {
    opacity: 0.15 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}
.carousel-controls button svg {
    width: 24px;
    height: 24px;
}
.bg-black .carousel-controls button {
    color: #ffffff;
}
.bg-black .carousel-hint {
    color: #aaaaaa;
}

/* --- Expertise Section --- */
.expertise-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.expertise-card {
    background-color: var(--bg-white);
    border: 2px solid var(--text-dark);
    border-radius: 30px;
    padding: 40px 30px;
    height: 560px;
    display: flex;
    flex-direction: column;
}
.card-header h4 { font-size: 1.2rem; margin-bottom: 30px; text-align: center; }
.accordion { flex: 1; }
.accordion-item { border-bottom: 1px solid rgba(0,0,0,0.1); }

.accordion-title {
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0; 
}

.accordion-title .icon {
    position: relative;
    width: 18px;
    height: 18px;
    transition: transform 0.4s ease;
}
.accordion-title .icon::before,
.accordion-title .icon::after {
    content: '';
    position: absolute;
    background-color: var(--text-dark);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.4s ease, opacity 0.4s ease;
}
.accordion-title .icon::before {
    width: 100%;
    height: 2.5px;
    border-radius: 2px;
}
.accordion-title .icon::after {
    width: 2.5px;
    height: 100%;
    border-radius: 2px;
}

.accordion-item.active .icon { transform: rotate(180deg); }
.accordion-item.active .icon::after {
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(0);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.4s ease;
    font-size: 0.9rem;
    color: var(--text-grey);
    margin-top: 0;
    opacity: 0;
}
.accordion-item.active .accordion-content {
    max-height: 200px; 
    margin-top: 5px;
    padding-bottom: 20px;
    opacity: 1;
}

/* --- Tech Stack Section --- */
.tech-grid { display: grid; grid-template-columns: 300px 1fr; gap: 50px; align-items: start; }
.circle-img { width: 100%; border-radius: 50%; }
.tech-details { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.tech-column h4 { font-size: 1.2rem; margin-bottom: 20px; }
.tech-column ul li { font-size: 0.95rem; margin-bottom: 8px; color: #CCCCCC; }
.italic { font-style: italic; }
.footnotes { margin-top: 20px; font-size: 0.75rem; color: #888; font-style: italic; }

/* --- Research Section --- */
.research-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 28px; 
    align-items: stretch;
}
.research-card {
    background-color: var(--bg-white);
    padding: 22px;
    border-radius: 26px;
    border: 1px solid #e6e0d9;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
}
.research-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
}
.research-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 0;
    margin-bottom: 22px;
    background-color: #f1efeb;
}
.research-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
    transition: transform 0.3s ease;
}
.research-card:hover img {
    transform: scale(1.02);
}
.research-card .research-action {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: auto;
    padding-bottom: 2px;
}
.research-card .btn {
    display: inline-block;
    width: auto;
    min-height: auto;
    padding: 10px 22px;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-radius: var(--btn-radius);
    font-weight: 600;
    text-align: center;
}

/* --- Video / Media / Currently Working On Grid --- */
.video-wrapper { display: flex; justify-content: center; }
.video-link {
    position: relative;
    display: block;
    width: 100%;
    max-width: 900px;
    border-radius: 30px;
    overflow: hidden;
    margin: 0 auto;
}
.video-link img { 
    width: 100%; 
    display: block; 
    aspect-ratio: 16/9;
    object-fit: cover;
    max-height: 500px;
    transition: opacity 0.3s ease;
}
.video-link:hover img { opacity: 0.85; }
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.play-icon svg {
    width: 36px;
    height: 36px;
    fill: white;
    margin-left: 3px;
}
.video-link:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: rgba(0, 0, 0, 0.9);
}
.vertical-video-wrapper { max-width: 300px; }
.vertical-video-wrapper img,
.vertical-video-wrapper video { 
    width: 100%; 
    border-radius: 30px; 
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.mockups-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}
.mockups-grid img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.2s ease;
    object-fit: cover;
}
.mockups-grid img:hover {
    transform: scale(1.04);
}

/* --- Contact Section --- */
.contact-grid { 
    display: flex; 
    justify-content: center; 
    align-items: flex-end;
    gap: 100px; 
    margin-top: 40px; 
}
.contact-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 15px; 
    width: 160px;
}
.contact-item .icon-wrapper {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 90px;
    width: 100%;
}
.contact-item .btn {
    width: 100%;
}
.contact-item img.icon-outline {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* --- Footer --- */
.site-footer { 
    padding: 36px 0; 
    border-top: 1px solid #222; 
    background-color: var(--bg-dark);
}
.footer-content { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-size: 0.95rem; 
    flex-wrap: wrap;
    gap: 16px;
}
.footer-links {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.footer-links a { 
    text-decoration: underline; 
    text-underline-offset: 4px;
    color: var(--text-light);
    transition: opacity var(--transition);
}
.footer-links a:hover {
    opacity: 0.75;
}
.footer-copy {
    color: #999999;
    font-size: 0.9rem;
    letter-spacing: 0.2px;
}

/* --- Footer Rainbow Trigger & Emoji Rain --- */
.footer-rainbow {
    display: inline-block;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    padding: 0 4px;
    vertical-align: baseline;
}
/* Generous touch target for mobile/tablet without expanding text line-height */
.footer-rainbow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    pointer-events: auto;
}
.footer-rainbow:hover {
    transform: scale(1.35) rotate(-8deg);
}
.footer-rainbow:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 4px;
    border-radius: 4px;
}
.footer-rainbow:active,
.footer-rainbow.rainbow-popping {
    animation: rainbow-pop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes rainbow-pop {
    0% { transform: scale(1); }
    35% { transform: scale(1.55) rotate(18deg); }
    70% { transform: scale(0.9) rotate(-10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Emoji Rain Overlay */
#emoji-rain-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999999;
    overflow: hidden;
    contain: layout size;
}
.emoji-raindrop {
    position: absolute;
    top: -60px;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    line-height: 1;
    will-change: transform;
    animation: emoji-rain-fall linear forwards;
}
@keyframes emoji-rain-fall {
    0% {
        transform: translate3d(0, -60px, 0) rotate(var(--rot-start, 0deg));
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    88% {
        opacity: 1;
    }
    100% {
        transform: translate3d(var(--drift-x, 0px), calc(100vh + 80px), 0) rotate(var(--rot-end, 0deg));
        opacity: 0.85;
    }
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .pt-large { padding-top: 50px; }
    .pb-large { padding-bottom: 60px; }
    .section-title { font-size: 1.9rem; margin-bottom: 30px;}

    .hero { 
        grid-template-columns: 1fr; 
        grid-template-areas: 
            "title" 
            "image" 
            "bio"; 
        text-align: left;
        gap: 25px; 
    }
    .hero-title { font-size: 2.6rem; }
    .hero-image { justify-content: center; justify-self: center; }
    .blob-img { max-width: 320px; }
    .hero-bio-action { 
        max-width: 100%; 
        width: 100%; 
    }
    .hero-bio { 
        max-width: 100%; 
        width: 100%; 
        margin-bottom: 25px; 
    }
    .hero-bio p { 
        max-width: 100%; 
        font-size: 1.15rem; 
        line-height: 1.65; 
    }
    
    .passion-grid, .tech-grid, .tech-details, .research-grid, .expertise-grid { 
        grid-template-columns: 1fr; 
    }
    .tech-image { max-width: 250px; margin: 0 auto; }
}

@media (max-width: 768px) {
    .carousel-wrapper {
        margin-top: -10px;
        margin-left: -20px;
        margin-right: -20px;
    }
    .carousel-container {
        padding: 20px 20px 14px 20px;
        gap: 20px;
        scroll-padding-left: 20px;
        scroll-padding-right: 20px;
    }
    .project-card { 
        flex: 0 0 300px;
        width: 300px;
        min-width: min(300px, 82vw);
        max-width: 82vw;
    }
    .project-info {
        padding: 12px 24px 28px 24px;
    }
    .project-info h3 {
        font-size: 1.15rem;
        font-weight: 700;
        margin-bottom: 8px;
        line-height: 1.3;
    }
    .project-info p {
        font-size: 0.86rem;
        margin-bottom: 22px;
        line-height: 1.55;
    }
    .project-info .btn {
        align-self: flex-start;
        padding: 9px 20px;
        font-size: 0.78rem;
    }
    .project-card:last-child {
        scroll-snap-align: end;
    }
    .carousel-controls {
        margin-top: -4px;
        margin-right: 0;
        padding: 0 20px 8px 20px;
        gap: 12px;
    }
    .carousel-hint {
        font-size: 0.82rem;
    }
    .mockups-grid { gap: 8px; }

    .research-card {
        padding: 18px;
        border-radius: 22px;
    }
    .research-img-wrapper {
        margin-bottom: 18px;
    }
    .research-card .btn {
        padding: 9px 20px;
        font-size: 0.78rem;
    }

    .site-footer {
        padding: 40px 0 36px;
    }
    .footer-content {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 20px;
    }
    .footer-links {
        justify-content: center;
        gap: 8px 24px;
    }
    .footer-links a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 6px 12px;
        font-size: 0.95rem;
    }
    .footer-copy {
        font-size: 0.85rem;
        color: #888888;
        padding-top: 2px;
    }

    /* Disable all hover effects for mobile view */
    .project-card,
    .project-card:hover {
        box-shadow: none !important;
        transform: none !important;
    }
    .study-card:hover,
    .research-card:hover {
        transform: none !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
    }
    .study-media-wrapper:hover .study-img {
        transform: none !important;
    }
    .carousel-controls button:hover:not(:disabled) {
        opacity: 1 !important;
        transform: none !important;
    }
    .btn:hover,
    .btn-black:hover {
        transform: none !important;
    }
}

/* --- Research Subpage & Studies Grid --- */
.studies-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 46px 38px;
    margin-top: 10px;
    margin-bottom: 40px;
}

.study-card {
    background-color: var(--bg-white);
    border: 1px solid #dfd7ce;
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.study-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.09);
}

.study-media-wrapper {
    position: relative;
    background-color: #eae5de;
    overflow: hidden;
    border-top-left-radius: 29px;
    border-top-right-radius: 29px;
    width: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #d9d0c5;
    cursor: zoom-in;
}

.study-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.25s ease, filter 0.25s ease;
    cursor: zoom-in;
}

.study-media-wrapper:hover .study-img {
    transform: scale(1.02);
}

.study-zoom-cue {
    position: absolute;
    bottom: 12px;
    right: 14px;
    background: rgba(14, 17, 22, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.study-media-wrapper:hover .study-zoom-cue {
    opacity: 1;
    transform: translateY(0);
}

.study-card-action {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #f0ece6;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.btn-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 26px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--btn-radius);
    background-color: var(--text-dark);
    color: var(--text-light);
    border: 2px solid var(--text-dark);
    transition: var(--transition);
    text-decoration: none;
    letter-spacing: 0.3px;
    cursor: pointer;
    text-align: center;
}

.btn-pdf:hover {
    background-color: transparent;
    color: var(--text-dark);
}

.study-content {
    padding: 24px 28px 26px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 12px;
}

.study-category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.85px;
    color: var(--accent-orange);
}

.study-title {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.study-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 2px 0 4px;
}

.study-tag {
    font-size: 0.67rem;
    font-weight: 600;
    color: #333333;
    background-color: #f1edea;
    padding: 3px 9px;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 0.1px;
}

.study-desc {
    font-size: 0.81rem;
    color: #383838;
    line-height: 1.62;
    margin: 0;
}

/* --- Research Toolbar & Filtering --- */
.research-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 36px;
    padding-bottom: 22px;
    border-bottom: 1px solid #e5dfd9;
}

.filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-grey);
    margin-right: 4px;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-pill {
    background-color: transparent;
    border: 1px solid #cfc7c0;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #444444;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.filter-pill:hover {
    border-color: var(--text-dark);
    color: var(--text-dark);
    background-color: #f7f4ef;
}

.filter-pill.active {
    background-color: var(--text-dark);
    border-color: var(--text-dark);
    color: var(--text-light);
}

.btn-toggle-all {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background-color: transparent;
    border: none;
    padding: 6px 2px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: color 0.2s ease;
    font-family: inherit;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: #baa99b;
}

.btn-toggle-all:hover {
    color: #000000;
    text-decoration-color: var(--text-dark);
}

.btn-toggle-all .toggle-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background-color: #eae4dc;
    color: var(--text-dark);
    text-decoration: none;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.btn-toggle-all:hover .toggle-icon-box {
    background-color: #ded6cb;
}

.btn-toggle-all .toggle-icon-box svg {
    transition: transform 0.25s ease;
}

.btn-toggle-all.is-expanded .toggle-icon-box svg {
    transform: rotate(180deg);
}

/* --- Interactive Accordions (Overview & Highlights) --- */
.study-accordions-group {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee8e2;
}

.study-accordion {
    width: 100%;
}

.study-accordion:not(.study-accordions-group .study-accordion) {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #eee8e2;
}

.study-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background-color: #f8f6f3;
    border: 1px solid #e7e0d9;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-dark);
    list-style: none;
    user-select: none;
    transition: all 0.2s ease;
}

.study-accordion-summary::-webkit-details-marker {
    display: none;
}

.study-accordion-summary:hover {
    background-color: #efeae2;
    border-color: #dbd2c8;
}

.summary-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.summary-title {
    font-size: 0.78rem;
    letter-spacing: 0.15px;
    font-weight: 700;
}

.summary-badge {
    display: none;
}

.summary-arrow {
    transition: transform 0.25s ease;
    color: #000000 !important;
    stroke: #000000 !important;
    flex-shrink: 0;
}

.study-accordion[open] .summary-arrow {
    transform: rotate(180deg);
}

.study-accordion[open] .study-accordion-summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background-color: #f2ece4;
}

.study-accordion-body {
    padding: 14px 16px 14px;
    border: 1px solid #e7e0d9;
    border-top: none;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    background-color: #faf9f7;
    animation: fadeInAccordion 0.2s ease;
}

.study-accordion-body .study-desc {
    font-size: 0.83rem;
    color: #383838;
    line-height: 1.65;
    padding: 2px 2px;
}

@keyframes fadeInAccordion {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.study-highlights-block {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f0ece9;
}

.study-highlights-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.study-highlights {
    list-style: disc;
    padding-left: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.76rem;
    color: #444444;
    line-height: 1.56;
}

.study-highlights li strong {
    color: var(--text-dark);
}

/* --- Canva Presentations on Research Page --- */
.canva-presentations-section {
    margin-top: 70px;
    padding-top: 60px;
    border-top: 1px solid #ded8d2;
}

.canva-header-block {
    margin-bottom: 32px;
}

.canva-presentations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    width: 100%;
}

.canva-presentation-card {
    background-color: var(--bg-white);
    padding: 22px;
    border-radius: 26px;
    text-align: center;
    border: 1px solid #e6e0d9;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
}

.canva-presentation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
}

.canva-card-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 0;
    margin-bottom: 18px;
    background-color: #f1efeb;
}

.canva-presentation-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
    transition: transform 0.3s ease;
}

.canva-presentation-card:hover img {
    transform: scale(1.03);
}

.canva-presentation-card .card-info {
    margin-bottom: 18px;
    text-align: left;
}

.canva-presentation-card .card-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-orange);
    display: block;
    margin-bottom: 4px;
    white-space: nowrap;
}

.canva-presentation-card .card-title {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-dark);
}

.canva-presentation-card .research-action {
    margin-top: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding-top: 10px;
}

.canva-presentation-card .btn {
    width: auto;
    min-height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: var(--btn-radius);
    border: 2px solid var(--text-dark);
    background-color: var(--text-dark);
    color: var(--text-light);
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.canva-presentation-card .btn:hover {
    background-color: transparent;
    color: var(--text-dark);
}

.research-hero-banner {
    max-width: 820px;
    margin-bottom: 50px;
}

.research-hero-title {
    font-size: 3.2rem;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.research-hero-desc {
    font-size: 1.15rem;
    color: var(--text-grey);
    line-height: 1.7;
}

@media (max-width: 992px) {
    .studies-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .research-hero-title {
        font-size: 2.3rem;
    }
    .study-content {
        padding: 22px 24px 24px;
        gap: 12px;
    }
    .canva-presentations-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }
}

@media (max-width: 768px) {
    .studies-grid {
        gap: 28px;
    }
    .study-content {
        padding: 18px 20px 22px;
    }
    .study-media-wrapper {
        padding: 12px 14px;
    }
    .canva-presentations-section {
        margin-top: 48px;
        padding-top: 40px;
    }
    .canva-presentations-grid {
        grid-template-columns: 1fr;
        gap: 22px;
        width: 100%;
    }
    .canva-presentation-card {
        padding: 20px;
        border-radius: 22px;
        width: 100%;
    }
    .canva-card-img-wrapper {
        border-radius: 0;
        margin-bottom: 14px;
    }
    .canva-presentation-card .card-title {
        font-size: 1.1rem;
        line-height: 1.4;
    }
    .canva-presentation-card .btn {
        width: auto;
        min-height: auto;
        font-size: 0.82rem;
        padding: 10px 22px;
    }
    .research-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 28px;
    }
    .filter-group {
        width: 100%;
    }
    .filter-pills {
        width: 100%;
        gap: 6px;
    }
    .filter-pill {
        padding: 7px 14px;
        font-size: 0.8rem;
    }
    .toolbar-actions {
        width: 100%;
    }
    .btn-toggle-all {
        width: auto;
        justify-content: flex-start;
        padding: 8px 0;
        min-height: 44px;
    }
    .research-hero-title {
        font-size: 1.95rem;
        margin-bottom: 14px;
    }
    .research-hero-desc {
        font-size: 0.98rem;
        line-height: 1.6;
    }
}

/* --- High-Performance Image Viewer Overlay --- */
.overlay {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(9, 11, 15, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    touch-action: none;
    overscroll-behavior: contain;
    justify-content: center;
    align-items: center;
}

.close-btn {
    position: absolute;
    top: 28px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 0;
    outline: none;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(239, 68, 68, 0.9);
    transform: scale(1.08);
    color: #ffffff;
}

.close-btn:active {
    transform: scale(0.95);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 0;
    outline: none;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.08);
    color: #ffffff;
}

.nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.prev-btn {
    left: 28px;
}

.next-btn {
    right: 28px;
}

.overlay-toolbar {
    position: absolute;
    top: 24px;
    right: 28px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(26, 30, 40, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 40px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    z-index: 10002;
    user-select: none;
}

.overlay-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    color: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.overlay-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    transform: scale(1.06);
}

.overlay-btn:active {
    transform: scale(0.96);
}

.overlay-btn-close {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.14);
}

.overlay-btn-close:hover {
    background: rgba(239, 68, 68, 0.85);
    border-color: transparent;
    color: #ffffff;
}

.overlay-zoom-level {
    font-size: 0.78rem;
    font-weight: 700;
    color: #e2e8f0;
    min-width: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.2px;
}

.overlay-divider {
    width: 1px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.18);
    margin: 0 2px;
}

.overlay-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

.overlay-stage.is-dragging {
    cursor: grabbing;
}

#overlay-img {
    max-width: 90vw;
    max-height: 84vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.65);
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
    will-change: transform;
}

#overlay-img.no-transition {
    transition: none !important;
}

.overlay-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(18, 22, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 30px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 10002;
    transition: opacity 0.5s ease;
}

@media (max-width: 768px) {
    .contact-grid {
        gap: 16px;
        padding: 0 10px;
    }
    .close-btn {
        top: 16px;
        right: 16px;
        width: 42px;
        height: 42px;
    }
    .nav-btn {
        width: 44px;
        height: 44px;
    }
    .prev-btn {
        left: 12px;
    }
    .next-btn {
        right: 12px;
    }
    .overlay #overlay-img {
        max-width: 82vw;
        max-height: 80vh;
    }
    .overlay-toolbar {
        top: 14px;
        right: 14px;
        left: auto;
        padding: 4px 8px;
        gap: 4px;
    }
    .overlay-btn {
        width: 36px;
        height: 36px;
    }
    .overlay-zoom-level {
        font-size: 0.72rem;
        min-width: 38px;
    }
    .overlay-hint {
        bottom: 16px;
        font-size: 0.7rem;
        padding: 6px 12px;
        width: max-content;
        max-width: 90vw;
        text-align: center;
    }
}
