/* ==========================================================================
   Matteo Mosti — Portfolio
   Dark theme · pink accent (#ffc0cb)
   1. Tokens & reset
   2. Base elements & utilities
   3. Header / navigation
   4. Hero
   5. Marquee
   6. About / timeline
   7. Contact
   8. Footer
   9. Responsive
   10. Reduced motion & print
   ========================================================================== */

/* ==========================================================================
   1. TOKENS & RESET
   ========================================================================== */

:root {
    color-scheme: dark;
    --bg: #0a0a0c;
    --bg-soft: #0e0e12;
    --surface: #111116;
    --surface-2: #16161c;

    --text: #f3f3f6;
    --text-soft: #c3c3cd;
    --muted: #8d8d9b;

    --accent: #ffc0cb;
    --accent-strong: #ff9fb0;
    --accent-ink: #1b0f13;
    --accent-soft: rgba(255, 192, 203, 0.1);

    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --border-accent: rgba(255, 192, 203, 0.32);

    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

    --header-h: 72px;
    --container: 1140px;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --shadow-card: 0 24px 60px -32px rgba(0, 0, 0, 0.9);
    --shadow-accent: 0 24px 60px -30px rgba(255, 192, 203, 0.28);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

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

img {
    height: auto;
}

a {
    color: inherit;
}

button {
    font: inherit;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
}

::selection {
    background: rgba(255, 192, 203, 0.3);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

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

::-webkit-scrollbar-track {
    background: #08080a;
}

::-webkit-scrollbar-thumb {
    background: #2a2a33;
    border-radius: 99px;
    border: 2px solid #08080a;
}

::-webkit-scrollbar-thumb:hover {
    background: #3c3c48;
}

/* ==========================================================================
   2. BASE ELEMENTS & UTILITIES
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: clamp(20px, 4vw, 32px);
}

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

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 999;
    padding: 12px 20px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.25s var(--ease-out);
}

.skip-link:focus-visible {
    transform: translateY(0);
    outline-color: #fff;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
}

.eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 192, 203, 0.12);
    animation: pulse-dot 2.6s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(255, 192, 203, 0.1);
    }
    50% {
        box-shadow: 0 0 0 7px rgba(255, 192, 203, 0.02);
    }
}

.text-gradient {
    background: linear-gradient(100deg, #ffffff 0%, #ffe3e8 34%, var(--accent) 68%, var(--accent-strong) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.accent-dot {
    color: var(--accent);
}

.muted {
    color: var(--muted);
}

.section {
    position: relative;
    padding: clamp(80px, 10vw, 128px) 0;
}

.section-head {
    max-width: 660px;
    margin: 0 auto clamp(48px, 7vw, 72px);
    text-align: center;
}

.section-title {
    margin: 16px 0 18px;
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 4.4vw, 3.3rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.03em;
}

.section-desc {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
    text-wrap: pretty;
}

/* Reveal-on-scroll (only when JavaScript is available) */
.js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s var(--ease-out);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ==========================================================================
   2b. PRELOADER
   ========================================================================== */

.preloader {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 400;
    grid-template-rows: auto 1fr auto;
    gap: 24px;
    padding: clamp(20px, 4vw, 36px);
    background: #08080a;
    overflow: hidden;
}

.js .preloader {
    display: grid;
}

.preloader[hidden] {
    display: none;
}

.preloader::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 72px 72px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 10%, transparent 80%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 10%, transparent 80%);
    pointer-events: none;
}

.preloader.is-done {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
    transition: transform 0.9s var(--ease-out), opacity 0.5s ease, visibility 0s 0.9s;
}

.preloader-top,
.preloader-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.preloader-word {
    position: relative;
    z-index: 1;
    align-self: center;
    justify-self: center;
    font-family: var(--font-display);
    font-size: clamp(6rem, 24vw, 19rem);
    font-weight: 700;
    line-height: 0.8;
    letter-spacing: -0.09em;
    background: linear-gradient(110deg, #ffffff 0%, #ffe3e8 30%, var(--accent) 62%, var(--accent-strong) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 20px 60px rgba(255, 192, 203, 0.18));
}

.preloader-bottom {
    align-self: end;
}

.preloader-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
}

.preloader-bar i {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-soft), var(--accent), var(--accent-strong));
    transform: scaleX(0);
    transform-origin: left center;
}

/* ==========================================================================
   2c. CUSTOM CURSOR
   ========================================================================== */

.cursor {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    pointer-events: none;
}

