/* Core Utilities & Custom Scrollbar */
html {
    --scrollbar-track-color: #f3f4f4;
    --scrollbar-thumb-color: #d9dddc;
    --scrollbar-border-color: #c8cecc;
    scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
}

html.dark {
    --scrollbar-track-color: #000000;
    --scrollbar-thumb-color: #3a3a3a;
    --scrollbar-border-color: #525252;
}

::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track-color);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb-color);
    border: 1px solid var(--scrollbar-border-color);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-color);
}

/* Reusable UI Components extracted for cleaner HTML */
@layer components {
    .nav-link {
        @apply text-slate-600 dark:text-slate-300 hover:text-brand dark:hover:text-brand transition-colors relative;
    }
    .nav-link::after {
        @apply content-[''] absolute -bottom-1 left-0 w-0 h-0.5 bg-brand transition-all duration-300;
    }
    .nav-link:hover::after {
        @apply w-full;
    }
    
    .section-title {
        @apply text-3xl md:text-4xl font-heading font-bold text-slate-900 dark:text-white mb-8 relative inline-block;
    }
    
    .card-base {
        @apply bg-card-light dark:bg-card-dark rounded-2xl border border-slate-200 dark:border-slate-800 shadow-sm transition-all duration-300;
    }
    
    .badge {
        @apply px-3 py-1 bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-300 rounded-full text-xs font-semibold border border-slate-200 dark:border-slate-700;
    }

    /* Modern Form Input */
    .form-group {
        position: relative;
    }
    .form-label {
        display: block;
        font-size: 0.875rem;
        font-weight: 600;
        color: #334155;
        margin-bottom: 0.5rem;
        transition: color 0.2s;
    }
    .dark .form-label {
        color: #cbd5e1;
    }
    .form-input {
        width: 100%;
        background: #ffffff;
        border: 1px solid #cbd5e1;
        border-radius: 0.75rem;
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
        font-weight: 400;
        color: #0f172a;
        outline: none;
        transition: all 0.2s;
        box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    }
    .dark .form-input {
        background: #1e293b;
        border-color: #475569;
        color: #f1f5f9;
    }
    .form-input::placeholder {
        color: #94a3b8;
    }
    .dark .form-input::placeholder {
        color: #64748b;
    }
    .form-input:hover {
        border-color: #94a3b8;
    }
    .dark .form-input:hover {
        border-color: #64748b;
    }
    .form-input:focus {
        border-color: #059669;
        box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    }
    .dark .form-input:focus {
        border-color: #059669;
        box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    }
    .form-textarea {
        width: 100%;
        background: #ffffff;
        border: 1px solid #cbd5e1;
        border-radius: 0.75rem;
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
        color: #0f172a;
        outline: none;
        transition: all 0.2s;
        resize: none;
        min-height: 200px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    }
    .dark .form-textarea {
        background: #1e293b;
        border-color: #475569;
        color: #f1f5f9;
    }
    .form-textarea::placeholder {
        color: #94a3b8;
    }
    .dark .form-textarea::placeholder {
        color: #64748b;
    }
    .form-textarea:hover {
        border-color: #94a3b8;
    }
    .dark .form-textarea:hover {
        border-color: #64748b;
    }
    .form-textarea:focus {
        border-color: #059669;
        box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    }
    .dark .form-textarea:focus {
        border-color: #059669;
        box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    }

    .social-icon {
        @apply w-12 h-12 rounded-full border border-slate-200 dark:border-slate-700 flex items-center justify-center text-slate-600 dark:text-slate-400 hover:bg-brand hover:text-white hover:border-brand transition-all transform hover:-translate-y-1 shadow-sm;
    }

    .mobile-nav-link {
        @apply block px-4 py-3 rounded-xl text-slate-700 dark:text-slate-300 font-medium hover:bg-brand/10 hover:text-brand dark:hover:text-brand transition-all duration-200;
    }
}

/* Animations */
@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}
.animate-blob {
    animation: blob 7s infinite;
}
.animation-delay-2000 {
    animation-delay: 2s;
}
.animation-delay-4000 {
    animation-delay: 4s;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}
.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Carousel Styles */
.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-slide.active {
    opacity: 1;
    position: relative;
}
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Scroll Reveal Logic */
.section-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.5, 0, 0, 1), transform 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.section-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.stagger-element {
    opacity: 0;
    transform: translateY(20px);
}


/* 3D mouse tilt is applied to the inner frame so the existing float stays intact. */
.theme-switching,
.theme-switching * {
    transition: none !important;
}

::view-transition-old(root),
::view-transition-new(root) {
    mix-blend-mode: normal;
}

::view-transition-old(root) {
    animation: none;
    z-index: 2147483646;
}

::view-transition-new(root) {
    animation: none;
    z-index: 2147483647;
}

[data-profile-tilt-target] {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 180ms ease-out;
    touch-action: pan-y;
    isolation: isolate;
    overflow: visible;
}

/* E01 Scrap Crawler: its face clears the frame while its chassis stays behind the photo. */
.profile-photo-layer {
    position: relative;
    z-index: 2;
    transform: translateZ(0);
}

.profile-crawler-stage,
.profile-crawler-grip-stage {
    position: absolute;
    width: 64%;
    height: 54%;
    top: -7%;
    right: -9%;
    pointer-events: none;
    overflow: visible;
    filter: drop-shadow(0 14px 18px rgba(2, 8, 23, 0.42));
}

.profile-crawler-stage {
    z-index: 1;
    transform: translateZ(-18px);
}

.profile-crawler-grip-stage {
    z-index: 3;
    transform: translateZ(42px);
}

.profile-crawler-stage,
.profile-crawler-grip-stage,
.profile-photo-layer {
    transform-style: preserve-3d;
    will-change: transform;
}

.profile-crawler-stage canvas,
.profile-crawler-grip-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.crawler-arm-game-link {
    position: absolute;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    min-height: 1.65rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid #059669;
    border-radius: 0.48rem;
    background: #059669;
    color: #ffffff;
    box-shadow: none;
    font-size: 0.52rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transform: translate(0.35rem, -50%);
    transform-origin: left center;
    transition: transform 180ms ease, box-shadow 180ms ease;
}
.crawler-arm-game-link::before {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    width: 0.42rem;
    height: 2px;
    background: #059669;
    transform: translateY(-50%);
}
.crawler-arm-game-link:hover,
.crawler-arm-game-link:focus-visible {
    box-shadow: 0 8px 22px rgba(5, 150, 105, 0.42);
    transform: translate(0.35rem, -50%) scale(1.04);
    outline: none;
}

.crawler-guided-pointer {
    position: fixed;
    z-index: 2147483647;
    color: #ffffff;
    filter: drop-shadow(0 2px 2px rgba(2, 8, 23, 0.9)) drop-shadow(0 0 8px rgba(5, 150, 105, 0.85));
    font-size: 1.2rem;
    line-height: 1;
    pointer-events: none;
    transform: none;
    transform-origin: 0 0;
}
html.crawler-pointer-guiding,
html.crawler-pointer-guiding * {
    cursor: none !important;
}

[data-profile-tilt-target] > .absolute {
    z-index: 4;
}

.profile-crawler-stage-mobile {
    width: 72%;
    height: 60%;
    top: -10%;
    right: -15%;
}

@media (prefers-reduced-motion: reduce) {
    [data-profile-tilt-target] {
        transform: none !important;
    }

    .profile-crawler-stage canvas,
    .profile-crawler-grip-stage canvas {
        animation: none !important;
    }

    .profile-crawler-stage,
    .profile-crawler-grip-stage,
    .profile-photo-layer {
        transform: none;
    }

    .crawler-arm-game-link { transition: none; }
}

/* Navigation scroll progress */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}
@supports (overflow: clip) {
    html,
    body { overflow-x: clip; }
}
#navbar {
    left: 0;
    right: 0;
    width: auto !important;
    max-width: 100vw;
    box-sizing: border-box;
}
#navbar > .flex {
    position: relative;
    width: 100%;
    min-width: 0;
}
#navbar > .flex > a {
    min-width: 0;
    flex-shrink: 1;
    white-space: nowrap;
}
#theme-toggle-mobile,
#menu-toggle {
    flex-shrink: 0;
}
#mobile-menu {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
@media (max-width: 767px) {
    #navbar > .flex {
        padding-right: 5.75rem;
        box-sizing: border-box;
    }
    .mobile-nav-controls {
        position: absolute;
        top: 50%;
        right: 0;
        z-index: 2;
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        transform: translateY(-50%);
    }
}
@supports (width: 100dvw) {
    #navbar { max-width: 100dvw; }
}
@media (max-width: 380px) {
    #navbar { padding-inline: 1rem; }
    #navbar > .flex > a { font-size: 1.25rem; }
}
.scroll-progress-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.16);
}
.scroll-progress-bar {
    width: 100%;
    height: 100%;
    background: #059669;
    box-shadow: 0 0 8px rgba(5, 150, 105, 0.35);
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}
.dark .scroll-progress-track {
    background: rgba(148, 163, 184, 0.12);
}
.dark .scroll-progress-bar {
    background: #059669;
}

