/* ===================================
   Guillaume Caillet — Portfolio
   Minimal, dark, micro-animated
   =================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #1a1a1a;
    --bg-elevated: #222222;
    --bg-card: #252525;
    --text: #f5f0eb;
    --text-muted: rgba(245, 240, 235, 0.45);
    --text-dim: rgba(245, 240, 235, 0.2);
    --border: rgba(245, 240, 235, 0.08);
    --border-hover: rgba(245, 240, 235, 0.15);
    --glow: rgba(245, 240, 235, 0.04);
    --accent: #4d34ff;
    --accent-strong: #1400a0;
    --accent-soft: rgba(77, 52, 255, 0.14);
    --surface: rgba(26, 26, 28, 0.72);
    --surface-light: rgba(26, 26, 28, 0.62);
    --surface-border: rgba(255, 255, 255, 0.06);
    --ink: rgba(245, 240, 235, 0.12);
    --ink-strong: rgba(245, 240, 235, 0.3);
    --radius: 12px;
    --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="light"] {
    --bg: #ffffff;
    --bg-elevated: #f7f6f4;
    --bg-card: #f5f5f5;
    --text: #1a1a1a;
    --text-muted: rgba(26, 26, 26, 0.5);
    --text-dim: rgba(26, 26, 26, 0.25);
    --border: rgba(26, 26, 26, 0.1);
    --border-hover: rgba(26, 26, 26, 0.2);
    --glow: rgba(26, 26, 26, 0.04);
    --accent: #1400a0;
    --accent-strong: #1400a0;
    --accent-soft: rgba(20, 0, 160, 0.08);
    --surface: rgba(255, 255, 255, 0.78);
    --surface-light: rgba(255, 255, 255, 0.66);
    --surface-border: rgba(26, 26, 26, 0.08);
    --ink: rgba(26, 26, 26, 0.14);
    --ink-strong: rgba(26, 26, 26, 0.35);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    letter-spacing: -0.03em;
    background-color: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* --- Keyboard focus: accent ring on keyboard nav only --- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* --- Navigation --- */
/* --- Global galaxy background (dark pages) --- */
.galaxy-bg {
    position: fixed;
    inset: 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.52rem;
    line-height: 1.15;
    color: var(--ink);
    white-space: pre;
    letter-spacing: 0.04em;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

body:not(.landing-active):not(.loading) .galaxy-bg {
    opacity: 1;
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 48px;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

body.loading .nav {
    opacity: 0;
    pointer-events: none;
}

.nav::after {
    content: '';
    position: absolute;
    inset: 0;
    bottom: -24px;
    z-index: -1;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 100%);
}

.nav-logo {
    display: flex;
    align-items: center;
    pointer-events: auto;
    transition: opacity var(--transition-fast);
}

.nav-logo:hover {
    opacity: 0.7;
}

.nav-logo svg {
    display: block;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.01em;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text);
    transition: width var(--transition);
}

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

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

.nav-link.active {
    color: var(--text);
}

/* --- Pages --- */
.page {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;       /* stack content + page-footer vertically */
    align-items: center;          /* horizontal centring */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.6s;
    padding: 100px 48px 0;        /* no bottom padding: footer lives inside .page */
    overflow-y: auto;
}

.page--active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.page--exit {
    opacity: 0;
    transform: translateY(-20px);
    visibility: hidden;
    pointer-events: none;
}

#landing {
    background-color: var(--bg);
    color: var(--text);
    overflow-y: auto;
    overflow-x: hidden;
}

body.landing-active .cursor-trail span {
    color: var(--ink-strong);
}

.landing-company {
    color: var(--accent);
    text-decoration: none;
    display: inline-block;
}

/* --- Landing Page ---
   3-row grid: spacer · hero · spacer ; with the bottom context anchored to the
   end of row 3 so the hero stays at the geometric centre of the page.
*/
.landing {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    margin-top: auto;
    margin-bottom: auto;
    position: relative;
    z-index: 1;
}

