/* ==========================================================================
   Loïc Moche — Portfolio V4
   Brand: "Operator's logbook" — warm black, cream paper, electric signature.
   ========================================================================== */

/* -----------------------------
   1. Tokens
------------------------------*/
:root {
    /* Surfaces */
    --bg: #0b0b0e;
    --bg-1: #0f0f15;
    --bg-2: #14141c;
    --bg-paper: #f1ead8;
    --bg-paper-2: #e8dfc6;

    --surface: rgba(255, 255, 255, 0.025);
    --surface-strong: rgba(255, 255, 255, 0.06);
    --border: rgba(241, 234, 216, 0.08);
    --border-strong: rgba(241, 234, 216, 0.16);
    --grid-line: rgba(241, 234, 216, 0.028);
    --grid-line-major: rgba(241, 234, 216, 0.048);

    /* Text */
    --text: #ece7d9;
    --text-dim: #aaa394;
    --text-mute: #6a6457;
    --ink: #15140e;

    /* Signature accent — electric chartreuse */
    --accent: #d4ff3c;
    --accent-soft: #b8e000;
    --accent-glow: rgba(212, 255, 60, 0.35);

    /* Universe palette */
    --u-engineering: #f59e0b;
    --u-code: #22d3ee;
    --u-research: #ec4899;
    --u-business: #fbbf24;

    /* Project-page accent (overridden per project) */
    --proj-accent: var(--accent);
    --proj-accent-glow: rgba(212, 255, 60, 0.25);

    /* Gradients */
    --grad-signature: linear-gradient(120deg, #fff 10%, #d4ff3c 100%);
    --grad-warm: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
    --grad-cool: linear-gradient(135deg, #22d3ee 0%, #8b5cf6 100%);
    --grad-paper: linear-gradient(180deg, #f1ead8 0%, #e8dfc6 100%);

    /* Radii / shadow */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 60px rgba(212, 255, 60, 0.15);

    /* Type */
    --font-body: "Inter", system-ui, -apple-system, sans-serif;
    --font-display: "Outfit", "Inter", sans-serif;
    --font-serif: "Fraunces", "Times New Roman", serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;

    --maxw: 1280px;
    --maxw-narrow: 1080px;
    --rail-w: 60px;
}

/* -----------------------------
   2. Reset / base
------------------------------*/
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent);
}

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

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(241, 234, 216, 0.08);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 32px;
}

/* Signature italic — Fraunces (restrained: WONK off, SOFT moderate) */
em,
.serif {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-variation-settings: "SOFT" 50, "WONK" 0, "opsz" 72;
    letter-spacing: -0.01em;
}

/* Body-level em: white + chartreuse underline accent */
p em, li em, .about-manifesto em, .section-lead em, .about-copy em {
    color: #fff;
    background: none;
    -webkit-text-fill-color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
    border-bottom: none;
}

strong {
    color: #fff;
    font-weight: 600;
}

/* -----------------------------
   3. Background ambient
------------------------------*/
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.grid-minor,
.grid-major {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
}

.grid-minor {
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}

.grid-major {
    background-image:
        linear-gradient(var(--grid-line-major) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line-major) 1px, transparent 1px);
    background-size: 200px 200px;
    mask-image: linear-gradient(180deg, transparent 0, #000 5%, #000 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 5%, #000 95%, transparent 100%);
}

/* Tiny accent dots at major intersections */
.bg-grid::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    background-image: radial-gradient(circle at 0 0, var(--accent) 1.2px, transparent 1.5px);
    background-size: 200px 200px;
    opacity: 0.1;
    mask-image: linear-gradient(180deg, transparent 0, #000 10%, #000 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 10%, #000 90%, transparent 100%);
}

.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow), transparent 60%);
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
    will-change: transform;
    mix-blend-mode: screen;
    opacity: 0.18;
}

@media (max-width: 900px) {
    .cursor-glow {
        display: none;
    }
}

/* Vignette: dark frame, clean centre */
.vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(
        ellipse 120% 90% at center,
        transparent 40%,
        rgba(11, 11, 14, 0.28) 70%,
        rgba(11, 11, 14, 0.55) 100%
    );
}

/* Technical cursor reticle */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    mix-blend-mode: exclusion;
}

.cursor-reticle {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    pointer-events: none;
    z-index: 9998;
    will-change: transform;
    transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
}

.cr-corner {
    position: absolute;
    width: 9px;
    height: 9px;
    border-color: var(--accent);
    border-style: solid;
    opacity: 0.85;
    transition: all 0.25s ease;
}

.cr-corner.tl { top: 0; left: 0; border-width: 1.5px 0 0 1.5px; }
.cr-corner.tr { top: 0; right: 0; border-width: 1.5px 1.5px 0 0; }
.cr-corner.bl { bottom: 0; left: 0; border-width: 0 0 1.5px 1.5px; }
.cr-corner.br { bottom: 0; right: 0; border-width: 0 1.5px 1.5px 0; }

.cursor-reticle.is-hover {
    width: 44px;
    height: 44px;
}

.cursor-reticle.is-hover .cr-corner {
    opacity: 1;
    border-color: #fff;
}

@media (hover: none), (max-width: 900px) {
    .cursor-dot, .cursor-reticle { display: none; }
    body { cursor: auto; }
}

@media (hover: hover) and (min-width: 901px) {
    body { cursor: none; }
    a, button, [role="button"] { cursor: none; }
}

main {
    position: relative;
    z-index: 2;
}

