/* Google Fonts — must be first */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300..700&family=Geist+Mono:wght@400;500&display=swap');

/* loader */
#loader {
    position: fixed;
    inset: 0;
    background: #080808;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    overflow: hidden;
    transition: opacity 0.7s ease;
}

#loaderName {
    position: fixed;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-body);
    font-size: 13px;
    letter-spacing: 0.25em;
    color: rgba(0, 229, 255, 0);
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 1.2s ease;
    z-index: 100002;
}

#loaderName.visible {
    color: rgba(0, 229, 255, 0.5);
}

/* Hero sphere au-dessus du fond noir pendant la formation */
.hero-sphere.is-loading {
    position: fixed !important;
    z-index: 100001 !important;
}

/* cursor */
*, *::before, *::after { cursor: none !important; }

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

/* variables */
:root {
    --bg: #080808;
    --text: #FFFFFF;
    --accent: #00E5FF;
    --muted: #848484;
    --font-display: 'Instrument Serif', serif;
    --font-body: 'Geist', sans-serif;
    --font-mono: 'Geist Mono', monospace;
}

/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-stopped { overflow: clip; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    overflow-x: hidden;
}

/* custom cursor */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: transform 0.08s ease, opacity 0.3s ease;
    box-shadow: 0 0 12px var(--accent), 0 0 24px rgba(0, 229, 255, 0.4);
}

/* scroll progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 0%;
    background: var(--accent);
    z-index: 9997;
    pointer-events: none;
    box-shadow: 0 0 8px var(--accent);
    transition: height 0.05s linear;
}

/* scroll hint */
.hero-scroll-hint {
    position: absolute;
    bottom: 60px;
    left: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.scroll-hint-text {
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--muted);
    text-transform: uppercase;
    animation: hint-pulse 2s ease-in-out infinite;
}

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

@keyframes hint-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; color: var(--accent); }
}

