* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevent flickering across all elements */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* GPU Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:root {
    --surface-color: #5c5c9e;
    --layer-1-color: #3d3d7a;
    --layer-2-color: #2a2d5c;
    --layer-3-color: #151830;
    --accent-color: #818cf8;
    --text-light: #e8e7f5;
    --text-muted: #a5a8c8;
    --card-radius: 8px;
    --pulse-rgb: 129, 140, 248;
    
    /* Home typography tokens (mobile-first, fluid within bounds) */
    --home-title-size: clamp(4rem, calc(3.2rem + 2.2vw), 5.5rem);
    --home-subtitle-size: clamp(0.9rem, calc(0.84rem + 0.28vw), 1.1rem);
    --home-role-subtitle-size: clamp(0.78rem, calc(0.72rem + 0.22vw), 0.92rem);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background: radial-gradient(ellipse at center, #3b3b82 0%, #1a1a3b 55%, #060612 100%);
    min-height: 100%
}

@media (min-width:1025px) and (max-width:1400px) {
    html {
        font-size: 87.5%
    }
}

/* Desktop typography tokens (single fluid scale, no breakpoint jumps) */
@media (min-width: 1025px) {
    :root {
        --home-title-size: clamp(6.5rem, calc(2.8rem + 5.6vw), 15rem);
        --home-subtitle-size: clamp(1.1rem, calc(0.9rem + 0.45vw), 1.6rem);
        --home-role-subtitle-size: clamp(0.95rem, calc(0.78rem + 0.32vw), 1.3rem);
    }
}

/* Large desktop: 1600px - 1919px */
@media (min-width: 1600px) and (max-width: 1919px) {
    .layer[data-depth="0"] .layer-content {
        padding: 4rem;
    }

    .layer[data-depth="0"] .home-line1 {
        bottom: 4rem;
        right: 4rem;
    }

    .layer[data-depth="0"] .home-line2 {
        top: 4rem;
        left: 4rem;
    }
}

/* 2K displays: 1920px - 2559px */
@media (min-width: 1920px) and (max-width: 2559px) {
    .layer[data-depth="0"] .layer-content {
        padding: 5rem;
    }

    .layer[data-depth="0"] .home-line1 {
        bottom: 5rem;
        right: 5rem;
    }

    .layer[data-depth="0"] .home-line2 {
        top: 5rem;
        left: 5rem;
    }
}

/* 4K displays: 2560px - 3199px */
@media (min-width: 2560px) and (max-width: 3199px) {
    .layer[data-depth="0"] .layer-content {
        padding: 6rem;
    }

    .layer[data-depth="0"] .home-line1 {
        bottom: 6rem;
        right: 6rem;
    }

    .layer[data-depth="0"] .home-line2 {
        top: 6rem;
        left: 6rem;
    }
}

/* Ultra-wide 3K+ displays: 3200px+ */
@media (min-width: 3200px) {
    .layer[data-depth="0"] .layer-content {
        padding: 7rem;
    }

    .layer[data-depth="0"] .home-line1 {
        bottom: 7rem;
        right: 7rem;
    }

    .layer[data-depth="0"] .home-line2 {
        top: 7rem;
        left: 7rem;
    }
}

body {
    font-family: 'Times New Roman', Times, serif;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #3b3b82 0%, #1a1a3b 55%, #060612 100%);
    color: var(--text-light);
    opacity: 0;
    visibility: hidden;
    /* Prevent flickering on Windows */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body.layers-loaded {
    visibility: visible
}

body.load-input-lock,
body.load-input-lock * {
    pointer-events: none !important;
    user-select: none
}

body.page-hidden .layer,
body.page-hidden .layer::after,
body.page-hidden .layer::before {
    animation-play-state: paused !important
}

/* Additional GPU optimization: pause all animations when page is hidden */
body.page-hidden * {
    animation-play-state: paused !important;
}

/* Light mode — white with subtle lavender */
body.light-mode {
    --surface-color: #fafafa;
    --layer-1-color: #f5f5f5;
    --layer-2-color: #f0f0f0;
    --layer-3-color: #ebebeb;
    --accent-color: #312e81;
    --text-light: #1e1b4b;
    --text-muted: #312e81;
    --pulse-rgb: 49, 46, 129; /* Darker blue for light mode pulse */
}

body.light-mode,
body.light-mode html {
    background: #ffffff !important;
}

body.light-mode .layer[data-depth="0"] {
    background: #ffffff !important;
}

body.light-mode .layer[data-depth="1"] {
    background: #fafafa !important;
}

body.light-mode .layer[data-depth="2"] {
    background: #f5f5f5 !important;
}

body.light-mode .layer[data-depth="3"] {
    background: #f0f0f0 !important;
}

body.light-mode .layer {
    box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
}

body.light-mode .layer::before {
    border-color: rgba(49, 46, 129, 0.2);
}

body.light-mode .layer.active {
    box-shadow: 0 15px 50px rgba(0, 0, 0, .08);
}

body.light-mode .layer.active::before {
    border-color: rgba(49, 46, 129, 0.3);
}

body.light-mode .layer::after {
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 23px,
        rgba(49, 46, 129, 0.08) 23px,
        rgba(49, 46, 129, 0.08) 24px
    ) !important;
}

body.light-mode .layer[data-depth="2"]::after {
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 23px,
        rgba(49, 46, 129, 0.045) 23px,
        rgba(49, 46, 129, 0.045) 24px
    ) !important;
}

body.light-mode .layer[data-depth="3"]::after {
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 23px,
        rgba(49, 46, 129, 0.05) 23px,
        rgba(49, 46, 129, 0.05) 24px
    ) !important;
}

body.light-mode .layer-label {
    color: #1e1b4b !important;
}

body.light-mode .layer[data-depth="0"] .designer-footnote,
body.light-mode .layer[data-depth="0"] .subtitle {
    color: #1e1b4b !important;
}

body.light-mode .layer[data-depth="0"] h1,
body.light-mode .layer[data-depth="0"] .greeting-line {
    color: #1e1b4b !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
}

body.light-mode .settings-btn {
    color: #2a2d5c;
}

body.light-mode .settings-container .settings-btn {
    color: #2a2d5c;
}

body.light-mode .settings-container:has(.settings-overlay.active) .settings-btn {
    color: #1e1b4b;
}



body.light-mode .settings-overlay {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(49, 46, 129, 0.2);
}

body.light-mode .settings-label {
    color: #1e1b4b;
}

body.light-mode .settings-toggle:hover {
    background: rgba(49, 46, 129, 0.06);
}

body.light-mode .profile-image-wrap {
    background: #151830 !important;
    border-color: rgba(129, 140, 248, .5) !important;
}

body.light-mode .gallery-viewer-overlay {
    background: rgba(255, 255, 255, 0.97);
}

body.light-mode .gallery-viewer-close,
body.light-mode .gallery-viewer-prev,
body.light-mode .gallery-viewer-next {
    background: rgba(49, 46, 129, 0.12);
    color: #1e1b4b;
}

body.light-mode .gallery-viewer-close:hover,
body.light-mode .gallery-viewer-prev:hover,
body.light-mode .gallery-viewer-next:hover {
    background: rgba(49, 46, 129, 0.2);
}

body.light-mode .project-card-overlay-backdrop {
    background: rgba(255, 255, 255, 0.9);
}

body.light-mode .project-card-overlay-card {
    background: #fafafa !important;
}

body.light-mode .bio-contact-link,
body.light-mode .card-project-link,
body.light-mode .surface-btn,
body.light-mode .popup-link,
body.light-mode .project-link {
    color: #3730a3 !important;
}

body.light-mode .bio-contact-link:hover,
body.light-mode .card-project-link:hover,
body.light-mode .surface-btn:hover,
body.light-mode .popup-link:hover,
body.light-mode .project-link:hover {
    color: #312e81 !important;
}

body.light-mode .card-read-more {
    color: #3730a3 !important;
}