/* -----------------------------
   4. Side rails (signature)
------------------------------*/
.side-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    width: var(--rail-w);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 100px 0 32px;
    pointer-events: none;
    border-right: 1px solid var(--border);
    background: linear-gradient(180deg, transparent, rgba(11, 11, 14, 0.6), transparent);
}

.side-rail.left {
    left: 0;
}

.side-rail.right {
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border);
}

.rail-mark {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-mute);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.rail-mark.vertical {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: var(--text-dim);
    letter-spacing: 0.4em;
    font-weight: 500;
}

.rail-line {
    width: 1px;
    flex: 1;
    background: linear-gradient(180deg, transparent, var(--border-strong), transparent);
    margin: 16px 0;
}

@media (max-width: 1100px) {
    .side-rail {
        display: none;
    }

    :root {
        --rail-w: 0px;
    }
}

/* -----------------------------
   5. Header / nav
------------------------------*/
#main-header {
    position: fixed;
    top: 0;
    left: var(--rail-w);
    right: var(--rail-w);
    z-index: 9998;
    padding: 18px 0;
    transition: all 0.3s ease;
}

#main-header.scrolled {
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    background: rgba(11, 11, 14, 0.72);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

#main-header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 32px;
    gap: 24px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.logo .sigil {
    width: 26px;
    height: 26px;
    color: var(--text);
}

.logo .sigil svg {
    width: 100%;
    height: 100%;
}

.logo-text em {
    margin-left: 2px;
    color: var(--accent);
    font-size: 1em;
    background: none;
    -webkit-text-fill-color: var(--accent);
}

.logo.big {
    font-size: 1.6rem;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text-dim);
    font-weight: 500;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

.nav-link .nav-num {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-mute);
    letter-spacing: 0.05em;
}

.nav-link:hover {
    color: #fff;
    border-color: var(--border-strong);
    background: var(--surface);
}

.nav-link:hover .nav-num {
    color: var(--accent);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    transition: all 0.25s ease;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
    color: var(--ink);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    z-index: 10000;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav overlay */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 9999;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 80px 24px 40px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Close button inside the mobile nav overlay */
.mobile-nav .close-menu {
    position: absolute;
    top: 18px;
    right: 32px;
    display: flex;
    z-index: 10001;
}

/* Force X shape on the close button */
.mobile-nav .close-menu span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-nav .close-menu span:nth-child(2) {
    opacity: 0;
}

.mobile-nav .close-menu span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    width: 100%;
    max-width: 320px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

.mobile-nav-link .nav-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-mute);
    letter-spacing: 0.05em;
}

.mobile-nav-link:hover {
    color: var(--accent);
    border-color: var(--border-strong);
    background: var(--surface);
}

.mobile-nav-link:hover .nav-num {
    color: var(--accent);
}

.nav-cta.mobile {
    display: none;
    margin-top: 24px;
    flex-shrink: 0;
}

@media (max-width: 800px) {
    .nav-toggle {
        display: flex;
        position: fixed;
        top: 14px;
        right: 32px;
        z-index: 10000;
    }

    .nav-links {
        display: none;
    }

    .nav-cta {
        display: none;
    }

    .nav-cta.mobile {
        display: inline-flex;
    }

    .mobile-nav.is-open {
        display: flex;
    }
}

/* -----------------------------
   6. Buttons
------------------------------*/
.btn-primary,
.btn-ghost,
.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 999px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    text-decoration: none;
    position: relative;
}

.btn-primary {
    background: var(--accent);
    color: var(--ink);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px var(--accent-glow);
    color: var(--ink);
    background: #e3ff5a;
}

.btn-primary.big {
    padding: 18px 32px;
    font-size: 1rem;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.btn-cta {
    background: var(--accent);
    color: var(--ink);
}

.btn-cta:hover {
    transform: translateY(-2px);
    color: var(--ink);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-cta.secondary {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-cta.secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-text:hover {
    gap: 12px;
}

/* =================================================================
   HOME PAGE
================================================================= */

/* -----------------------------
   7. Hero
------------------------------*/
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 160px 0 100px;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -10%;
    left: 50%;
    width: min(1100px, 140vw);
    height: min(1100px, 140vw);
    background: radial-gradient(circle, rgba(212, 255, 60, 0.1), transparent 60%);
    transform: translateX(-50%);
    pointer-events: none;
    filter: blur(40px);
}

.hero-container {
    position: relative;
    z-index: 2;
    text-align: left;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.hero-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.hero-handle {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-mute);
    padding: 8px 14px;
    border: 1px dashed var(--border-strong);
    border-radius: 4px;
}

.handle-key {
    color: var(--accent);
    margin-right: 4px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 8vw, 6.4rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.045em;
    margin: 0 0 36px;
    max-width: 17ch;
    perspective: 900px;
}

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

.hero-title .line span {
    display: inline-block;
    will-change: transform;
}

.hero-title em {
    color: var(--accent);
    background: none;
    -webkit-text-fill-color: var(--accent);
    font-size: 0.96em;
    padding-right: 0.1em;
    text-decoration: none;
}

.hero-sub {
    font-size: clamp(1rem, 1.3vw, 1.18rem);
    color: var(--text-dim);
    max-width: 60ch;
    margin: 0 0 48px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 80px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    border-top: 1px solid var(--border);
    padding-top: 28px;
    max-width: 600px;
    position: relative;
}

.hero-stats::before {
    content: "// METRICS";
    position: absolute;
    top: -8px;
    left: 0;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-mute);
    background: var(--bg);
    padding-right: 12px;
    letter-spacing: 0.15em;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-num {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.025em;
    line-height: 1;
}

.stat-label {
    font-size: 0.74rem;
    color: var(--text-mute);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.scroll-cue {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--text-mute);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.3em;
}

.cue-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--accent));
    animation: scroll-line 2s ease-in-out infinite;
}