@keyframes hint-line {
    0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
    50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
    100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* stats block */
.about-stats {
    display: flex;
    gap: 80px;
    margin-top: 80px;
    justify-content: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 72px;
    font-weight: 400;
    color: var(--accent);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 12px;
    letter-spacing: 0.2em;
    color: var(--muted);
    text-transform: uppercase;
}

.stat-sub {
    font-size: 11px;
    letter-spacing: 0.15em;
    color: rgba(68, 68, 68, 0.5);
    font-style: italic;
    text-transform: uppercase;
}

/* navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 60px;
    z-index: 1000;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: inherit;
    text-decoration: none;
}

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

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.08em;
    transition: color 0.3s ease;
    position: relative;
}

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

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s ease;
}

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

/* hero */
.hero {
    height: 100vh;
    position: relative;
    padding: 0 60px;
    overflow: hidden;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
    z-index: 1;
}

.hero-slogan {
    font-family: var(--font-body);
    font-size: clamp(28px, 5vw, 72px);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}

.hero-name {
    font-family: var(--font-display);
    font-size: clamp(60px, 22vw, 430px);
    font-weight: 400;
    line-height: 0.85;
    white-space: nowrap;
    align-self: center;
    text-align: center;
    position: relative;
    cursor: pointer;
    user-select: none;
    letter-spacing: -0.02em;
}

/* glitch: stacked strips of the name, see initHeroGlitch */
.glitch-base { visibility: hidden; }

.glitch-strip {
    position: absolute;
    left: 0;
    right: 0;
    top: -0.2em;
    bottom: -0.2em;
    padding: 0.2em 0;
    pointer-events: none;
    will-change: transform;
    text-shadow:
        calc(var(--split, 0px) * -1) 0 rgba(255, 0, 64, 0.85),
        var(--split, 0px) 0 rgba(0, 229, 255, 0.85);
}

.hero-btn {
    position: absolute;
    bottom: 60px;
    right: 60px;
    padding: 14px 32px;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.hero-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

.hero-sphere {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: max(90vw, 90vh);
    height: max(90vw, 90vh);
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-sphere canvas {
    width: 100% !important;
    height: 100% !important;
}

/* about */
.about {
    padding: 80px 60px;
    border-top: 1px solid var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.about-label {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.22em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 40px;
}

.about-text {
    font-family: var(--font-body);
    font-size: 20px;
    font-weight: 300;
    line-height: 1.85;
    margin-bottom: 16px;
    max-width: 1200px;
    width: 100%;
}

.about-signature {
    font-style: italic;
    font-weight: 300;
    color: var(--muted);
    margin-top: 24px;
    font-size: 17px;
}

/* selected works */
.works {
    padding: 80px 60px;
    border-top: 1px solid var(--muted);
    overflow: hidden;
}

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

.works-label {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.18em;
    color: var(--accent);
    text-transform: uppercase;
}

.works-list {
    display: flex;
    flex-direction: column;
}

.work-item {
    display: grid;
    grid-template-columns: 60px 1fr auto auto;
    align-items: center;
    gap: 40px;
    padding: 32px 0;
    border-bottom: 1px solid var(--muted);
    text-decoration: none;
    color: var(--text);
    position: relative;
    transition: color 0.3s ease;
}

.work-item:first-child {
    border-top: 1px solid var(--muted);
}

.work-item:hover {
    color: var(--accent);
}

.work-number {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.08em;
}

.work-title {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.work-category {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 300;
    color: var(--muted);
    font-style: italic;
    letter-spacing: 0.04em;
}

.work-year {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.08em;
}

.work-preview {
    position: absolute;
    visibility: hidden;
    width: 1px;
    height: 1px;
}

.works-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    position: sticky;
    top: 20%;
}

.works-desc-display {
    font-size: 18px;
    font-style: italic;
    color: var(--muted);
    text-align: center;
    max-width: 560px;
    line-height: 1.8;
    min-height: 2.4em;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.works-desc-display.visible {
    opacity: 1;
    transform: translateY(0);
}

.works-container {
    display: grid;
    grid-template-columns: 1fr 660px;
    gap: 60px;
    align-items: center;
}

.works-sphere {
    width: 660px;
    height: 660px;
    border-radius: 50%;
    z-index: 1;
    filter: drop-shadow(0 0 24px rgba(0, 229, 255, 0.25));
    overflow: hidden;
    position: relative;
}

.works-img-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.works-img-overlay.visible {
    opacity: 1;
}


/* ── Works : number flip ── */
.work-number {
    display: inline-block;
    transform-origin: center bottom;
}
@keyframes numFlip3d {
    0%   { transform: perspective(300px) rotateX(0deg);    opacity: 1; }
    35%  { transform: perspective(300px) rotateX(-90deg);  opacity: 0; }
    65%  { transform: perspective(300px) rotateX(90deg);   opacity: 0; }
    100% { transform: perspective(300px) rotateX(0deg);    opacity: 1; }
}

/* ── Works : magnetic title (needs display:inline-block) ── */
.work-title {
    display: inline-block;
    will-change: transform;
}

/* ── Works : separator line reveal ── */
.work-sep-line {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform-origin: left center;
    transform: scaleX(0) perspective(400px) rotateX(12deg);
    opacity: 0.45;
    pointer-events: none;
    transition: transform 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.work-sep-line.active {
    transform: scaleX(1) perspective(400px) rotateX(0deg);
}

/* ── Works : scroll axis indicator ── */
.works-axis {
    position: absolute;
    left: -28px;
    top: 0;
    height: 100%;
    width: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}
.works-axis-track {
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--muted) 20%, var(--muted) 80%, transparent);
    opacity: 0.3;
    transform: perspective(200px) rotateY(8deg);
}
.works-axis-dot {
    position: absolute;
    top: 0%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(0,229,255,0.4);
    transition: top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
    opacity: 0;
}
.works-axis-dot.active {
    opacity: 1;
}

/* skills */
.skills {
    padding: 80px 60px;
    border-top: 1px solid var(--muted);
    position: relative;
    overflow: hidden;
}

.skills-label {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.18em;
    color: var(--accent);
    text-transform: uppercase;
    display: block;
    margin-bottom: 60px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    transform-style: preserve-3d;
    transition: transform 0.15s ease;
    will-change: transform;
}

.skill-cat {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--muted);
    text-align: center;
}

.skill-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.skill-list li {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.52);
    transition: color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    animation: skillFloat 4s ease-in-out infinite;
}

.skill-list li:nth-child(1) { animation-delay: 0s; }
.skill-list li:nth-child(2) { animation-delay: 0.4s; }
.skill-list li:nth-child(3) { animation-delay: 0.8s; }
.skill-list li:nth-child(4) { animation-delay: 1.2s; }

@keyframes skillFloat {
    0%, 100% { transform: translateY(0) translateZ(0); }
    50%       { transform: translateY(-4px) translateZ(10px); }
}

.skill-list li:hover {
    color: var(--accent);
    transform: translateY(-4px) translateZ(14px) !important;
}

.skill-col {
    position: relative;
    transition: transform 0.35s ease;
    transform-style: preserve-3d;
}

.skill-col:hover {
    transform: translateZ(22px) rotateY(-3deg);
}

/* footer */
.footer {
    padding: 80px 60px 40px 60px;
    border-top: 1px solid var(--muted);
}

.footer-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    margin-bottom: 60px;
}

.footer-status {
    font-size: 14px;
    color: var(--muted);
    font-style: italic;
    text-align: center;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 32px;
}

.footer-link {
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--muted);
    transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

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

.footer-bottom {
    font-size: 12px;
    color: var(--muted);
    border-top: 1px solid var(--muted);
    padding-top: 20px;
    text-align: center;
}

/* grain noise overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 128px;
    animation: grain 0.5s steps(1) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-2%, -3%); }
    20% { transform: translate(3%, 2%); }
    30% { transform: translate(-1%, 4%); }
    40% { transform: translate(2%, -1%); }
    50% { transform: translate(-3%, 2%); }
    60% { transform: translate(1%, -2%); }
    70% { transform: translate(3%, 3%); }
    80% { transform: translate(-2%, 1%); }
    90% { transform: translate(2%, -3%); }
}


.relic {
    position: absolute;
    font-size: 13px;
    color: transparent;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
    pointer-events: none;
    text-shadow: none;
    white-space: nowrap;
    z-index: 0;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 32px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
    font-family: var(--font-body);
    font-size: 16px;
    cursor: pointer !important;
    z-index: 9990;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s ease, transform 0.35s ease, background 0.25s ease, color 0.25s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.back-to-top:hover {
    background: var(--accent);
    color: var(--bg);
}

/* ===== PAGE TRANSITIONS ===== */
#page-transition {
    position: fixed;
    inset: 0;
    background: #080808;
    z-index: 99998;
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.48s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Project pages: fade body in (no loader present) */
body:not(:has(#loader)) {
    animation: pageEnter 0.55s ease forwards;
}

@keyframes pageEnter {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===== CURSOR TRAIL ===== */
.cursor-trail {
    position: fixed;
    border-radius: 50%;
    background: var(--accent);
    pointer-events: none;
    z-index: 99997;
    transform: translate(-50%, -50%);
    mix-blend-mode: screen;
    will-change: left, top;
}

/* ===== VIEW TRANSITIONS (home <-> project) ===== */
@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.45s; }

::view-transition-group(project-title) {
    animation-duration: 0.75s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(project-title),
::view-transition-new(project-title) {
    height: 100%;
    object-fit: contain;
}

/* arrived through a view transition: no extra fade-in */
html.vt body { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
}

/* ===== EASTER EGG ===== */
.shockwave {
    position: fixed;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9996;
    opacity: 0;
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.6), inset 0 0 24px rgba(0, 229, 255, 0.35);
    animation: shockwave 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* size, not scale: the ring stays one pixel thin as it grows */
@keyframes shockwave {
    0%   { width: 20px;   height: 20px;   margin: -10px 0 0 -10px;     opacity: 0.95; }
    100% { width: 2600px; height: 2600px; margin: -1300px 0 0 -1300px; opacity: 0; }
}

.egg-line {
    position: absolute;
    left: 50%;
    bottom: 17%;
    transform: translateX(-50%);
    z-index: 2;
    max-width: 90%;
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--accent);
    text-shadow: 0 0 14px rgba(0, 229, 255, 0.7);
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.egg-line.visible { opacity: 1; }

.egg-line::after {
    content: '_';
    animation: eggCaret 0.7s steps(1) infinite;
}

@keyframes eggCaret { 50% { opacity: 0; } }

/* ===== DATA PULSE ===== */
@keyframes dataPulse {
    0%   { box-shadow: inset 0 0 0   rgba(0, 229, 255, 0); }
    40%  { box-shadow: inset 0 0 120px rgba(0, 229, 255, 0.07); }
    100% { box-shadow: inset 0 0 0   rgba(0, 229, 255, 0); }
}

body.data-pulse {
    animation: dataPulse 2.2s ease-out;
}

.pulse-relic {
    color: rgba(0, 229, 255, 0.95) !important;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.8) !important;
}

/* ===== SKILLS FEATURES ===== */

/* HUD brackets around category titles */
.hud-bracket {
    color: var(--accent);
    opacity: 0.5;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0;
}

/* Scan line sweeping down each column */
.skill-scan {
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,229,255,0.5), transparent);
    pointer-events: none;
    animation: skillScan 5s ease-in-out infinite;
    opacity: 0;
    z-index: 2;
}

