@import url('satoshi.css');
@import url('terminal-grotesque.css');

/* ============================================================
 *  PORTFOLIO - Professional Neutral Theme
 *  Clean, modern, slate-charcoal palette with warm accent
 * ============================================================ */

/* ── CSS Custom Properties (Design Tokens) ─────────────── */
:root {
    /* Palette - Deep Charcoal / Pure White (No violet) */
    --clr-bg-deep:      #08080a;
    --clr-bg:           #0f0f12;
    --clr-bg-card:      rgba(18, 18, 22, 0.85);
    --clr-bg-glass:     rgba(24, 24, 28, 0.70);
    --clr-surface:      rgba(255, 255, 255, 0.06);
    --clr-border:       rgba(255, 255, 255, 0.14);
    --clr-border-focus: rgba(255, 255, 255, 0.50);

    --clr-primary:      #ffffff;
    --clr-primary-light:#ffffff;
    --clr-primary-dark: #e4e4e7;
    --clr-accent:       #ffffff;
    --clr-accent2:      #e4e4e7;
    --clr-glow:         rgba(255, 255, 255, 0.22);

    --clr-text:         #ffffff;
    --clr-text-muted:   #a1a1aa;
    --clr-text-dim:     #71717a;

    --clr-success:      #10b981;
    --clr-error:        #ef4444;

    --clr-header:       rgba(8, 8, 10, 0.90);
    --clr-drawer-start: #141418;
    --clr-drawer-end:   #08080a;
    --clr-shadow:       rgba(0, 0, 0, 0.60);
    --clr-image-overlay:rgba(8, 8, 10, 0.80);

    /* Typography - Terminal Grotesque for titles, Satoshi for reading text */
    --ff-display: 'terminal_grotesque', monospace, sans-serif;
    --ff-heading: 'terminal_grotesque', monospace, sans-serif;
    --ff-body:    'Satoshi-Variable', 'Satoshi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Spacing */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  2rem;
    --space-xl:  3rem;
    --space-2xl: 5rem;
    --space-3xl: 8rem;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 9999px;

    /* Hero 3D Stack Offsets */
    --hero-layer-offset-1: 16px;
    --hero-layer-offset-2: 30px;
    --hero-layer-offset-3: 44px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 200ms;
    --duration-normal: 400ms;
    --duration-slow: 700ms;
}

html[data-theme="light"] {
    /* Light Mode: Warm Beige Base + Pure Black for all titles, accents and important words */
    --clr-bg-deep:      #f5eee1;
    --clr-bg:           #faf6ef;
    --clr-bg-card:      rgba(255, 255, 255, 0.90);
    --clr-bg-glass:     rgba(255, 255, 255, 0.80);

    --clr-surface:      rgba(0, 0, 0, 0.05);
    --clr-border:       rgba(0, 0, 0, 0.16);
    --clr-border-focus: rgba(0, 0, 0, 0.60);
    --clr-glow:         rgba(0, 0, 0, 0.15);

    --clr-primary:      #000000;
    --clr-primary-light:#000000;
    --clr-primary-dark: #18181b;

    --clr-accent:       #000000;
    --clr-accent2:      #27272a;

    --clr-text:         #000000;
    --clr-text-muted:   #27272a;
    --clr-text-dim:     #52525b;

    --clr-success:      #059669;
    --clr-error:        #dc2626;

    --clr-header:       rgba(250, 246, 239, 0.88);
    --clr-drawer-start: #fdfbf7;
    --clr-drawer-end:   #f5eee1;
    --clr-shadow:       rgba(0, 0, 0, 0.12);
    --clr-image-overlay:rgba(245, 238, 225, 0.85);
}

/* ── Light mode element overrides ─────────────────────── */