@media (pointer: fine) {
    body.has-cursor .cursor {
        display: block;
    }

    body.has-cursor,
    body.has-cursor a,
    body.has-cursor button,
    body.has-cursor [role="button"] {
        cursor: none;
    }
}

.cursor-dot,
.cursor-ring {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(255, 192, 203, 0.9);
}

.cursor-ring {
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 1px solid rgba(255, 192, 203, 0.55);
    background: rgba(255, 192, 203, 0.02);
    transition: opacity 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

/* ==========================================================================
   3. HEADER / NAVIGATION
   ========================================================================== */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 120;
    height: var(--header-h);
    background: rgba(10, 10, 12, 0.55);
    border-bottom: 1px solid transparent;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    background: rgba(10, 10, 12, 0.82);
    border-bottom-color: var(--border);
    box-shadow: 0 12px 40px -24px rgba(0, 0, 0, 0.9);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--container);
}

.brand {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    text-decoration: none;
    color: var(--text);
}

.brand-word {
    font-family: var(--font-display);
    font-size: 1.95rem;
    font-weight: 700;
    line-height: 0.78;
    letter-spacing: -0.075em;
    background: linear-gradient(120deg, #ffffff 0%, #ffe3e8 32%, var(--accent) 68%, var(--accent-strong));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transition: transform 0.35s var(--ease-out), filter 0.35s ease;
}

.brand-trace {
    position: relative;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(255, 192, 203, 0.65), rgba(255, 192, 203, 0.08));
    box-shadow: 0 0 10px rgba(255, 192, 203, 0.18);
    overflow: hidden;
}

.brand-trace i {
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #ffffff, var(--accent), transparent);
    animation: brand-trace 3.8s ease-in-out infinite;
}

@keyframes brand-trace {
    0% { left: -40%; }
    55%, 100% { left: 100%; }
}

.brand:hover .brand-word {
    transform: translateY(-1px);
    filter: drop-shadow(0 0 14px rgba(255, 192, 203, 0.45));
}

.menu-items {
    display: flex;
    align-items: center;
    gap: 2px;
}

.menu-items a.menu-link {
    position: relative;
    display: block;
    padding: 9px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.menu-items a.menu-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.menu-items a.menu-link.is-active {
    color: var(--accent);
}

.menu-items a.menu-link.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    transform: translateX(-50%);
}

.nav-cta-wrap {
    margin-left: 12px;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid var(--border-accent);
    border-radius: 999px;
    background: rgba(255, 192, 203, 0.06);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s var(--ease-out),
        box-shadow 0.25s ease;
}

.nav-cta svg {
    width: 15px;
    height: 15px;
}

.nav-cta:hover {
    background: var(--accent);
    color: var(--accent-ink);
    transform: translateY(-1px);
    box-shadow: 0 10px 26px -12px rgba(255, 192, 203, 0.8);
}

/* Hamburger (mobile only) */
.nav-toggle {
    display: none;
    position: relative;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.nav-toggle:hover {
    border-color: var(--border-accent);
}

.nav-toggle span {
    position: absolute;
    left: 50%;
    width: 18px;
    height: 1.5px;
    border-radius: 2px;
    background: var(--accent);
    transform: translateX(-50%);
    transition: transform 0.3s var(--ease-out), opacity 0.2s ease, top 0.3s var(--ease-out);
}

.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }

body.menu-open .nav-toggle span:nth-child(1) {
    top: 20px;
    transform: translateX(-50%) rotate(45deg);
}

body.menu-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

body.menu-open .nav-toggle span:nth-child(3) {
    top: 20px;
    transform: translateX(-50%) rotate(-45deg);
}

/* Scroll progress */
.scroll-progress {
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 2px;
    overflow: hidden;
}

.scroll-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-soft), var(--accent), var(--accent-strong));
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

/* Mobile menu overlay */
.menu-overlay {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 110;
    background: rgba(4, 4, 6, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.menu-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   4. HERO
   ========================================================================== */

.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--header-h) + 48px) 0 96px;
    overflow: hidden;
    isolation: isolate;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 38%, #000 10%, transparent 78%);
    mask-image: radial-gradient(ellipse 80% 65% at 50% 38%, #000 10%, transparent 78%);
    opacity: 0.7;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
}

.glow-1 {
    top: -18%;
    left: 8%;
    width: 46vw;
    height: 46vw;
    background: radial-gradient(circle, rgba(255, 192, 203, 0.24), transparent 66%);
}

.glow-2 {
    right: -12%;
    bottom: 4%;
    width: 38vw;
    height: 38vw;
    background: radial-gradient(circle, rgba(255, 159, 176, 0.16), transparent 68%);
}

