:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-primary: #00ff88;
    --accent-secondary: #00d4ff;
    --accent-tertiary: #8b5cf6;
    --gradient-accent: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --border-color: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(255, 255, 255, 0.02);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    /* Matrix accents — vivid hues; card colour is mostly neutral (see corner radials). */
    /* Accent-a: pink family, pulled back so it doesn’t dominate next to About. */
    --matrix-a: #b84f86;
    --matrix-b: #38bdf8;
    --matrix-c: #fb923c;
    --matrix-d: #a78bfa;
    --about-accent-soft: var(--matrix-d);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition:
        background 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

/* Home #home: links sit in the hero until you scroll past it; then bar + centered links. */
body.home-page:not(.nav-past-hero) .navbar {
    background: rgba(10, 10, 15, 0.38);
    border-bottom-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(18px);
}

body.nav-past-hero .navbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
}

body.nav-past-hero .nav-brand {
    grid-column: 1;
    justify-self: start;
}

body.nav-past-hero .nav-links {
    grid-column: 2;
    justify-self: center;
}

body.nav-past-hero .mobile-menu-btn {
    grid-column: 3;
    justify-self: end;
}

@media (min-width: 769px) {
    body.home-page:not(.nav-past-hero) .navbar .nav-links {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        top: clamp(5.5rem, 18vh, 8.25rem);
        z-index: 1001;
        max-width: min(96vw, 1080px);
        justify-content: center;
        flex-wrap: wrap;
        row-gap: 0.35rem;
        column-gap: clamp(0.65rem, 1.6vw, 1.75rem);
        pointer-events: auto;
        transition:
            top 0.35s ease,
            transform 0.35s ease;
    }
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    color: inherit;
}

.terminal-prompt {
    color: var(--accent-primary);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.brand-text .accent {
    color: var(--accent-secondary);
}

/*
 * Subsidiary pages (any HTML except index.html): after .accent, add
 *   <span class="brand-path">/slug</span>
 * e.g. /live_demo on project-demos.html. Omit on index.html. Point .nav-brand to index.html (or #home).
 */
.nav-brand .brand-path {
    color: var(--text-muted);
    font-weight: 500;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: width var(--transition-normal);
}

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

.nav-links a:hover::after {
    width: 100%;
}

.nav-resume {
    color: var(--accent-primary) !important;
}

.nav-resume::after {
    background: var(--accent-primary);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-normal);
}

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 2rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 212, 255, 0.035) 0%, transparent 58%),
        radial-gradient(ellipse 50% 45% at 90% 55%, rgba(0, 255, 136, 0.025) 0%, transparent 52%);
    pointer-events: none;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2.5rem, 6vw, 4rem);
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.hero-title.hero-title--minimal {
    font-size: clamp(3rem, 9vw, 5.25rem);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.035em;
    margin: 0;
    color: var(--text-primary);
}

.hero-name-line {
    display: block;
}