/* Background: warm, rich, elegant pure beige - zero violet in background */
html[data-theme="light"] body {
    background-color: #f5eee1;
    background-image: 
        radial-gradient(ellipse 70% 60% at 20% 20%, #fffbf3 0%, rgba(255, 251, 243, 0.7) 45%, transparent 75%),
        radial-gradient(ellipse 65% 65% at 80% 80%, #f7ecd7 0%, rgba(247, 236, 215, 0.6) 45%, transparent 70%),
        radial-gradient(circle 800px at 85% 15%, #f2e3c8 0%, transparent 65%),
        radial-gradient(circle 750px at 15% 85%, #ede0c7 0%, transparent 65%),
        radial-gradient(circle 600px at 50% 50%, #faf3e5 0%, transparent 70%);
    background-attachment: fixed;
    background-size: cover;
}

/* Starfield canvas overlay in light mode */
html[data-theme="light"] .starfield {
    opacity: 0.95;
}

html[data-theme="light"] .hero__shape {
    opacity: 0.22;
}

/* Header blur & border */
html[data-theme="light"] .site-header {
    background: rgba(250, 246, 239, 0.84);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(180, 155, 125, 0.22);
}

/* Hero badge: cream tint with beige border */
html[data-theme="light"] .hero__badge {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.25);
    color: #000000;
}

/* Cards: crisp frosted glass with clean black borders and offset shadows */
html[data-theme="light"] .skill-card,
html[data-theme="light"] .project-card,
html[data-theme="light"] .portfolio-project {
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-color: rgba(0, 0, 0, 0.18);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .skill-card:hover,
html[data-theme="light"] .project-card:hover,
html[data-theme="light"] .portfolio-project:hover {
    background: #ffffff;
    border-color: #000000;
    box-shadow: 6px 6px 0px #000000, 0 12px 32px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .about__stat {
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: rgba(0, 0, 0, 0.18);
    border-left: 3px solid #000000;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .about__stat:hover {
    border-color: #000000;
    box-shadow: 5px 5px 0px #000000;
}

/* Contact inputs */
html[data-theme="light"] .contact__input {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.22);
    color: #000000;
}

html[data-theme="light"] .contact__input:focus {
    border-color: #000000;
    box-shadow: 3px 3px 0px #000000;
}

/* Buttons: Pure Black in light mode with hard offset shadows */
html[data-theme="light"] .hero__cta--primary,
html[data-theme="light"] .contact__submit {
    color: #ffffff;
    background: #000000;
    border-color: #000000;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] .hero__cta--primary:hover,
html[data-theme="light"] .contact__submit:hover {
    box-shadow: 6px 6px 0px #000000;
    background: #27272a;
    transform: translate(-2px, -2px) skewX(-10deg);
}

/* Secondary CTA */
html[data-theme="light"] .hero__cta--secondary {
    background: #ffffff;
    backdrop-filter: blur(8px);
    border-color: #000000;
    color: #000000;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.25);
}

html[data-theme="light"] .hero__cta--secondary:hover {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
    box-shadow: 6px 6px 0px #000000;
}

html[data-theme="light"] .cv-link,
html[data-theme="light"] .theme-toggle {
    background: #ffffff;
    backdrop-filter: blur(8px);
    border-color: rgba(0, 0, 0, 0.25);
    color: #000000;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .cv-link:hover,
html[data-theme="light"] .theme-toggle:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.4);
}

/* Section backgrounds: no visible opaque gradients */
html[data-theme="light"] .hero__bg-overlay,
html[data-theme="light"] .about__bg,
html[data-theme="light"] .projects__bg,
html[data-theme="light"] .contact__bg {
    background: none;
}

/* Nav pill */
html[data-theme="light"] .site-nav__link:hover {
    color: var(--clr-primary);
}

/* Footer */
html[data-theme="light"] .site-footer {
    border-color: rgba(180, 155, 125, 0.22);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    font-family: var(--ff-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

body,
button,
input,
textarea,
select,
optgroup {
    font-family: var(--ff-body);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--ff-heading);
}

p, a, span, li, label {
    font-family: inherit;
}

/* ── Important Words (Black in Light, White in Dark) & Titles in Grotesque ── */
strong,
b,
.text-accent,
.highlight,
.about__em {
    font-family: var(--ff-heading);
    color: var(--clr-primary);
    font-weight: 700;
    letter-spacing: 0.04em;
}

html[data-theme="light"] strong,
html[data-theme="light"] b,
html[data-theme="light"] .text-accent,
html[data-theme="light"] .highlight,
html[data-theme="light"] .about__em {
    color: var(--clr-primary);
}

body {
    color: var(--clr-text);
    background: var(--clr-bg-deep);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background-color var(--duration-normal) var(--ease-out), color var(--duration-normal) var(--ease-out);
}

html.in-theme-transition body {
    transition: none !important;
}

::view-transition-group(root),
::view-transition-image-pair(root) {
    background: linear-gradient(
        135deg,
        #fffdf7 0%,
        #faf2e2 20%,
        #f4ead7 50%,
        #ebdcc3 75%,
        #08080a 100%
    );
    overflow: hidden;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 1200ms;
    animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
    animation-fill-mode: both;
    mix-blend-mode: normal;
    will-change: clip-path;
}

::view-transition-old(root) {
    z-index: 1;
    animation-name: personaBandOld;
}

::view-transition-new(root) {
    z-index: 2;
    animation-name: personaBandNew;
}

@keyframes personaBandNew {
    0% {
        clip-path: polygon(-50% -50%, 38% -50%, -50% 38%);
    }
    100% {
        clip-path: polygon(-50% -50%, 262% -50%, -50% 262%);
    }
}

@keyframes personaBandOld {
    0% {
        clip-path: polygon(150% 150%, -154% 150%, 150% -154%);
    }
    100% {
        clip-path: polygon(150% 150%, 70% 150%, 150% 70%);
    }
}

a {
    color: var(--clr-primary-light);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover { color: var(--clr-primary); }

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

ul[role="list"] { list-style: none; }

/* ═══════════════════════════════════════════════════════════
 *  LOADING SCREEN - Disabled
 * ═══════════════════════════════════════════════════════════ */
.page-loading {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ═══════════════════════════════════════════════════════════
 *  INTRO WELCOME SCREEN (Simple First View, Click to Enter)
 * ═══════════════════════════════════════════════════════════ */
body.intro-active {
    overflow: hidden;
}

body.intro-active .site-header,
body.intro-active .site-footer {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transform: translateY(-24px);
    transition: none !important;
}

body.intro-active #container {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transform: scale(0.98);
    transition: none !important;
}

body.intro-dismissed .site-header {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 1.2s var(--ease-out) 0.3s, transform 1.2s var(--ease-out) 0.3s;
}

body.intro-dismissed #container {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: scale(1);
    transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

body.intro-dismissed .site-footer {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition: opacity 1.4s var(--ease-out) 2.2s;
}

/* ── Instant display when intro is skipped (returning from CV, logo, navigation) ── */
body.intro-skipped .site-header,
body.intro-skipped #container,
body.intro-skipped .site-footer,
html.skip-intro-fast .site-header,
html.skip-intro-fast #container,
html.skip-intro-fast .site-footer {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
}

body.intro-skipped #intro-screen,
html.skip-intro-fast #intro-screen {
    display: none !important;
}

body.intro-skipped .hero__card,
body.intro-skipped .hero__content,
html.skip-intro-fast .hero__card,
html.skip-intro-fast .hero__content {
    opacity: 1 !important;
    transform: none !important;
}

body.intro-skipped .hero__layer--1,
html.skip-intro-fast .hero__layer--1 {
    opacity: 1 !important;
    transform: translate(16px, 16px) !important;
}

body.intro-skipped .hero__layer--2,
html.skip-intro-fast .hero__layer--2 {
    opacity: 1 !important;
    transform: translate(30px, 30px) !important;
}

body.intro-skipped .hero__layer--3,
html.skip-intro-fast .hero__layer--3 {
    opacity: 1 !important;
    transform: translate(44px, 44px) !important;
}

/* While intro screen is active, bring canvas to front so water droplet ripples are 100% visible */
body.intro-active .starfield {
    z-index: 5010;
}

.intro-screen {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    user-select: none;
    transition: opacity 1.4s var(--ease-out), visibility 1.4s;
}

html[data-theme="light"] .intro-screen {
    background: transparent;
}

.intro-screen--exit {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-screen__content {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    max-width: 900px;
    position: relative;
    z-index: 2;
}

.intro-screen__title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.intro-screen__eyebrow {
    font-family: var(--ff-heading);
    font-size: clamp(1.1rem, 2.8vw, 1.6rem);
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--clr-primary);
    opacity: 0.95;
    text-align: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.intro-screen__name {
    font-family: var(--ff-display);
    font-size: clamp(2rem, 8vw, 6.2rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #ffffff;
    text-shadow: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    word-break: normal;
    overflow-wrap: normal;
}

html[data-theme="light"] .intro-screen__name {
    color: #000000;
    text-shadow: none;
}

/* ── Individual Words (Ensures words like TURMO never break letters across lines) ── */
.intro-word {
    display: inline-block;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .intro-screen__content {
        padding: var(--space-xl) var(--space-sm);
        width: 100%;
        box-sizing: border-box;
    }
    .intro-screen__name {
        font-size: clamp(1.85rem, 8.5vw, 3.2rem);
        line-height: 1.2;
    }
    .intro-screen__eyebrow {
        font-size: clamp(0.9rem, 3.2vw, 1.2rem);
        letter-spacing: 0.22em;
    }
    .intro-screen__click-hint {
        font-size: 0.7rem;
        gap: 0.5rem;
    }
}

/* ── Click Hint on Intro Screen ─────────────────────────── */
.intro-screen__click-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 2.5rem;
    font-family: var(--ff-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--clr-primary);
    opacity: 0;
    animation: clickHintFadeIn 1.2s var(--ease-out) 1.6s forwards,
               clickHintPulse 2.5s ease-in-out 2.8s infinite;
}

html[data-theme="light"] .intro-screen__click-hint {
    color: #000000;
}

.intro-screen__click-text {
    display: inline-block;
}

.intro-screen__click-arrow {
    display: inline-flex;
    align-items: center;
    animation: clickArrowSlide 2.5s ease-in-out 2.8s infinite;
}

@keyframes clickHintFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 0.85; transform: translateY(0); }
}

@keyframes clickHintPulse {
    0%, 100% { opacity: 0.85; }
    50%      { opacity: 0.4; }
}

@keyframes clickArrowSlide {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(5px); }
}

/* ── Individual Letters for Water Ripple Blur Distortion ── */
.intro-char {
    display: inline-block;
    filter: none;
    -webkit-filter: none;
    opacity: 1;
    transform: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.intro-char--space {
    display: inline-block;
    width: 0.35em;
}

/* When the water ripple reaches a letter: natural liquid refraction swell and progressive blur */
.intro-char--water-rippled {
    animation: waterWaveRefraction 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes waterWaveRefraction {
    0% {
        filter: blur(0px);
        -webkit-filter: blur(0px);
        transform: translateY(0);
        opacity: 1;
    }
    14% {
        /* Instant water wave crest: text lifts and refracts immediately upon wave contact */
        filter: blur(2.5px);
        -webkit-filter: blur(2.5px);
        transform: translateY(-3.5px) scale(1.02);
        opacity: 0.95;
    }
    38% {
        /* Wave trough follows: fluid dip and liquid contour softening */
        filter: blur(5px);
        -webkit-filter: blur(5px);
        transform: translateY(1.5px) scale(0.99);
        opacity: 0.70;
    }
    68% {
        /* Smooth liquid dissipation into calm water */
        filter: blur(9px);
        -webkit-filter: blur(9px);
        transform: translateY(-0.5px);
        opacity: 0.30;
    }
    100% {
        /* Completely dissolved in the water */
        filter: blur(14px);
        -webkit-filter: blur(14px);
        transform: translateY(0);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
 *  STARFIELD CANVAS
 * ═══════════════════════════════════════════════════════════ */
.starfield {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
 *  HEADER / NAVIGATION - Bold & Visible
 * ═══════════════════════════════════════════════════════════ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 68px;
    box-sizing: border-box;
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    background: var(--clr-header);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border-bottom: 1px solid var(--clr-border);
    transition: background var(--duration-normal) var(--ease-out),
                backdrop-filter var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out);
}

.site-header--scrolled {
    box-shadow: 0 4px 24px var(--clr-shadow);
}

.site-header__left {
    display: inline-flex;
    align-items: center;
    gap: clamp(1.5rem, 2.8vw, 2.75rem);
    flex-shrink: 0;
}

.site-header__right {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    margin-left: auto;
    flex-shrink: 0;
    z-index: 2;
}

.site-nav {
    display: inline-flex;
    align-items: center;
    position: static;
    transform: none;
    z-index: 1;
}

.site-header__actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    gap: var(--space-xs);
    padding: 6px 14px;
    color: var(--clr-text-muted);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 3px;
    font-family: var(--ff-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transform: skewX(-10deg);
    box-shadow: 2px 2px 0px rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: color var(--duration-fast), border-color var(--duration-fast), background var(--duration-fast), box-shadow var(--duration-fast);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    color: #000000;
    background: #ffffff;
    border-color: #ffffff;
    transform: skewX(-10deg);
    box-shadow: 3px 3px 0px rgba(255, 255, 255, 0.6);
    outline: none;
}

.theme-toggle > * {
    transform: skewX(10deg);
    display: inline-block;
}

.cv-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 6px 14px;
    color: var(--clr-text-muted);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 3px;
    font-family: var(--ff-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
    cursor: pointer;
    transform: skewX(-10deg);
    box-shadow: 2px 2px 0px rgba(255, 255, 255, 0.2);
    transition: color var(--duration-fast), border-color var(--duration-fast), background var(--duration-fast), box-shadow var(--duration-fast);
}

.cv-link:hover,
.cv-link:focus-visible {
    color: #000000;
    background: #ffffff;
    border-color: #ffffff;
    transform: skewX(-10deg);
    box-shadow: 3px 3px 0px rgba(255, 255, 255, 0.6);
    outline: none;
}

.cv-link > * {
    transform: skewX(10deg);
    display: inline-block;
}

.theme-toggle__icon { font-size: 1rem; line-height: 1; }

/* ── Logo - SVG Monogram & Monogram Styles ───────────────── */
.site-header__logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}

.site-logo-img {
    height: 40px;
    width: auto;
    max-width: 62px;
    display: block;
    object-fit: contain;
    transition: transform var(--duration-fast) var(--ease-out),
                opacity var(--duration-fast) var(--ease-out),
                filter var(--duration-fast) var(--ease-out);
    filter: brightness(0) invert(1);
}

/* Light mode: turn the logo strokes into pure black */
html[data-theme="light"] .site-logo-img {
    filter: brightness(0);
}

.site-header__logo:hover .site-logo-img {
    transform: scale(1.06);
    opacity: 0.85;
}

.mobile-nav__logo {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.mobile-nav__logo .site-logo-img {
    height: 38px;
    max-width: 58px;
}

.logo-dot {
    font-family: var(--ff-heading);
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 0.8;
    color: var(--clr-text);
    margin-left: 2px;
    margin-bottom: 4px;
    user-select: none;
    transition: transform var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out);
}

.site-header__logo:hover .logo-dot {
    transform: scale(1.15);
}

.logo-text {
    font-family: var(--ff-heading);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    color: var(--clr-text);
    letter-spacing: -0.02em;
    transition: color var(--duration-fast);
}

/* ── Desktop Nav ──────────────────────────────────────── */
.site-nav__list {
    display: flex;
    align-items: center;
    gap: clamp(0.4rem, 1vw, 1rem);
}

.site-nav__link {
    font-family: var(--ff-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--clr-text-muted);
    text-decoration: none;
    position: relative;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: color var(--duration-fast) var(--ease-out);
}

.site-nav__link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 12px;
    right: 12px;
    width: auto;
    height: 2px;
    background: var(--clr-accent);
    border-radius: var(--radius-full);
    transform: scaleX(0);
    transition: transform var(--duration-normal) var(--ease-out);
}

.site-nav__link:hover {
    color: var(--clr-text);
}

.site-nav__link:hover::after {
    transform: scaleX(1);
}

.site-nav__link--active {
    color: var(--clr-accent);
    font-weight: 600;
}

.site-nav__link--active::after {
    transform: scaleX(1);
}

.site-nav__link--btn {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    line-height: inherit;
    text-transform: none;
}

/* ── Hamburger ─────────────────────────────────────────── */
.site-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    flex-shrink: 0;
}

.site-menu-toggle__bar {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--clr-text);
    border-radius: var(--radius-full);
    transition: transform var(--duration-normal) var(--ease-out),
                opacity var(--duration-fast);
}

/* ── Mobile Nav Drawer ─────────────────────────────────── */
.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

.mobile-nav--open { pointer-events: auto; }

.mobile-nav__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
}

.mobile-nav--open .mobile-nav__overlay { opacity: 1; }

.mobile-nav__drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: min(380px, 85vw);
    height: 100%;
    background: linear-gradient(180deg, var(--clr-drawer-start) 0%, var(--clr-drawer-end) 100%);
    border-left: 1px solid var(--clr-border);
    transform: translateX(100%);
    transition: transform var(--duration-slow) var(--ease-out);
    display: flex;
    flex-direction: column;
    padding: var(--space-xl) var(--space-lg);
}