@keyframes skillScan {
    0%   { top: 0%;   opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 0.7; }
    100% { top: 100%; opacity: 0; }
}

/* Skill progress bars */
.skill-bar-wrap {
    width: 100%;
    height: 1px;
    background: rgba(68, 68, 68, 0.45);
    margin-top: 5px;
    overflow: hidden;
    border-radius: 1px;
}

.skill-bar {
    height: 100%;
    width: var(--bar-w, 70%);
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 5px rgba(0, 229, 255, 0.6);
}

.skill-bar.active {
    transform: scaleX(1);
}

/* CSS 3D cubes per category */
.skill-cube {
    width: 22px;
    height: 22px;
    position: relative;
    transform-style: preserve-3d;
    animation: cubeRotate 9s linear infinite;
    margin: 0 auto 14px;
}

.cube-face {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(0, 229, 255, 0.28);
    background: rgba(0, 229, 255, 0.025);
}

.cube-front  { transform: translateZ(11px); }
.cube-back   { transform: rotateY(180deg) translateZ(11px); }
.cube-left   { transform: rotateY(-90deg) translateZ(11px); }
.cube-right  { transform: rotateY(90deg)  translateZ(11px); }
.cube-top    { transform: rotateX(90deg)  translateZ(11px); }
.cube-bottom { transform: rotateX(-90deg) translateZ(11px); }