.landing-hero {
    min-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.landing-context {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 32px;
    padding-bottom: 120px;
}

.landing-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.landing-title .line {
    display: block;
    text-wrap: balance;
    opacity: 0;
    filter: blur(14px);
    transform: translateY(10px);
    transition:
        opacity 1.1s cubic-bezier(0.01, 0.73, 0.42, 0.99),
        filter  1.1s cubic-bezier(0.01, 0.73, 0.42, 0.99),
        transform 1.1s cubic-bezier(0.01, 0.73, 0.42, 0.99);
}

.landing-title .line.revealed {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.landing-sub {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    opacity: 0;
    filter: blur(10px);
    transform: translateY(8px);
    transition:
        opacity 1s cubic-bezier(0.01, 0.73, 0.42, 0.99),
        filter  1s cubic-bezier(0.01, 0.73, 0.42, 0.99),
        transform 1s cubic-bezier(0.01, 0.73, 0.42, 0.99);
}

.landing-sub-sep {
    color: var(--text-dim);
    line-height: 1;
}

.landing-sub-loc {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
}

.landing-sub-loc .pin-icon {
    flex-shrink: 0;
    color: var(--accent);
    transform: translateY(-0.5px);
}

.landing-sub.visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.landing-pitch {
    margin-top: 24px;
    max-width: 620px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
    letter-spacing: 0.005em;
    opacity: 0;
    filter: blur(10px);
    transform: translateY(8px);
    transition:
        opacity 1s cubic-bezier(0.01, 0.73, 0.42, 0.99),
        filter  1s cubic-bezier(0.01, 0.73, 0.42, 0.99),
        transform 1s cubic-bezier(0.01, 0.73, 0.42, 0.99);
}

.landing-pitch.visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.landing-pitch strong {
    color: var(--text);
    font-weight: 600;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.landing-contact {
    opacity: 0;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    transition: all var(--transition-fast);
    position: relative;
}

.contact-link:last-child {
    border-bottom: 1px solid var(--border);
}

.contact-link::before {
    content: '';
    position: absolute;
    inset: 0 -16px;
    background: var(--glow);
    border-radius: 8px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.contact-link:hover::before {
    opacity: 1;
}

.contact-link:hover {
    border-color: var(--border-hover);
    padding-left: 8px;
}

.contact-link:hover + .contact-link {
    border-top-color: var(--border-hover);
}

.contact-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    min-width: 80px;
    transition: color var(--transition-fast);
    position: relative;
    z-index: 1;
}

.contact-link:hover .contact-label {
    color: var(--text);
}

.contact-value {
    font-size: 0.9375rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    position: relative;
    z-index: 1;
}

.contact-link:hover .contact-value {
    color: var(--text);
}

/* --- Landing Link Cards --- */
.landing-links {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(8px);
    transition:
        opacity 1s cubic-bezier(0.01, 0.73, 0.42, 0.99),
        filter  1s cubic-bezier(0.01, 0.73, 0.42, 0.99),
        transform 1s cubic-bezier(0.01, 0.73, 0.42, 0.99);
}

.landing-links.visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.landing-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.landing-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.landing-link-card:hover {
    border-color: transparent;
    transform: translateY(-2px);
}

.landing-link-card-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1a1a1a;
}

.landing-link-card-arrow {
    font-size: 1.125rem;
    color: rgba(26, 26, 26, 0.3);
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.landing-link-card:hover .landing-link-card-arrow {
    transform: translateX(4px);
    color: #1a1a1a;
}

@media (max-width: 768px) {
    .landing-links-grid {
        grid-template-columns: 1fr;
    }
}

/* --- ASCII Galaxy --- */
.ascii-sphere {
    position: absolute;
    inset: 0;
    overflow: hidden;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.52rem;
    line-height: 1.15;
    color: var(--text);
    white-space: pre;
    letter-spacing: 0.04em;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    transition: color 1.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ascii-sphere.loaded {
    color: var(--ink);
}

/* --- Cursor follower --- */
.cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--ink-strong);
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    transition: color 0.3s;
}

/* --- Page Title (shared) --- */
.page-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 64px;
}

/* --- Who Am I Page --- */
.who {
    width: 100%;
    max-width: 800px;
    padding-top: 20px;
}

.who-intro {
    margin-bottom: 64px;
}

.who-intro p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 20px;
}

.who-intro p:last-child {
    margin-bottom: 0;
}

.who-intro s {
    color: var(--text-muted);
}

.who-section {
    margin-bottom: 56px;
}

.who-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 32px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.who-label {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 20px;
}

.who-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    font-weight: 400;
    max-width: 640px;
    margin-bottom: 12px;
}

/* Experience entries */
.experience-entry {
    border-bottom: 1px solid var(--border);
}

.experience-entry:first-of-type {
    border-top: 1px solid var(--border);
}

.experience-header {
    display: grid;
    grid-template-columns: 160px 1fr auto;
    gap: 32px;
    padding: 24px 0;
    cursor: pointer;
    align-items: center;
    transition: opacity var(--transition-fast);
}

.experience-header:hover {
    opacity: 0.7;
}

.experience-toggle {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    user-select: none;
}

.experience-entry.open .experience-toggle {
    transform: rotate(45deg);
}

.experience-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding-top: 2px;
}

.experience-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.experience-role {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.experience-company {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.experience-company a {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.experience-company a:hover {
    color: var(--text);
}

.experience-desc {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 0 0 192px;
}

.experience-entry.open .experience-desc {
    padding: 0 0 24px 192px;
}

.experience-desc p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 12px;
}

.experience-desc p:last-child {
    margin-bottom: 0;
}

.experience-desc strong {
    font-weight: 600;
}

.experience-desc ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.experience-desc li {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text);
    padding-left: 16px;
    position: relative;
}

.experience-desc li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
}

/* Who links */
.who-link {
    display: inline-block;
    font-size: 0.9375rem;
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--border-hover);
    transition: text-decoration-color var(--transition-fast);
}

.who-link:hover {
    text-decoration-color: var(--text);
}

.who-links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.who-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.who-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.who-link-card:hover {
    border-color: transparent;
    transform: translateY(-2px);
}

.who-link-card-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
}

.who-link-card-arrow {
    font-size: 1.125rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.who-link-card:hover .who-link-card-arrow {
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .experience-header {
        grid-template-columns: 1fr auto;
        gap: 16px;
    }

    .experience-header .experience-date {
        grid-column: 1 / -1;
    }

    .experience-desc {
        padding: 0;
    }

    .experience-entry.open .experience-desc {
        padding: 0 0 24px 0;
    }

    .who-links-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Projects Page --- */
.projects {
    width: 100%;
    max-width: 800px;
    padding-top: 20px;
    padding-bottom: 56px;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-card {
    display: block;
    transition: border-color var(--transition-fast);
    position: relative;
    overflow: hidden;
}

/* Subtle "ultracode bar" sweep on hover — a dithered dot matrix band
   along the bottom edge, with a travelling highlight window. Almost a
   watermark: nerd / PS2 dot-matrix, not a solid line. */
.project-card::before { content: none; }

.project-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 10px;
    background-image: radial-gradient(circle, var(--accent) 0.7px, transparent 0.8px);
    background-size: 5px 5px;
    background-position: 0 100%;
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
    /* a soft highlight window slides across the dots */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 50%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0%, #000 50%, transparent 100%);
    -webkit-mask-size: 60% 100%;
            mask-size: 60% 100%;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: -60% 0;
            mask-position: -60% 0;
}

.project-card:hover::after {
    opacity: 0.5;
    animation: cardDotSweep 2s linear infinite;
}

@keyframes cardDotSweep {
    from { -webkit-mask-position: -60% 0;  mask-position: -60% 0; }
    to   { -webkit-mask-position: 160% 0;  mask-position: 160% 0; }
}

.project-card-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 2px 0;
    position: relative;
    z-index: 1;
}

.project-index {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-dim);
    min-width: 28px;
    font-variant-numeric: tabular-nums;
    transition: color var(--transition-fast);
}