.hero-tagline {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 22rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.btn-secondary:hover {
    background: rgba(0, 255, 136, 0.1);
    transform: translateY(-2px);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-icon {
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-svg {
    width: 1.1em;
    height: 1.1em;
    display: block;
    flex-shrink: 0;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.terminal-window {
    width: 100%;
    max-width: 450px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.terminal-window--matrix {
    background: linear-gradient(165deg, rgba(22, 27, 34, 0.94) 0%, rgba(14, 17, 22, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 2px solid rgba(145, 136, 196, 0.55);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 12px 32px rgba(0, 0, 0, 0.25);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27ca40; }

.terminal-title {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.terminal-body {
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.terminal-line {
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.terminal-line-active {
    align-items: center;
}

.terminal-line .prompt {
    color: var(--accent-primary);
}

.terminal-line .command {
    color: var(--text-primary);
}

.terminal-line.output {
    color: var(--text-secondary);
    padding-left: 1rem;
}

.terminal-input-group {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.terminal-line-active .command {
    flex: 0 1 auto;
}

.terminal-cursor {
    display: inline-block;
    width: 0.55ch;
    min-height: 1.15em;
    margin-left: 3px;
    vertical-align: text-bottom;
    border-radius: 1px;
    background: var(--accent-primary);
    color: transparent;
    flex-shrink: 0;
    animation: blink 0.85s step-end infinite;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(113, 113, 122, 0.75);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.scroll-indicator-svg {
    width: 128px;
    height: auto;
}

.scroll-indicator-svg svg {
    display: block;
    width: 100%;
    height: auto;
    filter:
        drop-shadow(0 0 2px rgba(255, 255, 255, 0.35))
        drop-shadow(0 0 8px rgba(56, 189, 248, 0.55))
        drop-shadow(0 0 18px rgba(52, 211, 153, 0.25))
        drop-shadow(0 0 22px rgba(167, 139, 250, 0.35));
}

.scroll-line {
    stroke-width: 3.1;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

/* Pill split into prefix + suffix; dash reveal driven in JS (see pillStrokeDashOffsetAtCycleT in script.js). */
.scroll-line--pill-prefix,
.scroll-line--pill-suffix {
    fill: none;
}

/* Interior scroll line: dash window driven in script.js (continuous squiggle → arrow) */
.scroll-line--interior {
    stroke-width: 3.1;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* Flat end on squiggle meets one round cap on stem — avoids double round-cap bulge at the joint */
.scroll-line--squiggle {
    stroke-linecap: butt;
}

.scroll-arrow-bounce {
    transform-box: fill-box;
    transform-origin: 50% 88%;
}

@media (prefers-reduced-motion: reduce) {
    .scroll-line {
        animation: none !important;
        stroke-dashoffset: 0 !important;
    }

    .scroll-line--pill-prefix,
    .scroll-line--pill-suffix {
        stroke-dasharray: none !important;
        stroke-dashoffset: 0 !important;
    }

    .scroll-line--interior {
        stroke-dasharray: none !important;
        stroke-dashoffset: 0 !important;
    }

    .scroll-arrow-bounce {
        transform: none !important;
    }
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--accent-primary);
}

.section-intro {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 42rem;
    margin: -2rem 0 2rem;
    line-height: 1.6;
}

.about {
    padding: 8rem 2rem;
    background:
        radial-gradient(ellipse 65% 45% at 8% 30%, rgba(167, 139, 250, 0.05) 0%, transparent 54%),
        radial-gradient(ellipse 50% 42% at 92% 75%, rgba(56, 189, 248, 0.035) 0%, transparent 52%),
        var(--bg-secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
    width: 100%;
}

.about-panel {
    --about-accent: var(--about-accent-soft);
    background:
        radial-gradient(ellipse 95% 70% at 0% 0%, rgba(167, 139, 250, 0.06) 0%, transparent 38%),
        linear-gradient(165deg, rgba(22, 27, 34, 0.94) 0%, rgba(14, 17, 22, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 2px solid rgba(167, 139, 250, 0.62);
    border-radius: 12px;
    padding: 1.75rem 2rem 2rem;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 12px 32px rgba(0, 0, 0, 0.22);
}

.about-panel-header {
    margin-bottom: 1rem;
}

.about-panel-icon {
    color: var(--about-accent);
}

.about-panel-title {
    margin: 0;
}

.about-panel .skill-matrix-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.about-panel .skill-matrix-highlight {
    border-bottom-color: var(--matrix-d);
}

.about-snippet .skill-snippet-open {
    margin-bottom: 0.45rem;
}

/* YAML chrome + body: JetBrains Mono (one continuous “snippet” block). */
.about-snippet .skill-snippet-open,
.about-snippet .skill-snippet-close {
    color: rgba(181, 168, 220, 0.62);
    font-size: 0.68rem;
}

.about-snippet-body {
    margin: 0;
    padding: 0.35rem 0 0.35rem 0.85rem;
    border-left: 1px solid rgba(167, 139, 250, 0.28);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.about-snippet-body p {
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
    font-size: 0.94rem;
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: -0.01em;
}

.about-snippet-body p:last-child {
    margin-bottom: 0;
}

.about-inline-link {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: var(--accent-secondary);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.45);
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.about-inline-link:hover {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.about-inline-link:focus-visible {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 2px;
    border-radius: 2px;
}

.about-stats {
    display: flex;
    gap: 3rem;
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat--accent-a .stat-number {
    background: none;
    -webkit-text-fill-color: unset;
    color: #d4a3bf;
}

.stat--accent-b .stat-number {
    background: none;
    -webkit-text-fill-color: unset;
    color: var(--matrix-b);
}

.stat--accent-c .stat-number {
    background: none;
    -webkit-text-fill-color: unset;
    color: var(--matrix-c);
}

.stat-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    line-height: 1.45;
    margin-top: 0.35rem;
}

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

.image-frame {
    position: relative;
    width: 280px;
    height: 350px;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border: 2px dashed var(--border-color);
    transition: border-color var(--transition-normal);
}


.placeholder-icon {
    font-size: 4rem;
    opacity: 0.5;
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.frame-border {
    position: absolute;
    top: 20px;
    left: 20px;
    right: -20px;
    bottom: -20px;
    border: 2px solid var(--accent-primary);
    border-radius: 8px;
    z-index: -1;
    opacity: 0.3;
}

.experience {
    padding: 8rem 2rem;
    background:
        radial-gradient(ellipse 75% 50% at 50% -8%, rgba(184, 79, 134, 0.032), transparent 60%),
        radial-gradient(ellipse 45% 40% at 0% 85%, rgba(167, 139, 250, 0.04), transparent 52%),
        radial-gradient(ellipse 50% 40% at 100% 30%, rgba(56, 189, 248, 0.04), transparent 56%),
        var(--bg-primary);
}

.experience-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Same accent tokens as Education / Skills (cert-cell--accent-*). */
.experience-item {
    --exp-accent: var(--accent-primary);
    --exp-glow: rgba(0, 255, 136, 0.1);
    background: linear-gradient(165deg, rgba(22, 27, 34, 0.94) 0%, rgba(14, 17, 22, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 2px solid var(--exp-accent);
    border-radius: 12px;
    padding: 1.75rem 2rem 2rem;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 12px 32px rgba(0, 0, 0, 0.25);
    transition:
        border-color var(--transition-normal),
        box-shadow var(--transition-normal),
        transform var(--transition-normal);
}

.experience-item.cert-cell--accent-a {
    --exp-accent: var(--matrix-a);
    --exp-glow: rgba(184, 79, 134, 0.11);
    background:
        radial-gradient(ellipse 88% 55% at 0% 0%, rgba(184, 79, 134, 0.038) 0%, transparent 34%),
        linear-gradient(165deg, rgba(22, 27, 34, 0.94) 0%, rgba(14, 17, 22, 0.98) 100%);
}

.experience-item.cert-cell--accent-b {
    --exp-accent: var(--matrix-b);
    --exp-glow: rgba(56, 189, 248, 0.18);
    background:
        radial-gradient(ellipse 95% 70% at 0% 0%, rgba(56, 189, 248, 0.09) 0%, transparent 42%),
        linear-gradient(165deg, rgba(22, 27, 34, 0.94) 0%, rgba(14, 17, 22, 0.98) 100%);
}

/* Intern card only: neon white accent (orange reserved elsewhere for --matrix-c). */
.experience-item.cert-cell--accent-c {
    --exp-accent: #f4f8ff;
    --exp-glow: rgba(255, 255, 255, 0.32);
    background:
        radial-gradient(ellipse 95% 70% at 0% 0%, rgba(255, 255, 255, 0.065) 0%, transparent 42%),
        linear-gradient(165deg, rgba(22, 27, 34, 0.94) 0%, rgba(14, 17, 22, 0.98) 100%);
}

.experience-item.cert-cell--accent-c .skill-matrix-icon {
    color: rgba(244, 248, 255, 0.95);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.28));
}

.experience-item.cert-cell--accent-c .skill-matrix-highlight {
    border-bottom-color: rgba(255, 255, 255, 0.55);
}

.experience-item.cert-cell--accent-c .experience-date {
    color: #e8eef7;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.35);
}

.experience-item:hover {
    border-color: rgba(255, 255, 255, 0.12);
    border-left-color: var(--exp-accent);
    transform: translateY(-2px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 20px 48px rgba(0, 0, 0, 0.35),
        0 0 32px var(--exp-glow);
}

.experience-card-top {
    margin-bottom: 1rem;
}

.experience-card-top .category-header {
    margin-bottom: 0;
}

.experience-card-main {
    flex: 1;
    min-width: 0;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 0.75rem 1rem;
    margin-bottom: 0.35rem;
}

.experience-item .skill-matrix-title {
    margin: 0;
}

.experience-date {
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--exp-accent);
    text-align: right;
}

.experience-item.cert-cell--accent-a .experience-date {
    color: #c9a0b8;
}

.experience-company {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.experience-item .skill-snippet {
    margin-top: 0.25rem;
}

.experience-bullets {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0 0.35rem 0.85rem;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.experience-item.cert-cell--accent-a .experience-bullets {
    border-left-color: rgba(184, 79, 134, 0.22);
}

.experience-item.cert-cell--accent-b .experience-bullets {
    border-left-color: rgba(56, 189, 248, 0.32);
}

.experience-item.cert-cell--accent-c .experience-bullets {
    border-left-color: rgba(255, 255, 255, 0.38);
}

.experience-item.cert-cell--accent-c .experience-bullets li::before {
    background: #f6f9ff;
    box-shadow:
        0 0 14px rgba(255, 255, 255, 0.5),
        0 0 6px rgba(220, 235, 255, 0.45);
}

.experience-bullets li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Match cert / paper snippet body (JetBrains Mono) so label + list read as one block. */
.experience-bullets li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.45rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.5;
}

.experience-bullets li:last-child {
    margin-bottom: 0;
}

.experience-bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    background: var(--exp-accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--exp-glow);
}

@media (max-width: 520px) {
    .experience-header {
        flex-wrap: wrap;
    }

    .experience-date {
        width: 100%;
        text-align: left;
    }
}

.skills {
    padding: 8rem 2rem;
}

.skills-matrix,
.cert-matrix {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.cert-matrix + .cert-matrix {
    margin-top: 1.75rem;
}

.cert-matrix--formal {
    grid-template-columns: 1fr;
}

.skill-category,
.cert-cell {
    padding: 1.75rem 1.35rem;
    border-right: 1px solid var(--border-color);
    border-bottom: none;
    transition: background var(--transition-normal);
}

.skill-category:last-child,
.cert-cell:last-child {
    border-right: none;
}

.skill-category:hover,
.cert-cell:hover {
    background: rgba(0, 255, 136, 0.04);
}

.category-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.skill-matrix-icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    color: var(--text-muted);
}

.skill-matrix-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.skill-category--accent-a .skill-matrix-icon,
.cert-cell--accent-a .skill-matrix-icon,
.project-card--accent-a .project-header-matrix-icon {
    color: var(--matrix-a);
}

.skill-category--accent-b .skill-matrix-icon,
.cert-cell--accent-b .skill-matrix-icon,
.project-card--accent-b .project-header-matrix-icon {
    color: var(--matrix-b);
}

.skill-category--accent-c .skill-matrix-icon,
.cert-cell--accent-c .skill-matrix-icon,
.project-card--accent-c .project-header-matrix-icon {
    color: var(--matrix-c);
}

.skill-category--accent-d .skill-matrix-icon,
.cert-cell--accent-d .skill-matrix-icon,
.project-card--accent-d .project-header-matrix-icon,
.project-card--accent-d .project-placeholder-matrix-icon {
    color: var(--matrix-d);
}

.cert-cell--accent-formal .skill-matrix-icon {
    color: var(--accent-primary);
}

.skill-matrix-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    text-transform: none;
}

.skill-matrix-highlight {
    display: inline;
    padding-bottom: 0.12em;
    border-bottom: 2px solid transparent;
}

.skill-category--accent-a .skill-matrix-highlight,
.cert-cell--accent-a .skill-matrix-highlight {
    border-bottom-color: var(--matrix-a);
}

.skill-category--accent-b .skill-matrix-highlight,
.cert-cell--accent-b .skill-matrix-highlight {
    border-bottom-color: var(--matrix-b);
}

.skill-category--accent-c .skill-matrix-highlight,
.cert-cell--accent-c .skill-matrix-highlight {
    border-bottom-color: var(--matrix-c);
}

.skill-category--accent-d .skill-matrix-highlight,
.cert-cell--accent-d .skill-matrix-highlight {
    border-bottom-color: var(--matrix-d);
}

.cert-cell--accent-formal .skill-matrix-highlight {
    border-bottom-color: var(--accent-primary);
}

.skill-snippet {
    margin-top: 0.25rem;
}

.skill-snippet-open,
.skill-snippet-close {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    line-height: 1.5;
}

.skill-snippet-open {
    margin-bottom: 0.5rem;
    opacity: 0.85;
}

.skill-snippet-close {
    margin-top: 0.65rem;
    opacity: 0.55;
}

.skill-list {
    list-style: none;
}

.skill-list--snippet {
    margin: 0;
    padding: 0.35rem 0 0.35rem 0.85rem;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.skill-list--snippet li {
    position: relative;
    padding: 0.28rem 0;
    padding-left: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.skill-list--snippet li::before {
    content: '-';
    position: absolute;
    left: 0;
    color: var(--text-muted);
    opacity: 0.7;
}

.cert-snippet-text,
.paper-snippet .paper-description {
    margin: 0;
    padding: 0.35rem 0 0.35rem 0.85rem;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-secondary);
    text-align: left;
}

.paper-snippet {
    margin-top: 0.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.cert-badge {
    display: inline-block;
    margin-top: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #d2a8ff;
    background: rgba(210, 168, 255, 0.1);
    border: 1px solid rgba(210, 168, 255, 0.35);
    padding: 0.3rem 0.65rem;
    border-radius: 4px;
}

.edu-formal-inner {
    margin: 0;
    padding: 0.35rem 0 0.35rem 0.85rem;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.edu-formal-degree {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
}

.edu-formal-school {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.cert-matrix--formal .edu-formal-inner .edu-date {
    display: block;
    margin-top: 0.25rem;
}

@media (max-width: 1199px) {
    .skills-matrix,
    .cert-matrix:not(.cert-matrix--formal) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .skill-category,
    .cert-matrix:not(.cert-matrix--formal) .cert-cell {
        border-right: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
    }

    .skill-category:nth-child(2n),
    .cert-matrix:not(.cert-matrix--formal) .cert-cell:nth-child(2n) {
        border-right: none;
    }

    .skill-category:nth-child(n + 3),
    .cert-matrix:not(.cert-matrix--formal) .cert-cell:nth-child(n + 3) {
        border-bottom: none;
    }
}

.projects {
    padding: 8rem 2rem;
    background: var(--bg-secondary);
    overflow: visible;
}

/* Wide content band: same max-width across Projects, Papers, Education & Skills. */
.projects .container,
.papers .container,
.certifications .container,
.skills .container {
    max-width: min(1520px, 100%);
}

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

.projects-phone-row {
    position: relative;
    margin: 0 0 3rem;
    isolation: isolate;
    display: block;
    /*
     * Large-desktop-only 3D phone (≥1400px); see phone-showcase-config.json and phone-showcase-loader.js.
     */
    --phone-showcase-width: min(900px, 96vw);
    --phone-showcase-nudge-x: 0rem;
    --phone-showcase-nudge-y: 0rem;
    --phone-showcase-anchor-right: -2rem;
    --phone-showcase-row-gap: 1.25rem;
    --phone-showcase-aspect: 1080 / 2340;
    --phone-showcase-max-h: min(90vh, 1500px);
    --phone-showcase-mobile-max-w: min(100%, 96vw);
    --phone-video-decode-w: 1080px;
    --phone-video-decode-h: 2340px;
}

/* Cards stay full width and above the decorative phone (z-index). */
.projects-phone-row > .projects-grid--with-phone {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
}

.phone-showcase-standalone {
    position: absolute;
    top: var(--phone-showcase-nudge-y);
    right: var(--phone-showcase-anchor-right);
    width: var(--phone-showcase-width);
    max-width: 100%;
    margin: 0;
    transform: translateX(var(--phone-showcase-nudge-x));
    background: transparent;
    pointer-events: auto;
    z-index: var(--phone-showcase-z-index, 0);
    overflow: visible;
    /* Room under the canvas so the glow can sit in real layout space (not only under a higher z-index layer). */
    padding-bottom: clamp(3.4rem, 9vmin, 5.65rem);
}

/*
 * Ground glow under the 3D phone — same green as .cursor-glow. Static (no tilt sync); z-index above canvas.
 */
.phone-showcase-standalone::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: clamp(0.15rem, 1vmin, 0.5rem);
    width: 100%;
    max-width: 24rem;
    height: 10.125rem;
    z-index: 0;
    transform: translateX(-50%) translateY(-52%) scaleY(0.46);
    transform-origin: 50% 40%;
    border-radius: 50%;
    background:
        radial-gradient(
            ellipse 80% 68% at 50% 18%,
            rgba(0, 255, 136, 0.48) 0%,
            rgba(0, 255, 136, 0.15) 44%,
            transparent 64%
        ),
        radial-gradient(
            ellipse 100% 58% at 50% 70%,
            rgba(0, 255, 136, 0.14) 0%,
            rgba(0, 255, 136, 0.04) 50%,
            transparent 72%
        );
    filter: blur(42px);
    pointer-events: none;
    opacity: 0.88;
}

.project-card--phone-showcase {
    border-color: rgba(94, 234, 212, 0.25);
    overflow: visible;
}

.project-card--phone-showcase:hover {
    border-color: rgba(94, 234, 212, 0.5);
}

.project-content--phone-showcase {
    padding: 1.25rem 1.25rem 1.5rem;
    align-items: center;
    flex: 1;
    min-height: 0;
}

/*
 * 3D phone only on large desktop (≥1400px): overlay under the grid, anchored top-right.
 * Below that width the slot is display:none and phone-showcase-loader.js skips loading Three.js/video init.
 */
.project-phone-showcase-slot {
    display: none;
}

@media (max-width: 1399px) {
    .projects-phone-row > .projects-grid--with-phone {
        z-index: auto;
    }
}

@media (min-width: 1400px) {
    .project-phone-showcase-slot {
        display: block;
    }

    .projects-phone-row .projects-grid--with-phone > article {
        position: relative;
        z-index: 1;
    }

    .project-phone-showcase-slot.project-card {
        grid-column: 1 / -1;
        grid-row: 1 / -1;
        z-index: 0;
        margin: 0;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        pointer-events: none;
        overflow: visible;
    }

    .project-phone-showcase-slot.project-card:hover {
        transform: none;
        border: none;
        box-shadow: none;
    }

    .project-phone-showcase-slot .project-content--phone-showcase {
        padding: 0;
        height: 100%;
        align-items: stretch;
    }

    .project-phone-showcase-slot .phone-showcase-standalone {
        pointer-events: auto;
    }
}

.phone-showcase-viewport {
    position: relative;
    z-index: 3;
    width: 100%;
    aspect-ratio: var(--phone-showcase-aspect);
    max-height: var(--phone-showcase-max-h);
    margin: 0 auto;
    overflow: hidden;
    border: none;
    border-radius: 0;
    background: transparent;
}

.phone-showcase-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 0;
    pointer-events: none;
}

.phone-showcase-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
}

/* Off-screen decode size: set --phone-video-decode-w/h on .projects to match MP4 pixels. */
.phone-showcase-video {
    position: absolute;
    left: -10000px;
    top: 0;
    width: var(--phone-video-decode-w);
    height: var(--phone-video-decode-h);
    max-width: none;
    max-height: none;
    padding: 0;
    margin: 0;
    opacity: 0;
    border: 0;
    pointer-events: none;
}

.projects-demos-cta {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.project-demos-btn {
    margin-top: 1.25rem;
}

/* SMS project card: pulsing “Try Live Demo” only (demos stay discoverable per project) */
.project-card--live-demo .project-demos-btn > .btn-primary {
    animation: btnLiveDemoCTAPulse 1s ease-in-out infinite;
    will-change: filter, box-shadow;
}

.project-card--live-demo .project-demos-btn > .btn-primary:hover {
    animation-play-state: paused;
}

/* SMS demo page: Analyze (same pulse as portfolio “Try Live Demo”) */
#analyze-btn.btn-primary {
    animation: btnLiveDemoCTAPulse 1s ease-in-out infinite;
    will-change: filter, box-shadow;
}

#analyze-btn.btn-primary:hover:not(:disabled) {
    animation-play-state: paused;
}

#analyze-btn.btn-primary:disabled {
    animation: none;
    filter: none;
    will-change: auto;
}

.project-demos-btn--row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.projects .btn-primary {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.18);
}

.projects .btn-primary:hover {
    box-shadow: 0 0 28px rgba(0, 255, 136, 0.28);
}

.projects .btn-secondary {
    border-color: rgba(255, 255, 255, 0.35);
    color: #e4e4e7;
}

.projects .btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(0, 255, 136, 0.08);
}

.project-card {
    border-radius: 12px;
    overflow: hidden;
    transition:
        border-color var(--transition-normal),
        box-shadow var(--transition-normal),
        transform var(--transition-normal);
}

/* Tech-noir panels: charcoal card, cyan edge on hover (Featured Projects grid). */
.projects .project-card:not(.project-phone-showcase-slot) {
    background: linear-gradient(165deg, rgba(22, 27, 34, 0.94) 0%, rgba(14, 17, 22, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 12px 32px rgba(0, 0, 0, 0.25);
}

.projects .project-card:not(.project-phone-showcase-slot):hover {
    border-color: rgba(0, 229, 255, 0.38);
    transform: translateY(-4px);
    box-shadow:
        0 0 0 1px rgba(0, 212, 255, 0.1),
        0 20px 48px rgba(0, 0, 0, 0.35),
        0 0 28px rgba(0, 212, 255, 0.06);
}

.project-card--live-demo {
    border-color: rgba(94, 234, 212, 0.4) !important;
    box-shadow:
        0 0 0 1px rgba(94, 234, 212, 0.12),
        0 12px 32px rgba(0, 0, 0, 0.25) !important;
    overflow: visible;
}

.project-card--live-demo:hover {
    border-color: rgba(94, 234, 212, 0.75) !important;
    box-shadow:
        0 0 0 1px rgba(94, 234, 212, 0.2),
        0 20px 52px rgba(94, 234, 212, 0.14) !important;
}

.project-card.featured {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
}

@media (min-width: 1280px) {
    .projects-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem 1.5rem;
    }

    .project-card.featured {
        grid-column: span 3;
    }
}

.project-image {
    background: linear-gradient(180deg, #0d1117 0%, #07090d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.project-card.featured .project-image {
    position: relative;
}

.project-card.featured .project-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(167, 139, 250, 0.09), transparent 65%);
    pointer-events: none;
}

.project-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.92;
}

.project-placeholder-matrix-icon {
    width: 4.25rem;
    height: 4.25rem;
    flex-shrink: 0;
}

.project-placeholder-matrix-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

@media (max-width: 1024px) {
    .project-card.featured .project-image {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
}

.project-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.project-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.project-header-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.project-scope {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.3rem 0.55rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    line-height: 1.2;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
}

.project-scope--capstone {
    color: #c4b5fd;
    background: rgba(123, 97, 255, 0.14);
    border-color: rgba(123, 97, 255, 0.45);
}

.project-scope--production {
    color: #86efac;
    background: rgba(0, 255, 136, 0.12);
    border-color: rgba(0, 255, 136, 0.42);
}

.project-scope--coursework {
    color: #d8b4fe;
    background: rgba(167, 139, 250, 0.12);
    border-color: rgba(167, 139, 250, 0.4);
}

.project-scope--live {
    color: #5eead4;
    background: rgba(94, 234, 212, 0.14);
    border-color: rgba(94, 234, 212, 0.5);
}

.project-scope--live.project-scope--live--ok {
    animation: livePulse 2.4s ease-in-out infinite;
}

.project-scope--live.project-scope--live--pending {
    color: #a1a1aa;
    background: rgba(161, 161, 170, 0.1);
    border-color: rgba(161, 161, 170, 0.35);
}

.project-scope--live.project-scope--live--warn {
    color: #fcd34d;
    background: rgba(252, 211, 77, 0.12);
    border-color: rgba(252, 211, 77, 0.4);
}

.project-scope--live.project-scope--live--offline {
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.35);
}

.project-scope--redteam {
    color: #f0a0a0;
    background: rgba(240, 160, 160, 0.1);
    border-color: rgba(240, 160, 160, 0.4);
}

.folder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.88;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.project-header-matrix-icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.35rem;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.project-header-matrix-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.project-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.project-links .project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    transition:
        color var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast);
}

.project-links .project-link:hover {
    color: var(--accent-secondary);
    border-color: rgba(0, 212, 255, 0.35);
    background: rgba(0, 212, 255, 0.08);
}

.project-link {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.project-link:hover {
    color: var(--accent-primary);
}

.project-link svg {
    width: 18px;
    height: 18px;
}

/* Match Education matrix / Papers: Inter title, JetBrains body (snippet). */
.project-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-description {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.project-tech li {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #67e8f9;
    background: rgba(0, 45, 52, 0.55);
    border: 1px solid rgba(0, 212, 255, 0.28);
    padding: 0.32rem 0.65rem;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.04);
}

.projects-coming-soon {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-color);
}

.projects-coming-soon-heading {
    font-size: 1rem;
    font-weight: 600;
    color: #ff9f0a;
    margin: 0 0 0.5rem;
    letter-spacing: 0.04em;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
}

.projects-coming-soon-lead {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 1.25rem;
    max-width: 42rem;
    line-height: 1.55;
}

.projects-coming-soon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.project-card--soon {
    cursor: default;
    opacity: 0.95;
}

.project-card--soon:hover {
    transform: none;
    border-color: rgba(255, 159, 10, 0.25) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25) !important;
}

.project-scope--soon {
    color: #fdba74;
    background: rgba(255, 159, 10, 0.1);
    border-color: rgba(255, 159, 10, 0.42);
}

.page-demo {
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse 65% 45% at 8% 30%, rgba(167, 139, 250, 0.05) 0%, transparent 54%),
        radial-gradient(ellipse 50% 42% at 92% 75%, rgba(56, 189, 248, 0.035) 0%, transparent 52%),
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 255, 136, 0.06), transparent),
        var(--bg-primary);
}

/*
 * project-demos.html — viewports ≤720px: compact tool-first layout for phones / OBS.
 * Wide layouts unchanged (see .demo-layout min-width: 1025px).
 */
@media (max-width: 720px) {
    .page-demo .demo-verbose-only {
        display: none;
    }

    .page-demo .demo-output-sub,
    .page-demo .demo-output-disclaimer {
        display: none;
    }

    .page-demo .demo-highlight-explainer {
        display: none;
    }

    .page-demo .demo-output-header {
        padding-bottom: 0.35rem;
    }
}

.demo-main {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 7rem max(1.25rem, env(safe-area-inset-left)) 4rem max(1.25rem, env(safe-area-inset-right));
    position: relative;
    z-index: 1;
}

.project-demos {
    padding: 0 0 3rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

.demo-container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.demo-hero {
    text-align: left;
    margin-bottom: 2.5rem;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.demo-hero-surface {
    padding: 1.35rem 1.5rem 1.6rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 2px solid rgba(56, 189, 248, 0.48);
    background:
        radial-gradient(ellipse 90% 80% at 0% 0%, rgba(56, 189, 248, 0.06) 0%, transparent 45%),
        linear-gradient(165deg, rgba(22, 27, 34, 0.92) 0%, rgba(14, 17, 22, 0.98) 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 14px 36px rgba(0, 0, 0, 0.24);
}

.demo-hero-top {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.demo-hero-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(167, 139, 250, 0.92);
}

.demo-hero-title {
    margin: 0 0 0.95rem;
    font-size: clamp(1.85rem, 4.5vw, 2.45rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.12;
    color: var(--text-primary);
}

.demo-lead {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.75;
}

.demo-lead-tight {
    max-width: 48rem;
    margin-left: 0;
    margin-right: 0;
    line-height: 1.65;
}

.demo-hero-meta {
    font-size: 0.9rem;
    margin-top: 0.85rem;
    color: var(--text-secondary);
    text-align: left;
}

.demo-hero-meta a {
    color: var(--accent-primary);
    text-decoration: none;
}

.demo-hero-meta a:hover {
    text-decoration: underline;
}

.demo-explainer-after {
    margin-top: 3rem;
    padding-top: 2.25rem;
    border-top: 1px solid var(--border-color);
}

.demo-explainer-compact {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
}

.demo-explainer-compact-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 42rem;
}

.demo-explainer-compact-text a {
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.35);
}

.demo-explainer-compact-text a:hover {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.demo-explainer-muted {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 400;
}

.demo-static-offline {
    margin: 1rem 0 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.22);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.demo-static-offline-lead {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    line-height: 1.55;
}

.demo-static-offline-scroll {
    overflow-x: auto;
}

.demo-static-offline-table {
    width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
}

.demo-static-offline-table th,
.demo-static-offline-table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.demo-misconceptions-single {
    max-width: 42rem;
    margin: 0 auto 1rem;
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 0.92rem;
}

.demo-lead strong {
    color: var(--text-primary);
    font-weight: 600;
}

.demo-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2.75rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.demo-hero-card {
    padding: 1.1rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.22);
    text-align: left;
}

.demo-hero-card-title {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-secondary);
    margin: 0 0 0.5rem;
}

.demo-hero-card-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

.demo-hero-card-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.demo-hero-card-list li {
    margin-bottom: 0.35rem;
}

.demo-hero-card-list li:last-child {
    margin-bottom: 0;
}

.demo-hero-card-list a {
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.35);
    font-size: 0.9rem;
}

.demo-hero-card-list a:hover {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.demo-note {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.demo-note-block {
    display: block;
    margin-top: 0.6rem;
}

.demo-api-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    max-width: 1200px;
    margin: 0 auto 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.88rem;
    line-height: 1.5;
    text-align: left;
    color: var(--text-secondary);
}

.demo-api-banner-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.demo-api-banner-primary {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
}

.demo-api-banner-detail {
    display: block;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.demo-api-banner-detail code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent-secondary);
    background: rgba(0, 212, 255, 0.08);
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
}

.demo-api-inline-details {
    margin-top: 0.35rem;
}

.demo-api-inline-details > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-secondary);
}

.demo-api-inline-details > summary::-webkit-details-marker {
    display: none;
}

.demo-api-inline-details .demo-api-banner-detail {
    display: block;
    margin-top: 0.45rem;
}

.demo-api-banner-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 0.35rem;
    border-radius: 50%;
    background: var(--text-muted);
}

.demo-api-banner--pending .demo-api-banner-dot {
    background: var(--accent-secondary);
    animation: demo-api-pulse 1.2s ease-in-out infinite;
}

.demo-api-banner--ok {
    border-color: rgba(0, 255, 136, 0.35);
    background: rgba(0, 255, 136, 0.06);
}

.demo-api-banner--ok .demo-api-banner-dot {
    background: var(--accent-primary);
    animation: none;
}

.demo-api-banner--warn {
    border-color: rgba(255, 180, 80, 0.4);
    background: rgba(255, 180, 80, 0.08);
}

.demo-api-banner--warn .demo-api-banner-dot {
    background: #ffb050;
    animation: none;
}

@keyframes demo-api-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.35;
    }
}

.demo-note a {
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.35);
}

.demo-note a:hover {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.demo-note code {
    font-size: 0.82em;
    color: var(--text-secondary);
}

.model-readme {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.model-readme-heading {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 0.65rem;
}

.model-readme-heading:first-child {
    margin-top: 0;
}

.model-readme-p {
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.75;
    margin: 0 0 0.5rem;
}

.model-readme-list {
    margin: 0.25rem 0 0.85rem 1.25rem;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.75;
}

.model-readme-list li {
    margin-bottom: 0.35rem;
}

.model-readme-foot {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.model-artifacts-list a {
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.35);
}

.model-artifacts-list a:hover {
    color: var(--accent-primary);
}

.demo-artifacts-hint {
    margin: 0.75rem 0 0;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.demo-artifacts-hint a {
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.35);
}

.demo-artifacts-hint a:hover {
    color: var(--accent-primary);
}

.model-engineering {
    margin-bottom: 1.5rem;
}

.model-failure {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.model-compare-wrap {
    overflow-x: auto;
    margin: 0.75rem 0 1rem;
    -webkit-overflow-scrolling: touch;
}

.model-compare-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.model-compare-table th,
.model-compare-table td {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.65rem;
    text-align: left;
    vertical-align: top;
}

.model-compare-table thead th {
    background: rgba(0, 255, 136, 0.08);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.model-tradeoff-note {
    margin-top: 1rem;
}

.demo-latency-line {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* Spam CNN pipeline walkthrough */
.demo-pipeline {
    max-width: 1200px;
    margin: 0 auto 1.5rem;
    padding: 1.1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.25);
}

.demo-pipeline-title {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

.demo-pipeline-lead {
    margin: 0 0 1rem;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.demo-pipeline-svg-wrap {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

.demo-pipeline-svg-wrap svg,
.demo-pipeline-svg-wrap img {
    display: block;
    min-width: 640px;
    max-width: none;
    width: 100%;
    height: auto;
    color: var(--accent-primary);
}

.demo-pipeline-steps {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
}

.demo-pipeline-steps li {
    margin-bottom: 0.4rem;
}

.demo-pipeline-steps strong {
    color: var(--text-primary);
    font-weight: 600;
}

.demo-pipeline-foot {
    margin: 0.85rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.demo-pipeline-foot a {
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.35);
}

.demo-pipeline-foot a:hover {
    color: var(--accent-primary);
}

.demo-pipeline--crosslink {
    padding: 0.85rem 1.15rem;
}

.demo-pipeline-crosslink-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.demo-pipeline-crosslink-text a {
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.35);
}

.demo-pipeline-crosslink-text a:hover {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

details.demo-misconceptions.demo-disclosure {
    max-width: 1200px;
    margin: 0 auto 1.75rem;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
}

details.demo-misconceptions > summary {
    list-style: none;
    padding: 0.85rem 1rem;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

details.demo-misconceptions > summary::-webkit-details-marker {
    display: none;
}

.demo-disclosure-body {
    padding: 0 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-misconceptions--top {
    margin-top: 0;
}

.demo-misconceptions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.demo-misconception-card {
    padding: 1.1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.demo-misconception-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent-primary);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.demo-misconception-heading {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.demo-misconception-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0.2rem 0 0;
}

.demo-misconception-body em {
    font-style: normal;
    color: var(--text-primary);
    font-weight: 500;
}

@media (max-width: 640px) {
    .demo-misconceptions-grid {
        grid-template-columns: 1fr;
    }
}

/* Disclaimer block */
.demo-disclaimer {
    margin-top: 1rem;
    padding: 0.85rem 1.1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 200, 80, 0.18);
    background: rgba(255, 200, 80, 0.025);
    width: 100%;
}

.demo-disclaimer-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgba(255, 200, 80, 0.7);
    margin-bottom: 0.5rem;
}

.demo-disclaimer-body {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 0.35rem;
}

.demo-disclaimer-purpose {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.25);
    line-height: 1.5;
    margin: 0.6rem 0 0;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Small output panel disclaimer note */
.demo-output-disclaimer {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.6;
    margin: 0.2rem 0 0;
}

.demo-random-label {
    font-size: 0.75rem;
    margin: 0.35rem 0 0;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    display: inline-block;
    font-family: var(--font-mono);
    border: 1px solid transparent;
}
.demo-random-label {
    color: var(--text-muted);
    border-color: var(--border-color);
}

details.demo-credibility {
    max-width: 1200px;
    margin: 0 auto 1rem;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 200, 80, 0.25);
    background: rgba(255, 200, 80, 0.06);
}

.demo-credibility--top {
    margin-bottom: 1.75rem;
}

details.demo-credibility > summary {
    list-style: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
}

details.demo-credibility > summary::-webkit-details-marker {
    display: none;
}

.demo-credibility-summary {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.demo-credibility-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.05rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: rgba(34, 197, 94, 0.85);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
}

#demo-credibility-toggle-label {
    margin: 0;
    flex: 1;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.45;
}

.demo-credibility-panel {
    margin: 0;
    padding: 0 1rem 1rem;
    border-top: 1px solid rgba(255, 200, 80, 0.2);
}

.demo-credibility-title {
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 200, 80, 0.9);
}

.demo-credibility-text {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.model-arch-figure {
    margin: 1rem 0 0;
    text-align: center;
}

.model-arch-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.model-arch-caption {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.model-arch-fallback {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-muted);
    text-align: left;
}

.demo-card-wide {
    background:
        radial-gradient(ellipse 95% 70% at 0% 0%, rgba(56, 189, 248, 0.05) 0%, transparent 42%),
        linear-gradient(165deg, rgba(22, 27, 34, 0.94) 0%, rgba(14, 17, 22, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 2px solid rgba(56, 189, 248, 0.55);
    border-radius: 12px;
    padding: 1.75rem 2rem 2rem;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 12px 32px rgba(0, 0, 0, 0.22);
}

/* Mobile-first: single column, DOM order = message → analysis → batch (readable on phones). */
.demo-layout {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    width: 100%;
}

.demo-panel-batch-column .demo-inbox {
    margin-top: 0;
}

@media (min-width: 1025px) {
    .demo-layout {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto auto;
        align-items: stretch;
        gap: 1.75rem;
    }

    .demo-input-column {
        grid-column: 1;
        grid-row: 1;
    }

    .demo-panel-batch-column {
        grid-column: 1;
        grid-row: 2;
    }

    .demo-output-column {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

.demo-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.demo-panel-input {
    gap: 1.25rem;
}

.demo-panel-output {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.35rem;
    gap: 1rem;
}

.demo-output-header {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.demo-output-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
}

.demo-output-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.demo-terminal {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.demo-terminal-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.75rem 0.75rem 0.85rem;
}

.demo-input-shell {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.demo-input-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.demo-input-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.demo-random-btn {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0.15rem 0.55rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    line-height: 1.6;
}
.demo-random-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(0, 255, 136, 0.06);
}

.demo-terminal-chrome {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.demo-terminal-prompt {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--accent-primary);
    letter-spacing: 0.01em;
    user-select: none;
}

.demo-terminal-label {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.demo-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    color-scheme: dark;
    padding: 0.85rem 0.95rem;
    resize: vertical;
    min-height: 200px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.55;
}

.demo-input::placeholder {
    color: var(--text-muted);
    opacity: 0.85;
}

.demo-input:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(0, 255, 136, 0.25);
}

.demo-highlight-wrap {
    margin: 0;
    padding: 0.75rem 0.85rem 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 136, 0.22);
    border-top: 3px solid rgba(0, 255, 136, 0.45);
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.06) 0%, rgba(0, 0, 0, 0.28) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 4px 14px rgba(0, 0, 0, 0.35);
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-primary);
    overflow: visible;
}

.demo-highlight-explainer {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0.5rem 0 0.65rem;
}

.demo-highlight-explainer-intro {
    margin: 0 0 0.45rem;
}

.demo-highlight-explainer-bullets {
    margin: 0 0 0.4rem;
    padding-left: 0.75rem;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.demo-highlight-explainer-bullets li {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.demo-highlight-explainer-bullets li::before {
    content: "";
    flex-shrink: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 200, 80, 0.7);
    margin-top: 0.38em;
}

.demo-highlight-explainer strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.demo-highlight-sample-wrap {
    display: inline-block;
    background: #0e0e16;
    border-radius: 3px;
    padding: 0 0.05em;
    line-height: 1.4;
    vertical-align: baseline;
}

.demo-highlight-sample {
    background: rgba(255, 200, 80, 0.55);
    color: #e4e4e7;
    padding: 0.05em 0.22em;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 200, 80, 0.35);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    font-size: 0.78rem;
    font-style: normal;
    font-family: 'JetBrains Mono', monospace;
}

.demo-highlight-why {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0.35rem 0 0;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    border-left: 3px solid rgba(0, 212, 255, 0.45);
    background: rgba(0, 0, 0, 0.18);
}

.demo-highlight-why[hidden] {
    display: none !important;
}

.demo-highlight-body {
    font-family: 'JetBrains Mono', monospace;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 180px;
    overflow-y: auto;
}

.demo-highlight-wrap[hidden] {
    display: none !important;
}

.demo-highlight-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(0, 255, 136, 0.15);
}

.demo-highlight-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(0, 255, 136, 0.85);
    font-family: 'Inter', sans-serif;
}

.how-it-works-link {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: 20px;
    padding: 0.2em 0.75em;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--accent-secondary);
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    line-height: 1.6;
}
.how-it-works-link:hover {
    background: rgba(0, 212, 255, 0.16);
    border-color: rgba(0, 212, 255, 0.55);
    color: #fff;
}

/* How-it-works modal styles live in project-demos.html <style> tag */

.demo-highlight-sublabel {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    font-size: 0.68rem;
}

.demo-highlight-wrap mark.signal-hit {
    background: rgba(255, 200, 80, 0.55);
    color: inherit;
    padding: 0 0.12em;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 200, 80, 0.35);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.demo-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
}

.demo-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
}

.demo-actions-row .btn {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
}

.demo-actions .demo-actions-report {
    width: 100%;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}

.demo-inbox {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.demo-inbox-toggle {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px dashed rgba(0, 212, 255, 0.35);
    background: rgba(0, 212, 255, 0.06);
    color: var(--accent-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    cursor: pointer;
    text-align: left;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.demo-inbox-toggle:hover {
    border-color: rgba(0, 255, 136, 0.45);
    background: rgba(0, 255, 136, 0.06);
    color: var(--accent-primary);
}

.demo-inbox-panel {
    margin-top: 0.85rem;
}

.demo-inbox-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
}

.demo-input-batch {
    min-height: 120px;
    font-size: 0.82rem;
    line-height: 1.5;
}

.demo-inbox-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.65rem;
}

.demo-batch-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.demo-batch-results {
    margin-top: 0.85rem;
}

.demo-batch-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.demo-batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    line-height: 1.4;
}

.demo-batch-table th,
.demo-batch-table td {
    padding: 0.5rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.demo-batch-table th {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.25);
}

.demo-batch-table tr:last-child td {
    border-bottom: none;
}

.demo-batch-snippet {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    max-width: 280px;
}

.demo-batch-label--spam {
    color: #ff9b7a;
    font-weight: 600;
}

.demo-batch-label--ham {
    color: var(--accent-primary);
    font-weight: 600;
}

.demo-batch-label--uncertain {
    color: #ffd080;
    font-weight: 600;
}

.demo-batch-label--err {
    color: #f59e0b;
}

/* Demo page — phones & narrow DevTools (OBS screen capture) */
@media (max-width: 640px) {
    .page-demo .demo-main {
        padding: 5.25rem max(1rem, env(safe-area-inset-left)) max(2.5rem, env(safe-area-inset-bottom))
            max(1rem, env(safe-area-inset-right));
    }

    .page-demo .project-demos {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }

    .page-demo .demo-hero {
        margin-bottom: 1.35rem;
        text-align: left;
    }

    .page-demo .demo-hero-title {
        font-size: clamp(1.45rem, 6.5vw, 1.95rem);
    }

    .page-demo .demo-hero-surface {
        padding: 1.15rem 1.15rem 1.35rem;
    }

    .page-demo .demo-lead {
        font-size: 0.94rem;
        line-height: 1.65;
    }

    .page-demo .demo-lead-tight {
        margin-left: 0;
        margin-right: 0;
    }

    .page-demo .demo-hero-meta {
        font-size: 0.78rem;
        line-height: 1.55;
        text-align: left;
        word-break: break-word;
    }

    .page-demo #demo-credibility-toggle-label {
        line-height: 1.35;
    }

    .page-demo .demo-api-banner {
        padding: 0.65rem 0.85rem;
        font-size: 0.82rem;
        align-items: center;
    }

    .page-demo .demo-card-wide {
        padding: 1.05rem 0.9rem;
        border-radius: 12px;
    }

    .page-demo .demo-layout {
        gap: 1.2rem;
    }

    .page-demo .demo-panel-output {
        padding: 1rem 0.95rem;
    }

    .page-demo .demo-terminal-chrome {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        padding: 0.65rem 0.75rem;
    }

    .page-demo .demo-terminal-label {
        margin-left: 0;
        align-self: flex-end;
        font-size: 0.68rem;
    }

    .page-demo .demo-terminal-prompt {
        font-size: 0.66rem;
        line-height: 1.35;
        word-break: break-word;
    }

    .page-demo .demo-input-shell {
        padding: 0.55rem 0.65rem 0.65rem;
    }

    .page-demo .demo-input {
        min-height: 9.5rem;
        padding: 0.7rem 0.8rem;
        font-size: 16px;
        line-height: 1.5;
    }

    .page-demo .demo-input-batch {
        min-height: 6.5rem;
        font-size: 16px;
    }

    .page-demo .demo-highlight-body {
        max-height: min(42vh, 14rem);
    }

    .page-demo .demo-highlight-label-row {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.45rem 0.5rem;
    }

    .page-demo .how-it-works-link {
        white-space: normal;
        text-align: center;
        line-height: 1.35;
    }

    .page-demo .demo-actions {
        gap: 0.55rem;
    }

    .page-demo .demo-actions-row {
        grid-template-columns: 1fr;
    }

    .page-demo .demo-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
        box-sizing: border-box;
    }

    .page-demo .demo-inbox-toggle {
        min-height: 48px;
        font-size: 0.8rem;
    }

    .page-demo .demo-batch-snippet {
        max-width: 100%;
    }

    .page-demo .demo-result-empty {
        min-height: 11rem;
        padding: 1.35rem 0.85rem;
    }

    .page-demo .verdict-text {
        font-size: 1.05rem;
    }

    .page-demo .confidence-row {
        flex-wrap: wrap;
        gap: 0.35rem 0.75rem;
    }

    .page-demo .demo-inference-pre {
        font-size: 0.68rem;
        padding: 0.55rem 0.6rem;
    }

    .page-demo .demo-pipeline {
        padding: 0.95rem 0.9rem;
    }

    .page-demo .demo-pipeline-svg-wrap svg,
    .page-demo .demo-pipeline-svg-wrap img {
        min-width: min(100%, 380px);
    }

    .page-demo .demo-hero-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) and (max-height: 740px) {
    .page-demo .demo-main {
        padding-top: 4.75rem;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.demo-result-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
    min-height: 220px;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.demo-result-empty[hidden],
#demo-result-empty[hidden] {
    display: none !important;
}

#demo-result[hidden] {
    display: none !important;
}