body.light-mode .card-read-more:hover {
    color: #312e81 !important;
}

body.light-mode .project-row:nth-child(1) .project-card,
body.light-mode .project-row:nth-child(2) .project-card,
body.light-mode .project-row:nth-child(3) .project-card,
body.light-mode .project-row:nth-child(4) .project-card,
body.light-mode .project-row:nth-child(5) .project-card,
body.light-mode .project-row:nth-child(6) .project-card,
body.light-mode .project-row:nth-child(7) .project-card,
body.light-mode .project-row:nth-child(8) .project-card {
    background: #f0f0f0 !important;
}

body.light-mode .card-title,
body.light-mode .card-subtitle,
body.light-mode .card-description,
body.light-mode .card-peek,
body.light-mode .card-expanded-text,
body.light-mode .project-label {
    color: #1e1b4b !important;
}

body.light-mode .project-label {
    -webkit-text-stroke: 1.5px #1e1b4b !important;
    -webkit-text-fill-color: #1e1b4b !important;
}

body.light-mode .project-category-tag {
    background: rgba(255, 255, 255, 0.6);
    color: #1e1b4b;
    border-color: rgba(30, 27, 75, 0.1);
}

.lake-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden
}

.layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 82vw;
    height: 76vh;
    border-radius: var(--card-radius);
    overflow: visible;
    opacity: 0;
    visibility: hidden;
    pointer-events: all;
    cursor: pointer;
    /* Simplified box-shadow for non-active layers */
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
    contain: layout style paint;
    /* Force GPU acceleration with transform */
    transform: translate3d(0, 0, 0) scale(1);
    transform-origin: top left;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Prevent subpixel rendering issues */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Add border hint instead of expensive inset shadow */
.layer::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(129, 140, 248, .12);
    pointer-events: none;
    z-index: 1;
    /* Prevent border from flickering */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.layers-no-transition .layer {
    transition: none !important
}

body:not(.layers-no-transition) .layer {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

body.layers-loaded .layer {
    visibility: visible
}

body.layers-loaded .layer[data-depth="3"] {
    animation: layerAppear .55s ease .15s forwards;
    animation-delay: .15s;
}

body.layers-loaded .layer[data-depth="2"] {
    animation: layerAppear .55s ease .4s forwards;
    animation-delay: .4s;
}

body.layers-loaded .layer[data-depth="1"] {
    animation: layerAppear .55s ease .65s forwards;
    animation-delay: .65s;
}

body.layers-loaded .layer[data-depth="0"] {
    animation: layerAppear .55s ease .9s forwards;
    animation-delay: .9s;
}

/* Skip layerAppear when already shown (e.g. after toggling effects) */
body.layers-loaded.layers-appeared .layer {
    opacity: 1;
}

body.layers-loaded.layers-appeared .layer[data-depth="0"] .greeting-line.fade-in,
body.layers-loaded.layers-appeared .layer[data-depth="0"] .fade-in-delay {
    animation: none !important;
    opacity: 1;
}

/* Only run fade-in animations on first load, not on navigation */
body.layers-loaded:not(.layers-appeared) .layer[data-depth="0"] .greeting-line.fade-in {
    animation: homeTitleFade .8s cubic-bezier(.22, 1, .36, 1) 2s both
}

body.layers-loaded:not(.layers-appeared) .layer[data-depth="0"] .fade-in-delay {
    animation: homeSubtitleIntro .8s cubic-bezier(.22, 1, .36, 1) 1s backwards
}

body.reduce-motion.layers-loaded .layer[data-depth="0"] .fade-in-delay,
body.reduce-motion.layers-loaded .layer[data-depth="0"] .greeting-line.fade-in {
    animation: none !important;
    opacity: 1
}

body.reduce-motion .layer[data-depth="0"] .role-subtitle {
    transition: none !important;
    transform: none !important;
}

body.reduce-motion .layer[data-depth="0"]::after {
    animation: none !important;
}

@keyframes layerAppear {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes homeTitleFade {
    from {
        opacity: 0;
        transform: translate3d(0, 10px, 0)
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0)
    }
}

@keyframes homeSubtitleIntro {
    from {
        opacity: 0;
        transform: translate3d(0, 8px, 0)
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0)
    }
}

@keyframes layerFloat {
    0% { translate: 0 0 0; }
    25% { translate: 2px -6px 0; }
    50% { translate: 4px 1px 0; }
    75% { translate: -2px -4px 0; }
    100% { translate: 0 0 0; }
}

@keyframes homePatternDrift {
    0% {
        background-position: 0 0;
        opacity: 1;
    }

    100% {
        background-position: 0 8px;
        opacity: 0.9;
    }
}

/* Pause floating animation when page is hidden or reduce-motion is enabled */
body.reduce-motion .layer,
body.page-hidden .layer {
    animation: none !important;
}

/* Keep layers static after initial load */
body.layers-loaded.layers-appeared .layer[data-depth="0"],
body.layers-loaded.layers-appeared .layer[data-depth="1"],
body.layers-loaded.layers-appeared .layer[data-depth="2"],
body.layers-loaded.layers-appeared .layer[data-depth="3"] { 
    animation: none;
}

.layer.active {
    cursor: default;
    box-shadow: 0 15px 50px rgba(0, 0, 0, .4);
}

.layer.active::before {
    border-color: rgba(129, 140, 248, .4);
}

.layer.active .layer-content {
    opacity: 1;
    pointer-events: all;
    /* Remove delay - content should be instantly visible when layer is active */
    transition-delay: 0s;
}

/* Only show dot pattern on active layer to reduce GPU load */
.layer:not(.active)::after {
    opacity: 0.4;
}

.layer:not(.active) .layer-content {
    opacity: 0;
    pointer-events: none;
    /* No delay when fading out */
    transition-delay: 0s;
}

.layer:not(.active) {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    content-visibility: auto;
}

.layer[data-depth="0"] {
    background: #5c5c9e;
    overflow: visible;
    contain: layout style;
}

.layer[data-depth="1"] {
    background: #3d3d7a;
}

.layer[data-depth="2"] {
    background: #151834;
}

.layer[data-depth="3"] {
    background: #090c1e;
}

.layer::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 23px,
        rgba(0, 0, 0, 0.08) 23px,
        rgba(0, 0, 0, 0.08) 24px
    );
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 0;
    /* Prevent pattern from flickering */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: auto;
}

.layer[data-depth="0"]::after {
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 23px,
        rgba(0, 0, 0, 0.06) 23px,
        rgba(0, 0, 0, 0.06) 24px
    );
    animation: homePatternDrift 16s ease-in-out infinite alternate;
}

.layer[data-depth="1"]::after {
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 23px,
        rgba(0, 0, 0, 0.08) 23px,
        rgba(0, 0, 0, 0.08) 24px
    );
}

.layer[data-depth="2"]::after {
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 23px,
        rgba(255, 255, 255, 0.025) 23px,
        rgba(255, 255, 255, 0.025) 24px
    );
}

.layer[data-depth="3"]::after {
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 23px,
        rgba(255, 255, 255, 0.03) 23px,
        rgba(255, 255, 255, 0.03) 24px
    );
}

.layer[data-depth="2"],
.layer[data-depth="3"] {
    container-type: inline-size;
    container-name: card
}



.layer:not(.active):hover {
    box-shadow: 0 8px 30px rgba(var(--pulse-rgb), .2);
}

.layer:not(.active):hover::before {
    border-color: rgba(var(--pulse-rgb), .6);
}

.layer.hint-pulse::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
    z-index: 1;
    border: 2px solid rgba(var(--pulse-rgb), 0);
    animation: edgeGlowPulse 2.5s ease-in-out infinite
}