/* Particle canvas host */
.hero-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.hero-canvas #finisher-canvas {
    background-color: transparent !important;
    opacity: 0.85;
}

/* CNC-style readout */
.hero-hud {
    position: absolute;
    bottom: 54px;
    z-index: 3;
    display: grid;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    color: var(--muted);
    pointer-events: none;
}

.hero-hud-left {
    left: clamp(20px, 4vw, 32px);
}

.hero-hud-right {
    right: clamp(20px, 4vw, 32px);
    text-align: right;
}

.hero-hud span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-hud-right span {
    justify-content: flex-end;
}

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

.hero-hud b {
    min-width: 8ch;
    font-weight: 400;
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1120px) {
    .hero-hud {
        display: none;
    }
}

.hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
    align-items: center;
    gap: clamp(32px, 5vw, 72px);
    width: 100%;
}

.hero-copy {
    max-width: 620px;
}

.hero-title {
    margin: 18px 0 22px;
    font-family: var(--font-display);
    font-size: clamp(2.9rem, 6.4vw, 5.1rem);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.hero-title > span {
    display: block;
}

.hero-role {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 1.9em;
    margin-bottom: 22px;
    font-family: var(--font-mono);
    font-size: clamp(0.86rem, 1.5vw, 1rem);
    color: var(--accent);
}

.mono-prompt {
    opacity: 0.7;
}

#typed-text {
    min-width: 1ch;
    white-space: pre;
}

.caret {
    display: inline-block;
    width: 2px;
    height: 1.05em;
    margin-left: 2px;
    background: var(--accent);
    animation: blink 1s step-end infinite;
}

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

.hero-desc {
    max-width: 47ch;
    margin-bottom: 34px;
    color: var(--text-soft);
    font-size: clamp(0.98rem, 1.4vw, 1.06rem);
    font-weight: 300;
    line-height: 1.75;
    text-wrap: pretty;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 36px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 26px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.93rem;
    font-weight: 600;
    letter-spacing: 0.005em;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.28s var(--ease-out), box-shadow 0.28s ease, background-color 0.28s ease,
        color 0.28s ease, border-color 0.28s ease;
}

.btn svg {
    width: 17px;
    height: 17px;
    transition: transform 0.28s var(--ease-out);
}

.btn:hover svg {
    transform: translateX(3px);
}

.btn-primary {
    background: linear-gradient(135deg, #ffdbe1, var(--accent) 45%, var(--accent-strong));
    color: var(--accent-ink);
    box-shadow: 0 14px 34px -16px rgba(255, 192, 203, 0.85);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 44px -16px rgba(255, 192, 203, 0.95);
}

.btn-ghost {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.025);
    color: var(--text);
}

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

.social-list {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-list a {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    transition: transform 0.28s var(--ease-out), border-color 0.28s ease, background-color 0.28s ease,
        box-shadow 0.28s ease;
}

.social-list img {
    width: 20px;
    height: 20px;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.social-list a:hover {
    transform: translateY(-3px);
    border-color: var(--border-accent);
    background: var(--accent-soft);
    box-shadow: 0 12px 26px -18px rgba(255, 192, 203, 0.9);
}

.social-list a:hover img {
    opacity: 1;
}

/* Hero visual */
.hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 460px;
    min-height: 420px;
    margin-inline: auto;
}

.avatar-frame {
    --rx: 0deg;
    --ry: 0deg;
    --gx: 50%;
    --gy: 40%;
    --lift: 0px;
    position: relative;
    width: min(360px, 78%);
    aspect-ratio: 1;
    padding: 10px;
    border-radius: var(--radius-lg);
    background: linear-gradient(150deg, rgba(255, 192, 203, 0.55), rgba(255, 192, 203, 0.06) 42%,
            rgba(255, 255, 255, 0.05));
    box-shadow: 0 40px 90px -40px rgba(255, 192, 203, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) rotate(-2deg) translateY(var(--lift));
    transform-style: preserve-3d;
    transition: transform 0.55s var(--ease-out), box-shadow 0.4s ease;
    will-change: transform;
}

.hero-visual.is-tilting .avatar-frame {
    transition-duration: 0.12s;
}

.avatar-frame::before {
    content: "";
    position: absolute;
    inset: -34px;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 45%, rgba(255, 192, 203, 0.3), transparent 66%);
    filter: blur(28px);
}