@keyframes cubeRotate {
    from { transform: rotateX(22deg) rotateY(0deg); }
    to   { transform: rotateX(22deg) rotateY(360deg); }
}

.skill-col:hover .skill-cube {
    animation-play-state: paused;
    filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.5));
}

/* Constellation canvas behind skills */
.skills-constellation {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
}

/* Keep skills content above constellation */
.skills-header,
.skills-grid {
    position: relative;
    z-index: 1;
}

/* ===== HERO ROLE ===== */
.hero-role {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.hero-role i {
    font-style: normal;
    color: var(--accent);
    opacity: 0.6;
}

.hero-role-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: rolePulse 2.2s ease-in-out infinite;
}

@keyframes rolePulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.7); opacity: 0.35; }
}

/* ===== ORBIT LABELS ===== */
.orbit-label {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    white-space: nowrap;
    will-change: transform, opacity;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.55);
}

.orbit-label::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--accent);
    vertical-align: middle;
}

/* ===== MARQUEE ===== */
.marquee {
    position: relative;
    overflow: hidden;
    padding: 34px 0;
    border-top: 1px solid var(--muted);
}

.marquee-track {
    display: flex;
    width: max-content;
    will-change: transform;
}

.marquee-group {
    display: flex;
    align-items: center;
    gap: 44px;
    padding-right: 44px;
    flex-shrink: 0;
}