.mobile-nav--open .mobile-nav__drawer { transform: translateX(0); }

.mobile-nav__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.mobile-nav__logo {
    font-family: var(--ff-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--clr-text);
}

.mobile-nav__close {
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    transition: border-color var(--duration-fast);
}

.mobile-nav__close:hover { border-color: var(--clr-primary); }

.mobile-nav__close span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background: var(--clr-text);
    border-radius: var(--radius-full);
}

.mobile-nav__close span:first-child { transform: translate(-50%, -50%) rotate(45deg); }
.mobile-nav__close span:last-child  { transform: translate(-50%, -50%) rotate(-45deg); }

.mobile-nav__list {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: clamp(1.5rem, 3.5vh, 2.25rem);
    margin: clamp(2.5rem, 8vh, 5rem) 0 auto 0;
    width: 100%;
    padding: 0;
    list-style: none;
}

.mobile-nav__list li {
    width: 100%;
    display: flex;
    justify-content: center;
    text-align: center;
}

.mobile-nav__link {
    font-family: var(--ff-body);
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--clr-text-muted);
    text-decoration: none;
    text-align: center;
    padding: var(--space-xs) var(--space-md);
    position: relative;
    display: inline-block;
    transition: color var(--duration-fast), transform var(--duration-fast);
}

.mobile-nav__link:hover,
.mobile-nav__link--active,
.mobile-nav__link:focus-visible {
    color: var(--clr-text);
    transform: scale(1.06);
}

.mobile-nav__link--btn {
    background: none;
    border: none;
    cursor: pointer;
    text-align: center;
    width: auto;
    font: inherit;
    font-size: 1.65rem;
    font-family: inherit;
    line-height: inherit;
    display: inline-block;
}

.mobile-nav__actions,
.mobile-nav__footer {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════
 *  MAIN CONTAINER
 * ═══════════════════════════════════════════════════════════ */
#container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
}

/* ═══════════════════════════════════════════════════════════
 *  SECTION SHARED STYLES
 * ═══════════════════════════════════════════════════════════ */
.section-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--ff-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: var(--clr-primary-light);
    padding: 4px 14px;
    border: 1px solid var(--clr-border);
    border-left: 3px solid var(--clr-accent);
    border-radius: 2px;
    margin-bottom: var(--space-md);
    background: var(--clr-surface);
    transform: skewX(-10deg);
    text-transform: uppercase;
    box-shadow: 2px 2px 0px rgba(255, 255, 255, 0.2);
}

.section-eyebrow > * {
    transform: skewX(10deg);
    display: inline-block;
}

.section-title {
    font-family: var(--ff-heading);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: var(--space-lg);
    color: var(--clr-text);
}

.section-title__line {
    position: relative;
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════
 *  HERO SECTION
 * ═══════════════════════════════════════════════════════════ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate; /* Contain internal z-indexes (layers 1-4) to prevent bleeding into other sections */
}

.hero__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: var(--clr-bg-deep);
}

.hero__bg-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 25% 20%, rgba(255, 255, 255, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 70%, rgba(148, 163, 184, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(148, 163, 184, 0.03) 0%, transparent 70%);
}

/* ── Hero Stack Layout ─────────────────────────────────── */
.hero__stack {
    position: relative;
    width: min(800px, calc(100% - 3.5rem));
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: visible;
}

/* ─── Main Card ─────────────────────────────────────────── */
.hero__card {
    position: relative;
    width: 100%;
    background: var(--clr-bg-card);
    border: 1.5px solid var(--clr-border);
    padding: clamp(2.2rem, 5vw, 3.5rem) clamp(1.25rem, 5vw, 3.5rem);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 4;
    /* Hidden until stack-active triggers */
    opacity: 0;
    transform: scale(0.97) translateY(8px);
}

html[data-theme="light"] .hero__card {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(0, 0, 0, 0.22);
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.06);
}

/* ─── Background Layers - hidden behind the card by default ── */
.hero__layer {
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--clr-border);
    pointer-events: none;
    /* Start hidden, perfectly overlapping the card */
    opacity: 0;
    transform: translate(0, 0);
}

html[data-theme="light"] .hero__layer {
    border-color: rgba(0, 0, 0, 0.18);
}

/* z-index ordering */
.hero__layer--1 { z-index: 3; }
.hero__layer--2 { z-index: 2; }
.hero__layer--3 { z-index: 1; }

/* ─── Animations ─────────────────────────────────────────── */

/* 1. Card snaps in from slightly smaller scale */
@keyframes cardSnapIn {
    0%   { opacity: 0; transform: scale(0.88); }
    65%  { opacity: 1; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

/* 2. Layers eject from (0,0) → their offset: start visible, slide out */
/*    fill-mode: forwards - layers stay at opacity:0 during delay,     */
/*    then jump visible and slide to their final offset.               */
@keyframes layer1Eject {
    0%   { opacity: 1; transform: translate(0, 0); }
    100% { opacity: 1; transform: translate(var(--hero-layer-offset-1), var(--hero-layer-offset-1)); }
}
@keyframes layer2Eject {
    0%   { opacity: 1; transform: translate(0, 0); }
    100% { opacity: 1; transform: translate(var(--hero-layer-offset-2), var(--hero-layer-offset-2)); }
}
@keyframes layer3Eject {
    0%   { opacity: 1; transform: translate(0, 0); }
    100% { opacity: 1; transform: translate(var(--hero-layer-offset-3), var(--hero-layer-offset-3)); }
}

/* 3. Content fades up into the card */
@keyframes contentReveal {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── stack-active choreography ─────────────────────────── */
/* ORDER: card → layer1 → layer2 → layer3 → content         */
/* Each layer base is opacity:0 - 'forwards' fill keeps it   */
/* hidden until the animation fires, then slides it out.     */

.hero__stack.stack-active .hero__card {
    /* 1. Main card snaps into center first */
    animation: cardSnapIn 0.35s cubic-bezier(0.34, 1.4, 0.64, 1) 0ms forwards;
}
.hero__stack.stack-active .hero__layer--1 {
    /* 2. Layer 1 slides out */
    animation: layer1Eject 0.32s cubic-bezier(0.34, 1.25, 0.64, 1) 180ms forwards;
}
.hero__stack.stack-active .hero__layer--2 {
    /* 3. Layer 2 slides out further */
    animation: layer2Eject 0.32s cubic-bezier(0.34, 1.25, 0.64, 1) 280ms forwards;
}
.hero__stack.stack-active .hero__layer--3 {
    /* 4. Layer 3 slides out furthest */
    animation: layer3Eject 0.32s cubic-bezier(0.34, 1.25, 0.64, 1) 380ms forwards;
}
.hero__stack.stack-active .hero__content {
    /* 5. Title & content reveal once the card stack is assembled */
    animation: contentReveal 0.45s var(--ease-out) 420ms forwards;
}

.hero__content {
    text-align: center;
    opacity: 0;
}

.reveal .hero__content,
.hero__content.in-view {
    /* Handled by JS stack-active */
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--ff-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--clr-success);
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-left: 3px solid var(--clr-success);
    padding: 5px 14px;
    border-radius: 2px;
    margin-bottom: var(--space-xl);
    transform: skewX(-10deg);
    box-shadow: 2px 2px 0px rgba(52, 211, 153, 0.2);
}

.hero__badge > * {
    transform: skewX(10deg);
    display: inline-block;
}

.hero__badge-dot {
    width: 7px;
    height: 7px;
    background: var(--clr-success);
    border-radius: 50%;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    50%      { opacity: 0.7; box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

.hero__title {
    font-family: var(--ff-display);
    font-size: clamp(2rem, 5.5vw, 3.8rem);
    line-height: 1.15;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.01em;
}

.hero__title-line {
    display: block;
}

.hero__title-line--1 {
    font-family: var(--ff-display);
    font-size: 0.38em;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--clr-accent);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.hero__title-line--1::before,
.hero__title-line--1::after {
    content: '';
    display: inline-block;
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--clr-accent));
}

.hero__title-line--1::after {
    background: linear-gradient(90deg, var(--clr-accent), transparent);
}

.hero__title-line--2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35em;
    flex-wrap: wrap;
}

.hero__title-line--2 .hero__title-word {
    font-weight: 300;
    color: var(--clr-text);
    letter-spacing: -0.01em;
}

/* ── Animated Hero Letters (Reusing Loader Style & Colors) ── */
.hero__title-word--chars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    letter-spacing: 0.02em;
    font-family: var(--ff-display);
    font-weight: 800;
    color: var(--clr-primary);
}