.avatar-frame::after {
    content: "";
    position: absolute;
    inset: 10px;
    z-index: 2;
    border-radius: calc(var(--radius-lg) - 9px);
    background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, 0.22), transparent 48%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.hero-visual.is-tilting .avatar-frame::after {
    opacity: 1;
}

.avatar-frame:hover {
    --lift: -4px;
    box-shadow: 0 48px 100px -42px rgba(255, 192, 203, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.avatar {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-lg) - 9px);
    filter: grayscale(1) contrast(1.05);
    transition: filter 0.6s ease;
}

.avatar-frame:hover .avatar {
    filter: grayscale(0.15) contrast(1.02) sepia(0.12);
}

.float-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(17, 17, 22, 0.9);
    box-shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    color: var(--text-soft);
    white-space: nowrap;
    animation: float 7s ease-in-out infinite;
}

.chip-1 { top: 6%; left: 0; }
.chip-2 { right: -2%; bottom: 20%; animation-delay: -2.4s; }
.chip-3 { left: 6%; bottom: -2%; animation-delay: -4.6s; }

.chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(255, 192, 203, 0.9);
}

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

.scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 3;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    transform: translateX(-50%);
    transition: color 0.25s ease;
}

.scroll-hint:hover {
    color: var(--accent);
}

.scroll-hint-line {
    width: 1px;
    height: 38px;
    background: linear-gradient(180deg, transparent, var(--accent));
    animation: scroll-line 2s ease-in-out infinite;
}

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

/* ==========================================================================
   5. MARQUEE
   ========================================================================== */

.marquee-band {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.012);
}

.marquee {
    position: relative;
    padding: 18px 0;
    background: transparent;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee + .marquee {
    padding-top: 0;
    border-top: 1px solid var(--border);
}

.marquee + .marquee .marquee-track {
    padding-top: 18px;
}

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

.marquee-alt .marquee-track {
    animation-direction: reverse;
    animation-duration: 60s;
}

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

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

.marquee-group span {
    display: inline-flex;
    align-items: center;
    gap: 40px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.marquee-group span::after {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.55;
}

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

/* ==========================================================================
   6. ABOUT / TIMELINE
   ========================================================================== */

#aboutme {
    scroll-margin-top: calc(var(--header-h) + 8px);
}

#aboutme::before {
    content: "";
    position: absolute;
    top: 12%;
    left: 50%;
    width: 60vw;
    height: 60vw;
    max-width: 900px;
    max-height: 900px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 192, 203, 0.07), transparent 65%);
    filter: blur(70px);
    transform: translateX(-50%);
    pointer-events: none;
}

#aboutme .container {
    position: relative;
}

.subhead {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: clamp(40px, 6vw, 60px);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--muted);
}

.subhead::before,
.subhead::after {
    content: "";
    width: clamp(24px, 8vw, 72px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong));
}

.subhead::after {
    background: linear-gradient(90deg, var(--border-strong), transparent);
}

/* Numeri del percorso */
.stat-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    max-width: 720px;
    margin: 0 auto clamp(40px, 6vw, 60px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--border);
    overflow: hidden;
}

.stat-row li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 22px 14px;
    background: var(--bg);
    text-align: center;
}

.stat-row b {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.stat-row li > span {
    max-width: 18ch;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

.timeline {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 50%;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(255, 192, 203, 0.55) 10%,
            rgba(255, 192, 203, 0.55) 90%, transparent);
    box-shadow: 0 0 20px rgba(255, 192, 203, 0.2);
    transform: translateX(-50%);
}

.timeline-progress {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 50%;
    z-index: 1;
    width: 2px;
    background: rgba(255, 192, 203, 0.06);
    transform: translateX(-50%);
    pointer-events: none;
}

.timeline-progress i {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    box-shadow: 0 0 16px rgba(255, 192, 203, 0.6);
    transform: scaleY(0);
    transform-origin: top center;
    transition: transform 0.15s linear;
}

.entry {
    position: relative;
    width: 50%;
    padding: 0 60px 44px 0;
}

.entry.right {
    margin-left: 50%;
    padding: 0 0 44px 60px;
}

.entry:last-child {
    padding-bottom: 0;
}

.js .entry {
    opacity: 0;
    transform: translateX(-42px);
    transition: opacity 0.75s ease, transform 0.75s var(--ease-out);
}

.js .entry.right {
    transform: translateX(42px);
}

.js .entry.animate {
    opacity: 1;
    transform: translateX(0);
}

.timeline-node {
    position: absolute;
    top: 26px;
    right: -21px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-accent);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 0 0 6px rgba(255, 192, 203, 0.04), 0 0 26px rgba(255, 192, 203, 0.14);
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.entry.right .timeline-node {
    right: auto;
    left: -21px;
}

.timeline-node img {
    width: 18px;
    height: 18px;
}

.entry:hover .timeline-node {
    border-color: rgba(255, 192, 203, 0.7);
    box-shadow: 0 0 0 7px rgba(255, 192, 203, 0.06), 0 0 32px rgba(255, 192, 203, 0.3);
}

.entry-content {
    position: relative;
    padding: 24px 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.35s var(--ease-out), border-color 0.35s ease, box-shadow 0.35s ease;
}

.entry-content::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 100% at 100% 0%, rgba(255, 192, 203, 0.1), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.entry-content:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 192, 203, 0.28);
    box-shadow: var(--shadow-card), 0 0 0 1px rgba(255, 192, 203, 0.06);
}