@keyframes edgeGlowPulse {
    0% {
        opacity: .3;
        border-color: rgba(var(--pulse-rgb), 0)
    }

    20% {
        opacity: .65;
        border-color: rgba(var(--pulse-rgb), .35)
    }

    40% {
        opacity: .8;
        border-color: rgba(var(--pulse-rgb), .5)
    }

    50% {
        opacity: .9;
        border-color: rgba(var(--pulse-rgb), .6)
    }

    60% {
        opacity: .8;
        border-color: rgba(var(--pulse-rgb), .5)
    }

    80% {
        opacity: .65;
        border-color: rgba(var(--pulse-rgb), .35)
    }

    100% {
        opacity: .3;
        border-color: rgba(var(--pulse-rgb), 0)
    }
}

@keyframes arrowGlowPulse {

    0%,
    30% {
        border-color: rgba(129, 140, 248, 0);
        box-shadow: 0 0 20px rgba(129, 140, 248, .08)
    }

    45% {
        border-color: rgba(129, 140, 248, .4);
        box-shadow: 0 0 24px rgba(129, 140, 248, .18)
    }

    50% {
        border-color: rgba(129, 140, 248, .65);
        box-shadow: 0 0 30px rgba(129, 140, 248, .3)
    }

    55% {
        border-color: rgba(129, 140, 248, .4);
        box-shadow: 0 0 24px rgba(129, 140, 248, .18)
    }

    100%,
    70% {
        border-color: rgba(129, 140, 248, 0);
        box-shadow: 0 0 20px rgba(129, 140, 248, .08)
    }
}

.layer.hint-pulse .layer-label {
    animation: labelFlash 2.5s ease-in-out
}

.layer[data-depth="0"].hint-pulse .layer-label {
    animation: labelFlashHome 2.5s ease-in-out
}

@keyframes labelFlash {
    0%,
    100% {
        color: rgba(129, 140, 248, .7)
    }

    50% {
        color: #818cf8
    }
}

@keyframes labelFlashHome {
    0%,
    100% {
        color: #2a2d5c;
    }

    50% {
        color: #3d3d7a;
    }
}

.layer-label {
    position: absolute;
    top: 0.125rem;
    left: 0.5rem;
    font-family: inherit;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(129, 140, 248, .7);
    z-index: 5;
    pointer-events: none;
    transition: opacity .5s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    /* Remove will-change - not needed for simple opacity/transform */
    transform-origin: top left;
}

.layer[data-depth="0"] .layer-label {
    color: #2a2d5c;
}

.layer.active .layer-label {
    opacity: 0;
    pointer-events: none
}

.landing-outline-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
}

body.layers-loaded .landing-outline-wrap {
    animation: fadeInPlace 1.5s ease-out 1.2s forwards;
}

.landing-outline {
    position: absolute;
    top: 50%;
    left: 42%;
    transform: translate(-50%, -50%);
    width: 55%;
    height: auto;
    opacity: 0.2;
    color: #151830;
    mix-blend-mode: multiply;
}

body.light-mode .landing-outline {
    opacity: 0.08;
    color: #1e1b4b;
}

.layer-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    position: relative;
    overflow-y: auto;
    overflow-x: visible;
    z-index: 2;
    /* Remove transition - content should appear instantly */
    -webkit-overflow-scrolling: touch;
}

.layer-content {
    scrollbar-width: none;
    -ms-overflow-style: none
}

.layer-content::-webkit-scrollbar {
    display: none
}

.content-wrapper {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    text-align: center
}

.layer[data-depth="0"] .content-wrapper {
    position: relative;
    min-height: 100%;
    width: 100%;
    margin: 0;
    max-width: none
}

.layer[data-depth="0"] .home-line1 {
    position: absolute;
    bottom: 3rem;
    right: 3rem;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end
}

.layer[data-depth="0"] .home-line1 h1 {
    margin: 0;
    text-align: right
}

.layer[data-depth="0"] .greeting-line {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    text-transform: lowercase;
    will-change: opacity;
    transform: translateZ(0)
}

.layer[data-depth="0"] .home-line2 {
    height: 1.6em;
    min-height: 1.6em;
    margin-top: .25rem
}

.layer[data-depth="0"] .home-line2 .subtitle {
    margin: 0
}

.layer[data-depth="0"] .subtitle strong {
    font-weight: 700;
}

.home-about-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
    cursor: pointer;
    position: relative;
    display: inline-block;
}

.home-about-link:hover {
    opacity: 0.7;
}

.home-about-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.08em;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}

.home-about-link:hover::after,
.home-about-link:focus-visible::after {
    transform: scaleX(1);
}

.layer[data-depth="0"] h1 {
    font-size: var(--home-title-size);
    font-weight: 300;
    line-height: 1.15;
    min-height: 1.15em;
    margin-bottom: 0.5rem;
    color: #151830;
}

.flicker-dot {
    animation: flicker 11s infinite linear;
    animation-delay: 3s;
    display: inline;
}

/* Pause flicker when page is hidden or reduce-motion is on */
body.page-hidden .flicker-dot,
body.reduce-motion .flicker-dot {
    animation-play-state: paused;
    opacity: 1;
}

/* Keep the dot always visible when Effects are off */
body.reduce-motion .flicker-dot {
    animation: none !important;
    opacity: 1 !important;
}

@keyframes flicker {
    /* T: - */
    0%, 4.1% { opacity: 0; }
    4.11%, 8.2% { opacity: 1; }
    /* A: .- */
    8.21%, 9.6% { opacity: 0; }
    9.61%, 11.0% { opacity: 1; }
    11.01%, 15.1% { opacity: 0; }
    15.11%, 19.2% { opacity: 1; }
    /* M: -- */
    19.21%, 23.3% { opacity: 0; }
    23.31%, 24.7% { opacity: 1; }
    24.71%, 28.8% { opacity: 0; }
    28.81%, 32.9% { opacity: 1; }
    /* M: -- */
    32.91%, 37.0% { opacity: 0; }
    37.01%, 38.4% { opacity: 1; }
    38.41%, 42.5% { opacity: 0; }
    42.51%, 46.6% { opacity: 1; }
    /* U: ..- */
    46.61%, 48.0% { opacity: 0; }
    48.01%, 49.3% { opacity: 1; }
    49.31%, 50.7% { opacity: 0; }
    50.71%, 52.1% { opacity: 1; }
    52.11%, 56.2% { opacity: 0; }
    56.21%, 60.3% { opacity: 1; }
    /* Z: --.. */
    60.31%, 64.4% { opacity: 0; }
    64.41%, 65.8% { opacity: 1; }
    65.81%, 69.9% { opacity: 0; }
    69.91%, 71.2% { opacity: 1; }
    71.21%, 72.6% { opacity: 0; }
    72.61%, 74.0% { opacity: 1; }
    74.01%, 75.3% { opacity: 0; }
    75.31%, 100% { opacity: 1; }
}

.layer[data-depth="0"] .greeting-line,
.layer[data-depth="0"] h1 {
    font-size: var(--home-title-size) !important;
}

.name-wrap {
    display: inline-block;
    vertical-align: baseline
}



.subtitle {
    font-size: 1.5rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 3rem;
    min-height: 1.5em
}

.layer[data-depth="0"] .home-line2 {
    position: absolute;
    top: 3rem;
    left: 3rem;
    text-align: left;
    height: auto;
    min-height: auto;
    margin-top: 0;
}

.layer[data-depth="0"] .subtitle {
    margin-top: 0;
    color: #151830;
    font-size: var(--home-subtitle-size);
}

.layer[data-depth="0"] .role-subtitle {
    font-size: var(--home-role-subtitle-size);
    color: #151830;
    margin-top: 0.25rem;
    font-weight: 500;
    transition: opacity .24s ease, transform .24s ease;
    will-change: opacity, transform;
}

.layer[data-depth="0"] .role-subtitle.role-switching {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
}

.designer-footnote {
    position: absolute;
    bottom: .5rem;
    left: .5rem;
    font-size: .8rem;
    font-weight: 600;
    color: #2a2d5c;
    letter-spacing: .08em;
    pointer-events: none
}