/* Individual skill-card puzzle layout */
.skills-showcase {
    display: block;
    max-width: 1120px;
}
.skill-category {
    margin-bottom: 2.75rem;
    overflow: visible;
    padding: 0 4px 8px;
}
.skill-category:last-child { margin-bottom: 0; }
.skill-category-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid #e2e8f0;
}
.dark .skill-category-header { border-color: #334155; }
.skill-category-symbol {
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    flex: 0 0 2.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.8rem;
    color: #475569;
    background: #fff;
}
.dark .skill-category-symbol {
    border-color: #475569;
    color: #cbd5e1;
    background: #1e293b;
}
.skill-category-header span:not(.skill-category-symbol) {
    display: block;
    margin-bottom: 0.08rem;
    color: #94a3b8;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.skill-category-header h3 {
    margin: 0;
    color: #0f172a;
    font: 700 1.05rem Poppins, sans-serif;
}
.dark .skill-category-header h3 { color: #f8fafc; }
.skill-tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}
.skill-tile {
    --p0x: var(--d0x); --p0y: var(--d0y);
    --p1x: var(--d1x); --p1y: var(--d1y);
    --p2x: var(--d2x); --p2y: var(--d2y);
    --p3x: var(--d3x); --p3y: var(--d3y);
    --p4x: var(--d4x); --p4y: var(--d4y);
    --p5x: var(--d5x); --p5y: var(--d5y);
    position: relative;
    min-width: 0;
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 7px 20px rgba(15, 23, 42, 0.045);
    opacity: 1;
    transform: translate(var(--p0x), var(--p0y));
    will-change: transform, opacity;
    transition: border-color 220ms ease, box-shadow 220ms ease;
}
.dark .skill-tile {
    border-color: #334155;
    background: rgba(30, 41, 59, 0.96);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
.skill-tile:hover,
.skill-tile:focus-visible {
    z-index: 3;
    border-color: #94a3b8;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.11);
}
.dark .skill-tile:hover,
.dark .skill-tile:focus-visible { border-color: #64748b; }
.skill-tile:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.42);
    outline-offset: 3px;
}
.skill-category.active .skill-tile {
    animation: puzzle-three-moves 2200ms linear var(--puzzle-delay) both;
}
.skill-tile-icon {
    width: 2.8rem;
    height: 2.8rem;
    display: grid;
    place-items: center;
    flex: 0 0 2.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.72rem;
    background: #f8fafc;
    font-size: 1.55rem;
}
.dark .skill-tile-icon { border-color: #334155; background: #0f172a; }
.skill-tile-name {
    min-width: 0;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.3;
}
.dark .skill-tile-name { color: #e2e8f0; }
.tool-letter {
    font: 800 1rem Poppins, sans-serif;
}
.tool-tone-hive { color: #f59e0b; }
.tool-tone-wamp { color: #7c3aed; }
.tool-tone-python { color: #3776ab; }
.tool-tone-unity { color: #111827; }
.dark .tool-tone-unity { color: #f8fafc; }
@keyframes puzzle-three-moves {
    0% {
        opacity: 1;
        transform: translate(var(--p0x), var(--p0y));
    }
    20% {
        opacity: 1;
        transform: translate(var(--p1x), var(--p1y));
    }
    40% {
        opacity: 1;
        transform: translate(var(--p2x), var(--p2y));
    }
    60% {
        opacity: 1;
        transform: translate(var(--p3x), var(--p3y));
    }
    80% {
        opacity: 1;
        transform: translate(var(--p4x), var(--p4y));
    }
    100% {
        opacity: 1;
        transform: translate(var(--p5x), var(--p5y));
    }
}
@media (max-width: 700px) {
    .skill-tile {
        --p0x: var(--m0x); --p0y: var(--m0y);
        --p1x: var(--m1x); --p1y: var(--m1y);
        --p2x: var(--m2x); --p2y: var(--m2y);
        --p3x: var(--m3x); --p3y: var(--m3y);
        --p4x: var(--m4x); --p4y: var(--m4y);
        --p5x: var(--m5x); --p5y: var(--m5y);
    }
    .skill-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    .skill-tile,
    .skill-category.active .skill-tile {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* Resume download CTA */
.resume-cta-card {
    border-color: #dbe3ea;
    background: #ffffff;
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.08);
}
.dark .resume-cta-card {
    border-color: #334155;
    background: #1e293b;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
}
.resume-cta-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #059669;
}
.resume-cta-kicker {
    display: inline-flex;
    align-items: center;
    color: #059669;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.dark .resume-cta-kicker { color: #059669; }
.resume-cta-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.resume-download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 3.25rem;
    padding: 0.8rem 1.5rem;
    border: 1px solid #059669;
    border-radius: 0.8rem;
    background: #059669;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(5, 150, 105, 0.16);
    transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.resume-download-button:hover {
    border-color: #059669;
    background: #059669;
    box-shadow: 0 12px 28px rgba(5, 150, 105, 0.2);
    transform: translateY(-2px);
}
.resume-download-button:active { transform: translateY(0); }
.resume-download-button:focus-visible {
    outline: 3px solid rgba(5, 150, 105, 0.32);
    outline-offset: 4px;
}
.resume-download-icon {
    font-size: 1.15rem;
    transition: transform 200ms ease;
}
.resume-download-button:hover .resume-download-icon { transform: translateY(2px); }
.resume-file-meta {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.dark .resume-file-meta { color: #94a3b8; }
@media (prefers-reduced-motion: reduce) {
    .resume-download-button,
    .resume-download-icon { transition: none; }
    .resume-download-button:hover,
    .resume-download-button:active,
    .resume-download-button:hover .resume-download-icon { transform: none; }
}

/* Contact section redesign — visual only; form behavior remains unchanged */
.contact-redesign {
    isolation: isolate;
    overflow: hidden;
}
.contact-redesign::before {
    display: none;
}
.contact-intro {
    align-self: center;
}
.contact-methods {
    display: grid;
    gap: 0.75rem;
}
.contact-method {
    position: relative;
    min-height: 4.75rem;
    padding: 0.8rem 1rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.035);
    opacity: 0;
    transform: translateX(-22px);
    transition: border-color 250ms ease, box-shadow 250ms ease, transform 250ms ease;
}
.dark .contact-method {
    border-color: #334155;
    background: rgba(30, 41, 59, 0.76);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}
.contact-intro.active .contact-method {
    opacity: 1;
    transform: translateX(0);
    animation: contact-method-in 650ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.contact-intro.active .contact-method:nth-child(1) { animation-delay: 140ms; }
.contact-intro.active .contact-method:nth-child(2) { animation-delay: 230ms; }
.contact-intro.active .contact-method:nth-child(3) { animation-delay: 320ms; }
.contact-method::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #059669;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 300ms ease;
}
.contact-method:hover,
.contact-method:focus-within {
    border-color: rgba(5, 150, 105, 0.45);
    box-shadow: 0 12px 30px rgba(5, 150, 105, 0.08);
    transform: translateY(-2px);
}
.contact-method:hover::after,
.contact-method:focus-within::after { transform: scaleY(1); }

.contact-form-card {
    border-color: #e2e8f0;
    border-radius: 1.4rem;
    background: #ffffff;
    box-shadow: 0 22px 65px rgba(15, 23, 42, 0.1);
    transition: none;
}
.dark .contact-form-card {
    border-color: #334155;
    background: #1e293b;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}
.contact-form-card:hover {
    border-color: #e2e8f0;
    background: #ffffff;
    box-shadow: 0 22px 65px rgba(15, 23, 42, 0.1);
    transform: none;
}
.dark .contact-form-card:hover {
    border-color: #334155;
    background: #1e293b;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}
.contact-form-card > .absolute { display: none; }
.contact-form-header {
    background: transparent;
}
.dark .contact-form-header {
    background: transparent;
}
.contact-form-body .form-group {
    opacity: 0;
    transform: translateY(18px);
}
.contact-form-reveal.active .form-group {
    opacity: 1;
    transform: translateY(0);
    animation: contact-field-in 600ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.contact-form-reveal.active .form-group:nth-child(1) { animation-delay: 180ms; }
.contact-form-reveal.active .form-group:nth-child(2) { animation-delay: 260ms; }
.contact-form-reveal.active #contact-form > .form-group:nth-of-type(2) { animation-delay: 340ms; }
.contact-form-reveal.active #contact-form > .form-group:nth-of-type(3) { animation-delay: 420ms; }
.contact-form-card .form-input,
.contact-form-card .form-textarea {
    border-color: #dbe4e0;
    background: rgba(248, 250, 252, 0.86);
    transition: border-color 220ms ease, box-shadow 220ms ease, background 220ms ease, transform 220ms ease;
}
.dark .contact-form-card .form-input,
.dark .contact-form-card .form-textarea {
    border-color: #3a4b45;
    background: rgba(15, 23, 42, 0.68);
}
.contact-form-card .form-input:focus,
.contact-form-card .form-textarea:focus {
    background: #fff;
    border-color: #059669;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.11);
    transform: translateY(-1px);
}
.dark .contact-form-card .form-input:focus,
.dark .contact-form-card .form-textarea:focus { background: rgba(15, 23, 42, 0.95); }
.contact-submit {
    position: relative;
    overflow: hidden;
    background-image: none;
    background-color: #059669;
    box-shadow: 0 12px 25px rgba(5, 150, 105, 0.17);
}
.contact-submit:hover { background-color: #059669; }
.contact-submit::before {
    display: none;
}
#form-success:not(.hidden) {
    animation: contact-success-in 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes contact-method-in {
    from { opacity: 0; transform: translateX(-22px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes contact-field-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes contact-success-in {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 1023px) {
    .contact-intro { max-width: 44rem; }
    .contact-methods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .contact-method { align-items: flex-start; min-width: 0; }
    .contact-method > div:last-child { min-width: 0; }
}
@media (max-width: 767px) {
    .contact-methods { grid-template-columns: 1fr; }
    .contact-form-card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .contact-method,
    .contact-form-body .form-group,
    #form-success:not(.hidden) {
        opacity: 1;
        transform: none;
        animation: none;
    }
    .contact-submit::before { display: none; }
}

/* ===== Portfolio lower-half creative system ===== */
.creative-projects-section {
    padding-top: 7.5rem;
    padding-bottom: 8.5rem;
    overflow: hidden;
    isolation: isolate;
    background: #f8fafc;
}
.dark .creative-projects-section {
    background: #0b1220;
}
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.9rem;
    color: #059669;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}
.dark .section-eyebrow { color: #059669; }
.projects-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: 5.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #dce5e2;
}
.dark .projects-heading { border-color: #243246; }
.projects-heading-copy {
    max-width: 43rem;
    color: #64748b;
    font-size: 1.02rem;
    line-height: 1.8;
}
.dark .projects-heading-copy { color: #94a3b8; }
.projects-count {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: none;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.35;
    text-transform: uppercase;
}
.projects-count strong {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.8rem;
    line-height: 0.8;
    letter-spacing: -0.08em;
}
.dark .projects-count strong { color: #f8fafc; }
#projects-container {
    display: grid;
    gap: 8rem;
}
.project-showcase {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    align-items: center;
    gap: clamp(2.5rem, 5vw, 5.5rem);
}
.project-showcase::after {
    content: "";
    position: absolute;
    left: 4%;
    right: 4%;
    bottom: -4rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d9e3e0 18%, #d9e3e0 82%, transparent);
}
.dark .project-showcase::after {
    background: linear-gradient(90deg, transparent, #233145 18%, #233145 82%, transparent);
}
.project-showcase:last-child::after { display: none; }
.project-visual-wrap { position: relative; min-width: 0; }
.project-visual-wrap::before {
    content: "";
    position: absolute;
    inset: 1.25rem -1.25rem -1.25rem 1.25rem;
    border: 1px solid rgba(5, 150, 105, 0.28);
    border-radius: 1.65rem;
    pointer-events: none;
}
.project-showcase-reverse .project-visual-wrap::before {
    inset: 1.25rem 1.25rem -1.25rem -1.25rem;
}
.project-visual {
    position: relative;
    overflow: hidden;
    border: 1px solid #243247;
    border-radius: 1.5rem;
    background: transparent;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.2);
    transform: translateZ(0);
}
.dark .project-visual { box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38); }
.project-window-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    min-height: 3rem;
    padding: 0 1rem;
    border-bottom: 1px solid #263449;
    background: transparent;
    color: #7f8da3;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
}
.project-window-dots { display: flex; gap: 0.38rem; }
.project-window-dots i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #475569; }
.project-window-dots i:first-child { background: #059669; }
.project-window-label { justify-self: center; }
.project-window-live { justify-self: end; display: flex; align-items: center; gap: 0.4rem; }
.project-window-live i { width: 0.38rem; height: 0.38rem; border-radius: 50%; background: #059669; box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12); }
.project-carousel { overflow: hidden; background: transparent; }
.project-carousel .carousel-slide { background: transparent; }
.project-carousel .carousel-slide img { transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1); }
.project-visual:hover .carousel-slide.active img { transform: scale(1.025); }
.project-hover-video {
    position: absolute;
    z-index: 12;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #07101c;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 240ms ease, visibility 240ms ease;
}
.project-carousel.is-video-playing .project-hover-video {
    opacity: 1;
    visibility: visible;
}
.project-carousel-arrow {
    position: absolute;
    top: 50%;
    z-index: 20;
    display: grid;
    place-items: center;
    width: 2.65rem;
    height: 2.65rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(7, 15, 28, 0.75);
    color: white;
    opacity: 0;
    transform: translateY(-25%);
    backdrop-filter: blur(10px);
    transition: opacity 220ms ease, transform 220ms ease, background 220ms ease;
}
.project-carousel-prev { left: 1rem; }
.project-carousel-next { right: 1rem; }
.project-visual:hover .project-carousel-arrow,
.project-carousel-arrow:focus-visible { opacity: 1; transform: translateY(-50%); }
.project-carousel-arrow:hover { background: #059669; }
.project-carousel-dots {
    position: absolute;
    z-index: 20;
    left: 50%;
    bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(7, 15, 28, 0.72);
    transform: translateX(-50%);
    backdrop-filter: blur(10px);
}
.project-play-link {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
    padding: 1rem 1.2rem;
    border: 1px solid #059669;
    border-radius: 1rem;
    background: #059669;
    color: #ffffff;
    box-shadow: none;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-decoration: none;
    transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
}
.project-play-link span { display: inline-flex; align-items: center; gap: 0.65rem; }
.project-play-link:hover,
.project-play-link:focus-visible {
    background: #059669;
    box-shadow: 0 19px 42px rgba(5, 150, 105, 0.32);
    transform: translateY(-2px);
    outline: none;
}
.project-play-link > i { transition: transform 220ms ease; }
.project-play-link:hover > i,
.project-play-link:focus-visible > i { transform: translate(0.18rem, -0.18rem); }
.carousel-dot {
    display: block;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: #64748b;
    transition: width 240ms ease, background 240ms ease;
}
.carousel-dot.is-active { width: 1.35rem; background: #059669; }
.project-visual-index {
    position: absolute;
    right: -0.6rem;
    bottom: -3.4rem;
    z-index: -1;
    color: rgba(15, 23, 42, 0.07);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 7rem;
    font-weight: 800;
    line-height: 1;
}
.dark .project-visual-index { color: rgba(248, 250, 252, 0.045); }
.project-copy { position: relative; padding: clamp(1rem, 2vw, 2rem) 0; }
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1.3rem; }
.project-type {
    padding: 0.42rem 0.7rem;
    border: 1px solid rgba(5, 150, 105, 0.25);
    border-radius: 999px;
    background: rgba(5, 150, 105, 0.08);
    color: #059669;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.dark .project-type { color: #059669; background: rgba(5, 150, 105, 0.1); }
.project-date { display: inline-flex; align-items: center; gap: 0.45rem; color: #64748b; font-size: 0.75rem; font-weight: 600; }
.dark .project-date { color: #94a3b8; }
.project-title { color: #0f172a; font-family: 'Space Grotesk', sans-serif; font-size: clamp(1.75rem, 3vw, 2.55rem); font-weight: 750; line-height: 1.15; letter-spacing: -0.035em; }
.dark .project-title { color: #f8fafc; }
.project-description { margin-top: 1.25rem; color: #475569; font-size: 1rem; line-height: 1.8; }
.dark .project-description { color: #a7b4c7; }
.project-highlights { display: grid; gap: 0.85rem; margin-top: 1.5rem; color: #64748b; font-size: 0.83rem; line-height: 1.65; }
.dark .project-highlights { color: #94a3b8; }
.project-highlights li { display: grid; grid-template-columns: 1.55rem 1fr; align-items: start; gap: 0.7rem; }
.project-highlight-icon { display: grid; place-items: center; width: 1.45rem; height: 1.45rem; margin-top: 0.12rem; border-radius: 0.45rem; background: rgba(5, 150, 105, 0.1); color: #059669; font-size: 0.58rem; }
.project-tech-list { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.7rem; }
.project-tech-badge { padding: 0.4rem 0.68rem; border: 1px solid #dbe4e1; border-radius: 0.55rem; background: rgba(255,255,255,0.7); color: #475569; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.67rem; font-weight: 700; }
.dark .project-tech-badge { border-color: #2c3b50; background: rgba(30, 41, 59, 0.7); color: #b6c2d2; }
.project-card-footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.8rem; padding-top: 1rem; border-top: 1px solid #e2e8f0; color: #94a3b8; font-size: 0.67rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.project-card-footer span:first-child { color: #059669; }
.project-card-footer i { margin-right: 0.35rem; }
.dark .project-card-footer { border-color: #263449; }
.dark .project-card-footer span:first-child { color: #059669; }

/* Resume CTA */
.resume-cta-section { padding-top: 6.5rem; padding-bottom: 6.5rem; background: #f8fafc; }
.dark .resume-cta-section { background: #0b1220; }
.resume-cta-card {
    position: relative;
    display: grid;
    grid-template-columns: 9rem 1fr auto;
    align-items: center;
    gap: clamp(2rem, 4vw, 4rem);
    overflow: hidden;
    padding: clamp(2rem, 5vw, 4.25rem);
    border: 1px solid #26364a;
    border-radius: 2rem;
    background:
        radial-gradient(circle at 80% 20%, rgba(5, 150, 105, 0.17), transparent 23rem),
        linear-gradient(135deg, #0f172a, #111d30 70%, #0b1422);
    box-shadow: 0 35px 80px rgba(15, 23, 42, 0.22);
}
.resume-cta-card::before { content: ""; position: absolute; inset: 0; width: auto; background-image: linear-gradient(rgba(148,163,184,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.045) 1px, transparent 1px); background-size: 38px 38px; pointer-events: none; }
.resume-document-art { position: relative; width: 8rem; height: 10rem; padding: 1.3rem 1rem; border: 1px solid rgba(255,255,255,.16); border-radius: 1.1rem; background: rgba(255,255,255,.07); box-shadow: inset 0 1px rgba(255,255,255,.08); transform: rotate(-4deg); }
.resume-document-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; margin-bottom: 1rem; border-radius: .75rem; background: #059669; color: white; font-size: 1.15rem; }
.resume-document-line { display: block; width: 75%; height: .3rem; margin-top: .55rem; border-radius: 999px; background: #506077; }
.resume-document-line-long { width: 100%; }
.resume-document-line-short { width: 55%; }
.resume-document-stamp { position: absolute; right: .7rem; bottom: .7rem; color: #059669; font-size: .62rem; font-weight: 900; letter-spacing: .12em; }
.resume-cta-copy { position: relative; z-index: 1; }
.resume-cta-kicker { color: #059669; }
.resume-cta-copy h2 { margin-top: .75rem; color: white; font-family: 'Space Grotesk', sans-serif; font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 750; line-height: 1.08; letter-spacing: -.045em; }
.resume-cta-copy p { max-width: 38rem; margin-top: 1rem; color: #aab7c9; font-size: 1rem; line-height: 1.75; }
.resume-cta-actions { position: relative; z-index: 1; align-items: stretch; }
.resume-download-button { min-width: 13.5rem; min-height: 3.6rem; border-color: #059669; border-radius: .9rem; background: #059669; box-shadow: 0 14px 34px rgba(5, 150, 105,.24); }
.resume-download-button:hover { border-color: #059669; background: #059669; box-shadow: 0 18px 42px rgba(5, 150, 105,.3); }
.resume-file-meta { color: #8290a4; text-align: center; }

/* Contact */
.contact-redesign { padding-top: 8rem; padding-bottom: 8rem; background: #f1f5f9; }
.dark .contact-redesign { background: #0f172a; }
.contact-grid-pattern { position: absolute; inset: 0; opacity: .45; pointer-events: none; background-image: radial-gradient(rgba(5,150,105,.18) 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(to bottom, black, transparent 72%); }
.dark .contact-grid-pattern { opacity: .24; }
.contact-section-heading { max-width: 50rem; margin-bottom: 4.5rem; }
.contact-section-heading .section-title { font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: 1.04; letter-spacing: -.05em; }
.contact-section-heading > p { max-width: 38rem; margin-top: 1.2rem; color: #64748b; font-size: 1.02rem; line-height: 1.75; }
.dark .contact-section-heading > p { color: #94a3b8; }
.contact-intro { align-self: stretch; padding: 2rem; border: 1px solid #26364a; border-radius: 1.6rem; background: linear-gradient(145deg, #0f172a, #142238); box-shadow: 0 24px 60px rgba(15,23,42,.2); }
.contact-availability { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem .7rem; border: 1px solid rgba(5, 150, 105,.25); border-radius: 999px; background: rgba(5, 150, 105,.08); color: #059669; font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.contact-availability span { width: .48rem; height: .48rem; border-radius: 50%; background: #059669; box-shadow: 0 0 0 .3rem rgba(5, 150, 105,.1); animation: availability-pulse 2s ease-in-out infinite; }
.contact-intro > h3 { margin-top: 1.6rem; color: #f8fafc; font-family: 'Space Grotesk', sans-serif; font-size: 1.65rem; font-weight: 700; line-height: 1.25; }
.contact-intro > p { margin-top: .75rem; margin-bottom: 1.8rem; color: #94a3b8; font-size: .9rem; line-height: 1.7; }
.contact-methods { gap: .65rem; }
.contact-method { min-height: 4.55rem; padding: .75rem; border-color: rgba(148,163,184,.15); border-radius: .9rem; background: rgba(255,255,255,.045); box-shadow: none; }
.dark .contact-method { border-color: rgba(148,163,184,.15); background: rgba(255,255,255,.045); box-shadow: none; }
.contact-method:hover, .contact-method:focus-within { border-color: rgba(5, 150, 105,.45); background: rgba(5, 150, 105,.07); box-shadow: none; }
.contact-method > div:first-child { width: 2.7rem !important; height: 2.7rem !important; border-radius: .75rem !important; background: rgba(5, 150, 105,.12) !important; color: #059669 !important; }
.contact-method p:first-child { color: #7d8ca1 !important; font-size: .66rem; letter-spacing: .09em; text-transform: uppercase; }
.contact-method p:last-child, .contact-method a { color: #f1f5f9 !important; font-size: .84rem; }
.contact-form-card, .contact-form-card:hover { border: 1px solid #dce5e2; border-radius: 1.6rem; background: rgba(255,255,255,.94); box-shadow: 0 28px 70px rgba(15,23,42,.11); }
.dark .contact-form-card, .dark .contact-form-card:hover { border-color: #2b3a4f; background: #172236; box-shadow: 0 30px 75px rgba(0,0,0,.3); }
.contact-form-header { padding-top: 1.7rem !important; background: linear-gradient(90deg, rgba(5,150,105,.055), transparent) !important; }
.dark .contact-form-header { background: linear-gradient(90deg, rgba(5, 150, 105,.075), transparent) !important; }
.contact-form-card .form-input, .contact-form-card .form-textarea { border-color: #d9e3e0; border-radius: .8rem; background: #f8fafc; }
.dark .contact-form-card .form-input, .dark .contact-form-card .form-textarea { border-color: #34445a; background: #0f192a; }
.contact-form-card .form-textarea { min-height: 9.5rem; }
.contact-submit { min-height: 3.55rem; border-radius: .85rem; background: linear-gradient(135deg, #059669, #059669); box-shadow: 0 14px 32px rgba(5,150,105,.2); }
.contact-submit:hover { background: linear-gradient(135deg, #059669, #059669); }
@keyframes availability-pulse { 50% { opacity: .55; box-shadow: 0 0 0 .55rem rgba(5, 150, 105,0); } }

/* Footer */
.creative-footer { border-top: 1px solid #1e2c40; background: #08111f; }
.creative-footer-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem; min-height: 8rem; }
.footer-brand { color: #f8fafc; font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; font-weight: 800; letter-spacing: .04em; }
.footer-brand span { color: #059669; }
.creative-footer p { justify-self: center; color: #718096; font-size: .76rem; text-align: center; }
.footer-back-top { display: inline-flex; align-items: center; gap: .55rem; color: #a9b6c8; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; transition: color 200ms ease; }
.footer-back-top i { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid #2b3a50; border-radius: 50%; transition: transform 200ms ease, border-color 200ms ease; }
.footer-back-top:hover { color: #059669; }
.footer-back-top:hover i { border-color: #059669; transform: translateY(-3px); }

@media (max-width: 1023px) {
    .creative-projects-section { padding-top: 6rem; padding-bottom: 6.5rem; }
    #projects-container { gap: 6.5rem; }
    .project-showcase { grid-template-columns: 1fr; gap: 3rem; }
    .project-showcase-reverse .project-visual-wrap { order: 0; }
    .project-showcase-reverse .project-copy { order: 1; }
    .project-copy { max-width: 48rem; }
    .project-carousel-arrow { opacity: .9; transform: translateY(-50%); }
    .resume-cta-card { grid-template-columns: 7rem 1fr; }
    .resume-document-art { width: 6.5rem; height: 8.5rem; }
    .resume-cta-actions { grid-column: 2; align-items: flex-start; }
    .contact-intro { max-width: none; }
    .contact-methods { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 767px) {
    .creative-projects-section, .contact-redesign { padding-top: 5rem; padding-bottom: 5rem; }
    .projects-heading { align-items: flex-start; margin-bottom: 4rem; }
    .projects-count { display: none; }
    #projects-container { gap: 5.5rem; }
    .project-showcase { gap: 2.5rem; }
    .project-visual-wrap::before { inset: .75rem -.5rem -.75rem .5rem; }
    .project-showcase-reverse .project-visual-wrap::before { inset: .75rem .5rem -.75rem -.5rem; }
    .project-window-live { display: none; }
    .project-window-bar { grid-template-columns: 1fr auto; }
    .project-window-label { justify-self: end; }
    .project-carousel-arrow { width: 2.3rem; height: 2.3rem; }
    .project-title { font-size: 1.7rem; }
    .project-card-footer { align-items: center; }
    .resume-cta-section { padding-top: 4rem; padding-bottom: 4rem; }
    .resume-cta-card { grid-template-columns: 1fr; gap: 1.75rem; padding: 2rem; border-radius: 1.4rem; }
    .resume-document-art { display: none; }
    .resume-cta-actions { grid-column: auto; align-items: stretch; }
    .resume-download-button { width: 100%; }
    .contact-section-heading { margin-bottom: 3rem; }
    .contact-methods { grid-template-columns: 1fr; }
    .contact-intro { padding: 1.4rem; }
    .creative-footer-inner { grid-template-columns: 1fr; justify-items: center; gap: 1rem; padding: 2.5rem 0; }
    .creative-footer p { order: 3; }
}
@media (prefers-reduced-motion: reduce) {
    .contact-availability span { animation: none; }
    .project-play-link, .project-play-link > i { transition: none; }
    .project-carousel .carousel-slide img, .footer-back-top i { transition: none; }
}

/* Lower panels follow the global light/dark theme. */
.resume-cta-card {
    border-color: #d8e3df;
    background:
        radial-gradient(circle at 80% 20%, rgba(5, 150, 105, 0.09), transparent 23rem),
        #ffffff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.1);
}
.resume-cta-card::before {
    background-image: linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
}
.resume-document-art { border-color: #dbe5e1; background: #f1f5f9; box-shadow: inset 0 1px rgba(255,255,255,.8); }
.resume-document-line { background: #cbd5e1; }
.resume-document-stamp { color: #059669; }
.resume-cta-copy h2 { color: #0f172a; }
.resume-cta-copy p { color: #64748b; }
.resume-file-meta { color: #64748b; }
.dark .resume-cta-card {
    border-color: #26364a;
    background:
        radial-gradient(circle at 80% 20%, rgba(5, 150, 105, 0.17), transparent 23rem),
        linear-gradient(135deg, #0f172a, #111d30 70%, #0b1422);
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.3);
}
.dark .resume-cta-card::before {
    background-image: linear-gradient(rgba(148,163,184,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.045) 1px, transparent 1px);
}
.dark .resume-document-art { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.07); box-shadow: inset 0 1px rgba(255,255,255,.08); }
.dark .resume-document-line { background: #506077; }
.dark .resume-document-stamp { color: #059669; }
.dark .resume-cta-copy h2 { color: #ffffff; }
.dark .resume-cta-copy p { color: #aab7c9; }
.dark .resume-file-meta { color: #8290a4; }

.contact-intro {
    border-color: #d8e3df;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.09);
}
.contact-intro > h3 { color: #0f172a; }
.contact-intro > p { color: #64748b; }
.contact-method,
.dark .contact-method {
    border-color: #e2e8f0;
    background: #f8fafc;
    box-shadow: none;
}
.contact-method:hover,
.contact-method:focus-within { border-color: rgba(5,150,105,.38); background: rgba(5,150,105,.055); }
.contact-method p:first-child { color: #64748b !important; }
.contact-method p:last-child,
.contact-method a { color: #0f172a !important; }
.dark .contact-intro {
    border-color: #26364a;
    background: linear-gradient(145deg, #0f172a, #142238);
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.dark .contact-intro > h3 { color: #f8fafc; }
.dark .contact-intro > p { color: #94a3b8; }
.dark .contact-method { border-color: rgba(148,163,184,.15); background: rgba(255,255,255,.045); }
.dark .contact-method:hover,
.dark .contact-method:focus-within { border-color: rgba(5, 150, 105,.45); background: rgba(5, 150, 105,.07); }
.dark .contact-method p:first-child { color: #7d8ca1 !important; }
.dark .contact-method p:last-child,
.dark .contact-method a { color: #f1f5f9 !important; }

.creative-footer { border-color: #dbe4e1; background: #ffffff; }
.footer-brand { color: #0f172a; }
.creative-footer p { color: #64748b; }
.footer-back-top { color: #475569; }
.footer-back-top i { border-color: #cbd5e1; }
.dark .creative-footer { border-color: #1e2c40; background: #08111f; }
.dark .footer-brand { color: #f8fafc; }
.dark .creative-footer p { color: #718096; }
.dark .footer-back-top { color: #a9b6c8; }
.dark .footer-back-top i { border-color: #2b3a50; }

/* Pure portfolio canvas: white in light mode and black in dark mode. */
html,
body,
#navbar,
body > section,
.creative-footer {
    background: #ffffff !important;
    background-image: none !important;
}

.dark,
.dark body,
.dark #navbar,
.dark body > section,
.dark .creative-footer {
    background: #000000 !important;
    background-image: none !important;
}

/* Keep the contact content, but remove the tinted section backdrop. */
.contact-grid-pattern {
    display: none;
}

/* Contact panels use the portfolio's black / white / green palette. */
.contact-intro,
.contact-form-card,
.contact-form-card:hover {
    border-color: #e5e7eb;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
}

.contact-form-card > .absolute {
    display: none;
}

.contact-form-header {
    border-color: #e5e7eb !important;
    background: #ffffff !important;
}

.contact-method,
.contact-method:hover,
.contact-method:focus-within,
.contact-form-card .form-input,
.contact-form-card .form-textarea {
    border-color: #e5e7eb;
    background: #f7f7f7;
}

.contact-method:hover,
.contact-method:focus-within,
.contact-form-card .form-input:focus,
.contact-form-card .form-textarea:focus {
    border-color: #059669;
}

.contact-submit,
.contact-submit:hover {
    background: #059669;
}

.dark .contact-intro,
.dark .contact-form-card,
.dark .contact-form-card:hover {
    border-color: #2a2a2a;
    background: #0a0a0a;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.dark .contact-form-header {
    border-color: #2a2a2a !important;
    background: #0a0a0a !important;
}

.dark .contact-method,
.dark .contact-form-card .form-input,
.dark .contact-form-card .form-textarea {
    border-color: #2a2a2a;
    background: #141414;
}

.dark .contact-method:hover,
.dark .contact-method:focus-within {
    border-color: #059669;
    background: #141414;
}

.dark .contact-form-card .form-input:focus,
.dark .contact-form-card .form-textarea:focus {
    border-color: #059669;
    background: #141414;
}

.dark .contact-intro > p,
.dark .contact-form-header p,
.dark .contact-form-card .form-input::placeholder,
.dark .contact-form-card .form-textarea::placeholder {
    color: #a3a3a3;
}

/* One exact brand green and visually steady button hover states. */
.portfolio-button-primary,
.portfolio-button-primary:hover,
.resume-download-button,
.resume-download-button:hover,
.contact-submit,
.contact-submit:hover,
.project-play-link,
.project-play-link:hover {
    border-color: #059669 !important;
    background: #059669 !important;
    color: #ffffff !important;
}

button:hover,
.portfolio-button:hover,
.resume-download-button:hover,
.contact-submit:hover,
.project-play-link:hover,
.crawler-arm-game-link:hover,
.project-carousel-arrow:hover {
    box-shadow: none !important;
    filter: none !important;
}

.portfolio-button:hover,
.resume-download-button:hover,
.contact-submit:hover,
.project-play-link:hover {
    transform: none !important;
}

.portfolio-button-secondary:hover {
    border-color: #cbd5e1 !important;
    background: transparent !important;
    color: #1e293b !important;
}

.dark .portfolio-button-secondary:hover {
    border-color: #334155 !important;
    color: #ffffff !important;
}

#theme-toggle:hover,
#theme-toggle-mobile:hover {
    background: #e2e8f0 !important;
}

.dark #theme-toggle:hover,
.dark #theme-toggle-mobile:hover {
    background: #1e293b !important;
}

.project-carousel-arrow:hover {
    background: rgba(7, 15, 28, 0.75) !important;
    transform: translateY(-50%) !important;
}

.crawler-arm-game-link:hover {
    transform: translate(0.35rem, -50%) !important;
}

.resume-download-button:hover .resume-download-icon,
.project-play-link:hover > i {
    transform: none !important;
}

/* Green-filled interface elements use the exact solid brand color. */
.project-type,
.dark .project-type,
.project-highlight-icon,
.contact-availability,
.contact-method > div:first-child {
    border-color: #059669 !important;
    background: #059669 !important;
    color: #ffffff !important;
}

.contact-method:hover,
.contact-method:focus-within {
    background: #f7f7f7;
    box-shadow: none !important;
    transform: none !important;
}

.dark .contact-method:hover,
.dark .contact-method:focus-within {
    background: #141414;
    box-shadow: none !important;
    transform: none !important;
}

/* Skills share the exact neutral surfaces used by the contact form card. */
.skill-category-header {
    border-color: #e5e7eb;
}

.skill-category-symbol,
.skill-tile {
    border-color: #e5e7eb;
    background: #ffffff;
    box-shadow: none;
}

.skill-tile-icon {
    border-color: #e5e7eb;
    background: #f7f7f7;
}

.skill-tile:hover,
.skill-tile:focus-visible {
    border-color: #e5e7eb;
    background: #ffffff;
    box-shadow: none;
}

.skill-tile:focus-visible {
    outline-color: rgba(5, 150, 105, 0.55);
}

.dark .skill-category-header {
    border-color: #2a2a2a;
}

.dark .skill-category-symbol,
.dark .skill-tile,
.dark .skill-tile:hover,
.dark .skill-tile:focus-visible {
    border-color: #2a2a2a;
    background: #0a0a0a;
    box-shadow: none;
}

.dark .skill-tile-icon {
    border-color: #2a2a2a;
    background: #141414;
}

.dark .skill-category-header span:not(.skill-category-symbol),
.dark .skill-tile-name {
    color: #d4d4d4;
}

.skill-category-symbol,
.dark .skill-category-symbol {
    border-color: #059669;
    background: #059669;
    color: #ffffff;
}

.project-github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding: 0.72rem 0.9rem;
    border: 1px solid #059669;
    border-radius: 0.65rem;
    background: #059669;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-decoration: none;
}

.project-github-link .fa-arrow-up-right-from-square {
    font-size: 0.58rem;
}

.project-github-link:hover {
    border-color: #059669;
    background: #059669;
    color: #ffffff;
    box-shadow: none;
    transform: none;
}

.project-github-link:focus-visible {
    outline: 3px solid rgba(5, 150, 105, 0.45);
    outline-offset: 3px;
}

.project-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.project-actions .project-github-link,
.project-actions .project-play-link {
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    margin-top: 0;
    padding: 0.72rem 0.9rem;
    border-radius: 0.65rem;
    font-size: 0.68rem;
}

/* Eye-friendly light theme: soft neutrals replace high-glare pure white. */
html:not(.dark),
html:not(.dark) body,
html:not(.dark) body > section {
    background: #f3f4f4 !important;
    background-image: none !important;
}

html:not(.dark) body {
    color: #171717;
}

html:not(.dark) #navbar,
html:not(.dark) .creative-footer {
    background: #fafafa !important;
    background-image: none !important;
}

html:not(.dark) .card-base,
html:not(.dark) .resume-cta-card,
html:not(.dark) .contact-intro,
html:not(.dark) .contact-form-card,
html:not(.dark) .contact-form-card:hover,
html:not(.dark) .skill-tile,
html:not(.dark) .skill-tile:hover,
html:not(.dark) .skill-tile:focus-visible {
    border-color: #d9dddc;
    background: #fafafa;
}

html:not(.dark) .contact-form-header {
    border-color: #d9dddc !important;
    background: #fafafa !important;
}

html:not(.dark) .contact-method,
html:not(.dark) .contact-method:hover,
html:not(.dark) .contact-method:focus-within,
html:not(.dark) .contact-form-card .form-input,
html:not(.dark) .contact-form-card .form-textarea,
html:not(.dark) .skill-tile-icon,
html:not(.dark) .project-tech-badge {
    border-color: #d9dddc;
    background: #f0f1f1;
}

html:not(.dark) .contact-form-card .form-input:focus,
html:not(.dark) .contact-form-card .form-textarea:focus {
    border-color: #059669;
    background: #f0f1f1;
}

html:not(.dark) .skill-category-header,
html:not(.dark) .creative-footer {
    border-color: #d9dddc;
}

html:not(.dark) #theme-toggle,
html:not(.dark) #theme-toggle:hover,
html:not(.dark) #theme-toggle-mobile,
html:not(.dark) #theme-toggle-mobile:hover {
    background: #f0f1f1 !important;
}

html:not(.dark) .portfolio-button-secondary:hover {
    border-color: #d9dddc !important;
    color: #171717 !important;
}

.nav-resume-button,
.mobile-nav-resume {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid #059669;
    background: #059669 !important;
    color: #ffffff !important;
    font-weight: 700;
    text-decoration: none;
}

.nav-resume-button {
    padding: 0.62rem 0.85rem;
    border-radius: 0.65rem;
    font-size: 0.78rem;
}

.mobile-nav-resume {
    margin-top: 0.25rem;
    padding: 0.75rem 1rem;
}

.nav-resume-button:hover,
.mobile-nav-resume:hover {
    border-color: #059669;
    background: #059669 !important;
    color: #ffffff !important;
    box-shadow: none !important;
    transform: none !important;
}

.nav-resume-button:focus-visible,
.mobile-nav-resume:focus-visible {
    outline: 3px solid rgba(5, 150, 105, 0.45);
    outline-offset: 3px;
}

.nav-resume-button,
.nav-resume-button:hover,
.mobile-nav-resume,
.mobile-nav-resume:hover {
    border-color: #000000 !important;
    background: #000000 !important;
    color: #ffffff !important;
}

.dark .nav-resume-button,
.dark .nav-resume-button:hover,
.dark .mobile-nav-resume,
.dark .mobile-nav-resume:hover {
    border-color: #ffffff !important;
    background: #ffffff !important;
    color: #000000 !important;
}

#theme-toggle,
#theme-toggle:hover,
#theme-toggle-mobile,
#theme-toggle-mobile:hover {
    border: 1px solid #d9dddc !important;
    background: #fafafa !important;
    color: #171717 !important;
    box-shadow: none !important;
    filter: none !important;
    outline: none;
}

.dark #theme-toggle,
.dark #theme-toggle:hover,
.dark #theme-toggle-mobile,
.dark #theme-toggle-mobile:hover {
    border-color: #2a2a2a !important;
    background: #0a0a0a !important;
    color: #ffffff !important;
}

#theme-toggle:focus-visible,
#theme-toggle-mobile:focus-visible {
    outline: 2px solid #737373;
    outline-offset: 3px;
}

#theme-icon,
#theme-icon-mobile {
    color: inherit !important;
}

/* Technical Arsenal: three categories and three skills per category row. */
@media (min-width: 1024px) {
    .skills-showcase {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
        gap: 2.5rem 2rem;
        max-width: 100%;
    }

    .skill-category,
    .skill-category:last-child {
        min-width: 0;
        margin-bottom: 0;
    }

    .skill-tool-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .skill-tile {
        min-height: 3.25rem;
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.4rem;
        padding: 0.45rem;
        text-align: left;
    }

    .skill-tile-icon {
        width: 1.85rem;
        height: 1.85rem;
        flex-basis: 1.85rem;
        border-radius: 0.5rem;
        font-size: 1rem;
    }

    .skill-tile-name {
        font-size: 0.6rem;
        line-height: 1.2;
        text-align: left;
        overflow-wrap: anywhere;
    }
}

/* Additional projects dialog */
.more-projects-action {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.more-projects-button {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0;
    padding: 0.7rem 0.95rem;
    border: 1px solid #d9dddc;
    border-radius: 0.65rem;
    background: #fafafa;
    color: #171717;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.more-projects-button i {
    color: #059669;
}

.more-projects-button:hover,
.more-projects-button:focus-visible {
    border-color: #737373;
    background: #f0f1f1;
    box-shadow: none;
    outline: none;
}

.more-projects-button:focus-visible {
    outline: 2px solid #737373;
    outline-offset: 3px;
}

.dark .more-projects-button {
    border-color: #2a2a2a;
    background: #0a0a0a;
    color: #f5f5f5;
}

.dark .more-projects-button:hover,
.dark .more-projects-button:focus-visible {
    border-color: #737373;
    background: #141414;
}

html.modal-open,
body.modal-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.additional-projects-modal {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.72);
}

.additional-projects-modal.hidden {
    display: none;
}

.additional-projects-panel {
    width: min(78rem, 100%);
    max-height: 88vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #d9dddc;
    border-radius: 1.25rem;
    background: #f3f4f4;
    color: #171717;
}

.dark .additional-projects-panel {
    border-color: #2a2a2a;
    background: #000000;
    color: #f5f5f5;
}

.additional-projects-header {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.4rem 1.5rem;
    border-bottom: 1px solid #d9dddc;
    background: #fafafa;
}

.dark .additional-projects-header {
    border-color: #2a2a2a;
    background: #0a0a0a;
}

.additional-projects-header p,
.additional-project-type {
    color: #059669;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.additional-projects-header h2 {
    margin-top: 0.2rem;
    font-family: Poppins, sans-serif;
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 700;
}

.additional-projects-header button {
    display: grid;
    place-items: center;
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid #d9dddc;
    border-radius: 50%;
    background: #f0f1f1;
    color: #171717;
}

.dark .additional-projects-header button {
    border-color: #2a2a2a;
    background: #141414;
    color: #f5f5f5;
}

.additional-projects-header button:hover,
.additional-projects-header button:focus-visible {
    border-color: #737373;
    box-shadow: none;
    outline: none;
}

.additional-projects-header button:focus-visible {
    outline: 2px solid #737373;
    outline-offset: 3px;
}

.additional-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.additional-project-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #d9dddc;
    border-radius: 1rem;
    background: #fafafa;
}

.dark .additional-project-card {
    border-color: #2a2a2a;
    background: #0a0a0a;
}

.additional-project-image {
    position: relative;
    isolation: isolate;
    height: 13rem;
    overflow: hidden;
    border-bottom: 1px solid #d9dddc;
    background: #f0f1f1;
}

.dark .additional-project-image {
    border-color: #2a2a2a;
    background: #141414;
}

.additional-carousel-slide {
    position: absolute;
    inset: 0.75rem;
    display: none;
    place-items: center;
    min-width: 0;
    min-height: 0;
}

.additional-carousel-slide.is-active {
    display: grid;
}

.additional-carousel-slide img {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
}

.additional-carousel-arrow {
    position: absolute;
    z-index: 3;
    top: 50%;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    transform: translateY(-50%);
}

.additional-carousel-arrow:hover,
.additional-carousel-arrow:focus-visible {
    border-color: #ffffff;
    background: #000000;
    box-shadow: none;
    outline: none;
    transform: translateY(-50%);
}

.additional-carousel-arrow:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.additional-carousel-prev {
    left: 0.65rem;
}

.additional-carousel-next {
    right: 0.65rem;
}

.additional-carousel-dots {
    position: absolute;
    z-index: 3;
    bottom: 0.55rem;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    transform: translateX(-50%);
}

.additional-carousel-dot {
    width: 0.42rem;
    height: 0.42rem;
    border: 0;
    border-radius: 999px;
    background: #737373;
}

.additional-carousel-dot.is-active {
    width: 1.1rem;
    background: #059669;
}

.additional-carousel-dot:hover,
.additional-carousel-dot:focus-visible {
    background: #a3a3a3;
    box-shadow: none;
    outline: none;
}

.additional-carousel-dot.is-active:hover,
.additional-carousel-dot.is-active:focus-visible {
    background: #059669;
}

.additional-project-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.25rem;
}

.additional-project-content h3 {
    margin-top: 0.55rem;
    color: inherit;
    font-family: Poppins, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.additional-project-description {
    margin-top: 0.8rem;
    color: #525252;
    font-size: 0.8rem;
    line-height: 1.65;
}

.dark .additional-project-description {
    color: #a3a3a3;
}

.additional-project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
    margin-bottom: 1.1rem;
}

.additional-project-tech span {
    padding: 0.35rem 0.5rem;
    border: 1px solid #d9dddc;
    border-radius: 0.45rem;
    background: #f0f1f1;
    color: #404040;
    font-size: 0.62rem;
    font-weight: 700;
}

.dark .additional-project-tech span {
    border-color: #2a2a2a;
    background: #141414;
    color: #d4d4d4;
}

.additional-project-github {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.55rem;
    min-height: 2.55rem;
    margin-top: auto;
    padding: 0.65rem 0.8rem;
    border: 1px solid #059669;
    border-radius: 0.6rem;
    background: #059669;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-decoration: none;
    text-transform: uppercase;
}

.additional-project-tech + .additional-project-github {
    margin-top: auto;
}

.additional-project-github:hover,
.additional-project-github:focus-visible {
    border-color: #059669;
    background: #059669;
    color: #ffffff;
    box-shadow: none;
    outline: none;
}

.additional-project-github:focus-visible {
    outline: 2px solid #737373;
    outline-offset: 3px;
}

.additional-project-github .fa-arrow-up-right-from-square {
    font-size: 0.55rem;
}

@media (max-width: 900px) {
    .additional-projects-grid {
        grid-template-columns: 1fr;
    }

    .additional-project-image {
        height: 16rem;
    }
}

@media (max-width: 600px) {
    .additional-projects-modal {
        padding: 0.75rem;
    }

    .additional-projects-header,
    .additional-projects-grid {
        padding: 1rem;
    }

    .additional-project-image {
        height: 12rem;
    }

    .more-projects-action {
        margin-top: 2rem;
    }

}



/* Consistent, tighter spacing between the main portfolio sections. */
#about,
#skills,
.creative-projects-section,
.contact-redesign {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

@media (max-width: 1023px) {
    #about,
    #skills,
    .creative-projects-section,
    .contact-redesign {
        padding-top: 2.25rem !important;
        padding-bottom: 2.25rem !important;
    }
}

@media (max-width: 767px) {
    #about,
    #skills,
    .creative-projects-section,
    .contact-redesign {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
}


/* The profile image keeps its natural transparent body outline. */
.profile-portrait-stage {
    position: relative;
    flex: none;
    width: clamp(16rem, 28vw, 21rem);
    aspect-ratio: 1122 / 1402;
    isolation: isolate;
    overflow: visible;
}

.profile-portrait-stage-mobile {
    width: clamp(8.5rem, 34vw, 10rem);
}

.profile-portrait-stage .profile-photo-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.profile-portrait-stage .profile-photo-layer img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0 0 48% 48% / 0 0 8% 8%;
    -webkit-mask-image: linear-gradient(to bottom, #000 77%, rgba(0, 0, 0, 0.85) 85%, rgba(0, 0, 0, 0.25) 94%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 77%, rgba(0, 0, 0, 0.85) 85%, rgba(0, 0, 0, 0.25) 94%, transparent 100%);
}

.profile-portrait-stage .crawler-arm-game-link {
    max-width: calc(100vw - 1rem);
    box-sizing: border-box;
}

.profile-portrait-stage .crawler-arm-game-link[hidden] {
    display: none;
}


.profile-tech-icon {
    position: absolute;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(2, 8, 23, 0.22);
    font-size: 1.25rem;
    transform-style: preserve-3d;
    transition: transform 120ms ease-out, box-shadow 180ms ease;
}

.profile-tech-icon i {
    transform: translateZ(10px);
}

.profile-tech-icon:hover {
    z-index: 5;
    box-shadow: 0 14px 28px rgba(2, 8, 23, 0.3);
}

.dark .profile-tech-icon {
    border-color: #334155;
    background: #1e293b;
}

.profile-tech-icon-react {
    top: 17%;
    left: -11%;
    color: #0ea5e9;
}

.profile-tech-icon-php {
    right: -10%;
    bottom: 21%;
    color: #7c3aed;
}

.profile-tech-icon-unity {
    bottom: 6%;
    left: -7%;
    color: #111827;
}

.dark .profile-tech-icon-unity {
    color: #ffffff;
}

.profile-portrait-stage-mobile .profile-tech-icon {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.8rem;
}

.profile-portrait-stage-mobile .profile-tech-icon-react {
    left: -8%;
}

.profile-portrait-stage-mobile .profile-tech-icon-php {
    right: -7%;
}

.profile-portrait-stage-mobile .profile-tech-icon-unity {
    left: -6%;
}


.profile-portrait-stage .profile-tech-icon-react {
    left: -18%;
}

.profile-portrait-stage .profile-tech-icon-unity {
    left: -22%;
}

.profile-portrait-stage .profile-tech-icon-php {
    right: -22%;
}

.profile-portrait-stage .crawler-arm-game-link,
.profile-portrait-stage .crawler-arm-game-link:hover,
.profile-portrait-stage .crawler-arm-game-link:focus-visible {
    top: 0;
    right: 0;
    left: auto;
    min-height: 2rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.65rem;
    transform: none !important;
}

/* The link and tech icons float on the crawler's bob and sway. */
.profile-portrait-stage .crawler-arm-game-link,
.profile-portrait-stage .profile-tech-icon {
    translate: var(--crawler-float-x, 0px) var(--crawler-float-y, 0px);
}

@media (prefers-reduced-motion: reduce) {
    .profile-portrait-stage .crawler-arm-game-link,
    .profile-portrait-stage .profile-tech-icon {
        translate: none;
    }
}

/* Dashed contour follows the portrait alpha and its curved lower edge. */
.profile-body-outline {
    position: absolute;
    z-index: 3;
    left: -1.783%;
    top: -1.427%;
    width: 103.565%;
    max-width: none;
    height: 104.708%;
    transform: scale(1.035, 1.02);
    transform-origin: center;
    -webkit-mask-image: linear-gradient(to bottom, #000 75%, rgba(0, 0, 0, 0.85) 82%, rgba(0, 0, 0, 0.25) 92%, transparent 97%);
    mask-image: linear-gradient(to bottom, #000 75%, rgba(0, 0, 0, 0.85) 82%, rgba(0, 0, 0, 0.25) 92%, transparent 97%);
    pointer-events: none;
}

/* Profile-only static glow and circuit grid. */
.profile-portrait-stage::before,
.profile-portrait-stage::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: -24% -42% -19%;
    pointer-events: none;
}

.profile-portrait-stage::before {
    background:
        radial-gradient(ellipse at 50% 49%, rgba(49, 70, 82, 0.32), rgba(30, 41, 59, 0.12) 53%, transparent 76%);
}

.profile-portrait-stage::after {
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.30) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.30) 1px, transparent 1px),
        radial-gradient(circle, rgba(100, 116, 139, 0.58) 1px, transparent 1.5px);
    background-size: 44px 44px;
    background-position: center;
    -webkit-mask-image: radial-gradient(ellipse 53% 55% at 50% 50%, #000 8%, transparent 90%);
    mask-image: radial-gradient(ellipse 53% 55% at 50% 50%, #000 8%, transparent 90%);
    opacity: 0.5;
}

html:not(.dark) .profile-body-outline {
    filter: brightness(0);
}

html:not(.dark) .profile-portrait-stage::before {
    background:
        radial-gradient(ellipse at 50% 49%, rgba(148, 163, 184, 0.18), rgba(186, 205, 214, 0.10) 55%, transparent 77%);
}

html:not(.dark) .profile-portrait-stage::after {
    background-image:
        linear-gradient(rgba(51, 65, 85, 0.22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51, 65, 85, 0.22) 1px, transparent 1px),
        radial-gradient(circle, rgba(71, 85, 105, 0.52) 1px, transparent 1.5px);
    opacity: 0.55;
}

@media (max-width: 1023px) {
    .profile-portrait-stage::before,
    .profile-portrait-stage::after {
        inset: -24% -42% 0;
    }
}
/* Rust Guard occupies the sixth cell beside the skills, with no card frame. */
.rust-guard-stage {
    position: relative;
    width: min(100%, 24rem);
    height: 18rem;
    margin: 1.5rem auto 0;
    overflow: hidden;
    cursor: crosshair;
    touch-action: manipulation;
    background: radial-gradient(circle at 50% 55%, rgba(100, 116, 139, 0.08), transparent 68%);
}

.dark .rust-guard-stage {
    background: radial-gradient(circle at 50% 55%, rgba(100, 116, 139, 0.12), transparent 68%);
}

.rust-guard-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.rust-guard-stage:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
}

.rust-guard-label {
    position: absolute;
    z-index: 1;
    top: 0.35rem;
    left: 0.5rem;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    pointer-events: none;
}

.rust-guard-label span {
    display: block;
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.55rem;
    font-weight: 600;
}

.dark .rust-guard-label { color: #cbd5e1; }
.dark .rust-guard-label span { color: #94a3b8; }

@media (min-width: 1024px) {
    .rust-guard-stage {
        grid-column: 3;
        grid-row: 2;
        align-self: start;
        width: 100%;
        height: clamp(18rem, 25vw, 23rem);
        margin: 0;
    }
}

/* Pixel characters from the creative portfolio sit above the Detention preview. */
.project-pixel-cast {
    --pixel-cast-height: 10rem;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    height: var(--pixel-cast-height);
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.5rem 0.2rem;
    cursor: crosshair;
    outline: none;
}

.project-pixel-cast:focus-visible {
    outline: 2px solid #059669;
    outline-offset: -2px;
}

.project-pixel-cast-hint {
    position: absolute;
    top: 0.35rem;
    right: 0.65rem;
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    pointer-events: none;
}

.dark .project-pixel-cast-hint { color: #94a3b8; }

.project-pixel-actor {
    display: block;
    width: auto;
    max-width: 45%;
    height: 71%;
    image-rendering: pixelated;
    object-fit: contain;
}

/* Match the visible sprite heights and place their feet on one line. */
.project-pixel-actor[data-pixel-actor="one"] {
    transform: translateY(2px);
}

.project-pixel-actor[data-pixel-actor="two"] {
    height: calc(var(--pixel-cast-height) - 2.2rem);
}

@media (min-width: 1024px) {
    .project-pixel-actor[data-pixel-actor="one"] {
        height: 74%;
        transform: translateY(3px);
    }

    .project-pixel-cast {
        --pixel-cast-height: 12rem;
        position: absolute;
        z-index: 2;
        right: 0;
        bottom: calc(100% + 0.75rem);
        margin: 0;
    }
}

/* Certificates and achievements */
.certificates-section {
    padding-top: 7.5rem;
    padding-bottom: 8rem;
    overflow: hidden;
    background: #edf3f1;
}
.dark .certificates-section { background: #08111f; }
.certificate-heading {
    max-width: 48rem;
    margin-bottom: 3.5rem;
}
.certificate-heading .section-title {
    display: block;
    margin-bottom: 1rem;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    line-height: 1.05;
    letter-spacing: -.045em;
}
.certificate-heading > p {
    max-width: 39rem;
    color: #64748b;
    font-size: 1rem;
    line-height: 1.75;
}
.dark .certificate-heading > p { color: #94a3b8; }
.certificate-showcase {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(19rem, .8fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
    padding: clamp(1rem, 2.4vw, 2rem);
    border: 1px solid #d3dfdc;
    border-radius: 1.6rem;
    background: rgba(255,255,255,.72);
    box-shadow: 0 25px 65px rgba(15,23,42,.09);
}
.dark .certificate-showcase {
    border-color: #26364a;
    background: #0f192a;
    box-shadow: 0 28px 70px rgba(0,0,0,.26);
}
.certificate-visual {
    position: relative;
    display: block;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}
.certificate-frame {
    position: relative;
    display: block;
    padding: clamp(.55rem, 1.5vw, 1rem);
    border: 1px solid #cad7d3;
    border-radius: 1.05rem;
    background: #dfe8e5;
    overflow: hidden;
}
.dark .certificate-frame { border-color: #314158; background: #111d2f; }
.certificate-frame::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(125deg, rgba(255,255,255,.14), transparent 34% 68%, rgba(5,150,105,.08));
}
.certificate-frame img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: .65rem;
    transition: transform 350ms cubic-bezier(.22,1,.36,1), filter 350ms ease;
}
.certificate-visual:hover .certificate-frame img,
.certificate-visual:focus-visible .certificate-frame img { transform: scale(1.018); filter: contrast(1.03); }
.certificate-visual:focus-visible { outline: 3px solid rgba(5,150,105,.35); outline-offset: 5px; border-radius: 1rem; }
.certificate-view-label {
    position: absolute;
    z-index: 2;
    right: 1.25rem;
    bottom: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .75rem;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: .7rem;
    background: rgba(8,17,31,.86);
    color: #f8fafc;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}
.certificate-copy { min-width: 0; }
.certificate-index {
    color: #059669;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.certificate-copy h3 {
    margin: 1rem 0 .8rem;
    color: #0f172a;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    font-weight: 750;
    line-height: 1.18;
    letter-spacing: -.035em;
}
.dark .certificate-copy h3 { color: #f8fafc; }
.certificate-copy > p:not(.certificate-meta) { color: #64748b; line-height: 1.75; }
.dark .certificate-copy > p:not(.certificate-meta) { color: #94a3b8; }
.certificate-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
    margin-bottom: 1.15rem;
    color: #334155;
    font-size: .78rem;
    font-weight: 700;
}
.dark .certificate-meta { color: #cbd5e1; }
.certificate-meta i { color: #059669; }
.certificate-meta-separator { width: 4px; height: 4px; border-radius: 50%; background: #059669; }
.certificate-tags { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.4rem; }
.certificate-tags span { padding: .42rem .65rem; border: 1px solid #d6e1de; border-radius: 999px; color: #475569; font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.dark .certificate-tags span { border-color: #314158; color: #aab7c9; }
.certificate-open-link { display: inline-flex; align-items: center; gap: .6rem; margin-top: 1.7rem; color: #059669; font-size: .76rem; font-weight: 800; text-decoration: none; text-transform: uppercase; letter-spacing: .07em; }
.certificate-open-link i { transition: transform 200ms ease; }
.certificate-open-link:hover i, .certificate-open-link:focus-visible i { transform: translate(2px,-2px); }
.certificate-open-link:focus-visible { outline: 2px solid rgba(5,150,105,.35); outline-offset: 4px; }
html:not(.dark) .certificate-showcase {
    border-color: #d9dddc;
    background: #fafafa;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .08);
}
html:not(.dark) .certificate-frame {
    border-color: #d9dddc;
    background: #f0f1f1;
}
html:not(.dark) .certificate-tags span {
    border-color: #d9dddc;
    background: #f0f1f1;
    color: #475569;
}
.dark .certificate-showcase {
    border-color: #2a2a2a;
    background: #0a0a0a;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.dark .certificate-frame {
    border-color: #2a2a2a;
    background: #141414;
}
.dark .certificate-tags span {
    border-color: #2a2a2a;
    background: #141414;
    color: #d4d4d4;
}
.dark .certificate-copy > p:not(.certificate-meta),
.dark .certificate-heading > p { color: #a3a3a3; }
.dark .certificate-meta { color: #d4d4d4; }
.dark .certificate-view-label {
    border-color: #2a2a2a;
    background: rgba(10, 10, 10, .9);
}

.certificate-modal {
    position: fixed;
    z-index: 240;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(.75rem, 2vw, 1.5rem);
    background: rgba(0, 0, 0, .88);
    backdrop-filter: blur(7px);
}
.certificate-modal.hidden { display: none; }
.certificate-modal-panel {
    position: relative;
    display: grid;
    place-items: center;
    width: min(96rem, 100%);
    max-height: calc(100dvh - clamp(1.5rem, 4vw, 3rem));
}
.certificate-modal-panel img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: calc(100dvh - clamp(1.5rem, 4vw, 3rem));
    border: 1px solid #2a2a2a;
    border-radius: .8rem;
    object-fit: contain;
    box-shadow: 0 30px 90px rgba(0,0,0,.55);
}
.certificate-modal-close {
    position: fixed;
    z-index: 2;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border: 1px solid #404040;
    border-radius: 50%;
    background: #0a0a0a;
    color: #ffffff;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.certificate-modal-close:hover,
.certificate-modal-close:focus-visible {
    border-color: #059669;
    background: #141414;
    color: #059669;
    outline: none;
}


html:not(.dark) .certificates-section { background: #f3f4f4; }
.dark .certificates-section { background: #000; }
@media (max-width: 1023px) {
    .certificates-section { padding-top: 6rem; padding-bottom: 6.5rem; }
    .certificate-showcase { grid-template-columns: minmax(0, 1.1fr) minmax(17rem, .9fr); gap: 2rem; }
}
@media (max-width: 767px) {
    .certificates-section { padding-top: 5rem; padding-bottom: 5rem; }
    .certificate-heading { margin-bottom: 2.5rem; }
    .certificate-showcase { grid-template-columns: 1fr; gap: 2rem; padding: .75rem; border-radius: 1.25rem; }
    .certificate-copy { padding: 0 .55rem .75rem; }
    .certificate-view-label { right: .9rem; bottom: .9rem; }
}

/* Certificate carousel keeps differently sized images aligned. */
.certificate-frame {
    display: grid;
    place-items: center;
    aspect-ratio: 3 / 2;
}
.certificate-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.certificate-navigation {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-top: 1.8rem;
}
.certificate-nav-button {
    display: grid;
    place-items: center;
    width: 2.7rem;
    height: 2.7rem;
    border: 1px solid #cbd5d1;
    border-radius: 50%;
    color: #0f172a;
    background: #fff;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.certificate-nav-button:hover,
.certificate-nav-button:focus-visible {
    border-color: #059669;
    background: #e8f5ef;
    transform: translateY(-2px);
}
.certificate-nav-button:focus-visible,
.certificate-modal-arrow:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 3px;
}
.dark .certificate-nav-button {
    border-color: #3b4754;
    color: #fff;
    background: #141414;
}
.dark .certificate-nav-button:hover,
.dark .certificate-nav-button:focus-visible {
    border-color: #059669;
    background: #173327;
}
.certificate-position {
    min-width: 3.7rem;
    color: #64748b;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-align: center;
}
.dark .certificate-position { color: #a3a3a3; }
.certificate-modal-arrow {
    position: fixed;
    z-index: 2;
    top: 50%;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid #404040;
    border-radius: 50%;
    color: #fff;
    background: rgba(10, 10, 10, .88);
    transform: translateY(-50%);
    transition: border-color 180ms ease, background 180ms ease;
}
.certificate-modal-arrow:hover {
    border-color: #059669;
    background: #173327;
}
.certificate-modal-arrow-prev { left: max(1rem, env(safe-area-inset-left)); }
.certificate-modal-arrow-next { right: max(1rem, env(safe-area-inset-right)); }
@media (max-width: 767px) {
    .certificate-modal-arrow {
        width: 2.5rem;
        height: 2.5rem;
    }
    .certificate-modal-arrow-prev { left: .35rem; }
    .certificate-modal-arrow-next { right: .35rem; }
}

/* Put the certificate arrows at the sides of the showcase. */
.certificate-carousel-shell { position: relative; }
.certificate-navigation {
    position: absolute;
    inset: 0;
    display: block;
    margin: 0;
    pointer-events: none;
}
.certificate-nav-button {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 3.25rem;
    height: 3.25rem;
    pointer-events: auto;
    transform: translateY(-50%);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .16);
}
.certificate-nav-button:hover,
.certificate-nav-button:focus-visible { transform: translateY(calc(-50% - 2px)); }
#certificate-prev { left: -4.5rem; }
#certificate-next { right: -4.5rem; }
.certificate-position {
    display: block;
    width: fit-content;
    margin-top: 1.25rem;
}
@media (max-width: 1439px) {
    #certificate-prev { left: 1rem; }
    #certificate-next { right: 1rem; }
}
@media (max-width: 767px) {
    .certificate-navigation {
        position: static;
        display: flex;
        justify-content: space-between;
        margin-top: 1rem;
        pointer-events: auto;
    }
    .certificate-nav-button,
    .certificate-nav-button:hover,
    .certificate-nav-button:focus-visible {
        position: static;
        transform: none;
    }
}

/* Clickable media and a shared full-size viewer for every project. */
.project-media-open {
    position: absolute;
    z-index: 13;
    inset: 0;
    width: 100%;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}
.project-media-open:focus-visible {
    outline: 3px solid #059669;
    outline-offset: -3px;
}
.project-media-view-label {
    position: absolute;
    z-index: 14;
    right: 1rem;
    bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .6rem .75rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: .7rem;
    background: rgba(8, 17, 31, .86);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    pointer-events: none;
}
.additional-media-open { z-index: 2; }
.additional-media-view-label {
    z-index: 2;
    right: .65rem;
    bottom: .65rem;
    padding: .45rem .55rem;
    font-size: .6rem;
}
.project-media-modal {
    position: fixed;
    z-index: 300;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(.5rem, 2vw, 1.5rem);
    background: rgba(0, 0, 0, .9);
    backdrop-filter: blur(8px);
}
.project-media-modal.hidden { display: none; }
.project-media-panel {
    display: flex;
    flex-direction: column;
    width: min(92rem, 100%);
    max-height: calc(100dvh - 1rem);
    padding: clamp(.5rem, 1.5vw, 1rem);
    border: 1px solid #2a2a2a;
    border-radius: 1rem;
    background: #080808;
    color: #fff;
}
.project-media-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .2rem .3rem .8rem;
}
.project-media-toolbar h2 {
    overflow: hidden;
    font-size: clamp(.9rem, 1.5vw, 1.15rem);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.project-media-close,
.project-media-arrow {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.8rem;
    height: 2.8rem;
    border: 1px solid #525252;
    border-radius: 50%;
    background: rgba(10, 10, 10, .9);
    color: #fff;
}
.project-media-close:hover,
.project-media-arrow:hover {
    border-color: #059669;
    background: #173327;
}
.project-media-close:focus-visible,
.project-media-arrow:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
}
.project-media-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 0;
    overflow: hidden;
    border-radius: .65rem;
    background: #000;
}
.project-media-stage img,
.project-media-stage video {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 9rem);
    object-fit: contain;
}
.project-media-stage video {
    width: 100%;
    aspect-ratio: 16 / 9;
}
.project-media-stage [hidden] { display: none !important; }
.project-media-arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    transform: translateY(-50%);
}
.project-media-prev { left: .75rem; }
.project-media-next { right: .75rem; }
.project-media-counter {
    padding: .75rem .3rem .1rem;
    color: #a3a3a3;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-align: center;
}
@media (max-width: 767px) {
    .project-media-arrow { width: 2.3rem; height: 2.3rem; }
    .project-media-prev { left: .25rem; }
    .project-media-next { right: .25rem; }
}
/* Phone and tablet layouts: keep content and controls inside the viewport. */
@media (max-width: 1023px) {
    #hero {
        min-height: 100svh;
        padding-top: 7rem;
        padding-bottom: 3rem;
    }
    #hero > div, #hero > div > div { min-width: 0; }
    #hero .profile-portrait-stage-mobile { width: clamp(10.5rem, 28vw, 14rem); }
    #hero h2 {
        height: auto;
        min-height: 2.5rem;
        overflow-wrap: anywhere;
    }
    .project-showcase, .project-copy, .project-visual-wrap { min-width: 0; }
    .project-carousel-arrow {
        opacity: 1;
        transform: translateY(-50%);
    }
}

@media (max-width: 900px) {
    .certificate-showcase { grid-template-columns: minmax(0, 1fr); }
    .certificate-navigation {
        position: static;
        display: flex;
        justify-content: space-between;
        margin-top: 1rem;
        pointer-events: auto;
    }
    .certificate-nav-button,
    .certificate-nav-button:hover,
    .certificate-nav-button:focus-visible {
        position: static;
        transform: none;
    }
}

@media (max-width: 767px) {
    #navbar { padding-inline: 1rem; }
    #navbar > .flex { padding-right: 6rem; }
    #theme-toggle-mobile, #menu-toggle { min-width: 2.75rem; min-height: 2.75rem; }
    #mobile-menu {
        max-height: calc(100dvh - 5rem);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    #hero { padding-inline: 1rem; }
    #hero .profile-portrait-stage-mobile { width: clamp(10.5rem, 44vw, 13rem); }
    #hero h1 { font-size: clamp(2rem, 9vw, 3.1rem); }
    #hero h2 { font-size: clamp(1.05rem, 5vw, 1.5rem); }
    #about, #skills, #projects, #certificates, #contact { padding-inline: 1rem; }
    .contact-section-heading .section-title,
    .certificate-heading .section-title {
        font-size: clamp(2rem, 8vw, 3rem);
        overflow-wrap: anywhere;
    }
    .project-pixel-cast { --pixel-cast-height: 8rem; }
    .project-visual-wrap::before,
    .project-showcase-reverse .project-visual-wrap::before { display: none; }
    .project-window-bar { min-height: 2.5rem; padding-inline: .75rem; }
    .project-carousel.aspect-video { min-height: 11rem; }
    .project-carousel-arrow,
    .additional-carousel-arrow { width: 2.75rem; height: 2.75rem; }
    .project-carousel-prev { left: .5rem; }
    .project-carousel-next { right: .5rem; }
    .project-media-view-label {
        top: .6rem;
        right: .6rem;
        bottom: auto;
        padding: .4rem .55rem;
        font-size: .58rem;
    }
    .project-carousel-dots { bottom: .5rem; }

    .additional-projects-modal {
        padding: max(.5rem, env(safe-area-inset-top)) .5rem max(.5rem, env(safe-area-inset-bottom));
    }
    .additional-projects-panel { max-height: 100dvh; }
    .additional-projects-header,
    .additional-projects-grid { padding: .875rem; }
    .additional-project-image { height: clamp(11rem, 56vw, 16rem); }
    .additional-project-content { padding: 1rem; }
    .additional-projects-header button,
    .more-projects-button,
    .additional-project-github { min-height: 2.75rem; }
    .additional-projects-header button { flex-basis: 2.75rem; width: 2.75rem; }

    .certificate-nav-button { width: 2.75rem; height: 2.75rem; }
    .certificate-copy h3 { overflow-wrap: anywhere; }
    .certificate-modal-arrow,
    .project-media-arrow { width: 2.75rem; height: 2.75rem; }
    .certificate-modal-panel img { max-height: calc(100dvh - 7rem); }

    .project-media-panel { max-height: calc(100dvh - 1rem); }
    .project-media-toolbar h2 { min-width: 0; }
    .project-media-stage img,
    .project-media-stage video { max-height: calc(100dvh - 8rem); }
}

@media (max-width: 480px) {
    .project-actions { grid-template-columns: minmax(0, 1fr); }
    .project-title { overflow-wrap: anywhere; }
    .project-card-footer { flex-wrap: wrap; }
    .project-media-view-label,
    .additional-media-view-label { font-size: .55rem; }
    .certificate-view-label {
        right: .55rem;
        bottom: .55rem;
        padding: .4rem .5rem;
        font-size: .56rem;
    }
}

@media (max-width: 360px) {
    .skill-tile { gap: .45rem; padding: .55rem; }
    .skill-tile-icon {
        width: 2.1rem;
        height: 2.1rem;
        flex-basis: 2.1rem;
        font-size: 1.15rem;
    }
    .skill-tile-name { font-size: .68rem; overflow-wrap: anywhere; }
    #navbar > .flex > a { font-size: 1.1rem; }
    #hero .portfolio-button { padding-inline: 1rem; }
}
/* Larger hit areas for the tiny carousel indicators on touch screens. */
@media (hover: none), (pointer: coarse) {
    .carousel-dot,
    .additional-carousel-dot {
        position: relative;
        width: 1.25rem;
        height: 1.5rem;
        background: transparent;
    }
    .carousel-dot.is-active,
    .additional-carousel-dot.is-active {
        width: 1.25rem;
        background: transparent;
    }
    .carousel-dot::after,
    .additional-carousel-dot::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: .45rem;
        height: .45rem;
        border-radius: 999px;
        background: #737373;
        transform: translate(-50%, -50%);
    }
    .carousel-dot.is-active::after,
    .additional-carousel-dot.is-active::after {
        width: .9rem;
        background: #059669;
    }
}
@media (min-width: 768px) and (max-width: 1023px) {
    #theme-toggle-mobile, #menu-toggle {
        min-width: 2.75rem;
        min-height: 2.75rem;
    }
}
/* Scale the portrait action and project details to the available screen. */
.profile-portrait-stage .crawler-arm-game-link,
.profile-portrait-stage .crawler-arm-game-link:hover,
.profile-portrait-stage .crawler-arm-game-link:focus-visible {
    top: -1.75rem;
    right: -.5rem;
}

@media (max-width: 1023px) {
    .profile-portrait-stage-mobile .crawler-arm-game-link,
    .profile-portrait-stage-mobile .crawler-arm-game-link:hover,
    .profile-portrait-stage-mobile .crawler-arm-game-link:focus-visible {
        top: -2.75rem;
        right: -.4rem;
        min-height: 1.85rem;
        padding: .38rem .58rem;
        font-size: .57rem;
        line-height: 1.1;
    }

    .project-pixel-cast {
        --pixel-cast-height: 6.25rem;
        margin-bottom: .35rem;
        padding: .15rem .5rem .1rem;
    }
    .project-pixel-actor[data-pixel-actor="one"] { height: 5.25rem; }
    .project-pixel-actor[data-pixel-actor="two"] { height: 5.35rem; }
    .project-pixel-cast-hint { top: 0; }

    .skill-tile {
        min-height: 3.5rem;
        gap: .55rem;
        padding: .55rem;
    }
    .skill-tile-icon {
        width: 2.15rem;
        height: 2.15rem;
        flex-basis: 2.15rem;
        font-size: 1.2rem;
    }
    .skill-tile-name {
        font-size: .7rem;
        overflow-wrap: anywhere;
    }
    .skill-category { margin-bottom: 1.75rem; }
    .skill-category-header { margin-bottom: .8rem; padding-bottom: .7rem; }
    .skill-category-symbol {
        width: 2.4rem;
        height: 2.4rem;
        flex-basis: 2.4rem;
    }
    .skill-category-header h3 { font-size: 1rem; }
}

@media (max-width: 767px) {
    #hero { padding-top: 8rem; }
    .profile-portrait-stage-mobile .crawler-arm-game-link,
    .profile-portrait-stage-mobile .crawler-arm-game-link:hover,
    .profile-portrait-stage-mobile .crawler-arm-game-link:focus-visible {
        top: -3.1rem;
        right: -.35rem;
        min-height: 1.65rem;
        padding: .32rem .5rem;
        font-size: .5rem;
    }

    .project-pixel-cast {
        --pixel-cast-height: 5.5rem;
        margin-bottom: .25rem;
    }
    .project-pixel-actor[data-pixel-actor="one"] { height: 4.6rem; }
    .project-pixel-actor[data-pixel-actor="two"] { height: 4.7rem; }
    .project-pixel-cast-hint { font-size: .52rem; }
    .project-visual-index { display: none; }

    .additional-project-image { height: clamp(9.5rem, 45vw, 12rem); }

    .project-media-panel {
        width: min(100%, 34rem);
        min-width: 0;
        max-height: calc(100dvh - 2rem);
    }
    .project-media-stage {
        width: 100%;
        min-width: 0;
        max-height: min(62dvh, 34rem);
    }
    .project-media-stage img,
    .project-media-stage video {
        width: auto;
        max-width: 100%;
        max-height: min(62dvh, 34rem);
    }
    .project-media-stage video { width: 100%; }
}

@media (min-width: 640px) and (max-width: 900px) {
    .additional-projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .additional-project-image { height: clamp(10rem, 25vw, 13rem); }
}

@media (max-width: 360px) {
    .skill-tile { min-height: 3.25rem; gap: .4rem; padding: .45rem; }
    .skill-tile-icon {
        width: 1.9rem;
        height: 1.9rem;
        flex-basis: 1.9rem;
        font-size: 1rem;
    }
    .skill-tile-name { font-size: .65rem; }
}
/* Keep long project titles and media inside the viewer on tablets too. */
.project-media-panel,
.project-media-toolbar,
.project-media-stage { min-width: 0; }
.project-media-panel,
.project-media-stage { max-width: 100%; }
.project-media-toolbar h2 { min-width: 0; flex: 1; }
.project-media-stage { width: 100%; }

@media (max-width: 1023px) {
    #projects-container { gap: 4.5rem; }
    .project-showcase::after { bottom: -2.25rem; }
}

@media (max-width: 767px) {
    #hero { padding-top: 9rem; }
    #projects-container { gap: 3.5rem; }
    .project-showcase::after { bottom: -1.75rem; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    #hero { padding-top: 9rem; }
}

@media (max-width: 900px) {
    .project-media-stage,
    .project-media-stage img,
    .project-media-stage video { max-height: min(65dvh, 32rem); }
}

@media (max-width: 767px) {
    .project-media-stage,
    .project-media-stage img,
    .project-media-stage video { max-height: min(48dvh, 27rem); }
}
/* Keep the certificate controls on the certificate image at every width. */
.certificate-visual-wrap {
    position: relative;
    min-width: 0;
}
.certificate-visual-wrap .certificate-navigation {
    position: absolute;
    inset: 0;
    display: block;
    margin: 0;
    pointer-events: none;
}
.certificate-visual-wrap .certificate-nav-button,
.certificate-visual-wrap .certificate-nav-button:hover,
.certificate-visual-wrap .certificate-nav-button:focus-visible {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 3rem;
    height: 3rem;
    pointer-events: auto;
    transform: translateY(-50%);
    background: rgba(10, 10, 10, .86);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
    backdrop-filter: blur(6px);
}
.certificate-visual-wrap .certificate-nav-button:hover,
.certificate-visual-wrap .certificate-nav-button:focus-visible {
    background: #059669;
    border-color: #059669;
}
.certificate-visual-wrap #certificate-prev { left: 1.25rem; }
.certificate-visual-wrap #certificate-next { right: 1.25rem; }

@media (max-width: 767px) {
    .certificate-visual-wrap .certificate-nav-button,
    .certificate-visual-wrap .certificate-nav-button:hover,
    .certificate-visual-wrap .certificate-nav-button:focus-visible {
        width: 2.5rem;
        height: 2.5rem;
    }
    .certificate-visual-wrap #certificate-prev { left: .45rem; }
    .certificate-visual-wrap #certificate-next { right: .45rem; }
}

/* Center both theme glyphs and give the mobile menu matching theme surfaces. */
#theme-toggle,
#theme-toggle-mobile {
    display: inline-grid !important;
    place-items: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0 !important;
    line-height: 1;
}
#theme-icon,
#theme-icon-mobile {
    display: grid !important;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0 !important;
    font-size: 1.08rem;
    line-height: 1;
}
#theme-icon::before,
#theme-icon-mobile::before {
    display: block;
    line-height: 1;
}
#menu-toggle {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid #d9dddc;
    border-radius: 50%;
    background: #fafafa;
}
.dark #menu-toggle {
    border-color: #2a2a2a;
    background: #000;
    color: #fff;
}
#menu-icon { font-size: 1.1rem; line-height: 1; }
#menu-toggle:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
}

#mobile-menu { margin-top: .7rem; }
#mobile-menu .mobile-menu-panel {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    padding: .45rem;
    border: 1px solid #d9dddc;
    border-radius: .9rem;
    background: #fafafa;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .13);
}
.dark #mobile-menu .mobile-menu-panel {
    border-color: #2a2a2a;
    background: #000;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
#mobile-menu .mobile-nav-link:not(.mobile-nav-resume) {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 2.75rem;
    padding: .65rem .8rem;
    border-radius: .55rem;
    color: #334155;
    font-size: .88rem;
    font-weight: 600;
}
.dark #mobile-menu .mobile-nav-link:not(.mobile-nav-resume) { color: #e5e7eb; }
#mobile-menu .mobile-nav-link:not(.mobile-nav-resume):hover,
#mobile-menu .mobile-nav-link:not(.mobile-nav-resume):focus-visible {
    background: rgba(5, 150, 105, .09);
    color: #059669;
}
#mobile-menu .mobile-nav-link:not(.mobile-nav-resume) i {
    width: 1.1rem;
    flex: none;
    color: #64748b;
    text-align: center;
}
.dark #mobile-menu .mobile-nav-link:not(.mobile-nav-resume) i { color: #a3a3a3; }
#mobile-menu .mobile-nav-resume,
.dark #mobile-menu .mobile-nav-resume {
    min-height: 2.75rem;
    margin: .45rem .2rem .15rem;
    border: 1px solid #059669 !important;
    border-radius: .6rem;
    background: #059669 !important;
    color: #fff !important;
    font-size: .8rem;
}

.profile-portrait-stage .crawler-arm-game-link,
.profile-portrait-stage .crawler-arm-game-link:hover,
.profile-portrait-stage .crawler-arm-game-link:focus-visible {
    top: -.9rem;
}
@media (max-width: 1023px) {
    .profile-portrait-stage-mobile .crawler-arm-game-link,
    .profile-portrait-stage-mobile .crawler-arm-game-link:hover,
    .profile-portrait-stage-mobile .crawler-arm-game-link:focus-visible {
        top: -2.3rem;
    }
}
/* Two project actions stay on one row on phones; a single action fills the row. */
@media (max-width: 480px) {
    .project-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
    }
    .project-actions > :only-child { grid-column: 1 / -1; }
    .project-actions .project-github-link,
    .project-actions .project-play-link {
        gap: .25rem;
        min-height: 2.75rem;
        padding: .55rem .3rem;
        font-size: clamp(.53rem, 2.2vw, .65rem);
        line-height: 1.15;
        white-space: nowrap;
    }
    .project-actions .project-play-link span { gap: .3rem; }
}
/* Keep the desktop pixel characters close to their own game preview. */
@media (min-width: 1024px) {
    .project-pixel-cast {
        --pixel-cast-height: 7.5rem;
        bottom: calc(100% + .5rem);
    }
    .project-pixel-cast-hint { top: .6rem; }
}
/* Give the desktop pixel cast a readable size without the divider behind it. */
@media (min-width: 1024px) {
    .project-pixel-cast { --pixel-cast-height: 12rem; }
    .project-showcase:first-child::after { display: none; }
}

/* Direct access to the growing certificate collection. */
.certificate-browser {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1.5rem;
    margin-bottom: 1.5rem;
}
.certificate-browser label {
    color: #475569;
    font-size: .85rem;
    font-weight: 700;
}
.certificate-browser select {
    width: 100%;
    max-width: 30rem;
    min-width: 0;
    padding: .8rem 1rem;
    border: 1px solid #cad7d3;
    border-radius: .7rem;
    background: #fafafa;
    color: #0f172a;
    font: inherit;
    font-size: .9rem;
}
.certificate-browser select:focus-visible {
    outline: 3px solid #059669;
    outline-offset: 3px;
}
.dark .certificate-browser label { color: #a3a3a3; }
.dark .certificate-browser select {
    border-color: #314158;
    background: #141414;
    color: #f8fafc;
}