.entry-content:hover::before {
    opacity: 1;
}

.entry-year {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.entry h3 {
    margin: 10px 0 14px;
    font-family: var(--font-display);
    font-size: 1.16rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

.entry ul {
    display: grid;
    gap: 8px;
}

.entry li {
    position: relative;
    padding-left: 18px;
    color: var(--text-soft);
    font-size: 0.93rem;
    line-height: 1.6;
}

.entry li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.64em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.65;
}

.entry li .muted {
    font-size: 0.88em;
}

/* ==========================================================================
   6b. WEB
   ========================================================================== */

#web,
#cnc {
    scroll-margin-top: calc(var(--header-h) + 8px);
}

.section-web {
    position: relative;
}

.section-web::before {
    content: "";
    position: absolute;
    top: 28%;
    left: 50%;
    width: 52vw;
    height: 52vw;
    max-width: 760px;
    max-height: 760px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 192, 203, 0.07), transparent 68%);
    filter: blur(70px);
    transform: translateX(-50%);
    pointer-events: none;
}

.section-web .container,
.section-cnc .container {
    position: relative;
}

.web-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    max-width: 1040px;
    margin: 0 auto;
}

/* ---------- shared panels ---------- */
.bento-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
    box-shadow: var(--shadow-card);
    transition: transform 0.35s var(--ease-out), border-color 0.35s ease, box-shadow 0.35s ease;
}

.bento-card::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -35%;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 192, 203, 0.13), transparent 65%);
    filter: blur(24px);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.bento-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 192, 203, 0.3);
    box-shadow: var(--shadow-card), 0 0 0 1px rgba(255, 192, 203, 0.06);
}

.bento-card:hover::before {
    opacity: 1;
}

.bento-card h3 {
    margin-top: 4px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.bento-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.022);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--muted);
}

.bento-dots {
    display: flex;
    gap: 5px;
}

.bento-dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
}

.bento-dots i:first-child {
    background: rgba(255, 192, 203, 0.7);
}

.bento-file {
    color: var(--text-soft);
    letter-spacing: 0.06em;
}

.bento-lang {
    margin-left: auto;
    padding: 3px 8px;
    border: 1px solid var(--border-accent);
    border-radius: 999px;
    color: var(--accent);
    font-size: 0.58rem;
    letter-spacing: 0.14em;
}

.code-typer {
    flex: 1;
    margin: 0;
    padding: 22px 20px 26px;
    font-family: var(--font-mono);
    font-size: clamp(0.65rem, 1vw, 0.78rem);
    line-height: 1.85;
    color: #d9d9e3;
    white-space: pre-wrap;
    overflow: hidden;
    tab-size: 2;
}

.code-typer::after {
    content: "";
    display: inline-block;
    width: 0.55ch;
    height: 1.02em;
    margin-left: 2px;
    vertical-align: -0.16em;
    background: var(--accent);
    animation: blink 1s step-end infinite;
}

/* ---------- browser preview ---------- */
.web-browser {
    grid-column: span 7;
    display: flex;
    flex-direction: column;
    min-height: 440px;
    padding: 0;
}

.browser-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.022);
    font-family: var(--font-mono);
    font-size: 0.64rem;
    color: var(--muted);
}

.browser-url {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-soft);
    letter-spacing: 0.04em;
}

.view-switch {
    display: flex;
    gap: 2px;
    margin-left: auto;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
}

.view-btn {
    padding: 4px 9px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.view-btn.is-active {
    background: var(--accent);
    color: var(--accent-ink);
}

.browser-stage {
    position: relative;
    flex: 1;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 192, 203, 0.08), transparent 60%),
        #0b0b0f;
}