.layer[data-depth="2"] .content-wrapper {
    max-width: 40cqw;
    margin: 0 auto;
    text-align: justify
}

.about-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: justify;
    gap: clamp(1.5rem, 3cqw, 2.5rem);
    margin-top: 0;
    width: 100%
}

.layer[data-depth="2"] .profile-section {
    text-align: left;
    width: 100%
}

.layer[data-depth="2"] .profile-image-wrap {
    display: inline-block;
    padding: 0;
    background: var(--layer-3-color);
    border-radius: var(--card-radius);
    border: 2px solid rgba(129, 140, 248, .5);
    margin-bottom: clamp(1rem, 1.5cqw, 1.25rem)
}

.layer[data-depth="2"] .profile-image {
    width: clamp(96px, 17cqw, 140px);
    height: clamp(96px, 17cqw, 140px);
    border-radius: calc(var(--card-radius) - 2px);
    object-fit: cover;
    display: block;
    margin: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .2), 0 0 0 1px rgba(255, 255, 255, .06)
}

.layer[data-depth="2"] .profile-section h3 {
    font-size: clamp(1.1rem, 2.2cqw + .5rem, 2rem);
    font-weight: 600;
    margin-bottom: .5rem;
    letter-spacing: -.02em;
    color: var(--text-light)
}

.layer[data-depth="2"] .profile-section h3 .aka {
    font-size: clamp(.8rem, 1.1cqw, .9rem);
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: .01em
}

.layer[data-depth="2"] .role {
    display: inline-block;
    color: var(--accent-color);
    font-size: clamp(.82rem, 1.2cqw, .95rem);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .25rem .75rem .25rem 0;
    border-radius: 999px
}

.layer[data-depth="2"] .location {
    margin: .5rem 0 0 0;
    font-size: clamp(.8rem, 1.1cqw, .9rem);
    font-weight: 600;
    color: var(--accent-color);
    letter-spacing: .02em
}

.layer[data-depth="2"] .bio {
    position: relative;
    padding-top: clamp(1rem, 1.8cqw, 1.5rem);
    width: 100%
}

.layer[data-depth="2"] .bio::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: clamp(2rem, 3.5cqw, 3rem);
    height: 2px;
    background: rgba(129, 140, 248, .4);
    border-radius: 1px
}



.layer[data-depth="2"] .bio p {
    font-size: clamp(.85rem, 1.3cqw + .5rem, 1.05rem);
    line-height: 1.85;
    color: var(--text-muted);
    margin-bottom: clamp(1rem, 1.5cqw, 1.25rem);
    text-align: justify
}

.bio p:last-child {
    margin-bottom: 0
}

.bio-contact-link {
    margin: 0;
    padding: 0;
    border: none;
    background: 0 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    color: #a5b4fc;
    text-decoration: none;
    cursor: pointer;
    transition: color .2s ease
}

.bio-contact-link:hover {
    color: #c7d2fe
}

.layer[data-depth="1"] .layer-content {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden
}

.layer[data-depth="1"] .content-wrapper {
    max-width: 100%;
    width: 100%;
    text-align: left;
    padding: 0;
    height: auto;
    align-self: stretch;
    margin: 0
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    width: 100%;
    padding-top: 2rem;
    padding-bottom: 2rem
}

@keyframes projectCardSlideFromLeft {
    from {
        opacity: 0;
        transform: translateX(-80px) scale(.97)
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(.97)
    }
}

@keyframes projectCardSlideFromRight {
    from {
        opacity: 0;
        transform: translateX(80px) scale(.97)
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(.97)
    }
}