@keyframes scroll-line {

    0%,
    100% {
        transform: scaleY(0.3);
        transform-origin: top;
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
    }
}

@media (max-width: 1024px) {
    .hero {
        padding: 100px 0 80px;
    }

    .about-section,
    .profile-section,
    .universes,
    .projects-section,
    .contact-section {
        padding: 80px 0;
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 80px 0 60px;
    }

    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .stat-num {
        font-size: 1.6rem;
    }

    .scroll-cue {
        display: none;
    }
}

/* -----------------------------
   8. About section (notebook)
------------------------------*/
.about-section {
    padding: 140px 0 120px;
    border-top: 1px solid var(--border);
    background:
        linear-gradient(180deg, transparent 0%, rgba(212, 255, 60, 0.025) 50%, transparent 100%);
    position: relative;
}

.about-section::before,
.about-section::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background:
        linear-gradient(90deg, transparent, var(--border-strong) 20%, var(--border-strong) 80%, transparent);
}

.about-section::before {
    top: 0;
}

.about-section::after {
    bottom: 0;
}

.about-layout {
    display: grid;
    grid-template-columns: 1.1fr 1.4fr;
    grid-template-rows: auto auto;
    gap: 56px 64px;
    align-items: start;
}

.about-header {
    grid-column: 1;
    grid-row: 1;
    position: relative;
}

.about-name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 5.4rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.04em;
    color: #fff;
    margin: 16px 0 12px;
    position: relative;
    display: inline-block;
}

.about-name em {
    color: var(--accent);
    background: none;
    -webkit-text-fill-color: var(--accent);
    margin-right: 4px;
    display: inline-block;
    text-decoration: none;
}

.name-deco {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60%;
    height: 14px;
    color: var(--accent);
}

.name-deco svg {
    width: 100%;
    height: 100%;
}

.about-role {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 24px 0 0;
}

.about-manifesto {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    position: relative;
    padding-left: 28px;
    border-left: 1px solid var(--border-strong);
}

.about-manifesto p {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    font-weight: 300;
    line-height: 1.55;
    color: var(--text);
    margin: 0 0 18px;
}

.about-manifesto em {
    color: #fff;
    background: none;
    -webkit-text-fill-color: #fff;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 1px;
}

.about-signature {
    font-family: var(--font-serif) !important;
    font-style: italic !important;
    font-size: 1.1rem !important;
    color: var(--accent) !important;
    margin-top: 24px !important;
    font-weight: 300 !important;
}

.about-credo {
    grid-column: 1 / -1;
    grid-row: 2;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-1);
    overflow: hidden;
}

.about-credo li {
    padding: 32px 28px;
    border-right: 1px solid var(--border);
    position: relative;
    transition: background 0.3s ease;
}

.about-credo li:last-child {
    border-right: none;
}

.about-credo li:hover {
    background: var(--surface);
}

.about-credo li:hover .credo-num {
    color: var(--accent);
}

.credo-num {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-mute);
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 14px;
    transition: color 0.25s ease;
}

.about-credo h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: #fff;
    letter-spacing: -0.01em;
}

.about-credo p {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.88rem;
    line-height: 1.55;
}


@media (max-width: 900px) {
    .about-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-header,
    .about-manifesto {
        grid-column: 1;
    }

    .about-manifesto {
        grid-row: auto;
        padding-left: 16px;
    }

    .about-credo {
        grid-template-columns: 1fr 1fr;
    }

    .about-credo li {
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    .about-credo li:nth-child(2n) {
        border-right: none;
    }

    .about-credo li:nth-last-child(-n+2) {
        border-bottom: none;
    }

}

@media (max-width: 600px) {
    .about-credo {
        grid-template-columns: 1fr;
    }

    .about-credo li {
        border-right: none !important;
    }
}

/* -----------------------------
   8b. Profile section
------------------------------*/
.profile-section {
    padding: 140px 0;
    border-top: 1px solid var(--border);
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 24px;
    margin-bottom: 80px;
}

.profile-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-col > .profile-card:last-child {
    flex: 1;
}

.profile-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    position: relative;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.profile-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-2);
}

.profile-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-strong);
}

.profile-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.profile-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.profile-list li:first-child {
    padding-top: 0;
}

.profile-list li:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.pl-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
}

.pl-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.skill-groups {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.skill-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sg-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-mute);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(241, 234, 216, 0.22);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: #fff;
    letter-spacing: 0.02em;
    transition: all 0.25s ease;
}

.skill-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(212, 255, 60, 0.10);
}

.ai-manifesto {
    position: relative;
    padding: 48px 40px;
    background: linear-gradient(135deg, rgba(212, 255, 60, 0.04), transparent 60%);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
}

.manifesto-eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.ai-manifesto blockquote {
    margin: 0;
    padding: 0;
    border: none;
}

.ai-manifesto blockquote p {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 300;
    line-height: 1.55;
    color: var(--text);
    margin: 0 0 16px;
}

.ai-manifesto blockquote p em {
    color: var(--accent);
    background: none;
    -webkit-text-fill-color: var(--accent);
    text-decoration: none;
    border-bottom: none;
}

