:root {
    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;

    /* Color Palette */
    --bg-color: #09090b;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --accent: #ffffff;
    --accent-glow: rgba(255, 255, 255, 0.08);
    --glass-bg: linear-gradient(135deg, rgba(24, 24, 27, 0.85) 0%, rgba(9, 9, 11, 0.95) 100%);
    --glass-border: rgba(255, 255, 255, 0.14);
    
    /* Card Specifics */
    --card-bg: linear-gradient(135deg, #18181b 0%, #09090b 100%);
    --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    
    /* Interactive Elements */
    --btn-bg: rgba(255, 255, 255, 0.06);
    --btn-bg-hover: rgba(255, 255, 255, 0.12);
    --btn-border: rgba(255, 255, 255, 0.12);
    --btn-border-hover: rgba(255, 255, 255, 0.3);
    
    /* Inputs */
    --input-bg: rgba(0, 0, 0, 0.3);
    --border-subtle: rgba(255, 255, 255, 0.06);
    
    /* Highlights & Specific elements */
    --highlight-border: rgba(255, 255, 255, 0.4);
    --tag-bg: rgba(255, 255, 255, 0.04);
    --tag-bg-hover: rgba(255, 255, 255, 0.08);
    --tag-border: rgba(255, 255, 255, 0.08);
    --tag-border-hover: rgba(255, 255, 255, 0.2);
    
    /* Glow effect */
    --bg-glow-gradient: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, rgba(9, 9, 11, 0) 70%);
    
    /* Spinner */
    --spinner-track: rgba(255, 255, 255, 0.15);
    --spinner-active: #ffffff;
    
    /* Scrollbar */
    --scrollbar-thumb: rgba(255, 255, 255, 0.12);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.28);
    
    /* Card Scrollbar */
    --card-scrollbar-track: #121214;
    --card-scrollbar-thumb: #3f3f46;
    --card-scrollbar-thumb-hover: #52525b;
}

:root[data-theme="light"] {
    /* Color Palette */
    --bg-color: #f7f4ee; /* Warm vintage sketchbook paper */
    --text-primary: #1e1d1b; /* Soft warm charcoal-ink */
    --text-secondary: #6e6a64; /* Graphite sepia */
    --accent: #2b4c7e; /* Traditional navy ink blue */
    --accent-glow: rgba(43, 40, 38, 0.03);
    --glass-bg: rgba(247, 244, 238, 0.85); /* Tracing paper flat overlay */
    --glass-border: rgba(30, 29, 27, 0.1);
    
    /* Card Specifics */
    --card-bg: #ffffff; /* Crisp white cotton paper cardstock */
    --card-shadow: 0 4px 6px rgba(32, 30, 29, 0.02), 
                   0 10px 20px -5px rgba(32, 30, 29, 0.06), 
                   0 20px 30px -10px rgba(32, 30, 29, 0.04), 
                   0 0 0 1px rgba(32, 30, 29, 0.04);
    
    /* Interactive Elements */
    --btn-bg: #fffdf9; /* Soft cream paper buttons */
    --btn-bg-hover: #f3ede2; /* Pressed paper bevel */
    --btn-border: rgba(30, 29, 27, 0.15);
    --btn-border-hover: rgba(30, 29, 27, 0.35);
    
    /* Inputs */
    --input-bg: #ffffff;
    --border-subtle: rgba(30, 29, 27, 0.08);
    
    /* Highlights & Specific elements */
    --highlight-border: #a84a32; /* Heritage Terracotta orange highlight */
    --tag-bg: #fffdf9;
    --tag-bg-hover: #f3ede2;
    --tag-border: rgba(30, 29, 27, 0.12);
    --tag-border-hover: rgba(30, 29, 27, 0.25);
    
    /* Glow effect */
    --bg-glow-gradient: radial-gradient(circle, rgba(30, 29, 27, 0.02) 0%, rgba(247, 244, 238, 0) 70%);
    
    /* Spinner */
    --spinner-track: rgba(30, 29, 27, 0.1);
    --spinner-active: #a84a32;
    
    /* Scrollbar */
    --scrollbar-thumb: rgba(30, 29, 27, 0.15);
    --scrollbar-thumb-hover: rgba(30, 29, 27, 0.35);
    
    /* Card Scrollbar – warm graphite sepia to match paper */
    --card-scrollbar-track: #f0ede6;
    --card-scrollbar-thumb: #c5bcae;
    --card-scrollbar-thumb-hover: #b3a797;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global Custom Scrollbars */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    background-clip: padding-box;
    border: 1.5px solid transparent;
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
    background-clip: padding-box;
    border: 1.5px solid transparent;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.bg-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70vw;
    height: 70vw;
    background: var(--bg-glow-gradient);
    z-index: -1;
    pointer-events: none;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 30;
    transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                backdrop-filter 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-bottom: 1px solid transparent;
}