@keyframes projectLabelSlideFromLeft {
    from {
        opacity: 0;
        transform: translateX(-60px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

@keyframes projectLabelSlideFromRight {
    from {
        opacity: 0;
        transform: translateX(60px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

/* Project cards slide in when Work layer becomes active (first time only) */
.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(odd) .project-card {
    animation: projectCardSlideFromLeft .9s cubic-bezier(.16, 1, .3, 1) forwards;
    opacity: 0;
}

.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(even) .project-card {
    animation: projectCardSlideFromRight .9s cubic-bezier(.16, 1, .3, 1) forwards;
    opacity: 0;
}

/* Project labels slide in with cards */
.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(odd) .project-label {
    animation: projectLabelSlideFromLeft .9s cubic-bezier(.16, 1, .3, 1) forwards;
    opacity: 0;
}

.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(even) .project-label {
    animation: projectLabelSlideFromRight .9s cubic-bezier(.16, 1, .3, 1) forwards;
    opacity: 0;
}

/* Stagger the animations for each card */
.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(1) .project-card,
.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(1) .project-label {
    animation-delay: 0.15s;
}

.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(2) .project-card,
.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(2) .project-label {
    animation-delay: 0.35s;
}

.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(3) .project-card,
.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(3) .project-label {
    animation-delay: 0.55s;
}

.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(4) .project-card,
.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(4) .project-label {
    animation-delay: 0.75s;
}

.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(5) .project-card,
.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(5) .project-label {
    animation-delay: 0.95s;
}

.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(6) .project-card,
.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(6) .project-label {
    animation-delay: 1.15s;
}

.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(7) .project-card,
.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(7) .project-label {
    animation-delay: 1.35s;
}

.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(8) .project-card,
.layer[data-depth="1"].active:not(.cards-animated) .project-row:nth-child(8) .project-label {
    animation-delay: 1.55s;
}

/* After animation completes, cards remain visible */
.layer[data-depth="1"].cards-animated .project-card,
.layer[data-depth="1"].cards-animated .project-label {
    opacity: 1;
    transform: scale(.97);
}

.layer[data-depth="1"].cards-animated .project-label {
    transform: none;
}

/* Disable card slide animations when reduce-motion is on */
body.reduce-motion .layer[data-depth="1"].active:not(.cards-animated) .project-card,
body.reduce-motion .layer[data-depth="1"].active:not(.cards-animated) .project-label {
    animation: none !important;
    opacity: 1;
}

.project-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    margin: 0;
    transition: margin .5s cubic-bezier(.4, 0, .2, 1);
    pointer-events: none
}

.layer.active .project-row .project-card {
    pointer-events: auto;
    cursor: pointer
}

.project-row:nth-child(odd) {
    align-self: flex-start;
    flex-direction: row
}

.project-row:nth-child(2n) {
    align-self: flex-end;
    flex-direction: row-reverse
}

.project-label {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 300;
    color: var(--layer-3-color);
    -webkit-text-stroke: 1.5px var(--layer-3-color);
    -webkit-text-fill-color: var(--layer-3-color);
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    margin-top: .5rem
}

.project-card {
    position: relative;
    width: 100%;
    max-width: 48%;
    min-height: 0;
    display: flex;
    flex-direction: row;
    background: #1e2247;
    padding: 0;
    border: 1px solid rgba(129, 140, 248, .2);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .3);
    transition: transform .45s cubic-bezier(.16, 1, .3, 1), box-shadow .75s cubic-bezier(.33, .5, .2, 1), border-color .75s cubic-bezier(.33, .5, .2, 1);
    /* Remove will-change - only needed during active transitions */
    text-align: left;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    max-height: 400px
}

.project-row:nth-child(odd) .project-card {
    transform-origin: left bottom
}

.project-row:nth-child(2n) .project-card {
    transform-origin: right bottom
}

.project-card {
    transform: scale(.97)
}

.layer.active .project-card:not(.expanded):hover {
    box-shadow: 0 0 30px rgba(129, 140, 248, .3), inset 0 0 10px rgba(129, 140, 248, .1);
    border-color: rgba(129, 140, 248, .5);
}

.project-card.expanded {
    max-width: 100%;
    min-height: min(95vh, 1200px);
    max-height: 300vh;
    transform: scale(1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .3), 0 8px 32px rgba(0, 0, 0, .25);
    /* Add will-change only when expanded for smooth animation */
    will-change: transform, max-height;
}

.project-row:nth-child(odd) .project-card {
    border-radius: 0 var(--card-radius) var(--card-radius) 0
}

.project-row:nth-child(2n) .project-card {
    flex-direction: row-reverse;
    border-radius: var(--card-radius) 0 0 var(--card-radius)
}

.project-row:first-child .project-card {
    background: var(--layer-3-color);
    z-index: 1
}

.project-card.card-stack-layout {
    flex-direction: column !important;
    transform-origin: right bottom
}

.project-card.card-stack-layout {
    border-radius: var(--card-radius);
    position: relative
}

.project-card.card-stack-layout .card-thumbnail-block {
    order: 1;
    flex: 0 0 auto;
    width: 100%;
    position: relative
}

.project-card.card-stack-layout .card-thumbnail-block .project-image {
    min-height: 260px;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    overflow: hidden
}

.project-card.card-stack-layout:not(.expanded) .card-thumbnail-block .project-image {
    aspect-ratio: 16/9;
    min-height: 0 !important;
    width: 100%
}

.project-card.card-stack-layout.expanded .card-thumbnail-block .project-image {
    min-height: 60vh
}

.project-card.card-stack-layout .card-content-block {
    order: 2;
    flex: 1 1 auto;
    padding: 1rem;
    width: 100%
}

.project-row .project-card.card-stack-layout:not(.expanded) .card-thumbnail-block .card-expand-btn {
    position: absolute;
    top: 1rem;
    bottom: auto;
    left: auto;
    transform: none;
    z-index: 5;
    animation: none;
    flex: none;
    width: 2rem;
    height: 2rem;
    min-height: 2rem;
    padding: .25rem;
    margin: 0;
    border-radius: 8px;
    border: 2px solid transparent;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
    background: rgba(0, 0, 0, .4);
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .2s ease, border-color .2s ease, box-shadow .2s ease
}

.project-row:nth-child(odd) .project-card.card-stack-layout:not(.expanded) .card-thumbnail-block .card-expand-btn {
    right: 1rem;
    top: 1rem;
    bottom: auto
}

.project-row:nth-child(2n) .project-card.card-stack-layout:not(.expanded) .card-thumbnail-block .card-expand-btn {
    left: 1rem;
    right: auto;
    top: 1rem;
    bottom: auto
}

.project-category-tag {
    position: absolute;
    top: 1rem;
    z-index: 4;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    color: #a5b4fc;
    border: 1px solid rgba(165, 180, 252, 0.1);
    pointer-events: none;
    line-height: 1;
    white-space: nowrap;
}

.project-row:nth-child(odd) .project-category-tag {
    left: 1rem;
}

.project-row:nth-child(2n) .project-category-tag {
    right: 1rem;
}

.project-row .project-card.card-stack-layout:not(.expanded) .card-thumbnail-block .card-expand-btn:hover {
    background: rgba(129, 140, 248, .5);
    transform: scale(1.08);
    border-color: rgba(129, 140, 248, .6);
    box-shadow: 0 8px 30px rgba(129, 140, 248, .2), inset 0 0 45px rgba(129, 140, 248, .25)
}

.project-row .project-card.card-stack-layout:not(.expanded) .card-thumbnail-block .card-expand-arrow {
    display: block;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M20 8V4h-4M4 16v4h4'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center
}

.project-row:nth-child(2n) .project-card.card-stack-layout:not(.expanded) .card-thumbnail-block .card-expand-arrow {
    transform: scaleX(-1)
}

.project-row .project-card.card-stack-layout .card-expand-arrow::before {
    content: none
}

.project-row:nth-child(2) .project-card {
    background: #141728;
    z-index: 2
}

.project-row:nth-child(3) .project-card {
    background: #131525;
    z-index: 3
}

.project-row:nth-child(4) .project-card {
    background: #121422;
    z-index: 4
}

.project-row:nth-child(5) .project-card {
    background: #11131f;
    z-index: 5
}

.project-row:nth-child(6) .project-card {
    background: #10121c;
    z-index: 6
}

.project-row:nth-child(7) .project-card {
    background: #0f1119;
    z-index: 7
}

.project-row:nth-child(8) .project-card {
    background: #0e1016;
    z-index: 8
}

.project-card.expanded {
    z-index: 10
}

.card-content-block {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 1.5rem;
    min-width: 0
}

.card-thumbnail-block {
    position: relative;
    cursor: pointer
}

.card-content-block {
    position: relative
}

.card-peek-wrap {
    width: 100%;
    transition: opacity .3s ease;
}

.card-peek-wrap .card-peek {
    margin: 0
}

.project-card.expanded .card-peek-wrap {
    opacity: 0;
    pointer-events: none;
}

.card-content-block .card-peek-wrap .card-peek {
    font-size: 1.15rem;
    line-height: 1.5;
    color: rgba(129, 140, 248, .85);
    text-align: justify
}

.card-read-more {
    display: inline;
    margin: 0;
    padding: 0;
    border: none;
    background: 0 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    color: #a5b4fc;
    cursor: pointer;
    transition: color .2s ease
}

.card-read-more:hover {
    color: #c7d2fe
}

.card-expand-btn-peek {
    display: none !important;
    position: absolute !important;
    top: 1rem !important;
    bottom: auto !important;
    z-index: 6;
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    min-height: 2rem !important;
    padding: .25rem !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    border: 2px solid transparent !important;
    background: rgba(0, 0, 0, .4) !important;
    opacity: 1 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .3) !important;
    transform: none !important;
    transition: background .2s ease, transform .2s ease, border-color .2s ease, box-shadow .2s ease !important
}

.project-row:nth-child(odd) .card-expand-btn-peek {
    right: 1rem !important;
    left: auto !important;
    top: 1rem !important;
    bottom: auto !important
}

.project-row:nth-child(2n) .card-expand-btn-peek {
    left: 1rem !important;
    right: auto !important;
    top: 1rem !important;
    bottom: auto !important
}

.card-expand-btn-peek .card-expand-arrow {
    width: 1rem !important;
    height: 1rem !important;
    background-size: contain !important
}

.card-expand-btn-peek:hover {
    background: rgba(129, 140, 248, .5) !important;
    transform: scale(1.08) !important;
    border-color: rgba(129, 140, 248, .6) !important;
    box-shadow: 0 8px 30px rgba(129, 140, 248, .2), inset 0 0 45px rgba(129, 140, 248, .25) !important
}

.project-row:nth-child(odd) .card-expand-btn-peek .card-expand-arrow {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 8V4h4M20 16v4h-4'/%3E%3C/svg%3E") !important;
    transform: none
}

.project-row:nth-child(2n) .card-expand-btn-peek .card-expand-arrow {
    transform: scaleX(-1)
}

.card-content-block .card-expanded-text {
    display: none;
    margin: .75rem 0 0;
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text-muted);
    text-align: justify
}

@keyframes cardTextFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.project-card.expanded .card-content-block .card-expanded-text {
    display: none;
    opacity: 0
}

.project-card.expanded.content-visible .card-content-block .card-expanded-text {
    display: block;
    transform-origin: top;
    animation: cardTextFadeIn .4s cubic-bezier(.16, 1, .3, 1) forwards
}

.project-card.expanded.content-visible .card-content-block .card-expanded-text:nth-child(3) {
    animation-delay: 80ms
}

.project-card.expanded.content-visible .card-content-block .card-expanded-text:nth-child(4) {
    animation-delay: 140ms
}

.project-card.expanded.content-visible .card-content-block .card-expanded-text:nth-child(5) {
    animation-delay: 200ms
}

.project-card.expanded.content-visible .card-content-block .card-expanded-text:nth-child(6) {
    animation-delay: 260ms
}

.project-card.expanded.content-visible .card-content-block .card-expanded-text:nth-child(7) {
    animation-delay: 320ms
}

.project-card.expanded.content-visible .card-content-block .card-expanded-text:nth-child(8) {
    animation-delay: 380ms
}

.card-project-links .card-project-link {
    margin-top: 0
}

.card-project-links {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.5rem
}

.card-project-link {
    display: none;
    margin-top: 1rem;
    padding: 0;
    border: none;
    background: 0 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    color: #a5b4fc;
    text-decoration: none;
    cursor: pointer;
    transition: color .2s ease;
    width: fit-content;
    align-self: flex-start
}

.project-card.expanded .card-project-link {
    display: none;
    opacity: 0
}

.project-card.expanded.content-visible .card-project-link {
    display: inline-block;
    animation: cardTextFadeIn .4s cubic-bezier(.16, 1, .3, 1) 100ms forwards
}

.card-project-link:hover {
    color: #c7d2fe
}

.card-expand-btn {
    flex: 0 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(129, 140, 248, .5);
    box-shadow: 0 0 20px rgba(129, 140, 248, .2);
    background: rgba(129, 140, 248, .85);
    color: var(--text-muted);
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: color .3s ease, background .3s ease, border-color .35s ease, box-shadow .35s ease;
    align-self: stretch
}

.project-row:nth-child(odd) .card-expand-btn {
    border-radius: 0 var(--card-radius) var(--card-radius) 0
}

.project-row:nth-child(2n) .card-expand-btn {
    border-radius: var(--card-radius) 0 0 var(--card-radius)
}

.card-expand-btn:hover {
    color: var(--accent-color);
    background: rgba(129, 140, 248, .2);
    border-color: rgba(129, 140, 248, .5);
    box-shadow: 0 0 28px rgba(129, 140, 248, .28);
    animation-play-state: paused
}

.card-expand-arrow {
    display: inline-block;
    transition: transform .4s cubic-bezier(.4, 0, .2, 1)
}

.project-row:nth-child(odd) .card-expand-arrow {
    transform: rotate(180deg)
}

.project-row:nth-child(odd) .project-card.expanded .card-expand-arrow {
    transform: rotate(0)
}

.project-row:nth-child(2n) .card-expand-arrow {
    transform: rotate(0)
}

.project-row:nth-child(2n) .project-card.expanded .card-expand-arrow {
    transform: rotate(180deg)
}

.card-thumbnail-block {
    flex: 1 1 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    min-width: 0;
    position: relative;
    align-self: stretch
}

.project-row:nth-child(2n) .card-thumbnail-block {
    justify-content: stretch
}

.project-row:nth-child(2n) .card-content-block {
    padding: 1rem
}

.card-thumbnail-block .project-image {
    width: 100%;
    min-height: 320px;
    flex: 1;
    overflow: hidden;
    position: relative;
    box-sizing: border-box
}

.project-row:nth-child(odd) .card-thumbnail-block .project-image {
    border-radius: 0
}

.project-row:nth-child(2n) .card-thumbnail-block .project-image {
    border-radius: 0
}

.project-card.expanded .card-thumbnail-block .project-image {
    min-height: 60vh
}

.project-image picture {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%
}

.project-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center
}

.project-card[data-project=webfolio] .project-image img {
    object-position: center
}

.project-card[data-project=questions] .project-image img {
    object-position: center bottom
}

.project-row:nth-child(odd) .project-image img {
    border-radius: 0
}

.project-row:nth-child(2n) .project-image img {
    border-radius: 0
}

.cover-play {
    position: relative;
    cursor: pointer
}

.cover-play:hover img {
    filter: brightness(.7);
    transition: filter .3s ease
}

.img-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .5);
    border: 2px solid rgba(255, 255, 255, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.4rem;
    pointer-events: none;
    transition: background .3s ease, transform .3s ease, border-color .3s ease
}