.mini-site {
    --mini-accent: var(--accent);
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 560px;
    height: 310px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: linear-gradient(160deg, #101016, #0a0a0d);
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    transition: max-width 0.55s var(--ease-out), height 0.55s var(--ease-out), border-color 0.3s ease;
}

.mini-site::before {
    content: "";
    position: absolute;
    top: -90px;
    right: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 192, 203, 0.28), transparent 68%);
    filter: blur(18px);
    pointer-events: none;
}

.mini-site.is-mobile {
    max-width: 220px;
    height: 330px;
}

.mini-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000, transparent 80%);
    mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000, transparent 80%);
    pointer-events: none;
}

.mini-nav,
.mini-hero {
    position: relative;
    z-index: 1;
}

.mini-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mini-logo {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.06em;
    color: var(--mini-accent);
    transition: color 0.3s ease;
}

.mini-links {
    font-family: var(--font-mono);
    font-size: 0.48rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.mini-hero {
    margin-top: 32px;
}

.mini-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.48rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--mini-accent);
    transition: color 0.3s ease;
}

.mini-hero h3 {
    margin: 8px 0 6px;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.6vw, 2.8rem);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: -0.05em;
    background: linear-gradient(110deg, #ffffff, #ffe3e8 40%, var(--mini-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.mini-copy {
    max-width: 28ch;
    color: var(--text-soft);
    font-size: 0.6rem;
    line-height: 1.5;
}

.mini-actions {
    display: flex;
    gap: 6px;
    margin-top: 14px;
}

.mini-btn {
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--mini-accent);
    color: #1b0f13;
    font-size: 0.5rem;
    font-weight: 700;
    line-height: 1.2;
    transition: background-color 0.3s ease;
}

.mini-btn.is-ghost {
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text);
}

.mini-site.is-mobile .mini-links {
    display: none;
}

.mini-site.is-mobile .mini-hero {
    margin-top: 28px;
}

.mini-site.is-mobile .mini-hero h3 {
    font-size: 1.9rem;
}

.mini-site.is-mobile .mini-actions {
    flex-direction: column;
    align-items: flex-start;
}

.mini-site.is-mobile .mini-copy {
    font-size: 0.55rem;
}

.browser-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.accent-swatches {
    display: flex;
    gap: 6px;
}

.swatch {
    width: 16px;
    height: 16px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: var(--sw);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.swatch:hover {
    transform: scale(1.15);
}

.swatch.is-active {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), 0 0 12px var(--sw);
}

.browser-hint {
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- code window ---------- */
.web-code {
    grid-column: span 5;
    display: flex;
    flex-direction: column;
    min-height: 440px;
    padding: 0;
}

.web-code .code-typer {
    flex: 1;
}

/* ---------- web feature cards ---------- */
.web-card {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    min-height: 170px;
}

.web-card-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 192, 203, 0.18);
    border-radius: 12px;
    background: rgba(255, 192, 203, 0.06);
    color: var(--accent);
}

.web-card-icon svg {
    width: 21px;
    height: 21px;
}

.web-card h3 {
    font-size: 1.1rem;
}

.web-card p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.65;
}

/* ==========================================================================
   6c. CNC
   ========================================================================== */

.section-cnc {
    position: relative;
    padding-top: clamp(40px, 6vw, 72px);
}

.section-cnc::before {
    content: "";
    position: absolute;
    top: 20%;
    left: 50%;
    width: 46vw;
    height: 46vw;
    max-width: 680px;
    max-height: 680px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 192, 203, 0.06), transparent 68%);
    filter: blur(70px);
    transform: translateX(-50%);
    pointer-events: none;
}

.cnc-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    max-width: 1040px;
    margin: 0 auto;
}

.cnc-role {
    grid-column: span 6;
    display: flex;
    flex-direction: column;
    min-height: 230px;
    overflow: hidden;
}

.cnc-role-num {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    color: var(--muted);
}

.cnc-role-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 18px 0 14px;
    border: 1px solid rgba(255, 192, 203, 0.2);
    border-radius: 14px;
    background: rgba(255, 192, 203, 0.06);
    color: var(--accent);
}

.cnc-role-icon svg {
    width: 28px;
    height: 28px;
}

.cnc-role h3 {
    font-size: 1.45rem;
}

.cnc-role p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.cnc-terminal {
    grid-column: span 12;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.cnc-terminal-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
    gap: 22px;
    align-items: center;
    padding: 22px;
}