.header.scrolled {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: var(--border-subtle);
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.logo {
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.theme-toggle-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    margin-left: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

/* Sun icon is visible in dark mode, moon icon is visible in light mode */
:root[data-theme="light"] .theme-toggle-btn .sun-icon {
    display: none;
}
:root[data-theme="light"] .theme-toggle-btn .moon-icon {
    display: inline-block;
}
:root:not([data-theme="light"]) .theme-toggle-btn .sun-icon {
    display: inline-block;
}
:root:not([data-theme="light"]) .theme-toggle-btn .moon-icon {
    display: none;
}

.viewport {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4rem 2rem 5rem;
    overflow: hidden;
}

.carousel-container {
    width: 100%;
    max-width: 860px;
    height: 580px;
    position: relative;
    perspective: 1200px;
    margin: auto;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translate3d(120%, 0, 0) scale(0.7);
    pointer-events: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.6s ease,
                border-color 0.3s ease;
    will-change: transform, opacity;
    box-shadow: var(--card-shadow);
    text-rendering: geometricPrecision;
}

/* Active Centered Card */
.card.active {
    opacity: 1;
    /* Use no Z-offset to avoid fractional sub-pixel scaling from perspective,
       which causes blurry text. Background cards use negative Z to sit behind. */
    transform: none;
    filter: none;
    z-index: 10;
    pointer-events: auto;
    visibility: visible;
    /* Disable the composited GPU layer once the card is stationary so the
       browser renders text natively (sharp) instead of from a rasterized bitmap. */
    will-change: auto;
    box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.8), 
                0 0 40px var(--accent-glow), 
                inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

/* Hide content inside non-active cards so peek cards appear blank, excluding cards currently swiping away */
.card:not(.active):not(.swipe-out-left):not(.swipe-out-right):not(.swipe-out-left-hidden):not(.swipe-out-right-hidden) > * {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.card.active > * {
    opacity: 1;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Partially Visible Previous Card (Behind Left) */
.card.prev-peek {
    opacity: 1;
    /* Negative Z pushes these behind the active card (which sits at Z=0) */
    transform: translate3d(-56px, 0, -5px) scale(0.97);
    filter: none;
    z-index: 5;
    pointer-events: auto;
    visibility: visible;
}

/* Partially Visible Next Card (Behind Right - Poking out 2x as much) */
.card.next-peek {
    opacity: 1;
    transform: translate3d(56px, 0, -5px) scale(0.97);
    filter: none;
    z-index: 5;
    pointer-events: auto;
    visibility: visible;
}

/* Hovering over next/prev card does nothing */
.card.prev-peek:hover,
.card.next-peek:hover {
    filter: none;
    border-color: var(--glass-border);
}

/* Cards further left or right */
.card.hidden-left {
    opacity: 0;
    transform: translate3d(-90px, 0, -10px) scale(0.92);
    filter: none;
    z-index: 1;
    pointer-events: none;
    visibility: hidden;
}

.card.hidden-right {
    opacity: 0;
    transform: translate3d(90px, 0, -10px) scale(0.92);
    filter: none;
    z-index: 1;
    pointer-events: none;
    visibility: hidden;
}

/* Card Intro Fly-in Animations */
.intro-animate .card.active {
    animation: flyInActive 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.intro-animate .card.next-peek {
    animation: flyInNextPeek 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

/* Nav & Indicators Intro Fade-in Animations */
.intro-animate .nav-btn {
    animation: fadeInNavBtn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
    pointer-events: none;
}

.intro-animate .carousel-indicators {
    animation: fadeInIndicators 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
    pointer-events: none;
}

@keyframes flyInActive {
    0% {
        opacity: 0;
        transform: translate3d(0, 80px, 0) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes flyInNextPeek {
    0% {
        opacity: 0;
        transform: translate3d(150px, 0, -15px) scale(0.94);
    }
    100% {
        opacity: 1;
        transform: translate3d(56px, 0, -5px) scale(0.97);
    }
}

@keyframes flyInActiveMobile {
    0% {
        opacity: 0;
        transform: translate3d(0, 45px, 0) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes flyInNextPeekMobile {
    0% {
        opacity: 0;
        transform: translate3d(0, 45px, -5px) scale(0.93);
    }
    100% {
        opacity: 0.45;
        transform: translate3d(0, 0, -5px) scale(0.97);
    }
}

@keyframes fadeInNavBtn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 0.65;
    }
}

@keyframes fadeInIndicators {
    0% {
        opacity: 0;
        transform: translate3d(-50%, 15px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(-50%, 0, 0);
    }
}

@keyframes fadeInControlsMobile {
    0% {
        opacity: 0;
        transform: translate3d(-50%, 15px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(-50%, 0, 0);
    }
}

/* Card Swipe Away Animations */

.card.swipe-out-left {
    animation: swipeOutLeft 0.95s linear forwards;
    transition: none !important;
    visibility: visible !important;
}

.card.swipe-out-right {
    animation: swipeOutRight 0.95s linear forwards;
    transition: none !important;
    visibility: visible !important;
}

.card.swipe-out-left-hidden {
    animation: swipeOutLeftHidden 0.95s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    transition: none !important;
    visibility: visible !important;
}

.card.swipe-out-right-hidden {
    animation: swipeOutRightHidden 0.95s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    transition: none !important;
    visibility: visible !important;
}

@keyframes swipeOutLeft {
    0% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
        opacity: 1;
        z-index: 15;
        animation-timing-function: cubic-bezier(0.3, 0, 0.7, 0.3);
    }
    49% {
        transform: translate3d(-120%, 0, 0) scale(1) rotate(-15deg);
        opacity: 1;
        z-index: 15;
    }
    50% {
        transform: translate3d(-120%, 0, -5px) scale(0.97) rotate(-15deg);
        opacity: 1;
        z-index: 5;
        animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
    }
    100% {
        transform: translate3d(-56px, 0, -5px) scale(0.97) rotate(0deg);
        opacity: 1;
        z-index: 5;
    }
}

@keyframes swipeOutRight {
    0% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
        opacity: 1;
        z-index: 15;
        animation-timing-function: cubic-bezier(0.3, 0, 0.7, 0.3);
    }
    49% {
        transform: translate3d(120%, 0, 0) scale(1) rotate(15deg);
        opacity: 1;
        z-index: 15;
    }
    50% {
        transform: translate3d(120%, 0, -5px) scale(0.97) rotate(15deg);
        opacity: 1;
        z-index: 5;
        animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
    }
    100% {
        transform: translate3d(56px, 0, -5px) scale(0.97) rotate(0deg);
        opacity: 1;
        z-index: 5;
    }
}

@keyframes swipeOutLeftHidden {
    0% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
        opacity: 1;
        z-index: 15;
        animation-timing-function: cubic-bezier(0.3, 0, 0.7, 0.3);
    }
    100% {
        transform: translate3d(-120%, 0, 0) scale(1) rotate(-15deg);
        opacity: 1;
        z-index: 15;
    }
}

@keyframes swipeOutRightHidden {
    0% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
        opacity: 1;
        z-index: 15;
        animation-timing-function: cubic-bezier(0.3, 0, 0.7, 0.3);
    }
    100% {
        transform: translate3d(120%, 0, 0) scale(1) rotate(15deg);
        opacity: 1;
        z-index: 15;
    }
}

@keyframes swipeOutLeftMobile {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
        z-index: 15;
        animation-timing-function: cubic-bezier(0.3, 0, 0.7, 0.3);
    }
    49% {
        transform: translate3d(-120%, 0, 0) scale(1);
        opacity: 1;
        z-index: 15;
    }
    50% {
        transform: translate3d(-120%, 0, -5px) scale(0.97);
        opacity: 1;
        z-index: 5;
        animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
    }
    100% {
        transform: translate3d(0, 0, -5px) scale(0.97);
        opacity: 1;
        z-index: 5;
    }
}

@keyframes swipeOutRightMobile {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
        z-index: 15;
        animation-timing-function: cubic-bezier(0.3, 0, 0.7, 0.3);
    }
    49% {
        transform: translate3d(120%, 0, 0) scale(1);
        opacity: 1;
        z-index: 15;
    }
    50% {
        transform: translate3d(120%, 0, -5px) scale(0.97);
        opacity: 1;
        z-index: 5;
        animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
    }
    100% {
        transform: translate3d(0, 0, -5px) scale(0.97);
        opacity: 1;
        z-index: 5;
    }
}

/* Fade out child content smoothly as the card swipes away */
.card.swipe-out-left > *,
.card.swipe-out-right > *,
.card.swipe-out-left-hidden > *,
.card.swipe-out-right-hidden > * {
    animation: fadeOutChildren 0.95s linear forwards;
}

@keyframes fadeOutChildren {
    0% {
        opacity: 1;
        animation-timing-function: linear;
    }
    49% {
        opacity: 1;
    }
    50% {
        opacity: 1;
        animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
    }
    100% {
        opacity: 0;
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.card-header h2 {
    font-size: 1.85rem;
    font-weight: 500;
    letter-spacing: -0.5px;
}

.badge {
    background: var(--tag-bg);
    color: var(--text-primary);
    padding: 0.35rem 0.85rem;
    border-radius: 4px;
    font-size: 0.825rem;
    font-weight: 500;
    border: 1px solid var(--tag-border);
    letter-spacing: 0.3px;
}

/* Reset / Back-to-Overview Button — ghost pill, visible only in demo mode */
.reset-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 5px;
    padding: 0.4rem 0.85rem 0.4rem 0.65rem;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateX(8px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.reset-btn svg {
    opacity: 0.6;
    transition: all 0.25s ease;
}

.card.in-demo .reset-btn {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.reset-btn:hover {
    background: var(--btn-bg-hover);
    border-color: var(--btn-border-hover);
    color: var(--text-primary);
    box-shadow: 0 0 14px var(--accent-glow);
}

.reset-btn:hover svg {
    opacity: 1;
    transform: translateX(-2px);
}

.reset-btn:active {
    transform: scale(0.96);
}

/* GitHub Link Button */
.github-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 5px;
    padding: 0.4rem 0.85rem;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.github-btn svg {
    opacity: 0.6;
    transition: all 0.25s ease;
}

.github-btn:hover {
    background: var(--btn-bg-hover);
    border-color: var(--btn-border-hover);
    color: var(--text-primary);
    box-shadow: 0 0 14px var(--accent-glow);
}

.github-btn:hover svg {
    opacity: 1;
    transform: scale(1.05);
}

.github-btn:active {
    transform: scale(0.96);
}

/* Hide the card title when in demo mode — it was already shown on the info slide */
.card.in-demo .card-title-group h2 {
    display: none;
}

/* Dynamic Card Content Wrapper */
.card-content-wrapper {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.card-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.98);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 12px;
    -webkit-overflow-scrolling: touch;
}

.card-view.active {
    opacity: 1;
    pointer-events: auto;
    /* Use none instead of scale(1)/translateY(0) to avoid sub-pixel rendering */
    transform: none;
}

/* Info View Styling */
.info-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-section h3 {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    padding-left: 3px; /* Prevent serif swash clipping on letters like W */
}

.info-section p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.tech-specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 2.5rem;
    padding: 0.5rem 0.25rem;
    margin-top: auto;
    margin-bottom: auto;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-left: 0.85rem;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
}

.spec-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    font-weight: 500;
}

.spec-value {
    font-size: 0.925rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* "Continue" Button — matching demo page button style */
.launch-demo-btn {
    align-self: center;
    margin-top: auto;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--btn-bg);
    color: var(--text-primary);
    border: 1px solid var(--btn-border);
    padding: 0.45rem 1.25rem;
    border-radius: 5px;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.launch-demo-btn:hover {
    background: var(--btn-bg-hover);
    border-color: var(--btn-border-hover);
    box-shadow: 0 0 16px var(--accent-glow);
}

.launch-demo-btn:active {
    transform: scale(0.96);
}

/* ── Demo Input Group ── */
.demo-input-group {
    display: flex;
    flex-direction: column;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.demo-input-group:focus-within {
    border-color: var(--btn-border-hover);
    box-shadow: 0 0 24px var(--accent-glow);
}

.demo-input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    font-weight: 500;
    user-select: none;
}

.demo-input-label svg {
    opacity: 0.5;
}

textarea {
    width: 100%;
    height: 120px;
    background: transparent;
    border: none;
    padding: 0.65rem 1.25rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.65;
    resize: none;
    outline: none;
}

textarea::placeholder {
    color: rgba(161, 161, 170, 0.5);
}

.demo-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.65rem 0.65rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.demo-input-hint {
    font-size: 0.72rem;
    color: rgba(161, 161, 170, 0.5);
    letter-spacing: 0.2px;
}

/* Generate Button — compact, inline, ghost style */
.run-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--btn-bg);
    color: var(--text-primary);
    border: 1px solid var(--btn-border);
    padding: 0.45rem 1rem;
    border-radius: 5px;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.run-btn svg {
    opacity: 0.65;
    transition: opacity 0.2s ease;
}

.run-btn:hover {
    background: var(--btn-bg-hover);
    border-color: var(--btn-border-hover);
    box-shadow: 0 0 16px var(--accent-glow);
}

.run-btn:hover svg {
    opacity: 1;
}

.run-btn:active {
    transform: scale(0.96);
}

.run-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Centered Loading Spinner */
.loading-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    margin-top: auto;
    height: 140px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: -0.2px;
}

.loading-container.active {
    display: flex;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 2px solid var(--spinner-track);
    border-top-color: var(--spinner-active);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Borderless Clean Response Area */
.output-area {
    display: none;
    gap: 2rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.output-area.active {
    display: flex;
}

.output-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.output-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    font-weight: 500;
}

.output-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
}

.output-col.highlight {
    border-left: 2px solid var(--highlight-border);
    padding-left: 1.25rem;
}

.output-col.highlight .output-label {
    color: var(--text-primary);
}

.output-col.highlight .output-text {
    color: var(--text-primary);
    font-weight: 500;
}

.empty-state {
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    letter-spacing: -0.2px;
}

/* Proximity-Based Navigation Buttons (Clean transparent arrows) */
.nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%) scale(1);
    width: 56px;
    height: 56px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    opacity: 0.65; /* Constant ambient opacity */
    visibility: visible;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-btn svg {
    width: 28px;
    height: 28px;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.prev-btn {
    left: max(1.5rem, calc(50% - 430px - 80px));
}

.next-btn {
    right: max(1.5rem, calc(50% - 430px - 80px));
}

.nav-btn:hover {
    transform: translateY(-50%) scale(1.15);
    opacity: 1;
}

.nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.nav-btn:disabled {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-50%) scale(0.7) !important;
}

.carousel-controls-mobile {
    display: contents;
}

/* Carousel Indicators (Dots) */
.carousel-indicators {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.6rem;
    z-index: 30;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.indicator-dot:hover {
    background: rgba(255, 255, 255, 0.45);
}

.indicator-dot.active {
    width: 26px;
    background: #ffffff;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
}

@media (max-width: 900px) {
    .carousel-container {
        max-width: 90%;
        height: 520px;
    }
    
    .card {
        transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                    opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .card.active {
        transform: none;
        will-change: auto;
        visibility: visible;
    }

    /* Make peek cards stack directly behind the active card on mobile (no stick out) */
    .card.prev-peek {
        display: flex;
        transform: translate3d(0, 0, -5px) scale(0.97);
        opacity: 0.45;
        pointer-events: none;
        visibility: visible;
    }
    .card.next-peek {
        display: flex;
        transform: translate3d(0, 0, -5px) scale(0.97);
        opacity: 0.45;
        pointer-events: none;
        visibility: visible;
    }
    
    .card.hidden-left {
        transform: translate3d(-90px, 0, 1px) scale(0.92);
        visibility: hidden;
    }
    
    .card.hidden-right {
        transform: translate3d(90px, 0, 1px) scale(0.92);
        visibility: hidden;
    }
    
    .prev-btn { left: 1rem; }
    .next-btn { right: 1rem; }
    
    /* On mobile, use mobile-specific swipe animations to match the smaller peek offset */
    .card.swipe-out-left {
        animation-name: swipeOutLeftMobile;
    }
    .card.swipe-out-right {
        animation-name: swipeOutRightMobile;
    }
    
    /* Prevent cards undergoing animations from disappearing instantly on mobile */
    .card.swipe-out-left,
    .card.swipe-out-right,
    .card.swipe-out-left-hidden,
    .card.swipe-out-right-hidden {
        display: flex !important;
        visibility: visible !important;
    }
    
    /* Mobile load animations */
    .intro-animate .card.active {
        animation: flyInActiveMobile 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
    }
    
    .intro-animate .card.next-peek {
        animation: flyInNextPeekMobile 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
    }
    
    .intro-animate .carousel-controls-mobile {
        animation: fadeInControlsMobile 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
        pointer-events: none;
    }
    
    .intro-animate .nav-btn,
    .intro-animate .carousel-indicators {
        animation: none !important;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.6rem 0.75rem !important;
        height: 48px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
    }
    
    .header.scrolled {
        padding: 0.6rem 0.75rem !important;
    }
    
    .logo {
        font-size: 1.05rem !important;
        white-space: nowrap !important;
        margin-right: 0.5rem !important;
    }

    .nav-links {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 0.65rem !important;
    }

    .nav-links a {
        margin-left: 0 !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
    }

    .theme-toggle-btn {
        margin-left: 0 !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .viewport {
        padding: 4.25rem 0.85rem 3.25rem;
        height: 100vh;
        height: 100dvh;
    }

    .carousel-container {
        max-width: 100%;
        width: 100%;
        height: calc(100vh - 7.75rem);
        height: calc(100dvh - 7.75rem);
        max-height: 680px;
    }

    .card {
        padding: 1.25rem 0.65rem 1rem 1.25rem;
        border-radius: 12px;
    }

    .card-header {
        margin-bottom: 0.85rem;
    }

    .card-header h2 {
        font-size: 1.35rem;
    }

    .card-content-wrapper {
        flex: 1;
        min-height: 0;
        border-radius: inherit; /* Inherit rounded card corners */
    }

    .card-view {
        gap: 0.85rem;
    }

    .info-section {
        gap: 0.35rem;
    }

    .info-section h3 {
        font-size: 0.95rem;
    }

    .info-section p {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .tech-specs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem 0.85rem;
        padding: 0.25rem 0;
        margin-top: auto;
        margin-bottom: auto;
    }

    .spec-item {
        padding-left: 0.65rem;
    }

    .spec-label {
        font-size: 0.68rem;
    }

    .spec-value {
        font-size: 0.825rem;
        line-height: 1.3;
    }

    .launch-demo-btn {
        width: 100%;
        justify-content: center;
        padding: 0.6rem 1rem;
        margin-top: auto;
        margin-bottom: 0;
        font-size: 0.85rem;
    }

    /* Initial state: Findings box expands to take up ALL available vertical height */
    .demo-view {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .demo-input-group {
        border-radius: 6px;
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .demo-input-label {
        padding: 0.6rem 0.85rem 0;
        font-size: 0.68rem;
        flex-shrink: 0;
    }

    textarea {
        flex: 1;
        height: 100%;
        min-height: 90px;
        padding: 0.6rem 0.85rem;
        font-size: 16px;
        line-height: 1.5;
        transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .demo-input-footer {
        padding: 0.4rem 0.5rem 0.4rem 0.85rem;
        flex-shrink: 0;
    }

    .demo-input-hint {
        font-size: 0.68rem;
    }

    .run-btn {
        padding: 0.4rem 0.85rem;
        font-size: 0.78rem;
    }

    .loading-container {
        height: 80px;
        gap: 0.65rem;
        font-size: 0.85rem;
        margin-top: 1rem;
    }

    .spinner {
        width: 24px;
        height: 24px;
    }

    .output-area {
        flex: 0 0 auto; /* Takes exact text content height dynamically */
        flex-direction: column;
        gap: 1.25rem;
        padding-top: 0.25rem;
        margin-top: 0.75rem;
    }

    .output-col {
        flex: 0 0 auto;
        gap: 0.35rem;
    }

    .output-label {
        font-size: 0.7rem;
    }

    .output-text {
        font-size: 0.85rem;
        line-height: 1.5;
        color: var(--text-primary);
    }

    /* Uniform styling between base model & fine-tuned model outputs on mobile (no indent) */
    .output-col.highlight {
        border-left: none;
        padding-left: 0;
    }

    .output-col.highlight .output-label {
        color: var(--text-primary);
    }
    
    .output-col.highlight .output-text {
        color: var(--text-primary);
        font-weight: 500;
    }

    /* Navigation buttons placed below the card inline with carousel indicators */
    .carousel-controls-mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 1.25rem;
        position: absolute;
        bottom: 0.85rem;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        z-index: 40;
    }

    .nav-btn {
        position: static !important;
        transform: none !important;
        width: 36px;
        height: 36px;
        opacity: 0.65;
        background: var(--btn-bg) !important;
        border: 1px solid var(--btn-border) !important;
        border-radius: 50%;
        box-shadow: 0 4px 12px var(--accent-glow) !important;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .nav-btn svg {
        width: 18px;
        height: 18px;
    }

    .nav-btn:hover {
        transform: scale(1.1) !important;
        opacity: 0.95 !important;
    }

    .nav-btn:active {
        transform: scale(0.9) !important;
    }

    .nav-btn:disabled {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: scale(0.7) !important;
    }

    .prev-btn {
        margin: 0;
    }

    .next-btn {
        margin: 0;
    }

    .carousel-indicators {
        position: static !important;
        bottom: auto;
        left: auto;
        transform: none !important;
        margin: 0;
        display: flex;
        gap: 0.6rem;
    }
}

@media (max-width: 480px) {
    .tech-specs-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }
}

/* About Page Styling */
.about-viewport {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    padding: 6rem 2rem 4rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.about-container {
    width: 100%;
    max-width: 960px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 3.5rem;
    box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.8), 
                0 0 40px var(--accent-glow), 
                inset 0 1px 1px rgba(255, 255, 255, 0.15);
    margin: 2rem auto;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr;
    gap: 4rem;
}

.about-left, .about-right {
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
}

.about-profile h1 {
    font-size: 2.2rem;
    font-weight: 500;
    letter-spacing: -0.5px;
    margin-bottom: 0.35rem;
}

.about-profile .subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.contact-item svg {
    opacity: 0.6;
    color: var(--text-primary);
}

.contact-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.25s ease;
}

.contact-item a:hover {
    color: var(--text-primary);
}

.about-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.8rem;
    border-bottom: none;
    padding-bottom: 0;
}

.about-section p {
    font-size: 0.925rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1rem;
}

.about-section p:last-child {
    margin-bottom: 0;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.skill-tag {
    background: var(--tag-bg);
    color: var(--text-primary);
    padding: 0.35rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--tag-border);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.skill-tag:hover {
    background: var(--tag-bg-hover);
    border-color: var(--tag-border-hover);
}

/* Timelines styling */
.timeline {
    display: flex;
    flex-direction: column;
    position: relative;
}

.timeline-item {
    position: relative;
    padding-left: 1.75rem;
    border-left: 1px solid var(--border-subtle);
    padding-bottom: 2rem;
}

.timeline-item:last-child {
    border-left: 1px solid transparent;
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -4.5px;
    top: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    border: 1px solid var(--bg-color);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-item:hover .timeline-dot {
    background: var(--text-primary);
    box-shadow: 0 0 10px var(--accent-glow);
    transform: scale(1.2);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
    gap: 1rem;
}

.timeline-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.timeline-date {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.timeline-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
    display: block;
    margin-bottom: 0.5rem;
}

.timeline-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0.5rem 0 0;
}

.timeline-bullets {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
}

.timeline-bullets li {
    margin-bottom: 0.35rem;
}

.timeline-bullets li:last-child {
    margin-bottom: 0;
}

.nav-links a.active {
    color: var(--text-primary);
    border-bottom: 1.5px solid var(--text-primary);
    padding-bottom: 4px;
}

/* Media Queries for responsiveness */
@media (max-width: 860px) {
    .about-viewport {
        padding: 5rem 1.5rem 2rem;
    }
    
    .about-container {
        padding: 2rem;
        margin: 1.5rem auto;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .about-left, .about-right {
        gap: 1.8rem;
    }
    
    .about-profile h1 {
        font-size: 1.85rem;
    }
}

@media (max-width: 580px) {
    .about-viewport {
        padding: 4.5rem 1rem 1.5rem;
    }

    .about-container {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }

    .timeline-date {
        font-size: 0.72rem;
        margin-bottom: 0.2rem;
    }
}

/* Collapsible certificates styling */
.certs-details summary {
    font-family: inherit;
    font-size: 0.825rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: color 0.25s ease;
    outline: none;
    padding: 0.25rem 0;
}

.certs-details summary:hover {
    color: var(--text-primary);
}

.certs-details[open] summary {
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    border-bottom: 1px dotted var(--border-subtle);
    padding-bottom: 0.5rem;
}

.certs-list-container {
    margin-top: 0.75rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 12px;
}

/* Hide native scrollbars on scrollable elements */
.card-view,
.intro-grid,
.certs-list-container,
.about-section.collapsible .collapsible-content {
    scrollbar-width: none !important;
}

.card-view::-webkit-scrollbar,
.intro-grid::-webkit-scrollbar,
.certs-list-container::-webkit-scrollbar,
.about-section.collapsible .collapsible-content::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* JS-based Custom Scrollbar Styles */
.custom-scroll-track {
    position: absolute;
    right: 4px;
    top: 16px;
    bottom: 16px;
    width: 8px;
    background: var(--card-scrollbar-track);
    z-index: 90;
    pointer-events: auto;
    user-select: none;
    border-radius: 4px;
}

.custom-scroll-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--card-scrollbar-thumb);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
    border-radius: 4px;
}

.custom-scroll-thumb:hover,
.custom-scroll-thumb.dragging {
    background: var(--card-scrollbar-thumb-hover);
}

.certs-details,
.collapsible-wrapper {
    position: relative;
}

.sub-cert {
    padding: 0.15rem 0;
    transition: transform 0.2s ease;
}

.sub-cert:hover {
    transform: translateX(2px);
}

/* -------------------------------------------------------------
   About Page Collapsible Sections (Mobile Accordion / Scroll Link)
   ------------------------------------------------------------- */

/* Desktop defaults: sections are always expanded, header clicks disabled */
.section-toggle {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    cursor: default;
    pointer-events: none;
    outline: none;
}

.toggle-icon {
    display: none; /* Hide chevron on desktop */
}

.collapsible-wrapper {
    display: block;
}

.collapsible-content {
    overflow: visible;
}

/* Mobile accordion view styling */
@media (max-width: 768px) {
    .about-viewport {
        padding: 0 !important;
        margin-top: 48px !important; /* Space for fixed header */
        height: calc(100vh - 48px) !important;
        height: calc(100dvh - 48px) !important;
        padding-bottom: 0 !important;
    }

    .about-container {
        padding: 0 !important;
        margin: 0 !important;
        border: none;
        border-radius: 0;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
    }

    .about-grid {
        display: block; /* Collapse the grid into a single column flow */
    }

    .about-left, .about-right {
        display: contents;
    }

    /* Profile and contact stay above the accordion, not sticky */
    .about-profile {
        padding: 1.25rem 1rem 0.75rem;
    }

    .about-profile h1 {
        font-size: 1.6rem;
    }

    .contact-info {
        padding: 0 1rem 0.75rem;
    }

    /* Flatten section boxes so all sticky toggles share .about-grid
       as their containing block — enables cross-container stacking */
    .about-section.collapsible {
        display: contents;
    }

    /* Section toggle headers — sticky on mobile so they stack */
    .about-section.collapsible .section-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        z-index: 20;
        height: 44px;
        background: var(--bg-color);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        border-top: none;
        border-left: none;
        border-right: none;
        border-radius: 0;
        padding: 0 1rem;
        margin: 0;
        cursor: pointer;
        pointer-events: auto;
        outline: none;
        transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                    border-color 0.3s ease;
        /* Hardware acceleration to prevent sticky header lag and mask overlap */
        transform: translateZ(0);
        will-change: top, transform;
    }

    #sec-objective .section-toggle { top: 0; }
    #sec-skills { display: none !important; }
    #sec-certs .section-toggle { top: 44px; }
    #sec-education .section-toggle { top: 88px; }
    #sec-experience .section-toggle { top: 132px; }
    #sec-projects .section-toggle { top: 176px; }

    .about-section.collapsible.active .section-toggle {
        background: var(--bg-color);
        border-bottom-color: rgba(255, 255, 255, 0.12);
    }

    .about-section.collapsible .section-toggle h3 {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: var(--text-secondary);
        font-weight: 600;
        transition: color 0.3s ease;
    }

    .about-section.collapsible.active .section-toggle h3 {
        color: var(--text-primary);
    }

    /* Chevron toggle icon */
    .about-section.collapsible .toggle-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.08);
        color: var(--text-secondary);
        transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .about-section.collapsible.active .toggle-icon {
        transform: rotate(180deg);
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.18);
        color: var(--text-primary);
    }

    /* Collapsible wrapper — animate open/close with max-height instead of grid-template-rows */
    .about-section.collapsible .collapsible-wrapper {
        display: block; /* Use block layout to bypass grid track recalculations */
        max-height: 0; /* Starts fully collapsed at 0px */
        overflow: hidden; /* Clip contents cleanly during height animation */
        transition: max-height 0.9s cubic-bezier(0.16, 1, 0.3, 1);
        /* Hardware acceleration to speed up height transitions */
        transform: translateZ(0);
        will-change: max-height;
    }

    .about-section.collapsible.active .collapsible-wrapper {
        max-height: calc(100dvh - 312px); /* Animate smoothly up to the active height limit */
    }

    /* Inner content area — styles are permanent and static to prevent layout jumps or scroll layer glitches */
    .about-section.collapsible .collapsible-content {
        min-height: 0;
        padding: 1rem; /* Permanent padding since wrapper handles the collapse */
        max-height: calc(100dvh - 312px) !important;
        overflow-y: auto !important; /* Stable scroll container to prevent WebKit compositor lag */
        overflow-x: hidden !important;
        padding-right: 12px !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: auto !important;
    }

    /* Active state content is simplified since all layout styles are already permanent */
    .about-section.collapsible.active .collapsible-content {
        padding: 1rem;
    }

    /* Fix header on mobile to be compact */
    .header {
        padding: 0.9rem 1rem !important;
        background-color: rgba(9, 9, 11, 0.85);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }

    .header.scrolled {
        padding: 0.9rem 1rem !important;
    }
}

.cert-link {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.25);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.cert-link:hover {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

.sub-cert .cert-link {
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

/* ==========================================================================
   Tactile Paper & Cards Theme Overrides (Light Mode)
   ========================================================================== */

/* 1. Drafting Paper Grid Overlay */
:root[data-theme="light"] body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(30, 29, 27, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 29, 27, 0.015) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.8;
}

/* 2. Editorial Typography Contrasts */
:root[data-theme="light"] h1,
:root[data-theme="light"] h2,
:root[data-theme="light"] h3,
:root[data-theme="light"] .logo {
    font-family: var(--font-serif) !important;
    font-weight: 600 !important;
    letter-spacing: -0.3px !important;
}

/* 3. Physical Paper Cards & stacked stacks */
:root[data-theme="light"] .card {
    background: var(--card-bg) !important;
    border: 1px solid rgba(30, 29, 27, 0.12) !important;
    border-top: 4px solid var(--highlight-border) !important;
    box-shadow: var(--card-shadow) !important;
}

/* Add heritage filing card accent tab to all cards in light mode */
:root[data-theme="light"] .card::after {
    display: none !important;
}

/* Active card has a deep cardstock lift shadow */
:root[data-theme="light"] .card.active {
    box-shadow: 
        0 15px 35px -10px rgba(32, 30, 29, 0.08), 
        0 30px 60px -15px rgba(32, 30, 29, 0.06), 
        0 0 1px 1px rgba(32, 30, 29, 0.04) !important;
    border-color: rgba(30, 29, 27, 0.22) !important;
    border-top-color: var(--highlight-border) !important;
}

/* Peeking cards behind look like clean cardboard sheets */
:root[data-theme="light"] .card.prev-peek,
:root[data-theme="light"] .card.next-peek {
    box-shadow: 
        0 4px 10px rgba(32, 30, 29, 0.05), 
        0 0 0 1px rgba(32, 30, 29, 0.04) !important;
    border-color: rgba(30, 29, 27, 0.1) !important;
    border-top-color: var(--highlight-border) !important;
}

/* 4. Tactile Buttons & micro-animations */
:root[data-theme="light"] .launch-demo-btn,
:root[data-theme="light"] .run-btn,
:root[data-theme="light"] .reset-btn,
:root[data-theme="light"] .github-btn {
    border: 1px solid var(--btn-border) !important;
    background: var(--btn-bg) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 1.5px 3px rgba(30, 29, 27, 0.05), inset 0 -1px 0 rgba(30, 29, 27, 0.1) !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                background-color 0.25s ease, 
                border-color 0.25s ease !important;
}

:root[data-theme="light"] .launch-demo-btn:hover,
:root[data-theme="light"] .run-btn:hover,
:root[data-theme="light"] .reset-btn:hover,
:root[data-theme="light"] .github-btn:hover {
    transform: translateY(-1.5px) !important;
    background: var(--btn-bg-hover) !important;
    border-color: var(--btn-border-hover) !important;
    box-shadow: 0 4px 8px rgba(30, 29, 27, 0.08), inset 0 -1px 0 rgba(30, 29, 27, 0.1) !important;
}

:root[data-theme="light"] .launch-demo-btn:active,
:root[data-theme="light"] .run-btn:active,
:root[data-theme="light"] .reset-btn:active,
:root[data-theme="light"] .github-btn:active {
    transform: translateY(0.5px) !important;
    box-shadow: 0 1px 1.5px rgba(30, 29, 27, 0.05), inset 0 1px 2px rgba(30, 29, 27, 0.08) !important;
}

/* SVG icons visibility inside button in light mode */
:root[data-theme="light"] .run-btn svg,
:root[data-theme="light"] .reset-btn svg,
:root[data-theme="light"] .github-btn svg {
    color: var(--text-secondary);
}

:root[data-theme="light"] .run-btn:hover svg,
:root[data-theme="light"] .reset-btn:hover svg,
:root[data-theme="light"] .github-btn:hover svg {
    color: var(--text-primary);
}

/* 5. Notebook section header coloring on About page */
:root[data-theme="light"] .about-section h3 {
    color: var(--text-secondary) !important;
}

/* Dotted scrollbars and tags */
:root[data-theme="light"] .skill-tag,
:root[data-theme="light"] .badge {
    border: 1px solid var(--tag-border) !important;
    background: var(--tag-bg) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 1px 2px rgba(30, 29, 27, 0.02) !important;
    border-radius: 4px !important;
    transition: transform 0.2s ease, background 0.25s ease, border-color 0.25s ease !important;
}

:root[data-theme="light"] .skill-tag:hover {
    transform: translateY(-1px) !important;
    background: var(--tag-bg-hover) !important;
    border-color: var(--tag-border-hover) !important;
    box-shadow: 0 3px 6px rgba(30, 29, 27, 0.05) !important;
}

:root[data-theme="light"] .certs-details[open] summary {
    border-bottom-color: rgba(30, 29, 27, 0.15) !important;
}

:root[data-theme="light"] .timeline-dot {
    background: #ffffff !important;
    border: 2px solid var(--accent) !important;
}

:root[data-theme="light"] .timeline-item:hover .timeline-dot {
    background: #ffffff !important;
    border-color: var(--highlight-border) !important;
    box-shadow: 0 0 0 3px rgba(43, 76, 126, 0.15) !important;
}

:root[data-theme="light"] .cert-link {
    color: var(--accent) !important;
    border-bottom-color: rgba(43, 76, 126, 0.3) !important;
}

:root[data-theme="light"] .cert-link:hover {
    color: #1b365d !important;
    border-bottom-color: #1b365d !important;
}

/* 6. About Page paper sheet layout */
:root[data-theme="light"] .about-container {
    background: #ffffff !important;
    border: 1px solid rgba(30, 29, 27, 0.12) !important;
    box-shadow: 
        0 15px 35px -10px rgba(32, 30, 29, 0.08), 
        0 30px 60px -15px rgba(32, 30, 29, 0.06), 
        0 0 1px 1px rgba(32, 30, 29, 0.04) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    position: relative;
}

:root[data-theme="light"] .about-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #a84a32; /* Default Heritage Terracotta orange */
    border-radius: 8px 8px 0 0;
    pointer-events: none;
}

/* 7. Indicator Dots styling for high contrast in light mode */
:root[data-theme="light"] .indicator-dot {
    background: rgba(30, 29, 27, 0.18) !important;
}

:root[data-theme="light"] .indicator-dot:hover {
    background: rgba(30, 29, 27, 0.35) !important;
}

:root[data-theme="light"] .indicator-dot.active {
    background: #a84a32 !important; /* Terracotta orange active indicator */
    box-shadow: 0 0 10px rgba(168, 74, 50, 0.3) !important;
    width: 26px !important;
}

/* 8. Arrow buttons overlay and mobile hover overrides */
:root[data-theme="light"] .nav-btn {
    color: var(--text-primary) !important;
}

:root[data-theme="light"] .nav-btn:hover {
    color: var(--accent) !important;
}

@media (max-width: 900px) {
    :root[data-theme="light"] .nav-btn {
        background: var(--btn-bg) !important;
        border: 1px solid var(--btn-border) !important;
    }
    :root[data-theme="light"] .nav-btn:hover {
        background: #fffdf9 !important;
        border-color: rgba(30, 29, 27, 0.2) !important;
        box-shadow: 0 4px 16px rgba(32, 30, 29, 0.08) !important;
    }
}

/* 9. Header scroll tracing paper shadow */
:root[data-theme="light"] .header.scrolled {
    background: var(--glass-bg) !important;
    border-bottom-color: var(--glass-border) !important;
    box-shadow: 0 4px 20px rgba(30, 29, 27, 0.04) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

/* 10. Demo view input group physical look */
:root[data-theme="light"] .demo-input-group {
    background: #ffffff !important;
    border: 1px solid rgba(30, 29, 27, 0.15) !important;
    box-shadow: inset 0 1px 3px rgba(30, 29, 27, 0.03) !important;
}

:root[data-theme="light"] .demo-input-group:focus-within {
    border-color: rgba(30, 29, 27, 0.35) !important;
    box-shadow: 0 0 0 3px rgba(43, 76, 126, 0.1), inset 0 1px 3px rgba(30, 29, 27, 0.03) !important;
}

:root[data-theme="light"] textarea {
    color: var(--text-primary) !important;
}

:root[data-theme="light"] textarea::placeholder {
    color: rgba(110, 106, 100, 0.5) !important;
}

/* 11. Spec labels & details decoration */
:root[data-theme="light"] .spec-item {
    border-left: 2px solid rgba(30, 29, 27, 0.1) !important;
}

:root[data-theme="light"] .about-section.collapsible .toggle-icon {
    background: rgba(30, 29, 27, 0.02) !important;
    border: 1px solid rgba(30, 29, 27, 0.1) !important;
    color: var(--text-secondary) !important;
}

:root[data-theme="light"] .about-section.collapsible.active .toggle-icon {
    background: rgba(30, 29, 27, 0.05) !important;
    border-color: rgba(30, 29, 27, 0.2) !important;
    color: var(--text-primary) !important;
}

@media (max-width: 768px) {
    :root[data-theme="light"] .about-viewport {
        margin-top: 48px !important;
        height: calc(100vh - 48px) !important;
        height: calc(100dvh - 48px) !important;
    }
    
    :root[data-theme="light"] .header {
        background-color: rgba(247, 244, 238, 0.9) !important;
        border-bottom-color: rgba(30, 29, 27, 0.08) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
    }

    :root[data-theme="light"] .about-section.collapsible .section-toggle {
        background: var(--bg-color) !important;
        border-bottom: 1px solid rgba(30, 29, 27, 0.08) !important;
    }
}

/* ==========================================================================
   Global / Shared Layout Improvements (Both Themes)
   ========================================================================== */

/* Circular technical node styling for timeline dots */
.timeline-dot {
    position: absolute;
    left: -5.5px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-color) !important;
    border: 2px solid var(--text-secondary) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-item:hover .timeline-dot {
    border-color: var(--accent) !important;
    background: var(--bg-color) !important;
    box-shadow: 0 0 8px var(--accent-glow) !important;
    transform: scale(1.15);
}

/* Editorial Bullet Points Dash Overrides */
.timeline-bullets {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0.6rem 0 0 !important;
}

.timeline-bullets li {
    position: relative;
    padding-left: 1.15rem !important;
    margin-bottom: 0.45rem !important;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.timeline-bullets li::before {
    content: "—" !important; /* Long editorial dash */
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
    font-weight: 600;
    opacity: 0.65;
}

/* ==========================================================================
   Distinct Colors per Project Card (Both Themes)
   ========================================================================== */

/* Card 1: Radiology AI Summarizer */
.card:nth-child(1) {
    --highlight-border: #3b82f6; /* Blue spinner & highlight in dark mode */
    --spinner-active: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.08);
}
:root[data-theme="light"] .card:nth-child(1) {
    --card-bg: #f4f7fa !important; /* Soft blueprint blue-gray */
    --highlight-border: #2b4c7e; /* Navy comparison outline */
    --spinner-active: #2b4c7e;
    --btn-bg: #ffffff;
    --btn-bg-hover: #e8eff5;
    --btn-border: rgba(43, 76, 126, 0.2);
    --btn-border-hover: rgba(43, 76, 126, 0.4);
    --tag-bg: #ffffff;
    --tag-bg-hover: #e8eff5;
    --tag-border: rgba(43, 76, 126, 0.15);
    --tag-border-hover: rgba(43, 76, 126, 0.3);
    --accent-glow: rgba(43, 76, 126, 0.05);
}

/* Card 2: Deep Learning Image Classifier */
.card:nth-child(2) {
    --card-bg: linear-gradient(135deg, #0d1a14 0%, #050a07 100%) !important;
    --highlight-border: #10b981; /* Green spinner & highlight in dark mode */
    --spinner-active: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.08);
}
:root[data-theme="light"] .card:nth-child(2) {
    --card-bg: #edf3ee !important; /* Soft sage/mint paper */
    --highlight-border: #2a5d3e; /* Forest green outline */
    --spinner-active: #2a5d3e;
    --btn-bg: #ffffff;
    --btn-bg-hover: #e2ede5;
    --btn-border: rgba(42, 93, 62, 0.2);
    --btn-border-hover: rgba(42, 93, 62, 0.4);
    --tag-bg: #ffffff;
    --tag-bg-hover: #e2ede5;
    --tag-border: rgba(42, 93, 62, 0.15);
    --tag-border-hover: rgba(42, 93, 62, 0.3);
    --accent-glow: rgba(42, 93, 62, 0.05);
}

/* Card 3: Elderly-Accessible AI Food Ordering */
.card:nth-child(3) {
    --card-bg: linear-gradient(135deg, #1f110c 0%, #0c0705 100%) !important;
    --highlight-border: #f97316; /* Orange spinner & highlight in dark mode */
    --spinner-active: #f97316;
    --accent-glow: rgba(249, 115, 22, 0.08);
}
:root[data-theme="light"] .card:nth-child(3) {
    --card-bg: #faf1ec !important; /* Soft warm terracotta/peach paper */
    --highlight-border: #a84a32; /* Terracotta orange outline */
    --spinner-active: #a84a32;
    --btn-bg: #ffffff;
    --btn-bg-hover: #faf0eb;
    --btn-border: rgba(168, 74, 50, 0.2);
    --btn-border-hover: rgba(168, 74, 50, 0.4);
    --tag-bg: #ffffff;
    --tag-bg-hover: #faf0eb;
    --tag-border: rgba(168, 74, 50, 0.15);
    --tag-border-hover: rgba(168, 74, 50, 0.3);
    --accent-glow: rgba(168, 74, 50, 0.05);
}

/* Profile Card Wrapper styling */
.profile-card {
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
}

@media (max-width: 768px) {
    /* Center the profile card vertically and horizontally in mobile viewport */
    .profile-card {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 1.75rem 1rem 1rem !important;
        box-sizing: border-box !important;
        gap: 1rem !important;
    }
    
    .contact-info {
        align-items: center !important;
        width: 100% !important;
    }
    
    .contact-item {
        justify-content: center !important;
    }



    /* Projects Page Card Header Mobile adjustments to prevent title space squeezing */
    .card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.65rem !important;
    }

    .card-actions {
        width: 100% !important;
        justify-content: flex-start !important;
        margin-top: 0.15rem !important;
    }

    /* When in demo mode, title is hidden, so revert to row layout for buttons */
    .card.in-demo .card-header {
        flex-direction: row !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 0 !important;
    }

    .card.in-demo .card-actions {
        width: auto !important;
        margin-top: 0 !important;
    }
}

/* ==========================================================================
   Project 0 Intro Card: Infographic Styles
   ========================================================================== */

.card-intro {
    padding: 2.5rem 3rem;
}

.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 3rem;
    height: 100%;
    align-items: center;
}

.intro-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.intro-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid var(--glass-border);
    padding: 0.35rem 0.75rem;
    border-radius: 99px;
    margin-bottom: 0.25rem;
}

.intro-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-primary);
    line-height: 1.15;
}