.ai-manifesto blockquote footer {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-mute);
    letter-spacing: 0.04em;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-strong);
}

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

    .skill-groups {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .skill-groups {
        grid-template-columns: 1fr;
    }

    .ai-manifesto {
        padding: 32px 24px;
    }
}

/* -----------------------------
   9. Section heads
------------------------------*/
.section-head {
    margin-bottom: 64px;
    max-width: 760px;
    position: relative;
}

.section-eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 0.08em;
    margin-bottom: 18px;
    padding: 4px 10px 4px 0;
    border-bottom: 1px solid var(--border-strong);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin: 0 0 22px;
    color: #fff;
}

.section-title em {
    color: var(--accent);
    background: none;
    -webkit-text-fill-color: var(--accent);
    text-decoration: none;
}

.section-lead {
    color: var(--text-dim);
    font-size: 1.02rem;
    max-width: 60ch;
    margin: 0;
    line-height: 1.65;
}

/* -----------------------------
   10. Universes (image-led cards)
------------------------------*/
.universes {
    padding: 140px 0;
}

.universe-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.universe-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    isolation: isolate;
    background: var(--bg-1);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.universe-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-strong);
}

/* Numbered + universe label header */
.universe-card .uc-header {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(11, 11, 14, 0.6);
    backdrop-filter: blur(8px);
}

.universe-card .uc-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-mute);
    letter-spacing: 0.15em;
}

.universe-card .uc-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
}

.universe-card .uc-tag::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--uc-color, var(--accent));
    box-shadow: 0 0 10px var(--uc-color, var(--accent));
}

/* Image — large, dominant */
.universe-card .uc-media {
    position: relative;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: var(--bg);
}

.universe-card .uc-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.95) contrast(1.05);
    transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
}

.universe-card:hover .uc-media img {
    transform: scale(1.06);
    filter: saturate(1.1) contrast(1.1);
}

.universe-card .uc-media::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    background: linear-gradient(180deg,
            transparent 0%,
            transparent 50%,
            rgba(11, 11, 14, 0.6) 100%);
    pointer-events: none;
}

.universe-card .uc-corners {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    pointer-events: none;
}

.uc-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--uc-color, var(--accent));
    opacity: 0.85;
}

.uc-corner.tl {
    top: 12px;
    left: 12px;
    border-right: none;
    border-bottom: none;
}

.uc-corner.tr {
    top: 12px;
    right: 12px;
    border-left: none;
    border-bottom: none;
}

.uc-corner.bl {
    bottom: 12px;
    left: 12px;
    border-right: none;
    border-top: none;
}

.uc-corner.br {
    bottom: 12px;
    right: 12px;
    border-left: none;
    border-top: none;
}

/* Body */
.universe-card .uc-body {
    padding: 28px 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.universe-card .uc-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    font-weight: 800;
    line-height: 1.05;
    margin: 0;
    letter-spacing: -0.03em;
    color: #fff;
}

.universe-card .uc-title em {
    color: var(--uc-color, var(--accent));
    background: none;
    -webkit-text-fill-color: var(--uc-color, var(--accent));
}

.universe-card .uc-desc {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0;
}

.universe-card .uc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    margin-top: 4px;
    border-top: 1px dashed var(--border-strong);
    gap: 16px;
}

.universe-card .uc-featured {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.4;
}

.universe-card .uc-featured strong {
    display: block;
    color: #fff;
    font-weight: 600;
    font-family: var(--font-body);
    font-size: 0.88rem;
    letter-spacing: 0;
    margin-top: 2px;
}

.universe-card .uc-arrow {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text);
}

.universe-card:hover .uc-arrow {
    background: var(--uc-color, var(--accent));
    border-color: var(--uc-color, var(--accent));
    color: var(--ink);
    transform: rotate(-45deg);
}

@media (max-width: 800px) {
    .universe-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .universe-card {
        /* Make the card visually finished on dark bg */
        border: 1px solid var(--border-strong);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    }

    .universe-card .uc-media {
        aspect-ratio: 16 / 10;
    }

    .universe-card .uc-header {
        padding: 14px 18px;
    }

    .universe-card .uc-body {
        padding: 18px 20px 22px;
        gap: 14px;
    }

    .universe-card .uc-title {
        font-size: clamp(1.4rem, 6vw, 1.8rem);
    }

    .universe-card .uc-desc {
        font-size: 0.88rem;
        line-height: 1.5;
    }

    .universe-card .uc-footer {
        padding-top: 14px;
        margin-top: 4px;
    }

    .universe-card .uc-arrow {
        width: 38px;
        height: 38px;
    }
}

/* -----------------------------
   11. Trajectory chart
------------------------------*/
.trajectory-section {
    padding: 140px 0;
    border-top: 1px solid var(--border);
}

.chart-shell {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    position: relative;
    overflow: hidden;
    margin-bottom: 48px;
}

.chart-shell::before {
    content: "EXP-04 // SKILL TRAJECTORY";
    position: absolute;
    top: 16px;
    right: 24px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-mute);
    letter-spacing: 0.18em;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--border-strong);
}

.legend-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-mute);
    letter-spacing: 0.15em;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.legend-item .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
}

.chart-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 1200 / 520;
}

#chart-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

/* SVG sub-elements styled via class names */
.chart-axis-line {
    stroke: var(--border-strong);
    stroke-width: 1;
}

.chart-grid-line {
    stroke: var(--grid-line-major);
    stroke-width: 1;
    stroke-dasharray: 2 4;
}