.project-card:hover .project-index {
    color: var(--text-muted);
}

.project-info {
    flex: 1;
}

.project-name {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
    transition: transform var(--transition-fast);
}

.project-card:hover .project-name {
    transform: translateX(4px);
}

.project-type {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 400;
    transition: color var(--transition-fast);
}

.project-card:hover .project-type {
    color: var(--text);
}

.project-arrow {
    font-size: 1.25rem;
    color: var(--text-dim);
    transition:
        color var(--transition-fast),
        transform var(--transition-fast);
}

.project-card:hover .project-arrow {
    color: var(--text);
    transform: translateX(6px);
}

/* Project card stagger animation — gentle fade + tiny rise, GPU-only.
   Small offset + overlapping timing keeps the cascade smooth, not jerky. */
.project-card {
    opacity: 0;
    transform: translateY(6px);
    will-change: opacity, transform;
    transition:
        opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        border-color var(--transition-fast);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Cursor ASCII Trail --- */
.cursor-trail {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cursor-trail span {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    color: var(--text-muted);
    pointer-events: none;
    animation: trailFade 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes trailFade {
    0% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3) rotate(45deg);
    }
}

/* --- Page title animation --- */
.page-title {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(6px);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.page--active .page-title {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition-delay: 0.15s;
}

/* --- Case Study Pages --- */
.case-study {
    width: 100%;
    max-width: 800px;
    padding-top: 20px;
    padding-bottom: 80px;
}

.case-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 48px;
    transition: color var(--transition-fast);
    cursor: pointer;
}

.case-back:hover {
    color: var(--text);
}

.case-header {
    margin-bottom: 64px;
}

.case-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.case-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    line-height: 1.15;
}

.case-subtitle {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 24px;
}

.case-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.case-tag {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
}

.case-section {
    margin-bottom: 56px;
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.case-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.case-image {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 48px;
}

.case-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: zoom-in;
}

.case-image img:hover {
    transform: scale(1.02);
}

/* --- Lightbox --- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-overlay.active img {
    transform: scale(1);
}

.case-image figcaption {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 12px;
    text-align: center;
}

.case-image--cover {
    margin-bottom: 56px;
    overflow: hidden;
    border-radius: var(--radius);
}

.case-image--cover img {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: zoom-in;
}

.case-image--cover img:hover {
    transform: scale(1.02);
}

.case-image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 48px 0;
}

@media (max-width: 768px) {
    .case-image-grid {
        grid-template-columns: 1fr;
    }
}

.case-section p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 16px;
}

.case-section p:last-child {
    margin-bottom: 0;
}

/* ===================================
   Readable surfaces — semi-opaque dark backgrounds for text blocks
   so the galaxy canvas doesn't distract from reading.
   Default = dark anthracite (used on every page with galaxy bg).
   Landing page overrides below (clean white page, no boxes needed).
   =================================== */
.who-intro,
.who-section,
.case-section,
.case-header,
.project-card,
.project-other-list {
    position: relative;
    background: var(--surface);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 28px 32px;
}

/* Project cards — clean surface, no hover halo per design feedback */
.project-card {
    background: var(--surface-light);
    padding: 9px 22px;
}

/* Other-projects list as one surface */
.project-other-list {
    padding: 20px 28px;
}

/* Landing pitch — masked surface so the galaxy doesn't bleed through */
.landing-pitch {
    background: var(--surface-light);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 22px 26px;
    margin-top: 32px;
}

/* On case study pages, the header & sections breathe a bit more */
.case-header {
    padding: 32px 36px;
    margin-bottom: 24px;
}
.case-section {
    margin-bottom: 20px;
}

/* Caption — meta commentary under code/diff blocks */
.case-section .case-caption {
    font-size: 0.875rem;
    line-height: 1.55;
    color: rgba(230, 195, 74, 0.85);
    margin-top: 16px;
    padding-left: 12px;
    border-left: 2px solid rgba(230, 195, 74, 0.35);
}

.case-section .case-caption em {
    color: #e6c34a;
    font-style: normal;
    font-weight: 500;
}

.case-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.case-list li {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    padding-left: 20px;
    position: relative;
}