.cover-play:hover .img-play-btn {
    background: rgba(129, 140, 248, .7);
    border-color: rgba(129, 140, 248, .9);
    transform: translate(-50%, -50%) scale(1.08)
}

.expand-play-btn {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .5);
    border: 2px solid rgba(255, 255, 255, .4);
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background .3s ease, transform .3s ease, border-color .3s ease;
    z-index: 2
}

.project-image-with-play {
    position: relative
}

.project-card.expanded .expand-play-btn {
    display: flex
}

.expand-play-btn:hover {
    background: rgba(129, 140, 248, .7);
    border-color: rgba(129, 140, 248, .9);
    transform: translate(-50%, -50%) scale(1.08)
}

.project-image-with-video {
    position: relative
}

.project-card.card-stack-layout:not(.expanded) {
    max-height: 720px
}

.project-card.card-stack-layout:not(.expanded) .card-thumbnail-block .project-image-with-video {
    aspect-ratio: 16/9;
    min-height: 0 !important;
    width: 100%
}

.project-video-embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1
}

.project-video-embed iframe,
.project-video-embed video {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.project-card:not(.expanded) .project-image-with-video .project-video-embed {
    display: block
}

.project-card:not(.expanded) .project-image-with-video>img,
.project-card:not(.expanded) .project-image-with-video>picture {
    display: none
}

.project-card.expanded .project-image-with-video .project-video-embed {
    display: none
}

.project-card.expanded .project-image-with-video>img,
.project-card.expanded .project-image-with-video>picture {
    display: block
}

.project-image-gallery {
    position: relative
}

.project-image-gallery .gallery-images {
    display: none;
    position: absolute;
    inset: 0;
    overflow: hidden
}

.project-image-gallery .gallery-main {
    display: block
}

.project-card.expanded .project-image-gallery .gallery-main {
    display: none
}

.project-card.expanded .project-image-gallery .gallery-images {
    display: block;
    cursor: pointer
}

.project-image-gallery .gallery-images img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    object-fit: cover;
    object-position: center;
    display: none
}

.project-image-gallery[data-gallery-index="0"] .gallery-images img[data-gallery-img="0"],
.project-image-gallery[data-gallery-index="1"] .gallery-images img[data-gallery-img="1"],
.project-image-gallery[data-gallery-index="2"] .gallery-images img[data-gallery-img="2"],
.project-image-gallery[data-gallery-index="3"] .gallery-images img[data-gallery-img="3"] {
    display: block !important
}

.project-row:nth-child(odd) .project-image-gallery .gallery-images img {
    border-radius: 0
}

.project-row:nth-child(2n) .project-image-gallery .gallery-images img {
    border-radius: 0
}

.project-image-clickable {
    position: relative
}

.project-image-clickable .gallery-main {
    object-position: top
}

.project-image-clickable .gallery-click-overlay {
    display: none;
    position: absolute;
    inset: 0;
    cursor: pointer;
    z-index: 2
}

.project-card.expanded .project-image-clickable .gallery-click-overlay {
    display: block
}

.gallery-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, .95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s ease, visibility .3s
}

.gallery-viewer-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: all
}

.gallery-viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    gap: .5rem
}

.gallery-viewer-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain
}

.gallery-viewer-next,
.gallery-viewer-prev {
    flex-shrink: 0
}

.gallery-viewer-overlay.gallery-viewer-single .gallery-viewer-next,
.gallery-viewer-overlay.gallery-viewer-single .gallery-viewer-prev {
    display: none
}

.gallery-viewer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 2rem;
    height: 2rem;
    min-height: 2rem;
    padding: .25rem;
    border: 2px solid transparent;
    border-radius: 8px;
    background: rgba(0, 0, 0, .4);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    transition: opacity .25s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease
}

.gallery-viewer-close::before {
    content: '';
    display: block;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center
}

.gallery-viewer-close:hover {
    background: rgba(129, 140, 248, .5);
    border-color: rgba(129, 140, 248, .6);
    box-shadow: 0 8px 30px rgba(129, 140, 248, .2), inset 0 0 45px rgba(129, 140, 248, .25)
}

.gallery-viewer-next,
.gallery-viewer-prev {
    width: 40px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    color: var(--text-light);
    font-size: 1.75rem;
    cursor: pointer;
    transition: background .3s ease;
    line-height: 1;
    padding: 0
}