.chart-tick-label {
    fill: var(--text-mute);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
}

.chart-axis-label {
    fill: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.chart-line-bg {
    stroke: var(--accent);
    stroke-width: 1;
    fill: none;
    opacity: 0.18;
    filter: blur(8px);
}

.chart-area {
    fill: url(#chart-area-gradient);
    opacity: 0.5;
}

.chart-line {
    stroke: var(--accent);
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.chart-dot {
    cursor: pointer;
    transition: transform 0.25s ease, filter 0.25s ease;
    transform-box: fill-box;
    transform-origin: center;
}

.chart-dot circle.dot-halo {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.chart-dot:hover circle.dot-halo,
.chart-dot.is-active circle.dot-halo {
    opacity: 0.45;
}

.chart-dot circle.dot-core {
    transition: r 0.25s ease;
}

.chart-dot:hover circle.dot-core,
.chart-dot.is-active circle.dot-core {
    r: 8;
}

.chart-label {
    cursor: pointer;
    transition: fill 0.25s ease, transform 0.25s ease;
}

.chart-label text {
    fill: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    text-shadow: 0 1px 4px rgba(11, 11, 14, 0.9);
}

.chart-label.is-clickable text {
    fill: #fff;
    font-weight: 600;
}

.chart-label:hover text,
.chart-label.is-active text {
    fill: var(--accent);
}

.chart-label-tick {
    stroke: var(--border-strong);
    stroke-width: 1;
    stroke-dasharray: 2 3;
}

/* Tooltip — fixed portal, GSAP-animated, never clipped */
.chart-tooltip {
    position: fixed;
    min-width: 260px;
    max-width: 310px;
    background: rgba(11, 11, 16, 0.97);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--border-strong);
    border-top: 2px solid var(--tip-color, var(--accent));
    border-radius: var(--radius);
    padding: 18px 20px;
    pointer-events: none;
    opacity: 0;
    z-index: 9000;
    box-shadow: var(--shadow), 0 0 30px rgba(0,0,0,0.4);
    will-change: transform, opacity;
}

.chart-tooltip.is-visible {
    pointer-events: auto;
}

.tip-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-mute);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.tip-uni {
    color: var(--tip-color, var(--accent));
}

.tip-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: #fff;
    letter-spacing: -0.01em;
}

.tip-desc {
    font-size: 0.85rem;
    color: var(--text);
    margin: 0 0 8px;
    line-height: 1.5;
    font-weight: 500;
}

.tip-long {
    font-size: 0.80rem;
    color: var(--text-dim);
    margin: 0 0 14px;
    line-height: 1.55;
    border-top: 1px dashed var(--border-strong);
    padding-top: 8px;
}

.tip-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.tip-bar-row {
    display: grid;
    grid-template-columns: 50px 1fr 30px;
    gap: 8px;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-mute);
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

.tip-bar-track {
    height: 4px;
    background: var(--surface-strong);
    border-radius: 999px;
    overflow: hidden;
}

.tip-bar-fill {
    height: 100%;
    background: var(--tip-color, var(--accent));
    border-radius: 999px;
    transform-origin: left;
    transition: transform 0.4s ease;
}

.tip-bar-val {
    text-align: right;
    color: var(--text-dim);
}

.tip-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--tip-color, var(--accent));
    font-weight: 600;
    letter-spacing: 0.04em;
}

.tip-cta.hidden {
    display: none;
}

.tip-related {
    margin: 14px 0 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.tip-related-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 8px;
}

.tip-related-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tip-related-item {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.4;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.tip-related-item::before {
    content: "//";
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-mute);
    opacity: 0.6;
}

@media (max-width: 800px) {
    .chart-shell {
        padding: 20px;
    }

    .chart-canvas {
        aspect-ratio: 4 / 3;
    }
}

/* -----------------------------
   12. Lab notebook (filterable)
------------------------------*/
.projects-section {
    padding: 140px 0;
    border-top: 1px solid var(--border);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
}

.filter-chip {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.82rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    color: #fff;
    border-color: var(--border-strong);
}

.filter-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ink);
    font-weight: 600;
}

.projects-wrapper {
    position: relative;
    overflow: hidden;
    transition: max-height 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.projects-wrapper.collapsed {
    max-height: 380px;
}

.projects-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, transparent 0%, var(--bg) 90%);
    pointer-events: none;
    transition: opacity 0.45s ease;
}

.projects-wrapper.expanded .projects-fade {
    opacity: 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.project-card {
    position: relative;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 230px;
}

.project-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    background: var(--card-glow, var(--accent-glow));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    border-radius: inherit;
    filter: blur(40px);
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--card-color, var(--accent));
}

.project-card:hover::before {
    opacity: 0.18;
}

.project-card .pc-corner {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--card-color, var(--accent));
    border-left: none;
    border-bottom: none;
    opacity: 0.7;
}

.project-card .pc-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.project-card .pc-date {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--card-color, var(--accent));
    letter-spacing: 0.05em;
}

.project-card .pc-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.project-card .pc-tag {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--text-mute);
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.project-card .pc-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.project-card .pc-desc {
    font-size: 0.88rem;
    color: var(--text-dim);
    margin: 0;
    line-height: 1.55;
}

.project-card .pc-details {
    font-size: 0.78rem;
    color: var(--text-mute);
    margin: 0;
    border-top: 1px dashed var(--border-strong);
    padding-top: 10px;
    margin-top: auto;
    line-height: 1.5;
}