.intro-subtitle {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.intro-text {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.intro-highlight-box {
    background: var(--accent-glow);
    border-left: 3px solid var(--accent);
    padding: 0.85rem 1.1rem;
    border-radius: 0 8px 8px 0;
    margin-top: 0.75rem;
    width: 100%;
}

.highlight-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.highlight-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.intro-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
    justify-content: center;
}

.skills-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.skill-card-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-subtle);
    padding: 0.85rem 1.1rem;
    border-radius: 8px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.skill-card-item:hover {
    border-color: var(--glass-border);
    transform: translateY(-1px);
}

.skill-card-icon {
    font-size: 1.3rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.skill-card-icon svg {
    display: block;
    color: var(--accent);
}

.skill-card-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.skill-card-content p {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.intro-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--accent-glow);
    border: 1px solid var(--glass-border);
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    color: var(--accent);
    font-weight: 500;
    font-size: 0.9rem;
}

.cta-text {
    flex: 1;
    line-height: 1.4;
}

.swipe-text-desktop {
    display: inline;
}

.swipe-text-mobile {
    display: none;
}

@media (max-width: 820px) {
    .swipe-text-desktop {
        display: none;
    }
    .swipe-text-mobile {
        display: inline;
    }
}

.cta-arrow-pulse {
    animation: bounceRight 1.5s infinite;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

@keyframes bounceRight {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}

/* Responsive adjustments for the split-column layout */
@media (max-width: 820px) {
    .intro-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 12px;
    }
    .card-intro {
        padding: 1.5rem 0.65rem 1.5rem 1.5rem;
    }
    .intro-title {
        font-size: 1.75rem;
    }
    .skills-card-list {
        gap: 0.65rem;
    }
    .skill-card-item {
        padding: 0.75rem 1rem;
    }
}