.gallery-viewer-next:hover,
.gallery-viewer-prev:hover {
    background: rgba(129, 140, 248, .5)
}

@media (min-width:1601px) {
    .project-card {
        max-height: 520px
    }

    .project-card.card-stack-layout .card-thumbnail-block .project-image {
        min-height: 340px
    }

    .project-card.expanded {
        min-height: min(95vh, 1200px)
    }

    .project-card.expanded .card-thumbnail-block .project-image {
        min-height: 65vh
    }
}

@media (min-width:1025px) and (max-width:1600px) {
    .project-label {
        font-size: clamp(2rem, 6vw, 4rem)
    }

    .project-card {
        transition: transform .45s cubic-bezier(.16, 1, .3, 1), box-shadow .3s ease
    }

    .project-card.expanded {
        min-height: min(95vh, 1100px);
        max-height: 300vh
    }

    .project-card.expanded .card-thumbnail-block .project-image {
        min-height: 55vh
    }

}

@media (max-width:1024px) {
    .project-row {
        flex-direction: column !important;
        align-self: stretch
    }

    .project-row:nth-child(2n) .project-card {
        flex-direction: column
    }

    .project-label {
        font-size: clamp(2rem, 10vw, 3.5rem);
        order: -1
    }

    .project-card {
        flex-direction: column;
        max-height: 420px;
        max-width: 100%;
        width: 100%
    }

    .project-card.expanded {
        min-height: min(95vh, 1000px);
        max-height: 300vh
    }

    .card-content-block {
        flex: 1 1 auto;
        padding: 1.5rem 1.5rem 1rem
    }

    .card-expand-btn {
        flex: 0 0 auto;
        padding: .5rem
    }

    .card-thumbnail-block {
        flex: 1 1 auto;
        padding: 0
    }

    .card-thumbnail-block .project-image {
        min-height: 300px;
        border-radius: 0
    }

    .project-row:nth-child(2n) .card-thumbnail-block .project-image,
    .project-row:nth-child(odd) .card-thumbnail-block .project-image {
        border-radius: 0
    }

    .project-card.expanded .card-thumbnail-block .project-image {
        min-height: 50vh
    }

    .project-row:nth-child(2n) .project-image img,
    .project-row:nth-child(odd) .project-image img {
        border-radius: 0
    }

}

.project-card-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s
}

.project-card-overlay.open {
    pointer-events: all;
    opacity: 1;
    visibility: visible
}

.project-card-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 9, 24, .85);
    cursor: pointer
}

.project-card-overlay-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 2rem;
    height: 2rem;
    min-height: 2rem;
    padding: .25rem;
    border: 2px solid transparent;
    border-radius: 8px;
    background: rgba(0, 0, 0, .4);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity .25s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease
}

.project-card-overlay-close:hover {
    background: rgba(129, 140, 248, .5);
    border-color: rgba(129, 140, 248, .6);
    box-shadow: 0 8px 30px rgba(129, 140, 248, .2), inset 0 0 45px rgba(129, 140, 248, .25)
}

.project-card-overlay-close::before {
    content: '';
    display: block;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center
}

.project-card-overlay-scroll {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
    max-height: 90vh;
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    cursor: default;
    scrollbar-width: none;
    -ms-overflow-style: none
}

.project-card-overlay-scroll::-webkit-scrollbar {
    display: none
}

.project-card-overlay-scroll:focus {
    outline: 0
}

.project-card-overlay-wrap {
    position: relative;
    width: 100%
}

.project-card-overlay-card {
    position: relative;
    width: 100%;
    max-width: 100%;
    border-radius: var(--card-radius) !important;
    border: none !important;
    background: var(--layer-3-color) !important;
    cursor: default;
    transform: scale(.96);
    opacity: 0;
    transition: transform .2s cubic-bezier(.16, 1, .3, 1), opacity .2s ease
}

.project-card-overlay.open .project-card-overlay-card {
    transform: scale(1);
    opacity: 1
}

.project-card-overlay-card .card-thumbnail-block {
    position: relative
}

.project-card-overlay-card .card-thumbnail-block .project-image {
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
    min-height: 0 !important;
    aspect-ratio: 16/9
}

.project-card-overlay-card .card-expand-btn,
.project-card-overlay-card .card-expand-btn-peek,
.project-card-overlay-card .card-peek-wrap {
    display: none !important
}

/* Ensure category tag has proper spacing in overlay */
.project-card-overlay-card .project-category-tag {
    top: 1rem;
    left: 1rem;
    right: auto;
}

.project-card-overlay-card .project-image-with-video .project-video-embed {
    display: block !important
}

.project-card-overlay-card .project-image-with-video>img {
    display: none !important
}

.project-card-overlay-card .project-image-with-video {
    position: relative;
    aspect-ratio: 16/9;
    min-height: 0
}


.project-card h3 {
    font-size: 1.5rem;
    margin-bottom: .5rem;
    color: rgba(200, 210, 255, .9)
}

.project-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.6
}

.project-link {
    margin: 0;
    padding: 0;
    border: none;
    background: 0 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    color: #a5b4fc;
    text-decoration: none;
    cursor: pointer;
    transition: color .2s ease
}

.project-link:hover {
    color: #c7d2fe
}

.layer[data-depth="3"] .contact-content {
    max-width: 40cqw;
    margin: 0 auto;
    text-align: justify
}

.layer[data-depth="3"] .contact-intro {
    font-size: clamp(.9rem, 1.5cqw + .5rem, 1.3rem);
    color: var(--text-muted);
    margin-bottom: clamp(1.25rem, 2.2cqw, 2rem);
    line-height: 1.6
}

.layer[data-depth="3"] .contact-form {
    display: flex;
    flex-direction: column;
    gap: clamp(.9rem, 1.4cqw, 1.25rem);
    max-width: 100%
}

.layer[data-depth="3"] .contact-form-row {
    display: flex;
    gap: clamp(.75rem, 1.2cqw, 1rem)
}

.layer[data-depth="3"] .contact-form-field {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem
}

.layer[data-depth="3"] .contact-form-label {
    font-size: clamp(.85rem, 1.15cqw, .95rem);
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: .02em
}

.layer[data-depth="3"] .contact-form-input,
.layer[data-depth="3"] .contact-form-textarea {
    font-family: inherit;
    font-size: clamp(.9rem, 1.25cqw + .4rem, 1.05rem);
    color: var(--text-light);
    background: rgba(129, 140, 248, .08);
    border: 1px solid rgba(129, 140, 248, .3);
    border-radius: var(--card-radius);
    padding: clamp(.5rem, .75cqw, .6rem) clamp(.7rem, 1cqw, .9rem);
    transition: border-color .3s ease, background .3s ease
}

.layer[data-depth="3"] .contact-form-input::placeholder,
.layer[data-depth="3"] .contact-form-textarea::placeholder {
    color: rgba(165, 168, 200, .6)
}

.layer[data-depth="3"] .contact-form-input:focus,
.layer[data-depth="3"] .contact-form-textarea:focus {
    outline: 0;
    border-color: var(--accent-color);
    background: rgba(129, 140, 248, .12)
}

.layer[data-depth="3"] .contact-form-textarea {
    resize: vertical;
    min-height: clamp(4.5rem, 7cqw, 6rem)
}

.layer[data-depth="3"] .contact-form-submit {
    font-family: inherit;
    font-size: clamp(.95rem, 1.3cqw + .4rem, 1.1rem);
    font-weight: 600;
    color: var(--text-light);
    background: rgba(129, 140, 248, .2);
    border: 2px solid rgba(129, 140, 248, .5);
    border-radius: var(--card-radius);
    padding: clamp(.5rem, .8cqw, .65rem) clamp(1rem, 1.8cqw, 1.5rem);
    min-height: clamp(2.25rem, 3.2cqw, 2.75rem);
    cursor: pointer;
    transition: background .3s ease, border-color .3s ease, color .3s ease;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.layer[data-depth="3"] .contact-form-submit:hover {
    background: rgba(129, 140, 248, .3);
    border-color: var(--accent-color)
}

.layer[data-depth="3"] .contact-form-submit:focus {
    outline: 0;
    border-color: var(--accent-color)
}

.contact-submit-tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2em;
    height: 1.2em
}