.case-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.case-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.case-metric {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-metric.visible {
    opacity: 1;
    transform: translateY(0);
}

.case-metric-value {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.case-metric-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav {
        padding: 20px 24px;
    }

    .nav-links {
        gap: 24px;
    }

    .page {
        padding: 88px 24px 32px;
        align-items: flex-start;
        overflow-x: hidden;
    }

    .landing {
        gap: 0;
        justify-content: flex-start;
        min-height: auto;
        margin-top: 0;
        margin-bottom: 0;
    }

    .landing-hero {
        min-height: calc(100vh - 88px - 32px);
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .landing-context {
        padding-bottom: 48px;
    }

    .contact-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 16px 0;
    }

    .contact-label {
        min-width: unset;
    }

    .experience-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .experience-role {
        min-width: unset;
    }

    .experience-period {
        margin-left: 0;
        width: 100%;
    }

    .project-card-inner {
        padding: 20px 0;
    }

    .project-name {
        font-size: 1.0625rem;
    }

    .case-study {
        padding-bottom: 48px;
    }

    .case-header {
        margin-bottom: 40px;
    }

    .case-metrics {
        grid-template-columns: 1fr;
    }

    .case-metric {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .landing-title {
        font-size: 1.75rem;
    }

    .page-title {
        font-size: 1.75rem;
        margin-bottom: 40px;
    }
}

/* ===================================
   GitHub-style Buttons
   =================================== */

/* Override landing-link-card as gh-btn */
.landing-link-card {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding: 8px 14px !important;
    border: 1px solid var(--border-hover) !important;
    border-radius: 6px !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: var(--text) !important;
    background: var(--bg-card) !important;
    cursor: pointer !important;
    transition: all var(--transition-fast) !important;
    position: relative !important;
    z-index: 2 !important;
    white-space: nowrap;
}

.landing-link-card:hover {
    background: var(--bg-elevated) !important;
    border-color: var(--text-dim) !important;
    transform: translateY(-1px) !important;
}

.landing-link-card svg {
    flex-shrink: 0;
    opacity: 0.65;
}

.landing-link-card-label {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: var(--text) !important;
}

.landing-btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Override who-link-card as gh-btn */
.who-link-card {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding: 8px 14px !important;
    border: 1px solid var(--border-hover) !important;
    border-radius: 6px !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: var(--text) !important;
    background: var(--bg-card) !important;
    cursor: pointer !important;
    transition: all var(--transition-fast) !important;
    position: relative !important;
    white-space: nowrap;
}

.who-link-card:hover {
    background: var(--bg-elevated) !important;
    border-color: var(--text-dim) !important;
    transform: translateY(-1px) !important;
}

.who-link-card svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.who-link-card-label {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: var(--text) !important;
}

.who-btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===================================
   Nav Right: Star + Lang
   =================================== */

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
    pointer-events: auto;
}

/* --- Star Button --- */
.nav-star {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-star:hover {
    background: var(--bg-elevated);
    border-color: var(--text-dim);
    color: var(--text);
}

.nav-star.starred {
    border-color: rgba(218, 165, 32, 0.4);
    background: rgba(255, 215, 0, 0.07);
    color: #c9a227;
}

.nav-star.starred svg {
    fill: #f0b429;
    stroke: #d49e0b;
}

.star-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    height: 17px;
    min-width: 22px;
    background: var(--glow);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0;
}

/* Star tooltip */
.star-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--text);
    color: var(--bg);
    font-size: 0.6875rem;
    font-weight: 400;
    padding: 7px 11px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 600;
    font-family: inherit;
}

.star-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 14px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid var(--text);
}

.star-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Language Switch --- */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 3px;
}

.lang-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 3px;
    transition: color var(--transition-fast);
}

.lang-btn:hover,
.lang-btn.active {
    color: var(--text);
}

.lang-btn.active {
    font-weight: 700;
}

.lang-divider {
    color: var(--text-dim);
    font-size: 0.6875rem;
    pointer-events: none;
    user-select: none;
}

/* --- Burger Button (hidden on desktop) --- */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    pointer-events: auto;
    z-index: 10;
}

.burger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* X shape when open */
.burger-btn[aria-expanded="true"] .burger-line:first-child {
    transform: translateY(3.5px) rotate(45deg);
}

.burger-btn[aria-expanded="true"] .burger-line:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
}