.hero__char {
    display: inline-block;
    font-family: var(--ff-display);
    animation: heroCharDrop 0.65s var(--ease-spring) calc(0.12s + var(--i) * 0.05s) both,
               heroCharPulse 2.8s ease-in-out calc(1s + var(--i) * 0.12s) infinite;
    transition: transform 0.25s var(--ease-out), color 0.25s, text-shadow 0.25s;
    cursor: default;
}

.hero__char:hover {
    color: #ffffff;
    transform: translateY(-5px) scale(1.18);
    text-shadow: 0 0 16px var(--clr-accent), 0 0 30px var(--clr-accent2);
}

@keyframes heroCharDrop {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.85);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes heroCharPulse {
    0%, 100% {
        opacity: 0.82;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        color: var(--clr-primary-light);
        transform: translateY(0);
        text-shadow: 0 0 14px var(--clr-glow);
    }
}

html[data-theme="light"] .hero__title-word--chars {
    color: var(--clr-primary);
}

html[data-theme="light"] .hero__char:hover {
    color: #000000;
    text-shadow: 0 0 16px rgba(0, 0, 0, 0.35);
}

.hero__title-name {
    font-weight: 900;
    letter-spacing: -0.01em;
    color: #ffffff;
    position: relative;
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.25);
}

html[data-theme="light"] .hero__title-name {
    color: #000000;
    background: none;
    -webkit-text-fill-color: #000000;
    background-clip: unset;
    text-shadow: none;
}



.hero__subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--clr-text-muted);
    margin-bottom: var(--space-xl);
    font-weight: 300;
    letter-spacing: 0.03em;
}

/* ── CTA Buttons ───────────────────────────────────────── */
.hero__cta-group {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
}

.hero__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--ff-heading);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 12px 28px;
    border-radius: 3px;
    text-decoration: none;
    transition: transform var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out),
                background-color var(--duration-fast);
    position: relative;
    overflow: hidden;
    transform: skewX(-10deg);
}

.hero__cta > * {
    display: inline-flex;
    align-items: center;
    gap: inherit;
    transform: skewX(10deg);
}

.hero__cta--primary {
    background: #ffffff;
    color: #000000;
    border: 1px solid #ffffff;
    box-shadow: 4px 4px 0px rgba(255, 255, 255, 0.35);
}

.hero__cta--primary:hover {
    transform: translate(-2px, -2px) skewX(-10deg);
    box-shadow: 6px 6px 0px #ffffff;
    background: #e4e4e7;
    color: #000000;
}

.hero__cta--secondary {
    background: var(--clr-bg-card);
    color: #ffffff;
    border: 1px solid var(--clr-border);
    box-shadow: 4px 4px 0px rgba(255, 255, 255, 0.2);
}

.hero__cta--secondary:hover {
    background: #ffffff;
    border-color: #ffffff;
    transform: translate(-2px, -2px) skewX(-10deg);
    box-shadow: 6px 6px 0px #ffffff;
    color: #000000;
}

.hero__cta-icon {
    font-size: 1.1em;
}

.hero__cta-arrow {
    transition: transform var(--duration-fast) var(--ease-out);
}

.hero__cta--secondary:hover .hero__cta-arrow {
    transform: translateX(4px);
}

/* ── Scroll indicator ──────────────────────────────────── */
.hero__scroll {
    font-family: var(--ff-heading);
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    color: var(--clr-text-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    animation: scrollBounce 2.5s ease-in-out infinite;
}

.hero__scroll-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--clr-accent);
    opacity: 0.75;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(8px); }
}

/* ═══════════════════════════════════════════════════════════
 *  ABOUT SECTION
 * ═══════════════════════════════════════════════════════════ */
.about {
    position: relative;
    padding: var(--space-3xl) var(--space-lg);
    overflow: hidden;
    isolation: isolate;
}

.about__bg {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(148, 163, 184, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
}

.about__inner {
    max-width: 1100px;
    margin: 0 auto;
}

.about__header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.about__header.in-view {
    opacity: 1;
    transform: translateY(0);
}

.about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

.about__text-col,
.about__skills-col {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out) 0.2s, transform 0.8s var(--ease-out) 0.2s;
}

.about__text-col.in-view,
.about__skills-col.in-view {
    opacity: 1;
    transform: translateY(0);
}

.about__text {
    font-size: 1.05rem;
    color: var(--clr-text-muted);
    margin-bottom: var(--space-lg);
    line-height: 1.8;
}

.about__em {
    color: var(--clr-primary-light);
    font-style: normal;
    font-weight: 500;
}

/* ── Stats ─────────────────────────────────────────────── */
.about__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(8px, 1.8vw, 16px);
    margin-top: clamp(1.2rem, 3vw, var(--space-xl));
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--ease-out) 0.4s, transform 0.6s var(--ease-out) 0.4s;
}

.about__stats.in-view {
    opacity: 1;
    transform: translateY(0);
}

.about__stat {
    text-align: center;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-left: 3px solid var(--clr-accent);
    border-radius: 3px;
    padding: clamp(0.5rem, 1.5vw, 0.95rem) clamp(0.25rem, 1vw, 0.75rem);
    transform: skewX(-8deg);
    box-shadow: 2px 2px 0px rgba(255, 255, 255, 0.2);
    transition: transform var(--duration-fast), box-shadow var(--duration-fast);
}

.about__stat:hover {
    transform: translate(-2px, -2px) skewX(-8deg);
    box-shadow: 4px 4px 0px var(--clr-accent);
}

.about__stat > * {
    transform: skewX(8deg);
    display: block;
}

.about__stat-number {
    display: block;
    font-family: var(--ff-heading);
    font-size: clamp(1.35rem, 3.8vw, 2.4rem);
    font-weight: 800;
    font-style: italic;
    color: var(--clr-primary);
    line-height: 1.1;
}

.about__stat-label {
    font-size: clamp(0.58rem, 1.6vw, 0.72rem);
    font-weight: 600;
    color: var(--clr-text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 3px;
    line-height: 1.25;
}

/* ── Skills summary (replaces stats) ──────────────────── */
.about__skills-summary {
    margin-top: var(--space-xl);
    padding: var(--space-lg) var(--space-lg);
    border-left: 3px solid var(--clr-accent);
    border-top: 1px solid var(--clr-border);
    border-right: 1px solid var(--clr-border);
    border-bottom: 1px solid var(--clr-border);
    border-radius: 3px;
    background: var(--clr-surface);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s var(--ease-out) 0.5s, transform 0.6s var(--ease-out) 0.5s;
}

.about__skills-summary.in-view {
    opacity: 1;
    transform: translateY(0);
}

.about__skills-summary-text {
    font-size: 0.98rem;
    color: var(--clr-text-muted);
    line-height: 1.75;
    margin: 0;
}

html[data-theme="light"] .about__skills-summary {
    background: rgba(255, 255, 255, 0.85);
    border-left-color: #000000;
    border-color: rgba(0, 0, 0, 0.15);
    border-left: 3px solid #000000;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.10);
}


/* ── Skills ────────────────────────────────────────────── */
.about__skills-title {
    font-family: var(--ff-heading);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: var(--clr-text-muted);
    margin-bottom: var(--space-lg);
    text-transform: uppercase;
}

.about__skills-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(8px, 1.8vw, 14px);
}

.skill-card {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.6vw, 14px);
    padding: clamp(0.55rem, 1.4vw, 0.85rem) clamp(0.6rem, 1.6vw, 1rem);
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-left: 3px solid var(--clr-primary);
    border-radius: 3px;
    backdrop-filter: blur(12px);
    box-shadow: 2px 2px 0px rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: translateX(20px) skewX(-5deg);
    transition: opacity 0.5s var(--ease-out) calc(var(--delay, 0s) + 0.3s),
                transform var(--duration-fast) var(--ease-out),
                border-color var(--duration-fast),
                box-shadow var(--duration-fast);
}

.skill-card.in-view {
    opacity: 1;
    transform: translateX(0) skewX(-5deg);
}

.skill-card:hover {
    border-color: var(--clr-accent);
    border-left-color: var(--clr-accent);
    box-shadow: 4px 4px 0px var(--clr-accent), 0 4px 16px var(--clr-glow);
    transform: translate(-2px, -2px) skewX(-5deg);
}

.skill-card > * {
    transform: skewX(5deg);
}