.contact-submit-tick svg {
    width: 1.2em;
    height: 1.2em
}

.contact-submit-tick .tick-path {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: tickDraw .45s ease-out .15s forwards
}

.contact-submit-success {
    color: var(--accent-color);
    border-color: var(--accent-color)
}

@keyframes tickDraw {
    to {
        stroke-dashoffset: 0
    }
}

body.reduce-motion .contact-submit-tick .tick-path {
    animation: none;
    stroke-dashoffset: 0
}

.contact-form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden
}

.layer[data-depth="3"] .contact-form-status {
    font-size: clamp(.85rem, 1.15cqw, .95rem);
    margin-top: .25rem;
    min-height: 1.4em
}

.contact-form-status-success {
    color: var(--accent-color)
}

.contact-form-status-error {
    color: #e87979
}

.surface-btn {
    margin: 0;
    padding: 0;
    border: none;
    background: 0 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    color: #a5b4fc;
    text-decoration: none;
    cursor: pointer;
    transition: color .2s ease
}

.surface-btn:hover {
    color: #c7d2fe
}

.project-card[role="button"]:focus-visible,
.project-card-overlay-close:focus-visible,
.gallery-viewer-close:focus-visible,
.gallery-viewer-prev:focus-visible,
.gallery-viewer-next:focus-visible,
.home-about-link:focus-visible,
.bio-contact-link:focus-visible,
.card-project-link:focus-visible,
.project-link:focus-visible,
.surface-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.settings-container {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 1024px) {
    .settings-container {
        bottom: 0.5rem;
        left: 0.5rem;
    }
}

@media (min-width: 1401px) {
    .settings-container {
        bottom: 0.5rem;
        left: 0.5rem;
    }
}

/* Show while cursor is actively moving in home */
.layer[data-depth="0"] .settings-container.cursor-active {
    opacity: 1;
    pointer-events: all;
}

/* Keep visible if the overlay is actually active or on initial load */
.settings-container:has(.settings-overlay.active),
.settings-container.initial-show {
    opacity: 1 !important;
    pointer-events: all !important;
}

.settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #151830;
    opacity: 0.6;
    cursor: pointer;
    padding: 0.5rem;
    transition: color .25s ease, opacity .25s ease;
}



.settings-btn svg {
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.settings-btn:hover {
    opacity: 1;
}

.settings-container:has(.settings-overlay.active) .settings-btn svg {
    transform: rotate(45deg);
}

.settings-overlay {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    min-width: 140px;
    background: rgba(21, 24, 48, 0.98);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(0.95);
    transform-origin: bottom center;
    transition: all 0.3s cubic-bezier(0.33, 1, 0.68, 1);
}

.settings-overlay.active {
    pointer-events: auto;
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

.settings-overlay::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 15px;
    background: transparent;
}

.settings-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.settings-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    letter-spacing: 0.05em;
}

.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.settings-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.settings-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.settings-toggle-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-toggle-icon svg {
    display: block;
}

/* Light mode: moon when dark, sun when light */
.light-mode-icon {
    position: relative;
    width: 20px;
    height: 20px;
}

.light-mode-icon .icon-moon,
.light-mode-icon .icon-sun {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.light-mode-icon .icon-moon {
    opacity: 1;
}

.light-mode-icon .icon-sun {
    opacity: 0;
    pointer-events: none;
}

.light-mode-toggle input:checked + .light-mode-icon .icon-moon {
    opacity: 0;
    pointer-events: none;
}

.light-mode-toggle input:checked + .light-mode-icon .icon-sun {
    opacity: 1;
    pointer-events: auto;
}

/* Effects: cross-out when checked (reduced) */
.reduce-motion-toggle input:checked + .reduce-motion-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 130%;
    height: 2px;
    background: currentColor;
    transform: translate(-50%, -50%) rotate(-45deg);
    border-radius: 1px;
    opacity: .9;
}

/* Fade-in animations only on initial load */
body.layers-loaded:not(.layers-appeared) .fade-in {
    animation: fadeIn 1s ease-out
}

body.layers-loaded:not(.layers-appeared) .greeting-line.fade-in {
    animation: fadeInPlace 1s ease-out
}

/* After initial load, content is always visible */
body.layers-loaded.layers-appeared .fade-in,
body.layers-loaded.layers-appeared .greeting-line.fade-in,
body.layers-loaded.layers-appeared .fade-in-delay,
body.layers-loaded.layers-appeared .fade-in-delay-2 {
    animation: none !important;
    opacity: 1;
}

@keyframes fadeInPlace {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

/* Fade-in delay animations only on initial load */
body.layers-loaded:not(.layers-appeared) .fade-in-delay {
    animation: fadeInPlace 1s ease-out .3s backwards
}

body.layers-loaded:not(.layers-appeared) .fade-in-delay-2 {
    animation: fadeIn 1s ease-out .6s backwards
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 2rem;
    color: var(--accent-color);
}

@media (max-width:1024px) {
    :root {
        --home-title-size: 4rem;
        --home-subtitle-size: 0.85rem;
        --home-role-subtitle-size: 0.75rem;
    }

    .layer-content {
        padding: 1rem
    }

    .layer[data-depth="0"] .content-wrapper {
        min-height: auto
    }

    .layer[data-depth="0"] .home-line1 {
        top: 1.5rem;
        right: 1.5rem;
        bottom: auto;
    }

    .layer[data-depth="0"] .home-line2 {
        bottom: 1.5rem;
        left: 1.5rem;
        top: auto;
    }

    .layer[data-depth="0"] .greeting-line,
    .layer[data-depth="0"] h1 {
        line-height: 1.15;
        margin-bottom: .25rem
    }

    .layer[data-depth="0"] .subtitle {
        margin-bottom: .75rem;
        min-height: auto;
        white-space: nowrap
    }

    .layer[data-depth="0"] .role-subtitle {
        margin-top: .15rem;
    }

    .designer-footnote {
        font-size: .6rem;
        left: .5rem;
        bottom: .5rem
    }

    .layer[data-depth="2"] .layer-content {
        align-items: center;
        justify-content: flex-start
    }

    .layer[data-depth="2"] .content-wrapper {
        align-self: center;
        text-align: left;
        margin-left: 0;
        margin-right: auto;
        max-width: 100%;
    }

    .layer[data-depth="3"] .contact-content {
        max-width: 100%;
    }

    .layer[data-depth="3"] .contact-form-row {
        flex-direction: column
    }

    .card-content-block .card-expanded-text,
    .card-content-block .card-peek {
        font-size: clamp(.75rem, 1.8vw + .5rem, .95rem)
    }

    .card-project-link {
        font-size: clamp(.8rem, 1.8vw + .55rem, 1rem)
    }
}

@media (min-width: 1025px) {
    .layer-label {
        top: .5rem;
    }

    body.reduce-motion .card-expand-btn,
    body.reduce-motion .card-expanded-text,
    body.reduce-motion .card-project-link,
    body.reduce-motion .fade-in,
    body.reduce-motion .fade-in-delay,
    body.reduce-motion .fade-in-delay-2,
    body.reduce-motion .layer,
    body.reduce-motion .layer.hint-pulse .layer-label,
    body.reduce-motion .layer.hint-pulse::before,
    body.reduce-motion .layer::after {
        animation: none !important
    }

    body.reduce-motion .project-card.expanded .card-expanded-text,
    body.reduce-motion .project-card.expanded .card-project-link {
        opacity: 1
    }

    body.reduce-motion .layer {
        transition: none
    }

    body.reduce-motion * {
        transition-duration: .15s !important
    }
}