/* Mobile nav adjustments */
@media (max-width: 768px) {
    .burger-btn {
        display: flex;
        order: 3;
    }

    .nav-right {
        gap: 12px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        padding: 80px 24px 24px;
        background: var(--bg-elevated);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                    visibility 0.35s;
        pointer-events: none;
        z-index: -1;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-link {
        display: block;
        padding: 16px 0;
        font-size: 1.125rem;
        font-weight: 500;
        border-bottom: 1px solid var(--border);
    }

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

    .nav-link::after {
        display: none;
    }

    .nav-star span[data-i18n] {
        display: none;
    }

    .lang-switch {
        gap: 2px;
    }
}

/* ===================================
   Year Labels in Projects List
   =================================== */
.project-year-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 20px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    pointer-events: none;
    user-select: none;
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-year-label.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-list-sep {
    height: 1px;
    background: var(--border);
    margin: 12px 0 4px;
    opacity: 0.5;
}

/* ===================================
   Case study image — graceful fallback
   =================================== */
.case-image--missing {
    background: var(--bg-elevated);
    border: 1px dashed var(--border);
    border-radius: 8px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    padding: 32px 24px;
}
.case-image--missing img,
.case-image--missing figcaption {
    display: none;
}
.case-image--missing::before {
    content: 'Image — pending upload';
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.case-image--missing::after {
    content: attr(data-placeholder);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.62rem;
    color: var(--text-dim);
    text-align: center;
    max-width: 460px;
}

/* ===================================
   Other projects — simple list (non-clickable)
   =================================== */
.project-other-list {
    list-style: none;
    padding: 14px 28px 18px;
    margin: 0;
}

.project-other-item {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.project-other-item:last-child {
    border-bottom: none;
}

.project-other-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    flex-shrink: 0;
}

.project-other-type {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.02em;
}

@media (max-width: 600px) {
    .project-other-item {
        flex-direction: column;
        gap: 4px;
    }
}

/* ===================================
   Project company tag (above name)
   =================================== */
.project-company {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 8px;
    transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
    font-family: 'IBM Plex Mono', monospace;
    line-height: 1.3;
}

.project-card:hover .project-company {
    color: var(--text);
    border-color: var(--border-hover);
}

/* Subtle accent per company — optional */
.project-company--oplit {
    color: rgba(99, 132, 255, 0.85);
    border-color: rgba(99, 132, 255, 0.25);
}
.project-card:hover .project-company--oplit {
    color: #8ea6ff;
    border-color: rgba(99, 132, 255, 0.45);
}

.project-company--prestashop {
    color: rgba(165, 132, 230, 0.8);
    border-color: rgba(165, 132, 230, 0.22);
}
.project-card:hover .project-company--prestashop {
    color: #c2a8ee;
    border-color: rgba(165, 132, 230, 0.4);
}

.project-company--perso {
    color: var(--text-muted);
    border-color: var(--border);
    border-style: dashed;
}
.project-card:hover .project-company--perso {
    color: var(--text);
    border-color: var(--border-hover);
}

/* ===================================
   Inline Prototypes — Shared
   =================================== */
.proto-table-wrapper {
    overflow-x: auto;
    margin-top: 24px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.proto-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
    font-family: 'IBM Plex Mono', monospace;
}

.proto-table th {
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-weight: 500;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.proto-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

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

/* Status indicators */
.proto-status {
    display: inline-block;
    font-size: 0.9em;
    font-weight: 600;
}
.proto-status--ok    { color: #4caf6e; }
.proto-status--warn  { color: #e8a020; }
.proto-status--ko    { color: #e85050; }

/* Status badges */
.proto-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    font-family: 'IBM Plex Mono', monospace;
}
.proto-badge--ok   { background: rgba(76,175,110,0.15); color: #4caf6e; }
.proto-badge--warn { background: rgba(232,160,32,0.15); color: #e8a020; }
.proto-badge--ko   { background: rgba(232,80,80,0.15);  color: #e85050; }
.proto-badge--high { background: rgba(232,80,80,0.15);  color: #e85050; }
.proto-badge--med  { background: rgba(232,160,32,0.15); color: #e8a020; }
.proto-badge--low  { background: rgba(76,175,110,0.15); color: #4caf6e; }

/* ===================================
   Polyvalence / Competency Matrix
   =================================== */
.proto-competency {
    margin-top: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
}

.proto-competency-header {
    display: grid;
    grid-template-columns: 1fr 80px 80px 80px;
    background: var(--bg-elevated);
    padding: 8px 14px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.proto-competency-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px 80px;
    padding: 7px 14px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    gap: 8px;
}

.proto-competency-row:last-child {
    border-bottom: none;
}

.proto-dim { color: var(--text-muted); }

.proto-bar {
    height: 8px;
    border-radius: 2px;
    background: var(--bg-elevated);
    position: relative;
}
.proto-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 2px;
    background: #3f64ff;
}
.proto-bar--1::after { width: 25%; }
.proto-bar--2::after { width: 50%; }
.proto-bar--3::after { width: 75%; }
.proto-bar--4::after { width: 100%; }

.proto-bar--cert {
    height: auto;
    background: none;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}
.proto-bar--cert::after { display: none; }
.proto-bar--ok  { color: #4caf6e; }
.proto-bar--ko  { color: var(--text-muted); }

/* ===================================
   Gantt SVG Prototype
   =================================== */
.proto-gantt-wrapper {
    margin-top: 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}

.proto-gantt {
    width: 100%;
    min-width: 500px;
    height: auto;
}

/* ===================================
   Token Before/After Diff
   =================================== */
.proto-token-diff {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.proto-token-side {
    flex: 1;
    min-width: 200px;
}

.proto-token-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding: 2px 8px;
    border-radius: 3px;
    display: inline-block;
}
.proto-token-label--before { background: rgba(232,80,80,0.15); color: #e85050; }
.proto-token-label--after  { background: rgba(76,175,110,0.15); color: #4caf6e; }

.proto-token-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 300;
    align-self: center;
}

.proto-code {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 0.68rem;
    font-family: 'IBM Plex Mono', monospace;
    color: rgba(245, 240, 235, 0.85);
    white-space: pre;
    overflow-x: auto;
    line-height: 1.6;
}

.proto-hex   { color: #e85050; }
.proto-token { color: #4caf6e; }

/* ===================================
   Dev Alignment Workflow
   =================================== */
.proto-workflow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.proto-workflow-step {
    flex: 1;
    min-width: 100px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
}

.proto-workflow-step--done {
    border-color: rgba(76,175,110,0.4);
    background: rgba(76,175,110,0.05);
}

.proto-workflow-icon {
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.proto-workflow-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    font-family: 'IBM Plex Mono', monospace;
}

.proto-workflow-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
}

.proto-workflow-arrow {
    color: var(--text-muted);
    font-size: 1rem;
    flex-shrink: 0;
}

/* ===================================
   Figma Plugin Panel Mockup
   =================================== */
.proto-figma-panel {
    margin-top: 24px;
    background: #2c2c2c;
    border: 1px solid #404040;
    border-radius: 8px;
    overflow: hidden;
    max-width: 360px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
}

.proto-figma-titlebar {
    background: #1e1e1e;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #404040;
}

.proto-figma-title {
    color: #ccc;
    font-size: 0.72rem;
    font-weight: 500;
}

.proto-figma-close {
    color: #666;
    cursor: default;
    font-size: 0.65rem;
}

.proto-figma-body {
    padding: 0;
}

.proto-figma-row {
    display: grid;
    grid-template-columns: 1fr 50px 60px;
    padding: 8px 12px;
    border-bottom: 1px solid #383838;
    align-items: center;
    gap: 8px;
    color: #ccc;
}

.proto-figma-row--header {
    background: #242424;
    color: #888;
    font-size: 0.62rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.proto-figma-count {
    text-align: center;
    color: #aaa;
}

.proto-priority {
    text-align: center;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    letter-spacing: 0.05em;
}
.proto-priority--high { background: rgba(232,80,80,0.2);   color: #e85050; }
.proto-priority--med  { background: rgba(232,160,32,0.2);  color: #e8a020; }
.proto-priority--low  { background: rgba(76,175,110,0.2);  color: #4caf6e; }

.proto-figma-actions {
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    border-top: 1px solid #383838;
}

.proto-figma-btn {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-family: 'IBM Plex Mono', monospace;
    cursor: default;
    border: 1px solid #555;
    background: #383838;
    color: #ccc;
}

.proto-figma-btn--primary {
    background: #1a73e8;
    border-color: #1a73e8;
    color: white;
}

/* ===================================
   WO Lock State Matrix — state badges
   =================================== */
.proto-state {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    font-family: 'IBM Plex Mono', monospace;
}
.proto-state--unlocked  { background: rgba(76,175,110,0.12);  color: #4caf6e; }
.proto-state--locked    { background: rgba(232,80,80,0.12);   color: #e85050; }
.proto-state--partial   { background: rgba(232,160,32,0.12);  color: #e8a020; }
.proto-state--inherited { background: rgba(100,100,200,0.15); color: #8888ff; }

/* ===================================
   Bulk Edit Toolbar Mockup
   =================================== */
.proto-toolbar-wrapper {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.proto-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-hover);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'IBM Plex Mono', monospace;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.proto-toolbar-count {
    font-size: 0.7rem;
    color: var(--text);
    font-weight: 600;
    padding-right: 4px;
}

.proto-toolbar-sep {
    width: 1px;
    height: 16px;
    background: var(--border);
}

.proto-toolbar-btn {
    padding: 4px 9px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-family: 'IBM Plex Mono', monospace;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    cursor: default;
    transition: background var(--transition-fast);
}

.proto-toolbar-btn--danger {
    border-color: rgba(232,80,80,0.3);
    color: #e85050;
    background: rgba(232,80,80,0.06);
}

/* ===================================
   Sticky Action Bar Prototype
   =================================== */
.proto-stickybar-wrapper {
    margin-top: 24px;
}

.proto-stickybar {
    background: #3f3fb5;
    color: white;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    font-family: 'IBM Plex Mono', monospace;
    max-width: 720px;
}

.proto-stickybar-capa {
    display: flex;
    justify-content: flex-end;
    margin-bottom: -4px;
}
.proto-stickybar-capa-pill {
    background: #5252d6;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.62rem;
    font-weight: 600;
    color: white;
}

.proto-stickybar-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.proto-stickybar-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    color: white;
    cursor: default;
}

.proto-stickybar-checkbox {
    font-size: 0.85rem;
    line-height: 1;
}

.proto-stickybar-summary {
    flex: 1;
    text-align: right;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

.proto-stickybar-close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    cursor: default;
    padding: 0 4px;
}

.proto-stickybar-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.proto-stickybar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.proto-stickybar-chip {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: white;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.65rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    cursor: default;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.proto-stickybar-chip--more {
    padding: 5px 9px;
    font-weight: 700;
    letter-spacing: 1px;
}

.proto-stickybar-nav {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 2px;
}

.proto-stickybar-navbtn {
    background: transparent;
    border: none;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-family: 'IBM Plex Mono', monospace;
    cursor: default;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.proto-stickybar-caption {
    margin-top: 8px;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    font-style: italic;
}

.proto-stickybar-caption--menu {
    margin-top: 4px;
    margin-bottom: 4px;
}

.proto-stickybar-menu {
    margin-top: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 220px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.proto-stickybar-menu-item {
    padding: 6px 10px;
    font-size: 0.7rem;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text);
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===================================
   Responsive adjustments for protos
   =================================== */
@media (max-width: 768px) {
    .proto-token-diff   { flex-direction: column; }
    .proto-token-arrow  { transform: rotate(90deg); align-self: center; }
    .proto-workflow     { gap: 4px; }
    .proto-workflow-step { min-width: 80px; padding: 8px 8px; }
    .proto-sticky-compare { flex-direction: column; }
    .proto-gantt-wrapper { padding: 8px; }
}

/* ===================================
   Site footer
   Lives inside each .page (cloned via JS) so it sits at the end of the
   page's scroll area. The user scrolls down to reveal it.
   The original template at body level is hidden.
   =================================== */
.site-footer.footer-template {
    display: none;
}

.site-footer {
    /* Normal flow at the end of .page (flex-column). */
    width: calc(100% + 96px);     /* span across .page horizontal padding */
    margin-left: -48px;
    margin-right: -48px;
    margin-top: auto;             /* push to the very bottom of the flex column */
    padding: 16px 48px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.footer-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px 24px;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-name {
    color: var(--text);
    font-weight: 500;
}

.footer-sep {
    color: var(--text-dim);
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--text);
}

/* Footer shows on the landing too now that it carries key projects */

@media (max-width: 768px) {
    .site-footer {
        width: calc(100% + 48px);
        margin-left: -24px;
        margin-right: -24px;
        padding: 16px 24px;
        font-size: 0.72rem;
    }
    .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ===================================
   Projects filter + subtle hover sweep
   =================================== */
.projects {
    position: relative;
}

.projects-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.filter-chip {
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.filter-chip:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

.filter-chip.active {
    color: var(--bg);
    background: var(--text);
    border-color: var(--text);
}

/* Special CTA — key projects */
.filter-chip--key {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    background: var(--accent-soft);
}

.filter-chip--key .filter-chip-glyph {
    font-size: 0.6rem;
    line-height: 1;
    transform: translateY(0.5px);
}

.filter-chip--key:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 65%, transparent);
    box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 22%, transparent);
}

.filter-chip--key.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 38%, transparent);
}

.filter-chip--key.active .filter-chip-glyph {
    animation: keyPulse 1.8s ease-in-out infinite;
}

@keyframes keyPulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}

.filter-sep {
    width: 1px;
    align-self: stretch;
    margin: 2px 4px;
    background: var(--border);
}

/* Filtering: hide non-matching cards, year labels, earlier-projects block */
.project-card.is-filtered-out,
.project-year-label.is-filtered-out,
.is-filtered-out {
    display: none !important;
}

/* When a filter is active the list breathes a touch more between cards */
.projects-list.is-filtering {
    gap: 12px;
}

/* Hide on smaller screens — list remains the primary affordance */
@media (max-width: 560px) {
    .projects-filter { gap: 6px; }
    .filter-chip { font-size: 0.68rem; padding: 5px 10px; }
}

/* ===================================
   Fallback toast (soft 404)
   =================================== */
.fallback-toast {
    position: fixed;
    bottom: 96px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 100;
    padding: 12px 20px;
    background: rgba(20, 0, 160, 0.96);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 30px rgba(20, 0, 160, 0.25);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fallback-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===================================================================
   REDESIGN 2026 — Theme toggle · Hero · Key projects · Immersion
   =================================================================== */

/* --- Color-scheme hints for native UI --- */
:root { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

/* --- Smooth theme transition --- */
body,
.page,
.nav-star,
.site-footer,
.who-intro, .who-section, .case-section, .case-header,
.project-card, .project-other-list, .landing-pitch {
    transition: background-color 0.45s ease, border-color 0.45s ease, color 0.45s ease;
}

/* --- Theme toggle button --- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    pointer-events: auto;
}

.theme-toggle:hover {
    background: var(--bg-elevated);
    border-color: var(--text-dim);
    color: var(--text);
}

.theme-toggle svg {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-toggle .icon-sun  { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

html[data-theme="light"] .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0) scale(1); }
html[data-theme="light"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }

/* --- Light-theme fixes for components tuned on dark --- */
html[data-theme="light"] .project-company--oplit {
    color: #2742c7;
    border-color: rgba(39, 66, 199, 0.35);
}
html[data-theme="light"] .project-card:hover .project-company--oplit {
    color: #1400a0;
    border-color: rgba(20, 0, 160, 0.5);
}
html[data-theme="light"] .project-company--prestashop {
    color: #6f42c1;
    border-color: rgba(111, 66, 193, 0.35);
}
html[data-theme="light"] .project-card:hover .project-company--prestashop {
    color: #59359c;
    border-color: rgba(111, 66, 193, 0.5);
}
html[data-theme="light"] .case-section .case-caption {
    color: #8a6d00;
    border-left-color: rgba(138, 109, 0, 0.4);
}
html[data-theme="light"] .case-section .case-caption em {
    color: #8a6d00;
}

/* Galaxy canvases stay visible on every page incl. landing */
body:not(.loading) .galaxy-bg { opacity: 1; }
body.landing-active .galaxy-bg { opacity: 0; }

/* --- Hero: proof stats --- */
.landing-stats {
    display: flex;
    flex-wrap: nowrap;
    gap: 24px;
    margin-top: 40px;
    opacity: 0;
    filter: blur(10px);
    transform: translateY(8px);
    transition:
        opacity 1s cubic-bezier(0.01, 0.73, 0.42, 0.99) 0.35s,
        filter  1s cubic-bezier(0.01, 0.73, 0.42, 0.99) 0.35s,
        transform 1s cubic-bezier(0.01, 0.73, 0.42, 0.99) 0.35s;
}

.landing-stats.visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.landing-stat {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 14px;
    border-left: 2px solid var(--accent);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.landing-stat:hover {
    transform: translateX(3px);
}

.landing-stat-value {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.landing-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.landing-stat-go {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.landing-stat:hover .landing-stat-go {
    opacity: 1;
    transform: translateY(0);
}

/* --- Hero: scroll cue --- */
.landing-scroll-cue {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
    pointer-events: none;
    user-select: none;
    opacity: 0;
    animation: fadeIn 1s ease 1.6s forwards;
}

.landing-scroll-cue::after {
    content: '';
    width: 1px;
    height: 34px;
    background: linear-gradient(to bottom, var(--text-dim), transparent);
    animation: cueDrop 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes cueDrop {
    0%   { transform: scaleY(0); transform-origin: top; }
    45%  { transform: scaleY(1); transform-origin: top; }
    55%  { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* --- Marquee: two bands — clients · skills --- */
.landing-marquee {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    user-select: none;
}

.marquee-row {
    overflow: hidden;
    padding: 14px 0;
}

.marquee-row + .marquee-row {
    border-top: 1px dashed var(--border);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 40s linear infinite;
}

.marquee-track--reverse {
    animation-name: marqueeScrollReverse;
    animation-duration: 52s;
}

.landing-marquee:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-track span {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-right: 18px;
}

.marquee-track .mq-accent {
    color: var(--accent);
}

.marquee-track .mq-label {
    font-weight: 700;
    font-style: normal;
    color: var(--bg);
    background: var(--text-muted);
    border-radius: 3px;
    padding: 2px 8px;
    margin-right: 16px;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
}

@keyframes marqueeScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@keyframes marqueeScrollReverse {
    from { transform: translateX(-50%); }
    to   { transform: translateX(0); }
}

/* --- Landing context (pitch + CTA) spacing after the marquee --- */
.landing-context {
    margin-top: 72px;
}

/* --- Projects list: KEY badge + hover preview --- */
.project-key-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--accent);
    border: 1px solid var(--accent-soft);
    background: var(--accent-soft);
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: 8px;
    vertical-align: middle;
    transform: translateY(-1px);
}

/* Floating preview = generated "memory card" cover. One template,
   data-driven per project — nerd / ASCII / PS2-era vibes. Always dark,
   electric-blue glow, CRT scanlines: deliberate in both themes. */
.project-preview {
    --cover-accent: #4d34ff;
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--cover-accent) 40%, transparent);
    background:
        radial-gradient(120% 90% at 20% 0%, color-mix(in srgb, var(--cover-accent) 24%, transparent), transparent 55%),
        #0d0d12;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.45),
        0 0 28px color-mix(in srgb, var(--cover-accent) 20%, transparent);
    pointer-events: none;
    z-index: 450;
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.25s ease, transform 0.25s ease;
    will-change: transform;
    color: #f5f0eb;
}

/* CRT scanlines + vignette over the whole card */
.project-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.028) 0px,
            rgba(255, 255, 255, 0.028) 1px,
            transparent 1px,
            transparent 3px
        ),
        radial-gradient(110% 110% at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
}

.project-preview.on {
    opacity: 1;
}

/* Content on the left, a themed pixel-art sprite on the right —
   keeps the card short. The sprite shimmers very lightly. */
.cover-card {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "body icon" "foot foot";
    column-gap: 14px;
    align-items: center;
    padding: 14px 16px 12px;
    font-family: 'IBM Plex Mono', monospace;
}

.cover-body { grid-area: body; min-width: 0; }

.cover-icon {
    grid-area: icon;
    display: grid;
    gap: 1px;
    align-self: center;
}

.cover-icon i {
    display: block;
    border-radius: 1px;
    background: transparent;
}

.cover-code {
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(245, 240, 235, 0.45);
    margin-bottom: 6px;
}

.cover-metric {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f5f0eb;
    font-variant-numeric: tabular-nums;
    margin-bottom: 2px;
}

.cover-title {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(245, 240, 235, 0.75);
    margin-bottom: 0;
}

.cover-foot {
    grid-area: foot;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 11px;
    padding-top: 8px;
    border-top: 1px solid rgba(245, 240, 235, 0.12);
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(245, 240, 235, 0.4);
}

.cover-foot .cover-slot {
    color: var(--cover-accent);
    text-shadow: 0 0 6px color-mix(in srgb, var(--cover-accent) 45%, transparent);
}

/* Light mode: the memory card flips to a white surface with dark text.
   The grid accent/off colors are supplied per-theme from JS via the
   --cover-* custom props. */
html[data-theme="light"] .project-preview {
    background:
        radial-gradient(120% 90% at 20% 0%, color-mix(in srgb, var(--cover-accent) 13%, transparent), transparent 55%),
        #ffffff;
    border-color: color-mix(in srgb, var(--cover-accent) 32%, transparent);
    box-shadow:
        0 24px 64px rgba(26, 26, 26, 0.16),
        0 0 22px color-mix(in srgb, var(--cover-accent) 12%, transparent);
    color: #1a1a1a;
}

html[data-theme="light"] .project-preview::after {
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(26, 26, 26, 0.03) 0px,
            rgba(26, 26, 26, 0.03) 1px,
            transparent 1px,
            transparent 3px
        ),
        radial-gradient(110% 110% at 50% 50%, transparent 62%, rgba(26, 26, 26, 0.08) 100%);
}

html[data-theme="light"] .cover-code   { color: rgba(26, 26, 26, 0.5); }
html[data-theme="light"] .cover-metric { color: #1a1a1a; }
html[data-theme="light"] .cover-title  { color: rgba(26, 26, 26, 0.72); }
html[data-theme="light"] .cover-foot   { color: rgba(26, 26, 26, 0.45); border-top-color: rgba(26, 26, 26, 0.12); }

/* --- Scroll reveals --- */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in {
    opacity: 1;
    transform: translateY(0);
}

/* --- Footer v2: CTA + local time --- */
.footer-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: nowrap;
    margin: 0 auto 14px;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--border);
}

.footer-cta-kicker {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

.footer-cta-actions {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
}

/* Same treatment as the .who-link-card buttons elsewhere on the site */
.footer-cta-mail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg-card);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.footer-cta-mail:hover {
    background: var(--bg-elevated);
    border-color: var(--text-dim);
    transform: translateY(-1px);
}

.footer-cta-mail svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.footer-time {
    font-variant-numeric: tabular-nums;
}

.footer-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.footer-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3fb950;
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.5);
    animation: statusPulse 2.4s ease-out infinite;
}

@keyframes statusPulse {
    0%   { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.45); }
    70%  { box-shadow: 0 0 0 7px rgba(63, 185, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}

/* --- Film grain --- */
body::after {
    content: '';
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 350;
    opacity: 0.032;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grainShift 9s steps(6) infinite;
}

@keyframes grainShift {
    0%   { transform: translate(0, 0); }
    20%  { transform: translate(-3%, 2%); }
    40%  { transform: translate(2%, -3%); }
    60%  { transform: translate(-2%, -2%); }
    80%  { transform: translate(3%, 3%); }
    100% { transform: translate(0, 0); }
}

/* --- Fix: 4 metrics → 2×2 grid instead of 3+1 orphan --- */
@media (min-width: 769px) {
    .case-metrics:has(> :nth-child(4)) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Thematic compass: restored — immersive companion to the hover covers */

/* --- Mobile adjustments --- */
@media (max-width: 768px) {
    .ascii-sphere.loaded { opacity: 0.55; }

    .landing-stats { flex-wrap: wrap; gap: 14px 24px; margin-top: 32px; }
    .landing-stat { flex: 1 1 100%; }
    .landing-stat-value { font-size: 1.15rem; }

    .landing-context { margin-top: 48px; }

    .landing-scroll-cue { bottom: 12px; }

    .footer-cta { padding: 0 0 16px; flex-wrap: wrap; gap: 14px; text-align: center; }
    .footer-cta-kicker { font-size: 0.95rem; }

    .project-preview { display: none; }
}

/* --- Reduced motion: calm everything down --- */
@media (prefers-reduced-motion: reduce) {
    .marquee-track { animation: none; }
    .landing-scroll-cue { display: none; }
    body::after { animation: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .cursor-follower, .cursor-trail { display: none !important; }
    .footer-status::before { animation: none; }
}