.skill-card__icon {
    width: clamp(28px, 5.5vw, 38px);
    height: clamp(28px, 5.5vw, 38px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 2px;
    color: var(--clr-primary-light);
    flex-shrink: 0;
}

.skill-card__info {
    flex: 1;
    min-width: 0;
}

.skill-card__name {
    font-family: var(--ff-heading);
    font-size: clamp(0.72rem, 1.5vw, 0.78rem);
    font-weight: 600;
    color: var(--clr-text);
    display: block;
    line-height: 1.25;
}

.skill-card__technologies {
    display: block;
    margin-top: 0.15rem;
    color: var(--clr-text-muted);
    font-size: clamp(0.62rem, 1.3vw, 0.72rem);
    line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════
 *  PROJECTS SECTION
 * ═══════════════════════════════════════════════════════════ */
.projects {
    position: relative;
    padding: var(--space-3xl) 0;
    overflow: clip;
    isolation: isolate;
}

.projects__bg {
    background:
        radial-gradient(ellipse at 70% 40%, rgba(148, 163, 184, 0.04) 0%, transparent 55%),
        radial-gradient(ellipse at 30% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
}

.projects__inner {
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.projects__header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    padding: 0 var(--space-lg);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.projects__header.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ── Continuous Marquee Ticker ────────────────────────── */
.projects__marquee {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: var(--space-sm) 0 var(--space-xl);
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.projects__track {
    display: flex;
    flex-direction: row;
    width: max-content;
    will-change: transform;
    animation: projectsMarquee 38s linear infinite;
}

.projects__marquee:hover .projects__track,
.projects__track:hover {
    animation-play-state: paused;
}

.projects__group {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: var(--space-lg);
    padding-right: var(--space-lg); /* Exactly matches gap for zero-stutter seamless loop */
    flex-shrink: 0;
}

@keyframes projectsMarquee {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

/* ── Project Card ──────────────────────────────────────── */
.project-card {
    display: flex;
    flex-direction: column;
    flex: 0 0 clamp(260px, calc(25vw - 2rem), 380px);
    width: clamp(260px, calc(25vw - 2rem), 380px);
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: 4px;
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
    overflow: hidden;
    backdrop-filter: blur(14px);
    opacity: 1; /* Always visible in continuous ticker */
    transform: none;
    color: inherit;
    text-decoration: none;
    box-shadow: 4px 4px 0px rgba(255, 255, 255, 0.2);
    transition: transform var(--duration-fast) var(--ease-out),
                border-color var(--duration-fast),
                box-shadow var(--duration-fast);
}

.project-card:hover {
    transform: translateY(-6px) scale(1.015);
    border-color: var(--accent, var(--clr-primary));
    box-shadow: 6px 6px 0px var(--accent, var(--clr-primary)), 0 12px 32px var(--clr-glow);
    z-index: 10;
}

.project-card:focus-visible {
    outline: 2px solid var(--clr-accent);
    outline-offset: 4px;
}

.project-card__visual {
    position: relative;
    height: 180px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card__gradient {
    position: absolute;
    inset: 0;
}

.project-card__number {
    font-family: var(--ff-heading);
    font-size: 5.5rem;
    font-weight: 800;
    font-style: italic;
    color: rgba(255, 255, 255, 0.08);
    position: absolute;
    bottom: -15px;
    right: 14px;
    line-height: 1;
    transform: skewX(-8deg);
    pointer-events: none;
    user-select: none;
}

.project-card__orbit {
    width: 80px;
    height: 80px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: orbitSpin 8s linear infinite;
    position: relative;
}

.project-card__planet {
    width: 14px;
    height: 14px;
    background: var(--accent, var(--clr-primary));
    border-radius: 50%;
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 12px var(--accent, var(--clr-primary));
}

@keyframes orbitSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.project-card__body {
    padding: var(--space-lg);
}

.project-card__title {
    font-family: var(--ff-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--clr-text);
    margin-bottom: var(--space-sm);
}

.project-card__desc {
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.project-card__tag {
    font-family: var(--ff-heading);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--clr-primary-light);
    background: var(--clr-surface);
    padding: 3px 10px;
    border-radius: 2px;
    border: 1px solid var(--clr-border);
    transform: skewX(-8deg);
    display: inline-block;
    box-shadow: 1px 1px 0px rgba(255, 255, 255, 0.2);
}

.project-card__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--ff-heading);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--clr-primary);
    text-decoration: none;
    transition: gap var(--duration-fast) var(--ease-out);
}

.project-card:hover .project-card__link {
    gap: var(--space-md);
    color: var(--clr-primary-light);
}

.project-card__link-arrow {
    transition: transform var(--duration-fast) var(--ease-out);
}

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

/* ═══════════════════════════════════════════════════════════
 *  CONTACT SECTION
 * ═══════════════════════════════════════════════════════════ */
.contact {
    position: relative;
    padding: var(--space-3xl) var(--space-lg);
    overflow: hidden;
}

.contact__bg {
    background:
        radial-gradient(ellipse at 50% 60%, rgba(148, 163, 184, 0.05) 0%, transparent 60%);
}

.contact__inner {
    max-width: 680px;
    margin: 0 auto;
}

.contact__header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.contact__header.in-view {
    opacity: 1;
    transform: translateY(0);
}

.contact__subtitle {
    font-size: 1rem;
    color: var(--clr-text-muted);
    margin-top: calc(var(--space-md) * -1);
}

/* ── Form ──────────────────────────────────────────────── */
.contact__form {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out) 0.2s, transform 0.8s var(--ease-out) 0.2s;
}

.contact__form.in-view {
    opacity: 1;
    transform: translateY(0);
}

.contact__form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.contact__field {
    position: relative;
    margin-bottom: var(--space-lg);
}

.contact__form-row .contact__field { margin-bottom: 0; }

.contact__label {
    display: block;
    font-family: var(--ff-heading);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--clr-text-muted);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
}

.contact__input {
    width: 100%;
    font-family: var(--ff-body);
    font-size: 0.95rem;
    color: var(--clr-text);
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: 3px;
    padding: var(--space-md);
    outline: none;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.contact__input::placeholder {
    color: var(--clr-text-dim);
}

.contact__input:focus {
    border-color: var(--clr-accent);
    box-shadow: 3px 3px 0px var(--clr-accent);
}

.contact__textarea {
    resize: vertical;
    min-height: 140px;
}

.contact__field-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--clr-accent), var(--clr-accent2));
    border-radius: var(--radius-full);
    transition: width var(--duration-normal) var(--ease-out);
}

.contact__input:focus ~ .contact__field-line {
    width: 100%;
}

/* ── Errors ────────────────────────────────────────────── */
.contact__field--error .contact__input {
    border-color: var(--clr-error);
}

.contact__error {
    display: block;
    font-size: 0.75rem;
    color: var(--clr-error);
    margin-top: var(--space-xs);
}

/* ── Submit button ─────────────────────────────────────── */
.contact__submit {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--ff-heading);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #000000;
    background: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 3px;
    padding: var(--space-md) var(--space-2xl);
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out),
                background-color var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out);
    box-shadow: 4px 4px 0px rgba(255, 255, 255, 0.35);
    width: 100%;
    justify-content: center;
    transform: skewX(-8deg);
}

.contact__submit > * {
    transform: skewX(8deg);
    display: inline-block;
}

.contact__submit:hover {
    transform: translate(-2px, -2px) skewX(-8deg);
    box-shadow: 6px 6px 0px #ffffff;
    background: #e4e4e7;
    color: #000000;
}

.contact__submit:active {
    transform: translateY(0);
    box-shadow: 2px 2px 0px #ffffff;
}

.contact__submit--sending {
    opacity: 0.7;
    pointer-events: none;
}

@keyframes spinStar {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Decorative side motifs ───────────────────────────── */
.side-flower {
    position: absolute;
    z-index: 2;
    color: var(--clr-accent);
    font-family: var(--ff-heading);
    font-size: clamp(3rem, 5vw, 5rem);
    line-height: 1;
    opacity: 0.8;
    pointer-events: none;
    text-shadow: 0 0 20px var(--clr-glow);
    animation: spinStar 8s linear infinite;
}

.side-flower--about-top {
    top: 3rem;
    left: 1%;
    font-size: clamp(6rem, 12vw, 12rem);
}

.side-flower--portfolio-top {
    top: 3rem;
    right: 2%;
    font-size: clamp(6rem, 12vw, 12rem);
    animation-direction: reverse;
}

.side-flower--contact-top {
    bottom: 3rem;
    left: 4%;
    font-size: clamp(5rem, 10vw, 10rem);
}

/* ── Feedback ──────────────────────────────────────────── */
.contact__feedback {
    text-align: center;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
    font-family: var(--ff-heading);
    font-size: 0.85rem;
    font-weight: 500;
    animation: feedbackIn 0.4s var(--ease-spring);
}

.contact__feedback--success {
    background: rgba(52, 211, 153, 0.1);
    color: var(--clr-success);
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.contact__feedback--error {
    background: rgba(248, 113, 113, 0.1);
    color: var(--clr-error);
    border: 1px solid rgba(248, 113, 113, 0.25);
}

@keyframes feedbackIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
 *  FOOTER
 * ═══════════════════════════════════════════════════════════ */
.site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--clr-border);
    padding: var(--space-xl) var(--space-lg);
}

.site-footer__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-footer__copy {
    width: 100%;
    font-size: 1rem;
    color: var(--clr-text-dim);
    text-align: center;
}

.site-footer__tagline {
    font-family: var(--ff-heading);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    color: var(--clr-text-dim);
}

/* ═══════════════════════════════════════════════════════════
 *  GLITCH EFFECT
 * ═══════════════════════════════════════════════════════════ */
[data-glitch] {
    position: relative;
    cursor: default;
}