.demo-empty-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
    opacity: 0.5;
    margin-bottom: 0.75rem;
}

.demo-empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.demo-empty-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 22rem;
    margin: 0;
}

.demo-result {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    min-height: 0;
}

.verdict-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.verdict-badge[data-verdict="spam"] {
    border-color: rgba(255, 90, 90, 0.45);
    background: linear-gradient(135deg, rgba(255, 90, 90, 0.12), transparent);
    box-shadow: 0 0 24px rgba(255, 90, 90, 0.08);
}

.verdict-badge[data-verdict="ham"] {
    border-color: rgba(0, 255, 136, 0.35);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), transparent);
    box-shadow: 0 0 24px rgba(0, 255, 136, 0.06);
}

.verdict-badge[data-verdict="neutral"] {
    border-color: var(--border-color);
}

.verdict-badge[data-verdict="uncertain"] {
    border-color: rgba(255, 200, 80, 0.45);
    background: linear-gradient(135deg, rgba(255, 200, 80, 0.1), transparent);
    box-shadow: 0 0 24px rgba(255, 200, 80, 0.06);
}

.verdict-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.verdict-badge[data-verdict="spam"] .verdict-text {
    color: #ff8a8a;
}

.verdict-badge[data-verdict="ham"] .verdict-text {
    color: var(--accent-primary);
}