.marquee-group span {
    font-family: var(--font-display);
    font-size: clamp(38px, 5.6vw, 84px);
    font-weight: 400;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.13);
}

.marquee-group span:nth-of-type(3n + 1) { color: var(--text); }

.marquee-group b {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 14px var(--accent);
}

/* ===== WORKS: FEATURED TIER ===== */
.works-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
}

.works-count {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

/* clip, not hidden: hidden would make .works the sticky scrollport */
.works { overflow: clip; }

.works-container {
    grid-template-columns: minmax(0, 1fr) clamp(420px, 40vw, 660px);
    align-items: start;
}

.works-sphere {
    width: clamp(420px, 40vw, 660px);
    height: clamp(420px, 40vw, 660px);
}

.works-side { top: 13vh; gap: 36px; }

.works-group {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 0 18px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
}

.works-group::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.5), transparent);
}

.works-group ~ .works-group {
    padding-top: 64px;
    color: var(--muted);
}

.works-group ~ .works-group::after {
    background: linear-gradient(90deg, var(--muted), transparent);
}

.works-group + .work-item { border-top: 1px solid var(--muted); }

.work-item--featured {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    padding: 40px 28px 40px 24px;
    overflow: hidden;
    background: linear-gradient(100deg, rgba(0, 229, 255, 0.055), rgba(0, 229, 255, 0) 55%);
}

/* cursor-following sheen */
.work-item--featured::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 229, 255, 0.16), transparent 62%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.work-item--featured:hover::before { opacity: 1; }

/* accent bar that grows on hover */
.work-item--featured::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 14px var(--accent);
    transform: scaleY(0.28);
    transform-origin: top;
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-item--featured:hover::after { transform: scaleY(1); }

.work-item--featured .work-number { color: var(--accent); }

.work-meta {
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.work-meta i {
    font-style: normal;
    color: var(--accent);
    opacity: 0.6;
    margin: 0 6px;
}

.work-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.work-item--featured .work-title {
    font-size: clamp(30px, 3.1vw, 50px);
    line-height: 1.02;
    letter-spacing: -0.02em;
}

.work-pitch {
    font-size: 16px;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.66);
    max-width: 520px;
}

.work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.work-tags span {
    padding: 6px 12px;
    border: 1px solid rgba(0, 229, 255, 0.32);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(0, 229, 255, 0.04);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.work-item--featured:hover .work-tags span {
    background: rgba(0, 229, 255, 0.1);
    border-color: rgba(0, 229, 255, 0.6);
}

/* ===== FOOTER CTA ===== */
.footer-cta {
    font-family: var(--font-display);
    font-size: clamp(34px, 5vw, 76px);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    body::after,
    .hero-role-dot,
    .skill-list li,
    .skill-cube,
    .skill-scan { animation: none; }
}

/* ===== SERIF ITALICS (slogan, signature, hover description) ===== */
.hero-slogan {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.6);
}

.about-signature,
.works-desc-display {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.005em;
}

.about-signature    { font-size: 24px; }
.works-desc-display { font-size: 23px; line-height: 1.5; }
.relic              { font-size: 12px; }

/* small tracked capitals read better in the sans */
.works-label,
.skills-label,
.skill-cat {
    font-family: var(--font-body);
    font-weight: 600;
}

.works-label,
.skills-label { font-size: 15px; letter-spacing: 0.24em; }

.nav-logo { font-size: 20px; letter-spacing: 0; }