[data-glitch]::before,
[data-glitch]::after {
    content: attr(data-glitch);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

[data-glitch]::before { color: var(--clr-accent); }
[data-glitch]::after  { color: var(--clr-accent2); }

.glitch-active::before {
    animation: glitch1 0.22s steps(2) forwards;
}
.glitch-active::after {
    animation: glitch2 0.22s steps(2) forwards;
}

@keyframes glitch1 {
    0%   { opacity: 0.8; transform: translate(-3px, -1px); clip-path: inset(20% 0 40% 0); }
    50%  { opacity: 0.6; transform: translate(3px, 1px);   clip-path: inset(60% 0 10% 0); }
    100% { opacity: 0;   transform: translate(0); }
}

@keyframes glitch2 {
    0%   { opacity: 0.8; transform: translate(3px, 2px);   clip-path: inset(50% 0 20% 0); }
    50%  { opacity: 0.6; transform: translate(-3px, -1px); clip-path: inset(10% 0 60% 0); }
    100% { opacity: 0;   transform: translate(0); }
}

/* ═══════════════════════════════════════════════════════════
 *  RESPONSIVE
 * ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    :root {
        --hero-layer-offset-1: 7px;
        --hero-layer-offset-2: 14px;
        --hero-layer-offset-3: 20px;
    }

    .about__grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

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

    .site-nav { display: none; }
    .site-menu-toggle { display: flex; }

    /* Sur mobile : CV est dans le burger, bouton clair sur la barre nav (pas dans le burger) */
    .site-header__right {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .site-header__actions {
        display: inline-flex !important;
    }

    .site-header .theme-toggle {
        display: inline-flex !important;
    }

    .site-header .cv-link,
    .site-header .cv-link-nav {
        display: none !important;
    }

    .mobile-nav__actions {
        display: none !important;
    }

    .site-header {
        height: 60px;
        padding: 0 1.25rem;
    }
}

/* ═══════════════════════════════════════════════════════════
 *  CV MODAL VIEWER (Direct Document Display - No PDF Viewer UI)
 * ═══════════════════════════════════════════════════════════ */
body.modal-open {
    overflow: hidden !important;
}

.cv-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 2vw, 2rem);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out), visibility 0.3s;
}

body.intro-active:not(.intro-dismissed) .cv-modal {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.cv-modal.cv-modal--open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cv-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
    transition: opacity 0.3s var(--ease-out);
}

html[data-theme="light"] .cv-modal__backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.cv-modal__container {
    position: relative;
    z-index: 1;
    width: min(94vw, 1020px);
    height: min(92vh, 960px);
    background: var(--clr-bg-card);
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96) translateY(16px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.cv-modal.cv-modal--open .cv-modal__container {
    transform: scale(1) translateY(0);
}

html[data-theme="light"] .cv-modal__container {
    background: #ffffff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.22);
    border-color: rgba(0, 0, 0, 0.16);
}

.cv-modal__handle {
    display: none;
}

.cv-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: 0.85rem 1.4rem;
    border-bottom: 1px solid var(--clr-border);
    background: var(--clr-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-shrink: 0;
}

.cv-modal__header-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

.cv-modal__badge {
    font-family: var(--ff-heading);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--clr-accent);
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid var(--clr-border);
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

html[data-theme="light"] .cv-modal__badge {
    color: #000000;
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
}

.cv-modal__title {
    font-family: var(--ff-heading);
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    font-weight: 700;
    color: var(--clr-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cv-modal__header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cv-modal__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-family: var(--ff-heading);
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 4px;
    color: var(--clr-text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--clr-border);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.cv-modal__btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--clr-primary);
    border-color: var(--clr-accent);
    transform: translateY(-1px);
}

html[data-theme="light"] .cv-modal__btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.14);
    color: #000000;
}

html[data-theme="light"] .cv-modal__btn:hover {
    background: rgba(0, 0, 0, 0.09);
    border-color: #000000;
}

.cv-modal__btn--download {
    color: var(--clr-accent);
}

.cv-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 4px;
    border: 1px solid var(--clr-border);
    background: transparent;
    color: var(--clr-text);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, color 0.2s;
    margin-left: 4px;
}

.cv-modal__close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--clr-primary);
    transform: scale(1.08);
}

html[data-theme="light"] .cv-modal__close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #000000;
}

.cv-modal__body {
    flex: 1;
    width: 100%;
    min-height: 0;
    position: relative;
    background: #121216;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

html[data-theme="light"] .cv-modal__body {
    background: #f4f4f5;
}

.cv-modal__document-wrapper {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.cv-document-picture {
    display: block;
    width: 100%;
}

.cv-modal__document-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    background: #ffffff;
}

html[data-theme="light"] .cv-modal__document-img {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* ═══════════════════════════════════════════════════════════
 *  CV DEDICATED PAGE (cv.html)
 * ═══════════════════════════════════════════════════════════ */
.cv-page {
    min-height: 100vh;
    background: var(--clr-bg-deep);
    color: var(--clr-text);
}

.cv-page__main {
    width: min(100% - 2rem, 1100px);
    margin: 0 auto;
    padding: 6.5rem 0 var(--space-3xl);
}

.cv-page__header {
    margin-bottom: var(--space-xl);
}

.cv-page__header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-top: var(--space-xs);
}

.cv-page__title {
    font-family: var(--ff-heading);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 0.35rem 0;
}

.cv-page__subtitle {
    color: var(--clr-text-muted);
    font-size: 1.05rem;
    margin: 0;
}

.cv-page__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: var(--ff-heading);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 6px;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.cv-btn--primary {
    background: var(--clr-text);
    color: var(--clr-bg-deep);
    border: 1px solid var(--clr-text);
}

.cv-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
}

html[data-theme="light"] .cv-btn--primary {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

html[data-theme="light"] .cv-btn--primary:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.cv-btn--secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--clr-text);
    border: 1px solid var(--clr-border);
}

.cv-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--clr-accent);
    transform: translateY(-2px);
}

html[data-theme="light"] .cv-btn--secondary {
    background: rgba(0, 0, 0, 0.04);
    color: #000000;
    border-color: rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .cv-btn--secondary:hover {
    background: rgba(0, 0, 0, 0.08);
}

.cv-page__viewer {
    width: 100%;
    display: flex;
    justify-content: center;
}

.cv-document-wrapper {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

.cv-document-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    background: #ffffff;
}

html[data-theme="light"] .cv-document-image {
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.12);
}

/* ── Mobile Phone Styles (Bottom Sheet & Document View) ── */
@media (max-width: 768px) {
    .cv-modal {
        padding: 0;
        align-items: flex-end;
    }

    .cv-modal__container {
        width: 100vw;
        height: 94vh;
        max-height: 94vh;
        border-radius: 20px 20px 0 0;
        border: 1px solid var(--clr-border);
        border-bottom: none;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 -16px 60px rgba(0, 0, 0, 0.65);
    }

    .cv-modal.cv-modal--open .cv-modal__container {
        transform: translateY(0);
    }

    .cv-modal__handle {
        display: block;
        width: 44px;
        height: 4.5px;
        background: var(--clr-text-dim);
        border-radius: var(--radius-full);
        margin: 10px auto 4px auto;
        opacity: 0.45;
        flex-shrink: 0;
    }

    .cv-modal__header {
        padding: 0.65rem 0.9rem 0.75rem 0.9rem;
    }

    .cv-modal__badge {
        display: none;
    }

    .cv-modal__title {
        font-size: 0.9rem;
    }

    .cv-modal__btn {
        padding: 6px 9px;
        font-size: 0.72rem;
    }

    .cv-modal__btn span {
        display: none;
    }

    .cv-modal__close {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .cv-modal__body {
        padding: 0.4rem;
    }

    .cv-modal__document-img {
        width: 100%;
        border-radius: 4px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    }

    .cv-page__main {
        width: 100%;
        padding: 4.5rem 0.75rem var(--space-2xl);
    }

    .cv-page__header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .cv-page__actions {
        width: 100%;
    }

    .cv-btn {
        flex: 1;
        justify-content: center;
        padding: 9px 12px;
        font-size: 0.78rem;
    }

    .cv-document-wrapper {
        max-width: 100%;
    }

    .cv-document-image {
        border-radius: 4px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    }
}

/* ── Dedicated portfolio page ─────────────────────────── */
.portfolio-page {
    min-height: 100vh;
    background: var(--clr-bg-deep);
}

.portfolio-page__main {
    width: min(100% - 3rem, 1340px);
    margin: 0 auto;
    padding: 6.5rem 0 var(--space-3xl);
}

.portfolio-page__back {
    display: inline-block;
    margin-bottom: var(--space-2xl);
    color: var(--clr-text-muted);
    font-size: 0.85rem;
}

.portfolio-page__back:hover {
    color: var(--clr-accent);
}

.portfolio-page__back:hover .logo-text {
    color: var(--clr-accent);
}

.portfolio-page__header {
    max-width: 720px;
    margin-bottom: var(--space-2xl);
}

.portfolio-page__header h1 {
    margin: var(--space-sm) 0 var(--space-md);
    font-family: var(--ff-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1;
    color: var(--clr-text);
}

.portfolio-page__header p {
    max-width: 620px;
    color: var(--clr-text-muted);
    font-size: 1.05rem;
}

/* Projects displayed in 3-slot horizontal grid */
.portfolio-page__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: var(--space-lg);
    align-items: stretch;
}

.portfolio-project {
    display: flex;
    flex-direction: column;
    padding: 0.95rem;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    background: var(--clr-bg-card);
    text-decoration: none;
    color: var(--clr-text);
    transition: border-color var(--duration-fast), transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-fast);
    scroll-margin-top: var(--space-lg);
    height: 100%;
    cursor: pointer;
    overflow: hidden;
}