.verdict-badge[data-verdict="neutral"] .verdict-text {
    color: var(--text-secondary);
}

.verdict-badge[data-verdict="uncertain"] .verdict-text {
    color: #ffd080;
}

.demo-confidence-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.confidence-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.confidence-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.confidence-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.confidence-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-secondary);
}

.confidence-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width 0.45s ease, background var(--transition-normal);
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.confidence-fill.is-spam {
    background: linear-gradient(90deg, #ff6b6b, #ff9f7a);
}

.confidence-fill.is-ham {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.confidence-fill.is-uncertain {
    background: linear-gradient(90deg, rgba(255, 200, 80, 0.85), rgba(255, 160, 60, 0.75));
}

/* Why this result explanation layer */
.demo-why-section {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.025);
}

.demo-why-section[hidden] {
    display: none !important;
}

.demo-why-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 0.6rem;
}

.demo-why-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.demo-why-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.demo-why-dot {
    flex-shrink: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-muted);
    margin-top: 0.48em;
    transition: background var(--transition-normal);
}

.demo-why-section[data-verdict="spam"] {
    border-color: rgba(255, 90, 90, 0.25);
    background: rgba(255, 90, 90, 0.04);
}

.demo-why-section[data-verdict="spam"] .demo-why-dot {
    background: #ff8a8a;
}