.work-title { font-size: 42px; }
.work-item--featured .work-title { font-size: clamp(40px, 4vw, 64px); }
.stat-number { font-size: 84px; }

/* ===== LANGUAGE TOGGLE ===== */
.lang-toggle {
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.lang-toggle:hover {
    color: var(--bg);
    background: var(--accent);
    border-color: var(--accent);
}

.nav-links { align-items: center; }
.nav-logo { white-space: nowrap; }

/* small screens: the toggle takes the room of the Skills link */
@media (max-width: 480px) {
    .nav-links li:has(a[href="#skills"]) { display: none; }
}

/* ===== KEYBOARD FOCUS ===== */
a:focus-visible,
button:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 6px;
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.35);
}

.work-item:focus-visible { color: var(--accent); outline-offset: -1px; }
.work-item--featured:focus-visible::before { opacity: 1; }
.work-item--featured:focus-visible::after  { transform: scaleY(1); }

.skip-link {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100003;
    padding: 12px 20px;
    background: var(--accent);
    color: var(--bg);
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform 0.2s ease;
}

.skip-link:focus { transform: translateY(0); }

/* ===== BLOOM (screen blend hides the opaque black the bloom pass renders on) ===== */
.hero-sphere.has-bloom { mix-blend-mode: screen; }

.works-side:has(.has-bloom) { mix-blend-mode: screen; }
/* the glow haze fills the square canvas: fade it out instead of cutting a hard disc */
.works-sphere.has-bloom {
    filter: none;
    border-radius: 0;
    -webkit-mask-image: radial-gradient(closest-side, #000 80%, transparent 100%);
    mask-image: radial-gradient(closest-side, #000 80%, transparent 100%);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    /* Restore cursor on touch */
    *, *::before, *::after { cursor: auto !important; }
    .cursor-dot { display: none; }

    /* Navbar */
    .navbar { padding: 20px 24px; }
    .nav-links { gap: 24px; }

    /* Hero */
    .hero { padding: 0 24px; }
    .hero-name { font-size: 21vw; }
    .hero-slogan { font-size: clamp(28px, 7vw, 50px); }
    .hero-scroll-hint { left: 24px; bottom: 40px; }
    .hero-btn { right: 24px; bottom: 40px; padding: 12px 24px; font-size: 12px; }

    /* About */
    .about { padding: 60px 24px; }
    .about-text { font-size: 17px; }
    .about-stats { gap: 40px; }

    /* Works */
    .works { padding: 60px 24px; }
    .works-container { grid-template-columns: 1fr; }
    .works-side { display: none; }
    .work-item { grid-template-columns: 40px 1fr auto; gap: 20px; }
    .work-title, .work-item--featured .work-title { font-size: 30px; }
    .work-year { display: none; }

    /* Skills */
    .skills { padding: 60px 24px; }
    .skills-grid { grid-template-columns: 1fr 1fr; gap: 32px; }

    /* Footer */
    .footer { padding: 60px 24px 40px; }
    .footer-links { gap: 20px; flex-wrap: wrap; justify-content: center; }

    /* Relics — cachées sur mobile (positions desktop incompatibles) */
    .relic { display: none; }

    .hero-role { flex-wrap: wrap; font-size: 11px; gap: 8px; margin-top: 20px; }
    .marquee { padding: 22px 0; }
    .works-header { flex-direction: column; gap: 8px; }
    .work-item--featured { padding: 28px 16px 28px 18px; }
    .work-pitch { font-size: 15px; }
}

@media (max-width: 480px) {
    /* Navbar */
    .nav-links { gap: 16px; }
    .nav-links a { font-size: 12px; }

    /* Works */
    .work-item { grid-template-columns: 32px 1fr; gap: 16px; }
    .work-category { display: none; }

    /* Skills */
    .skills-grid { grid-template-columns: 1fr; }

    /* Stats */
    .about-stats { gap: 24px; flex-wrap: wrap; }
    .stat-number { font-size: 60px; }
}