.portfolio-project:target {
    border-color: var(--clr-accent);
    box-shadow: 0 0 24px var(--clr-glow);
}

.portfolio-project:hover {
    border-color: var(--clr-accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3), 0 0 18px var(--clr-glow);
}

.portfolio-project__preview {
    position: relative;
    height: 220px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--clr-border);
    background: var(--clr-surface);
    margin-bottom: 0.85rem;
    flex-shrink: 0;
}

.portfolio-project__preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: top;
    transition: transform 0.4s var(--ease-out);
}

.portfolio-project:hover .portfolio-project__preview img {
    transform: scale(1.05);
}

.portfolio-project__number {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    background: rgba(10, 10, 16, 0.82);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: var(--ff-heading);
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--clr-accent);
}

.portfolio-project__placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    color: var(--clr-text-dim);
    font-family: var(--ff-heading);
    font-size: 0.85rem;
    gap: 0.4rem;
}

.portfolio-project__body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.portfolio-project__type {
    margin: 0 0 0.25rem;
    color: var(--clr-text-dim);
    font-family: var(--ff-heading);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.3;
}

.portfolio-project__title,
.portfolio-project h2 {
    margin: 0 0 0.35rem;
    font-family: var(--ff-heading);
    font-size: 1.15rem;
    line-height: 1.25;
    color: var(--clr-text);
    transition: color var(--duration-fast);
}

.portfolio-project:hover .portfolio-project__title,
.portfolio-project:hover h2 {
    color: var(--clr-accent);
}

.portfolio-project__tags,
.portfolio-project ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.4rem 0 0.85rem;
    padding: 0;
    list-style: none;
}

.portfolio-project__tags li,
.portfolio-project li {
    padding: 0.22rem 0.5rem;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    color: var(--clr-primary-light);
    font-family: var(--ff-heading);
    font-size: 0.7rem;
}

.portfolio-project__link-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.65rem;
    border-top: 1px solid var(--clr-border);
    font-family: var(--ff-heading);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--clr-accent);
}

.portfolio-project__arrow {
    transition: transform var(--duration-fast);
}

.portfolio-project:hover .portfolio-project__arrow {
    transform: translateX(4px);
}

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

@media (max-width: 720px) {
    .portfolio-page__main {
        width: min(100% - 2rem, 1000px);
    }

    .portfolio-page__list {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

/* ── Dynamic Portfolio Layout (zigzag) ────────────────── */
.portfolio-page__list--dynamic {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Project item wrapper */
.pf-item {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2.5rem, 5vw, 5rem);
    align-items: center;
    padding: clamp(4rem, 7vw, 7rem) 0;
    border-bottom: 1px solid var(--clr-border);
    overflow: hidden;
}

.pf-item:last-of-type {
    border-bottom: none;
}

/* Decorative large number behind the item */
.pf-item__number {
    position: absolute;
    font-family: var(--ff-display);
    font-size: clamp(7rem, 18vw, 14rem);
    font-weight: 900;
    font-style: italic;
    color: var(--clr-surface);
    line-height: 1;
    pointer-events: none;
    user-select: none;
    top: 50%;
    transform: translateY(-50%);
    z-index: 0;
    letter-spacing: -0.04em;
    transition: color var(--duration-fast);
}

html[data-theme="light"] .pf-item__number {
    color: rgba(0, 0, 0, 0.05);
}

.pf-item--right .pf-item__number {
    right: -1rem;
}

.pf-item--left .pf-item__number {
    left: -1rem;
}

.pf-item:hover .pf-item__number {
    color: rgba(255, 255, 255, 0.07);
}

html[data-theme="light"] .pf-item:hover .pf-item__number {
    color: rgba(0, 0, 0, 0.07);
}

/* Body and visual ordering */
.pf-item__body,
.pf-item__visual {
    position: relative;
    z-index: 1;
}

/* image-right: body first, image second */
.pf-item--right .pf-item__body { order: 1; }
.pf-item--right .pf-item__visual { order: 2; }

/* image-left: image first, body second */
.pf-item--left .pf-item__visual { order: 1; }
.pf-item--left .pf-item__body { order: 2; }

/* Slight indent for visual variety */
.pf-item--right .pf-item__body {
    padding-left: 1.5rem;
}
.pf-item--left .pf-item__body {
    padding-right: 1.5rem;
}

/* Meta line */
.pf-item__meta {
    font-family: var(--ff-heading);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--clr-text-dim);
    margin-bottom: var(--space-md);
}

/* Title */
.pf-item__title {
    font-family: var(--ff-heading);
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    line-height: 1.1;
    color: var(--clr-text);
    margin: 0 0 var(--space-lg) 0;
    letter-spacing: -0.02em;
}

.pf-item__title-sub {
    font-weight: 400;
    opacity: 0.65;
    font-size: 0.65em;
    display: block;
    margin-top: 0.15em;
}

/* Description */
.pf-item__desc {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--clr-text-muted);
    margin-bottom: var(--space-lg);
    max-width: 520px;
}

.pf-item__desc strong {
    color: var(--clr-text);
    font-family: inherit;
    font-weight: 600;
}

/* Tags */
.pf-item__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-xl) 0;
}

.pf-item__tags li {
    font-family: var(--ff-heading);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--clr-primary-light);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 2px;
    padding: 4px 10px;
    transform: skewX(-6deg);
    display: inline-block;
}

/* CTA link */
.pf-item__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--ff-heading);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--clr-text);
    text-decoration: none;
    border-bottom: 2px solid var(--clr-accent);
    padding-bottom: 2px;
    transition: gap var(--duration-fast) var(--ease-out),
                color var(--duration-fast),
                border-color var(--duration-fast);
}

.pf-item__cta:hover {
    gap: 1rem;
    color: var(--clr-text);
}

html[data-theme="light"] .pf-item__cta {
    color: #000000;
    border-color: #000000;
}

/* Visual block */
.pf-item__visual {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--clr-border);
    aspect-ratio: 16 / 10;
    background: var(--clr-surface);
}

.pf-item__visual a {
    display: block;
    width: 100%;
    height: 100%;
}

.pf-item__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.5s var(--ease-out), filter 0.3s;
    filter: brightness(0.96);
}

.pf-item:hover .pf-item__visual img {
    transform: scale(1.04);
    filter: brightness(1);
}

html[data-theme="light"] .pf-item__visual {
    border-color: rgba(0, 0, 0, 0.16);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.10);
}

/* Divider between projects */
.pf-divider {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    color: var(--clr-text-dim);
    padding: 0;
}

.pf-divider__line {
    flex: 1;
    height: 1px;
    background: var(--clr-border);
}

.pf-divider__glyph {
    font-size: 0.75rem;
    opacity: 0.5;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 860px) {
    .pf-item {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
        padding: clamp(3rem, 6vw, 5rem) 0;
    }

    .pf-item--right .pf-item__body { order: 1; padding-left: 0; }
    .pf-item--right .pf-item__visual { order: 2; }
    .pf-item--left .pf-item__visual { order: 2; }
    .pf-item--left .pf-item__body { order: 1; padding-right: 0; }

    .pf-item__number {
        font-size: clamp(5rem, 20vw, 8rem);
        opacity: 0.5;
    }

    .pf-item__title {
        font-size: clamp(1.8rem, 6vw, 2.8rem);
    }
}


/* ═══════════════════════════════════════════════════════════
 *  PROJECT CARD MEDIA (Homepage Marquee & Portfolio list)
 * ═══════════════════════════════════════════════════════════ */
.project-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform var(--duration-slow) var(--ease-out), filter var(--duration-normal);
    filter: brightness(0.85);
}

.project-card:hover .project-card__img {
    transform: scale(1.06);
    filter: brightness(1);
}

.portfolio-project__preview {
    margin: var(--space-md) 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--clr-border);
    background: var(--clr-surface);
}

.portfolio-project__img-link {
    display: block;
    position: relative;
    max-height: 260px;
    overflow: hidden;
}

.portfolio-project__img-link img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: top;
    transition: transform 0.4s var(--ease-out);
}

.portfolio-project__img-link:hover img {
    transform: scale(1.03);
}

.portfolio-project__actions {
    margin-top: var(--space-md);
}

.portfolio-project__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    font-family: var(--ff-heading);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--clr-text);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast);
}

.portfolio-project__btn:hover {
    background: var(--clr-border);
    border-color: var(--clr-accent);
    transform: translateX(4px);
    color: var(--clr-text);
}

.portfolio-project__btn--primary {
    background: var(--clr-text);
    color: var(--clr-bg-deep);
    border-color: var(--clr-text);
}

.portfolio-project__btn--primary:hover {
    background: var(--clr-accent2);
    border-color: var(--clr-accent2);
    color: var(--clr-bg-deep);
}

.portfolio-project__btn--secondary {
    opacity: 0.7;
    cursor: default;
    background: rgba(255, 255, 255, 0.03);
    color: var(--clr-text-muted);
}

.portfolio-project__btn--secondary:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--clr-border);
    color: var(--clr-text-muted);
}

/* ═══════════════════════════════════════════════════════════
 *  PROJECT DETAIL PAGE (e.g. Tenrac Case Study)
 * ═══════════════════════════════════════════════════════════ */
.project-detail-page {
    min-height: 100vh;
    background: var(--clr-bg-deep);
    color: var(--clr-text);
}

.project-detail__main {
    width: min(100% - 3rem, 1080px);
    margin: 0 auto;
    padding: 6.5rem 0 var(--space-3xl);
}

/* ── Top Bar & Back Button (Shared across Detail Pages & CV) ── */
.page-topbar {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-top: var(--space-xs);
}