.demo-why-section[data-verdict="ham"] {
    border-color: rgba(0, 255, 136, 0.2);
    background: rgba(0, 255, 136, 0.03);
}

.demo-why-section[data-verdict="ham"] .demo-why-dot {
    background: var(--accent-primary);
}

.demo-why-section[data-verdict="uncertain"] {
    border-color: rgba(255, 200, 80, 0.25);
    background: rgba(255, 200, 80, 0.04);
}

.demo-why-section[data-verdict="uncertain"] .demo-why-dot {
    background: #ffd080;
}

.demo-why-signals {
    margin-top: 2.2rem !important;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.demo-why-signals[hidden] {
    display: none !important;
}

/* Signal cards inside why section inherit verdict color */
.demo-why-signals .signal-card {
    background: rgba(0, 0, 0, 0.18);
}

/* Spam */
.demo-why-section[data-verdict="spam"] .demo-why-signals .signal-card {
    border-color: rgba(255, 138, 138, 0.2);
}
.demo-why-section[data-verdict="spam"] .demo-why-signals .signal-chevron,
.demo-why-section[data-verdict="spam"] .demo-why-signals .signal-explain {
    color: #ff8a8a;
}
.demo-why-section[data-verdict="spam"] .demo-why-signals .signal-explain {
    border-color: rgba(255, 138, 138, 0.35);
    background: rgba(255, 138, 138, 0.08);
}

/* Ham */
.demo-why-section[data-verdict="ham"] .demo-why-signals .signal-card {
    border-color: rgba(0, 255, 136, 0.18);
}
.demo-why-section[data-verdict="ham"] .demo-why-signals .signal-chevron,
.demo-why-section[data-verdict="ham"] .demo-why-signals .signal-explain {
    color: var(--accent-primary);
}
.demo-why-section[data-verdict="ham"] .demo-why-signals .signal-explain {
    border-color: rgba(0, 255, 136, 0.3);
    background: rgba(0, 255, 136, 0.07);
}

/* Uncertain */
.demo-why-section[data-verdict="uncertain"] .demo-why-signals .signal-card {
    border-color: rgba(255, 208, 128, 0.2);
}
.demo-why-section[data-verdict="uncertain"] .demo-why-signals .signal-chevron,
.demo-why-section[data-verdict="uncertain"] .demo-why-signals .signal-explain {
    color: #ffd080;
}
.demo-why-section[data-verdict="uncertain"] .demo-why-signals .signal-explain {
    border-color: rgba(255, 208, 128, 0.35);
    background: rgba(255, 208, 128, 0.08);
}

.signals-block {
    padding-top: 0.25rem;
}

.signals-heading {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 0.65rem;
}

.result-signals {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.result-signals .signal-row {
    list-style: none;
}

.signal-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
    transition: border-color var(--transition-normal);
}

.signal-row:hover .signal-card {
    border-color: rgba(0, 255, 136, 0.25);
}

.signal-row.is-open .signal-card {
    border-color: rgba(0, 212, 255, 0.35);
}

.signal-toggle {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-secondary);
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 0;
}