.gcode-typer {
    margin: 0;
    font-family: var(--font-mono);
    font-size: clamp(0.67rem, 1vw, 0.78rem);
    line-height: 1.85;
    color: #d9d9e3;
    white-space: pre-wrap;
}

.gcode-typer::after {
    content: "";
    display: inline-block;
    width: 0.55ch;
    height: 1.02em;
    margin-left: 2px;
    vertical-align: -0.16em;
    background: var(--accent);
    animation: blink 1s step-end infinite;
}

.toolpath {
    width: 100%;
    height: auto;
    max-height: 220px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0b0b0f;
}

/* ==========================================================================
   7. CONTACT
   ========================================================================== */

.section-contact {
    padding-bottom: clamp(96px, 12vw, 150px);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.35s var(--ease-out), border-color 0.35s ease, box-shadow 0.35s ease;
}

.contact-card::after {
    content: "";
    position: absolute;
    top: -40%;
    right: -30%;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 192, 203, 0.14), transparent 65%);
    filter: blur(30px);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.contact-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 192, 203, 0.32);
    box-shadow: var(--shadow-accent);
}

.contact-card:hover::after {
    opacity: 1;
}

.contact-card.reveal:nth-child(2) {
    transition-delay: 0.08s;
}

.contact-card.reveal:nth-child(3) {
    transition-delay: 0.16s;
}

.contact-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 192, 203, 0.2);
    border-radius: 14px;
    background: rgba(255, 192, 203, 0.08);
    color: var(--accent);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.contact-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.contact-card:hover .contact-icon {
    background: rgba(255, 192, 203, 0.14);
    border-color: rgba(255, 192, 203, 0.4);
}

.contact-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.contact-value {
    margin-top: 6px;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.45;
    word-break: break-word;
}

.contact-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 22px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
}

.contact-cta svg {
    width: 15px;
    height: 15px;
    transition: transform 0.28s var(--ease-out);
}

.contact-card:hover .contact-cta svg {
    transform: translateX(3px);
}

.contact-card-cv {
    border-color: rgba(255, 192, 203, 0.26);
    background: linear-gradient(155deg, rgba(255, 192, 203, 0.14), rgba(255, 192, 203, 0.03) 55%,
            rgba(255, 255, 255, 0.015));
}