/* --- Spiral Data Classifier Card Styles --- */
#spiral-card.in-demo .card-content-wrapper {
    overflow: hidden; /* Prevent scrolling inside wrapper when demo is full size */
}

.spiral-demo-layout {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    align-items: stretch;
    width: 100%;
    padding: 0.5rem 0.25rem;
}

.spiral-canvas-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 280px;
    flex-shrink: 0;
}

.canvas-container {
    position: relative;
    width: 280px;
    height: 280px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background-color: var(--input-bg);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#spiral-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.canvas-overlay-text {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    opacity: 0.75;
    font-weight: 500;
}

.spiral-tooltip {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    margin-top: 0.75rem;
    width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.3rem;
}

.tooltip-coord {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-secondary);
}

.tooltip-class {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}

.tooltip-class.none {
    background: var(--btn-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.tooltip-class.c0 {
    background: #ef4444;
    color: #ffffff;
}

.tooltip-class.c1 {
    background: #10b981;
    color: #ffffff;
}

.tooltip-class.c2 {
    background: #3b82f6;
    color: #ffffff;
}

.tooltip-probs {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.prob-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prob-label {
    width: 80px;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.prob-bar-track {
    flex-grow: 1;
    height: 6px;
    background: var(--border-subtle);
    border-radius: 3px;
    overflow: hidden;
}

.prob-bar-fill {
    height: 100%;
    border-radius: 3px;
    width: 33.3%;
    transition: width 0.1s ease-out;
}

.prob-bar-fill.red {
    background: #ef4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

.prob-bar-fill.green {
    background: #10b981;
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
}

.prob-bar-fill.blue {
    background: #3b82f6;
    box-shadow: 0 0 4px rgba(59, 130, 246, 0.4);
}

.prob-val {
    width: 32px;
    text-align: right;
    font-size: 0.72rem;
    font-family: monospace;
    font-weight: 500;
    color: var(--text-primary);
}

.spiral-control-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    flex-grow: 1;
}

.model-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.model-toggle-btn {
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 8px;
    padding: 0.6rem 0.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.model-toggle-btn:hover {
    background: var(--btn-bg-hover);
    border-color: var(--btn-border-hover);
    color: var(--text-primary);
}

.model-toggle-btn.active {
    background: var(--btn-bg-hover);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}

.model-toggle-btn span {
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
}

.model-toggle-btn small {
    font-size: 0.62rem;
    opacity: 0.8;
    margin-top: 2px;
}

.model-narrative-container {
    background: var(--btn-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.75rem;
    flex-grow: 1;
    min-height: 95px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.narrative-pane {
    display: none;
}

.narrative-pane.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.narrative-pane h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.narrative-pane p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.gif-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gif-title {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gif-wrapper {
    position: relative;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    overflow: hidden;
    height: 135px;
    background-color: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

#training-gif {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

#training-gif.hidden {
    display: none;
}

.gif-fallback {
    display: none;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.gif-fallback.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .spiral-demo-layout {
        flex-direction: column;
        align-items: center;
        gap: 1.25rem;
    }
    
    .spiral-canvas-col {
        width: 100%;
    }
    
    .canvas-container, .spiral-tooltip {
        width: 280px;
    }
    
    .spiral-control-col {
        width: 100%;
        gap: 0.75rem;
    }
    
    .model-narrative-container {
        min-height: 80px;
    }
    
    .gif-wrapper {
        height: 110px;
    }
}

/* ==========================================================================
   About Page Projects Call-To-Action (CTA) Styles
   ========================================================================== */

.about-projects-cta {
    margin-top: 3.5rem;
    padding: 2.25rem 2.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.03);
}

.about-projects-cta:hover {
    border-color: var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.cta-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cta-subtitle {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid var(--glass-border);
    padding: 0.25rem 0.6rem;
    border-radius: 99px;
    margin-bottom: 0.75rem;
}

.cta-title {
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.4px;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.cta-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
    max-width: 580px;
}

.cta-action {
    flex-shrink: 0;
}

.explore-projects-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.6rem;
    background: var(--text-primary);
    color: var(--bg-color);
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.explore-projects-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 15px var(--accent-glow);
    filter: brightness(1.15);
}

.explore-projects-btn:active {
    transform: translateY(0.5px);
}

.explore-projects-btn svg {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.explore-projects-btn:hover svg {
    transform: translateX(4px);
}

/* --- Theme overrides (Light Mode) --- */
:root[data-theme="light"] .about-projects-cta {
    background: #fffdf9 !important;
    border: 1px solid rgba(30, 29, 27, 0.12) !important;
    border-left: 4px solid var(--highlight-border) !important; /* filing card tab look */
    box-shadow: 0 4px 10px rgba(32, 30, 29, 0.04) !important;
}

:root[data-theme="light"] .about-projects-cta:hover {
    background: #fdfaf4 !important;
    border-color: rgba(30, 29, 27, 0.22) !important;
    box-shadow: 0 8px 16px rgba(32, 30, 29, 0.06) !important;
}

:root[data-theme="light"] .cta-title {
    font-family: var(--font-serif) !important;
}

:root[data-theme="light"] .explore-projects-btn {
    background: var(--accent) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(43, 76, 126, 0.2) !important;
}

:root[data-theme="light"] .explore-projects-btn:hover {
    background: #1b365d !important;
    box-shadow: 0 6px 12px rgba(43, 76, 126, 0.3) !important;
}

/* --- Responsive overrides --- */
@media (max-width: 860px) {
    .about-projects-cta {
        margin-top: 2.5rem;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .about-projects-cta {
        margin: 2rem 1rem !important;
        padding: 1.75rem 1.5rem !important;
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: center !important;
        gap: 1.5rem !important;
        background: rgba(255, 255, 255, 0.03) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 8px !important;
    }

    .cta-content {
        align-items: center !important;
    }

    .cta-desc {
        max-width: 100% !important;
    }

    .explore-projects-btn {
        justify-content: center !important;
        width: 100% !important;
    }
    
    :root[data-theme="light"] .about-projects-cta {
        border-left: 1px solid rgba(30, 29, 27, 0.12) !important;
        border-top: 4px solid var(--highlight-border) !important; /* Top-tab style for mobile */
    }
}