.signal-toggle:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

.signal-chevron {
    flex-shrink: 0;
    margin-right: 0.35rem;
    color: var(--accent-primary);
    font-weight: 700;
    transition: transform 0.2s ease;
    display: inline-block;
}

.signal-row.is-open .signal-chevron {
    transform: rotate(90deg);
}

.signal-summary-text {
    flex: 1;
    min-width: 0;
}

.signal-explain {
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: rgba(0, 212, 255, 0.08);
}

.signal-detail {
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.22);
}

.signal-detail[hidden] {
    display: none !important;
}

.signal-detail-inner {
    padding: 0.75rem 0.85rem 0.9rem 2.15rem;
}

.signal-detail-inner p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.signal-detail-pre {
    white-space: pre-wrap;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.78rem;
    line-height: 1.55;
}

.demo-inference-trace {
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.25);
    background: rgba(0, 0, 0, 0.35);
    text-align: left;
}

.demo-inference-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.demo-inference-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    color: var(--bg-primary);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

.demo-inference-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0 0 0.65rem;
    line-height: 1.45;
}

.demo-inference-pre {
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--accent-primary);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.demo-inference-flags {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.demo-inference-flags li {
    margin-bottom: 0.35rem;
}

.demo-inference-flags code {
    font-size: 0.85em;
    color: var(--accent-secondary);
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.demo-grid.single-demo {
    grid-template-columns: minmax(280px, 760px);
    justify-content: center;
}

.demo-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.demo-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 255, 136, 0.08);
}