@media (max-width: 1000px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .projects-wrapper.collapsed {
        max-height: 480px;
    }
}

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

    .projects-wrapper.collapsed {
        max-height: 380px;
    }
}

.projects-toggle-wrap {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.projects-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: all 0.25s ease;
}

.projects-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.projects-toggle .toggle-icon {
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.projects-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

/* -----------------------------
   13. Contact
------------------------------*/
.contact-section {
    padding: 140px 0;
    border-top: 1px solid var(--border);
}

.contact-card {
    padding: 80px 64px;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(ellipse at top right, rgba(212, 255, 60, 0.18), transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(236, 72, 153, 0.14), transparent 60%),
        var(--bg-1);
    border: 1px solid var(--border-strong);
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 64px;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    inset: 0;
    background:
        linear-gradient(rgba(241, 234, 216, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(241, 234, 216, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.contact-card>* {
    position: relative;
}

.contact-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin: 0 0 22px;
    color: #fff;
}

.contact-title em {
    color: var(--accent);
    background: none;
    -webkit-text-fill-color: var(--accent);
    text-decoration: none;
}

.contact-sub {
    color: var(--text-dim);
    margin: 0;
    max-width: 50ch;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

.btn-copy-email {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    font-size: 0.82rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-copy-email:hover {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.btn-copy-email.copied {
    background: #2ecc71;
    color: #fff;
    border-color: #2ecc71;
}

.contact-socials {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-basis: 100%;
}

.contact-socials a {
    padding: 10px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    transition: all 0.25s ease;
}

.contact-socials a:hover {
    color: var(--ink);
    border-color: var(--accent);
    background: var(--accent);
    transform: translateY(-2px);
}

@media (max-width: 800px) {
    .contact-card {
        grid-template-columns: 1fr;
        padding: 48px 28px;
        gap: 32px;
    }
}

/* -----------------------------
   14. Footer
------------------------------*/
#footer {
    padding: 64px 0 48px;
    border-top: 1px solid var(--border);
    background: var(--bg-1);
    margin-left: var(--rail-w);
    margin-right: var(--rail-w);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 32px;
    align-items: end;
}

.footer-tag {
    color: var(--text-mute);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    margin: 8px 0 0;
    letter-spacing: 0.05em;
}

.footer-meta {
    text-align: right;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.footer-meta p {
    margin: 0 0 4px;
}

.footer-meta .muted {
    color: var(--text-mute);
}

@media (max-width: 700px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .footer-meta {
        text-align: left;
    }
}

/* =================================================================
   15. PROJECT PAGES (shared base inherited by every project page).
   The per-project style.css overrides --proj-accent etc.
================================================================= */

body.project-page {
    background: var(--bg);
}

.project-page main {
    padding-top: 80px;
}

/* Hero */
.project-hero {
    padding: 120px 0 60px;
    position: relative;
    text-align: center;
    overflow: hidden;
}

@media (max-width: 800px) {
    .project-hero {
        padding: 80px 0 40px;
    }
}

@media (max-width: 600px) {
    .project-hero {
        padding: 60px 0 32px;
    }
}

.project-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--proj-accent-glow), transparent 60%);
    transform: translateX(-50%) translateY(-30%);
    pointer-events: none;
    z-index: 0;
}

.project-hero .container {
    position: relative;
    z-index: 1;
    max-width: var(--maxw-narrow);
}

.category-tag {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--proj-accent);
    letter-spacing: 0.06em;
    margin-bottom: 32px;
    text-transform: uppercase;
}

.project-title {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin: 0 0 24px;
    color: #fff;
}

.project-lead {
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    color: var(--text-dim);
    max-width: 60ch;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.hero-links,
.hero-cta {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.badge {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.badge.playstore {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.hero-image-container,
.hero-image-container-small {
    margin: 48px auto 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-1);
    box-shadow: var(--shadow);
}

.hero-image-container-small {
    max-width: 200px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.hero-logo-img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.adaptive-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Sections */
.project-section {
    padding: 100px 0;
    border-top: 1px solid var(--border);
}

.project-section.accent-bg {
    background: var(--bg-1);
}

.section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.section-grid.reverse {
    direction: rtl;
}

.section-grid.reverse>* {
    direction: ltr;
}

.section-heading {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--proj-accent);
    letter-spacing: 0.06em;
    margin: 0 0 12px;
    text-transform: uppercase;
}

.section-heading.centered {
    text-align: center;
}

.sub-heading {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.5vw, 2.6rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin: 0 0 24px;
    color: #fff;
}

.sub-heading.centered {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    max-width: 22ch;
}

.text-content p {
    color: var(--text-dim);
    line-height: 1.7;
    margin: 0 0 16px;
}

.text-content p strong {
    color: #fff;
}

.text-center {
    text-align: center;
}

.intro-p {
    max-width: 60ch;
    margin: 0 auto 56px;
    color: var(--text-dim);
}

.problem-box,
.highlight-box,
.conclusion-box {
    padding: 24px;
    border-radius: var(--radius);
    margin: 24px 0;
    border: 1px solid var(--border);
    background: var(--surface);
}

.problem-box {
    border-left: 3px solid #ef4444;
}

.highlight-box {
    border-left: 3px solid var(--proj-accent);
}

.conclusion-box {
    border-left: 3px solid var(--accent);
    margin-top: 64px;
}

.problem-box h4,
.highlight-box h4,
.conclusion-box h4 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: #fff;
}

.problem-box p,
.highlight-box p,
.conclusion-box p {
    margin: 0;
    color: var(--text-dim);
}

.image-caption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-mute);
    text-align: center;
    margin: 12px 0 0;
    letter-spacing: 0.04em;
}

.visual-content img {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-1);
}

.content-img,
.content-img-contained {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-1);
    width: 100%;
}

.solution-grid,
.challenge-grid-compact,
.product-examples-grid,
.takeaways-grid,
.tech-deep-dive,
.reality-grid,
.research-visual-grid {
    display: grid;
    gap: 20px;
    margin-top: 48px;
}

.solution-grid {
    grid-template-columns: repeat(3, 1fr);
}

.challenge-grid-compact {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 0;
}

.product-examples-grid {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 56px;
}

.takeaways-grid {
    grid-template-columns: repeat(3, 1fr);
}

.takeaways-grid.four-col {
    grid-template-columns: repeat(4, 1fr);
}

.tech-deep-dive {
    grid-template-columns: 1fr 1fr;
}

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

.research-visual-grid {
    grid-template-columns: 1fr 1fr;
}

.solution-card,
.challenge-card,
.tech-step,
.reality-step,
.takeaway,
.example-item,
.visual-item,
.stat-card {
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.solution-card:hover,
.challenge-card:hover,
.tech-step:hover,
.reality-step:hover,
.takeaway:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    background: var(--surface-strong);
}

.solution-card .icon,
.challenge-card .icon {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.icon-small {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.solution-card h4,
.challenge-card h4,
.tech-step h4,
.reality-step h4,
.takeaway h5 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: -0.01em;
}

.solution-card p,
.challenge-card p,
.tech-step p,
.reality-step p,
.takeaway p {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.92rem;
    line-height: 1.6;
}

.solution-card.highlight,
.challenge-card.highlight,
.solution-card.highlight-purple,
.challenge-card.highlight-purple {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.3);
}

.challenge-card.highlight-red {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
}

.example-item img,
.app-screen-img,
.example-img {
    width: 100%;
    border-radius: var(--radius-sm);
    background: var(--bg);
    margin-bottom: 12px;
}

.app-screen-img {
    aspect-ratio: 9 / 16;
    object-fit: cover;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-card {
    text-align: center;
    padding: 28px 16px;
}

.stat-card .stat-number {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 800;
    background: var(--grad-signature);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-card .stat-label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-mute);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.stats-list {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}

.stats-list li {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.95rem;
}

.stats-list li:last-child {
    border-bottom: none;
}

.stats-list strong {
    color: #fff;
}

.specs-table-container {
    margin-top: 48px;
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.specs-table-container h4 {
    margin: 0 0 16px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--proj-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table th,
.specs-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.specs-table tr:last-child th,
.specs-table tr:last-child td {
    border-bottom: none;
}

.specs-table th {
    color: #fff;
    font-weight: 600;
    width: 35%;
}

.specs-table td {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.math-box {
    padding: 32px;
    margin: 24px 0;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    font-size: 1.4rem;
    color: var(--proj-accent);
}

.reality-step .step-number {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(212, 255, 60, 0.12);
    color: var(--accent);
    margin-bottom: 16px;
    letter-spacing: 0.05em;
}

.eval-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 48px;
}

.eval-column {
    padding: 32px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
}

.eval-column.positive {
    border-color: rgba(34, 197, 94, 0.3);
}

.eval-column.negative {
    border-color: rgba(239, 68, 68, 0.3);
}

.eval-column h4 {
    margin: 0 0 24px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: #fff;
    letter-spacing: -0.02em;
}

.eval-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.eval-list li strong {
    display: block;
    color: #fff;
    margin-bottom: 4px;
    font-weight: 600;
}

.eval-list li p {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.status-container {
    margin-top: 48px;
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 500;
}

.final-cta {
    margin-top: 48px;
    text-align: center;
}

.project-footer {
    padding: 80px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    font-weight: 500;
    transition: all 0.25s ease;
}

.back-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateX(-4px);
}

#footer .container {
    text-align: center;
    color: var(--text-mute);
    font-size: 0.85rem;
}

.project-page #footer {
    margin: 0;
}

@media (max-width: 900px) {

    .section-grid,
    .solution-grid,
    .product-examples-grid,
    .takeaways-grid,
    .takeaways-grid.four-col,
    .tech-deep-dive,
    .reality-grid,
    .research-visual-grid,
    .eval-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .section-grid.reverse {
        direction: ltr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Project pages — grid, nav, and rail overrides
   ========================================================================== */
.project-page {
    --rail-w: 0px;
}

.project-page .bg-grid::after {
    opacity: 0.06;
}

.project-page .grid-minor {
    opacity: 0.65;
}

.project-page .grid-major {
    opacity: 0.55;
}

/* Project page logo */
.project-page .logo .logo-text em {
    font-variation-settings: "SOFT" 50, "WONK" 0, "opsz" 72;
}

/* ==========================================================================
   MOBILE ENHANCEMENTS
   ========================================================================== */

/* 1. Contact — ensure email is visible and buttons stack */
@media (max-width: 800px) {
    .contact-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .btn-primary.big {
        padding: 14px 20px;
        font-size: 0.85rem;
        word-break: break-all;
        text-align: center;
        justify-content: center;
    }

    .btn-copy-email {
        justify-content: center;
    }

    .contact-socials {
        justify-content: center;
    }
}

/* 2. Chart — hidden on mobile */
@media (max-width: 800px) {
    .chart-shell {
        display: none;
    }
}

/* 3. Universal carousel system
   ------------------------------------------------------------------ */
.carousel-wrap {
    position: relative;
    z-index: 1;
}

/* Right-edge fade hint on mobile to indicate horizontal scroll exists.
   Hidden when JS detects we're at the end of the scroll. */
.carousel-wrap.is-active::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 28px;
    background: linear-gradient(to right, transparent, var(--bg));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.carousel-wrap.has-overflow-right::after {
    opacity: 1;
}

@media (min-width: 801px) {
    .carousel-wrap.is-active::after { display: none; }
}

@media (max-width: 800px) {
    .carousel-wrap {
        overflow: visible;
        position: relative;
        margin-left: -24px;
        margin-right: -24px;
        padding: 0 24px;
    }

    .section-grid,
    .section-grid > *,
    .text-content,
    .visual-content {
        min-width: 0 !important;
    }
}

/* The horizontal scroller.
   Using `overflow-x: clip` + `overflow-clip-margin` lets card shadows
   render outside the scroller's bounds without making the area scrollable.
   Fallback: `overflow: auto` for older browsers (shadow will still be clipped
   but the layout is functional). */
.is-carousel {
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
}

/* Modern browsers: `clip` keeps clipping but allows margin extension */
@supports (overflow-clip-margin: 80px) {
    .is-carousel {
        overflow-x: scroll;
        overflow-y: clip;
        overflow-clip-margin: 80px;
    }
}

.is-carousel::-webkit-scrollbar {
    display: none;
}

.is-carousel > * {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* Arrows (only rendered by JS when overflow is detected)
   `top` is set inline by JS to center on the first slide's focal point.
   We use translateY(-50%) so the value JS writes refers to the arrow's CENTER. */
.carousel-arrow {
    position: absolute;
    top: 50%; /* fallback if JS hasn't positioned yet */
    transform: translateY(-50%);
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 50%;
    background: rgba(11, 11, 14, 0.92);
    border: 1.5px solid var(--border-strong);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    padding: 0;
    margin: 0;
    transition: opacity 0.25s ease, background 0.2s, border-color 0.2s, color 0.2s;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
}

.carousel-arrow > svg {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
}

.carousel-arrow:hover,
.carousel-arrow:focus-visible {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
    outline: none;
}

.carousel-arrow--prev { left: 12px; }
.carousel-arrow--next { right: 12px; }

.carousel-arrow.is-hidden {
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 900px) {
    .carousel-arrow--prev { left: -16px; }
    .carousel-arrow--next { right: -16px; }
}

/* ------------------------------------------------------------------
   Mobile carousel layouts — PROJECT PAGES ONLY
   On screens ≤ 800px, project-page grids become horizontal flex rows.
   The home page uses a separate system (home-mobile.css).
   ------------------------------------------------------------------ */
@media (max-width: 800px) {
    .trajectory-section {
        display: none;
    }

    .projects-toggle-wrap {
        display: none;
    }

    .solution-grid,
    .product-examples-grid,
    .takeaways-grid,
    .takeaways-grid.four-col,
    .tech-deep-dive,
    .reality-grid,
    .research-visual-grid,
    .eval-grid,
    .stats-grid,
    .extra-visuals-grid,
    .challenge-grid-compact {
        display: flex !important;
        flex-wrap: nowrap !important;
        grid-template-columns: none !important;
        gap: 14px !important;
        align-items: flex-start !important;
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain;
        overscroll-behavior-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        scrollbar-width: none;
        padding: 12px 0 48px !important;
        margin-left: 0;
        margin-right: 0;
    }

    @supports (overflow-clip-margin: 80px) {
        .solution-grid,
        .product-examples-grid,
        .takeaways-grid,
        .takeaways-grid.four-col,
        .tech-deep-dive,
        .reality-grid,
        .research-visual-grid,
        .eval-grid,
        .stats-grid,
        .extra-visuals-grid,
        .challenge-grid-compact {
            overflow-x: scroll;
            overflow-y: clip;
            overflow-clip-margin: 80px;
        }
    }

    .solution-grid::-webkit-scrollbar,
    .product-examples-grid::-webkit-scrollbar,
    .takeaways-grid::-webkit-scrollbar,
    .tech-deep-dive::-webkit-scrollbar,
    .reality-grid::-webkit-scrollbar,
    .research-visual-grid::-webkit-scrollbar,
    .eval-grid::-webkit-scrollbar,
    .stats-grid::-webkit-scrollbar,
    .extra-visuals-grid::-webkit-scrollbar,
    .challenge-grid-compact::-webkit-scrollbar {
        display: none;
    }

    .solution-grid > *,
    .product-examples-grid > *,
    .takeaways-grid > *,
    .tech-deep-dive > *,
    .reality-grid > *,
    .research-visual-grid > *,
    .eval-grid > *,
    .extra-visuals-grid > *,
    .challenge-grid-compact > * {
        flex: 0 0 86% !important;
        min-width: 260px;
        max-width: 340px;
        scroll-snap-align: start;
    }

    .stats-grid > * {
        flex: 0 0 46% !important;
        min-width: 150px;
        scroll-snap-align: start;
    }

    /* Unified slide border & shadow for all mobile carousels */
    .solution-grid > *,
    .product-examples-grid > *,
    .takeaways-grid > *,
    .tech-deep-dive > *,
    .reality-grid > *,
    .research-visual-grid > *,
    .eval-grid > *,
    .stats-grid > *,
    .extra-visuals-grid > *,
    .challenge-grid-compact > * {
        border: 1px solid var(--border-strong);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    }
}