/* ==========================================================================
   8. FOOTER
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--border);
    background: #08080a;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-block: 30px;
}

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

.footer-top {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.25s ease;
}

.footer-top svg {
    width: 15px;
    height: 15px;
    transition: transform 0.28s var(--ease-out);
}

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

.footer-top:hover svg {
    transform: translateY(-3px);
}

/* ==========================================================================
   9. RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .hero-inner {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
        gap: 32px;
    }

    .avatar-frame {
        width: min(320px, 82%);
    }

    .contact-card {
        padding: 24px;
    }
}

@media (max-width: 860px) {
    :root {
        --header-h: 64px;
    }

    /* Navigation -> drawer */
    .nav {
        justify-content: space-between;
    }

    .nav-toggle {
        display: block;
    }

    .menu-items {
        position: fixed;
        top: var(--header-h);
        right: 0;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        width: min(84vw, 340px);
        height: calc(100dvh - var(--header-h));
        padding: 26px 20px 32px;
        border-left: 1px solid var(--border);
        background: #0d0d11;
        box-shadow: -30px 0 60px -30px rgba(0, 0, 0, 0.9);
        overflow-y: auto;
        transform: translateX(105%);
        visibility: hidden;
        transition: transform 0.38s var(--ease-out), visibility 0.38s;
    }

    body.menu-open .menu-items {
        transform: translateX(0);
        visibility: visible;
    }

    .menu-items li {
        width: 100%;
    }

    .menu-items a.menu-link {
        padding: 14px 16px;
        border-radius: 12px;
        font-size: 1.05rem;
        color: var(--text-soft);
    }

    .menu-items a.menu-link.is-active {
        background: rgba(255, 192, 203, 0.08);
    }

    .menu-items a.menu-link.is-active::after {
        display: none;
    }

    .nav-cta-wrap {
        margin: 14px 0 0;
    }

    .menu-items .nav-cta {
        width: 100%;
        justify-content: center;
        padding: 13px 18px;
        font-size: 0.92rem;
    }

    body.menu-open {
        overflow: hidden;
    }

    /* Hero */
    .hero {
        padding-top: calc(var(--header-h) + 56px);
        padding-bottom: 90px;
        min-height: auto;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 56px;
    }

    .hero-copy {
        max-width: 620px;
    }

    .hero-visual {
        order: 2;
        min-height: 0;
        padding: 10px 0;
    }

    .avatar-frame {
        width: min(300px, 72vw);
    }

    .scroll-hint {
        display: none;
    }

    /* Timeline */
    .timeline::before {
        left: 18px;
        transform: none;
    }

    .entry,
    .entry.right,
    .entry:last-child {
        width: 100%;
        margin-left: 0;
        padding: 0 0 32px 58px;
    }

    .entry:last-child {
        padding-bottom: 0;
    }

    .js .entry,
    .js .entry.right {
        transform: translateX(32px);
    }

    .js .entry.animate {
        transform: translateX(0);
    }

    .timeline-node,
    .entry.right .timeline-node {
        top: 22px;
        left: -3px;
        right: auto;
    }

    .timeline-progress {
        left: 18px;
        transform: none;
    }

    /* Web */
    .web-browser,
    .web-code {
        grid-column: span 12;
    }

    .web-browser {
        min-height: 0;
    }

    .web-code {
        min-height: 380px;
    }

    .web-card {
        grid-column: span 6;
    }

    .web-card:last-child {
        grid-column: span 12;
    }

    /* CNC */
    .cnc-terminal-body {
        grid-template-columns: 1fr;
    }

    .toolpath {
        max-height: 200px;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
    }

    .contact-card {
        padding: 26px;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: clamp(2.6rem, 12vw, 3.4rem);
    }

    .hero-actions {
        width: 100%;
    }

    .btn {
        flex: 1 1 auto;
        padding: 14px 20px;
    }

    .float-chip {
        font-size: 0.64rem;
        padding: 9px 12px;
    }

    .chip-1 { top: 0; left: 0; }
    .chip-2 { right: 0; bottom: 16%; }
    .chip-3 { display: none; }

    .avatar-frame {
        width: min(270px, 78vw);
    }

    .section-head {
        margin-bottom: 44px;
    }

    .stat-row li {
        padding: 18px 8px;
    }

    .stat-row li > span {
        font-size: 0.66rem;
    }

    .web-grid,
    .cnc-grid {
        gap: 12px;
    }

    .web-card,
    .cnc-role {
        grid-column: span 12;
        min-height: 0;
        padding: 20px;
    }

    .browser-bar {
        flex-wrap: wrap;
    }

    .view-switch {
        margin-left: 0;
    }

    .browser-stage {
        padding: 14px;
    }

    .mini-site {
        height: 280px;
        padding: 14px;
    }

    .mini-site.is-mobile {
        max-width: 200px;
        height: 300px;
    }

    .browser-foot {
        flex-wrap: wrap;
    }

    .web-code {
        min-height: 340px;
    }

    .cnc-terminal-body {
        padding: 16px;
    }

    .gcode-typer {
        font-size: 0.62rem;
    }

    .code-typer {
        padding: 16px 16px 20px;
        font-size: 0.62rem;
    }

    .entry-content {
        padding: 20px 22px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 400px) {
    .brand-word {
        font-size: 1.65rem;
    }

    .browser-url {
        display: none;
    }

    .view-btn {
        padding: 4px 7px;
    }

    .mini-site {
        height: 260px;
    }

    .mini-site.is-mobile {
        height: 280px;
    }

    .mini-hero h3 {
        font-size: 2rem;
    }

    .timeline-node,
    .entry.right .timeline-node {
        width: 36px;
        height: 36px;
        left: 0;
    }

    .timeline::before {
        left: 18px;
    }

    .timeline-progress {
        left: 18px;
    }

    .entry,
    .entry.right {
        padding-left: 50px;
    }

    .code-typer {
        font-size: 0.56rem;
    }
}

/* ==========================================================================
   10. REDUCED MOTION & PRINT
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .js .reveal,
    .js .entry,
    .js .entry.right {
        opacity: 1;
        transform: none;
    }

    .marquee-track {
        animation: none;
    }
}

@media print {
    .site-header,
    .menu-overlay,
    .preloader,
    .cursor,
    .hero-bg,
    .hero-canvas,
    .hero-hud,
    .scroll-hint,
    .marquee-band,
    .social-list,
    .float-chip,
    .scroll-progress,
    .skip-link {
        display: none !important;
    }

    body {
        background: #fff;
        color: #111;
    }

    .js .entry,
    .js .reveal {
        opacity: 1;
        transform: none;
    }

    .entry-content,
    .contact-card {
        border-color: #ddd;
        background: #fff;
        box-shadow: none;
    }
}