.demo-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.demo-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    flex-grow: 1;
}

.demo-playground {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.demo-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent-secondary);
}

.prediction-spam {
    color: #ff7a7a;
    font-weight: 700;
}

.prediction-ham {
    color: var(--accent-primary);
    font-weight: 700;
}

.papers {
    padding: 8rem 2rem;
}

.papers .container {
    min-width: 0;
}

.papers .section-intro {
    margin-bottom: 1.75rem;
}

.papers-carousel-outer {
    margin-top: 0.25rem;
    position: relative;
    width: 100%;
    min-width: 0;
}

.papers-carousel-viewport {
    width: 100%;
    min-width: 0;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-behavior: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5rem 0 1rem;
    cursor: grab;
    outline: none;
}

.papers-carousel-viewport::-webkit-scrollbar {
    display: none;
}

.papers-carousel-viewport:active {
    cursor: grabbing;
}

.papers-carousel-viewport:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 4px;
    border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .papers-carousel-viewport {
        scrollbar-width: thin;
    }
}

.papers-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 1.35rem;
    width: max-content;
    min-height: 100%;
}

/* Narrow cards; carousel viewport still spans the full papers container width. */
.papers-carousel-viewport .paper-card {
    flex: 0 0 auto;
    width: min(26rem, calc(100vw - 4rem));
    max-width: 26rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.papers-carousel-viewport .paper-card .paper-snippet {
    flex-grow: 1;
}

.paper-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem 1.85rem 1.75rem;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.paper-card:hover {
    border-color: rgba(0, 212, 255, 0.35);
    box-shadow:
        0 0 0 1px rgba(0, 212, 255, 0.06),
        0 20px 48px rgba(0, 0, 0, 0.35);
}

.paper-header {
    margin-bottom: 1rem;
}

.paper-header-main {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    width: 100%;
}

.paper-scope {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.35;
    padding: 0.32rem 0.65rem;
    border-radius: 4px;
    border: 1px solid transparent;
    max-width: 58%;
}

.paper-scope--accent-a {
    color: #d9a0c0;
    background: rgba(184, 79, 134, 0.08);
    border-color: rgba(184, 79, 134, 0.34);
}

.paper-scope--accent-b {
    color: #7dd3fc;
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.42);
}