.page-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--ff-heading);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--clr-text);
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-left: 3px solid var(--clr-accent);
    padding: 8px 18px;
    border-radius: 3px;
    text-decoration: none;
    box-shadow: 3px 3px 0px rgba(255, 255, 255, 0.18);
    transform: skewX(-8deg);
    transition: transform var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out),
                background-color var(--duration-fast),
                border-color var(--duration-fast),
                color var(--duration-fast);
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.page-back-btn > * {
    display: inline-flex;
    align-items: center;
    transform: skewX(8deg);
}

.page-back-btn__arrow {
    font-size: 1.05rem;
    line-height: 1;
    display: inline-block;
    transition: transform var(--duration-fast) var(--ease-spring);
}

.page-back-btn:hover {
    background: var(--clr-surface);
    color: var(--clr-text);
    border-color: var(--clr-accent);
    transform: translate(-2px, -2px) skewX(-8deg);
    box-shadow: 5px 5px 0px rgba(255, 255, 255, 0.35);
}

.page-back-btn:hover .page-back-btn__arrow {
    transform: translateX(-4px);
}

.page-back-btn:active {
    transform: translate(1px, 1px) skewX(-8deg);
    box-shadow: 1px 1px 0px rgba(255, 255, 255, 0.2);
}

/* Light Mode Back Button */
html[data-theme="light"] .page-back-btn {
    background: #ffffff;
    color: #000000;
    border-color: #000000;
    border-left: 3px solid #000000;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.25);
}

html[data-theme="light"] .page-back-btn:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    box-shadow: 5px 5px 0px #000000;
}

html[data-theme="light"] .page-back-btn:hover .page-back-btn__arrow {
    transform: translateX(-4px);
}

.project-detail__header {
    margin-bottom: var(--space-2xl);
}

.project-detail__eyebrow-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-xs);
}

.project-detail__badge {
    padding: 0.2rem 0.6rem;
    font-family: var(--ff-heading);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-full);
    color: var(--clr-accent);
}

.project-detail__hero-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2xl);
    margin: var(--space-xs) 0 var(--space-lg);
}

.project-detail__hero-left {
    flex: 1;
    min-width: 0;
}

.project-detail__hero-right {
    width: 380px;
    max-width: 100%;
    flex-shrink: 0;
    padding: var(--space-md) var(--space-lg);
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
}

.hero-skills__title {
    display: block;
    font-family: var(--ff-heading);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--clr-text-dim);
    margin-bottom: var(--space-xs);
}

.project-detail__hero-right .skills-chips {
    margin-top: 0.35rem;
}

.project-detail__title {
    font-family: var(--ff-heading);
    font-size: clamp(2.8rem, 8vw, 5.5rem);
    line-height: 1.05;
    margin: var(--space-xs) 0 var(--space-md);
    letter-spacing: -0.02em;
}

.project-detail__tagline {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.5;
    color: var(--clr-text-muted);
    max-width: 820px;
    margin-bottom: 0;
}

/* Metadata grid */
.project-detail__meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.project-detail__hero-media .project-detail__meta-grid {
    margin-top: var(--space-xl);
}

.meta-card {
    padding: var(--space-md) var(--space-lg);
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
}

.meta-card__label {
    display: block;
    font-family: var(--ff-heading);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--clr-text-dim);
    margin-bottom: 0.35rem;
}

.meta-card__val {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--clr-text);
    line-height: 1.35;
}

/* Hero media browser mockup */
.project-detail__hero-media {
    margin: var(--space-2xl) 0 var(--space-3xl);
}

.hero-media__window {
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
}

.hero-media__browser-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
}

.browser-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.browser-dot--red { background: #ef4444; }
.browser-dot--yellow { background: #f59e0b; }
.browser-dot--green { background: #10b981; }

.browser-address {
    margin-left: 12px;
    font-family: var(--ff-display);
    font-size: 0.78rem;
    color: var(--clr-text-dim);
    padding: 3px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.hero-media__img-container {
    width: 100%;
    background: #000;
    line-height: 0;
}

.hero-media__img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 640px;
    object-fit: cover;
    object-position: top;
}

.hero-media__caption {
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    color: var(--clr-text-dim);
    text-align: center;
}

/* Sections */
.project-detail__content-layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xl);
}

.detail-section {
    padding-top: var(--space-lg);
    border-top: 1px solid var(--clr-border);
}

.detail-section__header {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.detail-section__num {
    font-family: var(--ff-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--clr-text-dim);
}

.detail-section h2 {
    font-family: var(--ff-heading);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: var(--clr-text);
}

.detail-section__body {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--clr-text-muted);
}

.detail-section__body p {
    margin-bottom: var(--space-md);
}

.detail-section__body strong {
    color: var(--clr-text);
}

.detail-section__intro {
    font-size: 1rem;
    color: var(--clr-text-muted);
    margin-bottom: var(--space-xl);
}

/* Callout Box */
.callout-box {
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
    background: var(--clr-bg-card);
    border-left: 3px solid var(--clr-accent);
    border-radius: var(--radius-sm);
    border-top: 1px solid var(--clr-border);
    border-right: 1px solid var(--clr-border);
    border-bottom: 1px solid var(--clr-border);
}

.callout-box__title {
    margin: 0 0 0.5rem;
    font-family: var(--ff-heading);
    font-size: 1.15rem;
    color: var(--clr-text);
}

.callout-box p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--clr-text-muted);
}

/* Feature grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.feature-card {
    padding: var(--space-lg);
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    transition: transform var(--duration-fast), border-color var(--duration-fast);
}

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

.feature-card__badge {
    display: inline-block;
    font-family: var(--ff-heading);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--clr-text-dim);
    margin-bottom: var(--space-xs);
}

.feature-card h3 {
    font-family: var(--ff-heading);
    font-size: 1.2rem;
    margin-bottom: var(--space-xs);
    color: var(--clr-text);
}

.feature-card p {
    font-size: 0.92rem;
    color: var(--clr-text-muted);
    line-height: 1.55;
    margin: 0;
}

.task-list {
    list-style: none;
    padding: 0;
    margin: var(--space-sm) 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-list li {
    position: relative;
    padding-left: 1rem;
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    line-height: 1.45;
}

.task-list li::before {
    content: "-";
    position: absolute;
    left: 0;
    color: var(--clr-text-dim);
}

/* Architecture diagram showcase in section 02 */
.architecture-diagram-showcase {
    margin: var(--space-xl) 0 var(--space-2xl);
}

.architecture-diagram-showcase .gallery-item {
    max-width: 880px;
    margin: 0 auto;
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
}

.architecture-diagram__img-wrap {
    position: relative;
    padding: var(--space-xl) var(--space-lg);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.architecture-diagram__img-wrap img {
    max-width: 100%;
    height: auto;
    max-height: 440px;
    object-fit: contain;
    transition: transform 0.4s var(--ease-out);
}

.architecture-diagram-showcase:hover .architecture-diagram__img-wrap img {
    transform: scale(1.02);
}

.architecture-diagram-showcase figcaption {
    background: var(--clr-bg-card);
    border-top: 1px solid var(--clr-border);
}

/* Gallery Grid */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
}

.gallery-item {
    margin: 0;
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.gallery-item:hover, .gallery-item:focus-visible {
    transform: translateY(-4px);
    border-color: var(--clr-accent);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    outline: none;
}

.gallery-item__img-wrap {
    position: relative;
    height: 220px;
    background: #000;
    overflow: hidden;
}

.gallery-item__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.4s var(--ease-out);
}

.gallery-item:hover .gallery-item__img-wrap img {
    transform: scale(1.04);
}

.gallery-item__zoom-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 4px 10px;
    font-family: var(--ff-heading);
    font-size: 0.72rem;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border-radius: var(--radius-full);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--duration-fast);
}

.gallery-item:hover .gallery-item__zoom-hint {
    opacity: 1;
}

.gallery-item figcaption {
    padding: var(--space-md) var(--space-lg);
}

.gallery-item figcaption strong {
    display: block;
    font-family: var(--ff-heading);
    font-size: 1.05rem;
    color: var(--clr-text);
    margin-bottom: 0.2rem;
}

.gallery-item figcaption span {
    font-size: 0.85rem;
    color: var(--clr-text-muted);
}

/* Skills Chips */
.skills-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.skill-chip {
    padding: 0.4rem 0.9rem;
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-full);
    font-family: var(--ff-heading);
    font-size: 0.82rem;
    color: var(--clr-text);
}

/* Project Detail Footer */
.project-detail__footer {
    margin-top: var(--space-3xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--clr-border);
}

.project-detail__footer-inner {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Lightbox Modal */
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.image-lightbox[hidden] {
    display: none;
}

.image-lightbox__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
}

.image-lightbox__container {
    position: relative;
    max-width: 92vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.image-lightbox__close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background var(--duration-fast);
}

.image-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.image-lightbox__img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.image-lightbox__caption {
    margin-top: var(--space-md);
    font-family: var(--ff-heading);
    font-size: 0.95rem;
    color: #fff;
    text-align: center;
}

@media (max-width: 860px) {
    .project-detail__hero-row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-lg);
    }

    .project-detail__hero-right {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .project-detail__main {
        width: min(100% - 2rem, 1000px);
        padding-top: 5.5rem;
    }

    .project-detail__header {
        margin-bottom: var(--space-xl);
    }

    .project-gallery {
        grid-template-columns: 1fr;
    }

    .gallery-item__img-wrap {
        height: 190px;
    }

    .project-detail__footer-inner {
        flex-direction: column;
    }
}