.paper-scope--accent-c {
    color: #fdba74;
    background: rgba(251, 146, 60, 0.11);
    border-color: rgba(251, 146, 60, 0.45);
}

.paper-scope--accent-d {
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.11);
    border-color: rgba(167, 139, 250, 0.42);
}

.paper-scope--accent-e {
    color: var(--accent-primary);
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.4);
}

.paper-meta {
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Same as .skill-matrix-title (Education / Skills matrix). */
.paper-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
}

.paper-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.35rem;
    margin-top: auto;
    padding-top: 1.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.paper-actions .paper-link {
    margin-top: 0;
}

.paper-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.paper-link:hover {
    color: #5ee9ff;
    border-bottom-color: rgba(0, 212, 255, 0.55);
}

.paper-link--aux {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.paper-link--aux:hover {
    color: var(--accent-secondary);
    border-bottom-color: rgba(0, 212, 255, 0.45);
}

@media (max-width: 380px) {
    .paper-header-main {
        flex-wrap: wrap;
    }

    .paper-scope {
        max-width: 100%;
    }
}

.certifications {
    padding: 8rem 2rem;
}

.edu-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-primary);
}

.contact {
    padding: 8rem 2rem;
    background:
        radial-gradient(ellipse 60% 45% at 85% 15%, rgba(56, 189, 248, 0.06) 0%, transparent 52%),
        radial-gradient(ellipse 50% 40% at 10% 85%, rgba(0, 255, 136, 0.035) 0%, transparent 50%),
        var(--bg-secondary);
}

.contact-content {
    max-width: 640px;
    margin: 0 auto;
}

.contact-panel {
    --contact-accent: var(--matrix-b);
    background:
        radial-gradient(ellipse 95% 70% at 0% 0%, rgba(56, 189, 248, 0.085) 0%, transparent 42%),
        linear-gradient(165deg, rgba(22, 27, 34, 0.94) 0%, rgba(14, 17, 22, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 2px solid rgba(56, 189, 248, 0.72);
    border-radius: 12px;
    padding: 1.75rem 2rem 2rem;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 12px 32px rgba(0, 0, 0, 0.22);
    text-align: left;
}

.contact-panel-header {
    margin-bottom: 1rem;
}

.contact-panel-icon {
    color: var(--matrix-b);
}

.contact-panel-title {
    margin: 0;
}

.contact-panel .skill-matrix-highlight {
    border-bottom-color: var(--matrix-b);
}

.contact-snippet .skill-snippet-open {
    margin-bottom: 0.45rem;
}

.contact-snippet-body {
    margin: 0;
    padding: 0.35rem 0 0.35rem 0.85rem;
    border-left: 1px solid rgba(56, 189, 248, 0.32);
}

.contact-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0 0 1.25rem;
}

.contact-text a {
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.28);
}

.contact-text a:hover {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.contact-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.contact .btn {
    margin-bottom: 0;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-link {
    color: var(--text-muted);
    transition: all var(--transition-fast);
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.social-link--matrix {
    color: #7dd3fc;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(56, 189, 248, 0.38);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.social-link:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.social-link--matrix:hover {
    color: #bae6fd;
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.12);
}

.social-link svg {
    width: 22px;
    height: 22px;
    display: block;
}

.footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(14, 17, 22, 0.45) 0%, var(--bg-primary) 100%);
}

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

.footer-tagline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.footer-heart {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    color: var(--matrix-a);
    opacity: 0.85;
    filter: drop-shadow(0 0 5px rgba(184, 79, 134, 0.22));
}

.footer-heart-svg {
    width: 1em;
    height: 1em;
    display: block;
}

.footer-resume {
    margin-top: 0.75rem;
}

.footer-resume a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-resume a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.footer .copyright {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text {
        order: 1;
        align-items: center;
    }

    .hero-tagline {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-visual {
        order: 2;
    }

    .skills-matrix,
    .cert-matrix:not(.cert-matrix--formal) {
        grid-template-columns: 1fr;
    }

    .skill-category,
    .cert-cell {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .skill-category:last-child,
    .cert-cell:last-child {
        border-bottom: none;
    }

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

    .projects-coming-soon-grid {
        grid-template-columns: 1fr;
    }

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

    .project-card.featured {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        border-bottom: 1px solid var(--border-color);
    }

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

    .nav-links li {
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero-title.hero-title--minimal {
        font-size: clamp(2.75rem, 12vw, 3.75rem);
    }

    .about-stats {
        flex-wrap: wrap;
        gap: 2rem;
    }

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

@media (prefers-reduced-motion: reduce) {
    .hero-text > *,
    .terminal-window {
        animation: none !important;
        opacity: 1 !important;
    }

    .project-scope--live.project-scope--live--ok {
        animation: none !important;
    }

    .project-card--live-demo .project-demos-btn > .btn-primary {
        animation: none !important;
        filter: none !important;
    }

    #analyze-btn.btn-primary {
        animation: none !important;
        filter: none !important;
    }

    .cursor-glow {
        display: none !important;
    }
}

.animate-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.nav-links a.active {
    color: var(--accent-primary);
}

.nav-links a.active::after {
    width: 100%;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes livePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.2);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12);
    }
}

/* Portfolio “Try Live Demo” + demo page “Analyze” — glow + brightness (hover pauses; no transform vs .btn-primary:hover) */
@keyframes btnLiveDemoCTAPulse {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 8px rgba(0, 255, 136, 0.45)) drop-shadow(0 4px 14px rgba(0, 212, 255, 0.4));
        box-shadow:
            inset 0 0 0 0 rgba(255, 255, 255, 0),
            0 0 0 0 rgba(0, 255, 136, 0.35);
    }
    50% {
        filter: brightness(1.1) drop-shadow(0 0 18px rgba(0, 255, 136, 0.75)) drop-shadow(0 6px 22px rgba(0, 212, 255, 0.55));
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.35),
            0 0 0 3px rgba(0, 255, 136, 0.45);
    }
}

.hero-text > * {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.hero-title { animation-delay: 0.1s; }
.hero-tagline { animation-delay: 0.24s; }

.terminal-window {
    animation: fadeInUp 0.8s ease 0.45s forwards;
    opacity: 0;
}
