/* =============================================
   MATTIA MESSANA ��� Portfolio
   Light premium / Viola · Verde · Oro
   Fonts: Syne (display) + Outfit (body)
   ============================================= */

:root {
    /* === PALETTE — Warm Light with Purple & Green === */
    --bg: #faf8f5;
    --bg-alt: #f3f0ec;
    --bg-pure: #ffffff;
    --text: #1a1628;
    --text-secondary: #5c5470;
    --text-tertiary: #8a8498;
    --text-on-accent: #ffffff;

    --line: rgba(124, 58, 237, 0.10);
    --line-light: rgba(124, 58, 237, 0.06);
    --line-neutral: #e6e2dc;

    /* Accents */
    --purple: #7c3aed;
    --purple-deep: #6d28d9;
    --purple-light: #8b5cf6;
    --purple-soft: rgba(124, 58, 237, 0.08);
    --purple-wash: rgba(124, 58, 237, 0.04);
    --green: #059669;
    --green-deep: #047857;
    --green-light: #10b981;
    --green-soft: rgba(5, 150, 105, 0.07);
    --gold: #ca8a04;
    --gold-light: #eab308;
    --gold-soft: rgba(202, 138, 4, 0.08);

    --accent: var(--purple);
    --accent-hover: var(--purple-deep);
    --accent-ink: var(--purple);

    /* Shadows — warm toned */
    --shadow-xs: 0 1px 3px rgba(26, 22, 40, 0.04);
    --shadow-sm: 0 2px 8px rgba(26, 22, 40, 0.05), 0 1px 2px rgba(26, 22, 40, 0.03);
    --shadow: 0 4px 24px rgba(26, 22, 40, 0.07), 0 1px 4px rgba(26, 22, 40, 0.04);
    --shadow-lg: 0 16px 48px rgba(26, 22, 40, 0.10), 0 4px 12px rgba(26, 22, 40, 0.05);
    --shadow-xl: 0 24px 64px rgba(26, 22, 40, 0.12), 0 8px 20px rgba(26, 22, 40, 0.06);
    --shadow-card: 0 1px 4px rgba(26, 22, 40, 0.04), 0 4px 16px rgba(26, 22, 40, 0.03);
    --glow-purple: 0 8px 40px rgba(124, 58, 237, 0.12);
    --glow-green: 0 8px 40px rgba(5, 150, 105, 0.10);
    --glow-gold: 0 8px 40px rgba(202, 138, 4, 0.10);

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

    /* Fonts */
    --font-display: 'Syne', sans-serif;
    --font-body: 'Outfit', sans-serif;

    /* Type scale */
    --fs-display: clamp(46px, 7.5vw, 84px);
    --fs-headline: clamp(30px, 5vw, 54px);
    --fs-title: clamp(22px, 3vw, 30px);
    --fs-body-lg: clamp(17px, 1.4vw, 20px);
    --fs-body: clamp(15px, 1.1vw, 17px);
    --fs-caption: clamp(12px, 0.9vw, 14px);

    --lh-display: 1.06;
    --lh-headline: 1.12;
    --lh-body: 1.65;

    --ls-tight: -0.03em;
    --ls-normal: -0.015em;
    --ls-wide: 0.08em;

    /* Spacing — 8pt grid */
    --space-1: 4px;  --space-2: 8px;  --space-3: 16px;
    --space-4: 24px; --space-5: 32px; --space-6: 48px;
    --space-7: 64px; --space-8: 80px; --space-9: 120px;

    --section-pad: clamp(80px, 12vw, 160px);
    --container-max: 980px;
    --container-wide: 1120px;
    --container-pad: clamp(20px, 5vw, 32px);

    /* Easing */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 0.2s;
    --duration: 0.35s;
    --duration-slow: 0.8s;
    --duration-reveal: 1s;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; scroll-snap-type: y proximity; }

::selection {
    background: rgba(124, 58, 237, 0.15);
    color: var(--text);
}

a {
    color: var(--accent-ink);
    transition: color var(--duration-fast) var(--ease-smooth);
}
a:hover { color: var(--accent-hover); }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--fs-body);
    color: var(--text);
    background: var(--bg);
    line-height: var(--lh-body);
    letter-spacing: var(--ls-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Grain texture — very subtle on light */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10000;
    opacity: 0.018;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
    background-size: 200px;
}

/* === CONTAINER === */
.container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

@supports (padding: max(0px)) {
    .container, .site-header {
        padding-inline: max(var(--container-pad), env(safe-area-inset-left));
    }
}

/* === SKIP LINK === */
.skip-link { position: absolute; left: -9999px; top: auto; }
.skip-link:focus {
    left: 16px; top: 16px;
    background: var(--purple);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    z-index: 1000;
}

/* ========================================
   HEADER / NAV
   ======================================== */
.site-header {
    position: sticky;
    top: 0;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    background: rgba(250, 248, 245, 0.82);
    border-bottom: 1px solid var(--line-neutral);
    z-index: 50;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding-block: 14px;
    max-width: var(--container-wide);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-body);
    letter-spacing: var(--ls-normal);
    transition: opacity var(--duration) var(--ease-smooth);
}
.brand:hover { opacity: 0.65; color: var(--text); }

.logo-bg { fill: var(--purple-soft); }
.logo-stroke {
    stroke: var(--purple);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-toggle {
    margin-left: auto;
    display: none;
    border: 1px solid var(--line-neutral);
    background: var(--bg-pure);
    border-radius: var(--radius-sm);
    padding: 8px;
    color: var(--text);
    cursor: pointer;
    transition: background var(--duration) var(--ease-smooth),
                border-color var(--duration) var(--ease-smooth),
                color var(--duration) var(--ease-smooth);
    line-height: 0;
}
.nav-toggle:hover {
    background: var(--purple-soft);
    border-color: rgba(124, 58, 237, 0.2);
    color: var(--purple);
}

/* Icone nei link del menu */
.menu a svg {
    display: none;
}

.menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
}

.menu a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-caption);
    font-weight: 400;
    transition: color var(--duration) var(--ease-smooth),
                background var(--duration) var(--ease-smooth);
}
.menu a:hover {
    color: var(--purple);
    background: var(--purple-soft);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    background: var(--purple);
    color: var(--text-on-accent);
    padding: 13px 28px;
    border-radius: 980px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-body);
    text-decoration: none;
    letter-spacing: 0;
    line-height: 1.2;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform var(--duration-fast) var(--ease-spring),
                box-shadow var(--duration) var(--ease-smooth),
                background var(--duration-fast) var(--ease-smooth);
}
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.2), transparent 50%);
    opacity: 0;
    transition: opacity var(--duration) var(--ease-smooth);
}
.btn:hover {
    background: var(--purple-deep);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--glow-purple);
}
.btn:hover::before { opacity: 1; }
.btn:active { transform: translateY(0) scale(0.98); }

.btn.ghost {
    background: transparent;
    color: var(--purple);
    border: 1.5px solid rgba(124, 58, 237, 0.3);
    box-shadow: none;
}
.btn.ghost::before { display: none; }
.btn.ghost:hover {
    background: var(--purple);
    color: var(--text-on-accent);
    border-color: var(--purple);
    box-shadow: var(--glow-purple);
}

/* ========================================
   MOBILE NAV
   ======================================== */
@media (max-width: 860px) {
    .site-header { position: relative; }

    .nav { flex-wrap: wrap; }

    .nav-toggle { display: flex; align-items: center; justify-content: center; }

    .menu {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        width: 100%;
        order: 3;
        background: var(--bg-pure);
        border: 1px solid var(--line-neutral);
        border-radius: var(--radius);
        padding: var(--space-2);
        margin-top: var(--space-2);
        flex-direction: column;
        align-items: stretch;
        display: none;
        box-shadow: var(--shadow);
    }
    .menu.open { display: flex; }

    .menu a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 13px 16px;
        border-radius: var(--radius-sm);
        font-size: var(--fs-body);
    }
    .menu a svg {
        display: block;
        flex-shrink: 0;
        opacity: 0.45;
        transition: opacity var(--duration-fast) var(--ease-smooth);
    }
    .menu a:hover svg { opacity: 1; }
    .menu a:hover { background: var(--purple-soft); }

    /* CV button nel menu mobile */
    .menu .btn.ghost {
        margin-top: var(--space-1);
        justify-content: center;
    }
}

/* ========================================
   HERO
   ======================================== */
.hero {
    background: var(--bg);
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    position: relative;
    scroll-snap-align: start;
}

/* Soft watercolor orbs */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    will-change: transform;
    mix-blend-mode: multiply;
}
.hero-orb--purple {
    width: clamp(350px, 55vw, 700px);
    height: clamp(350px, 55vw, 700px);
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
    top: -18%;
    right: -12%;
    animation: orbFloat1 14s ease-in-out infinite;
}
.hero-orb--green {
    width: clamp(280px, 42vw, 550px);
    height: clamp(280px, 42vw, 550px);
    background: radial-gradient(circle, rgba(5, 150, 105, 0.10) 0%, transparent 70%);
    bottom: -12%;
    left: -10%;
    animation: orbFloat2 17s ease-in-out infinite;
}
.hero-orb--yellow {
    width: clamp(160px, 22vw, 300px);
    height: clamp(160px, 22vw, 300px);
    background: radial-gradient(circle, rgba(202, 138, 4, 0.07) 0%, transparent 70%);
    top: 45%;
    left: 55%;
    animation: orbFloat3 11s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-25px, 18px) scale(1.04); }
    66% { transform: translate(12px, -12px) scale(0.97); }
}
@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -16px) scale(1.03); }
    66% { transform: translate(-18px, 8px) scale(0.98); }
}
@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-12px, 20px) scale(1.06); }
}

.hero-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-block: var(--space-6);
    max-width: 900px;
    margin-inline: auto;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Staggered hero entrance */
.hero-copy > * {
    opacity: 0;
    transform: translateY(36px);
    filter: blur(6px);
    animation: heroReveal 1s var(--ease-out) forwards;
}
.hero-copy > *:nth-child(1) { animation-delay: 0.15s; }
.hero-copy > *:nth-child(2) { animation-delay: 0.35s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.55s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.7s; }
.hero-copy > *:nth-child(5) { animation-delay: 0.85s; }

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.hero-copy h1 {
    font-family: var(--font-display);
    font-size: var(--fs-display);
    line-height: var(--lh-display);
    letter-spacing: var(--ls-tight);
    font-weight: 800;
    margin: 0 0 var(--space-4);
    color: var(--text);
}

/* Animated gradient keyword */
.hero-copy h1 em {
    font-style: normal;
    background: linear-gradient(
        135deg,
        var(--purple),
        var(--green),
        var(--purple-light),
        var(--green-light)
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-copy .sub {
    color: var(--text-secondary);
    max-width: 580px;
    margin-inline: auto;
    font-size: var(--fs-body-lg);
    line-height: var(--lh-body);
}

.eyebrow {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--purple);
    letter-spacing: var(--ls-wide);
    font-size: var(--fs-caption);
    text-transform: uppercase;
    margin-bottom: var(--space-3);
}

.cta {
    display: flex;
    gap: 16px;
    margin-top: var(--space-6);
    flex-wrap: wrap;
    justify-content: center;
}

/* ========================================
   SECTIONS
   ======================================== */
.hero + .section { border-top: none; }

.section {
    padding-block: var(--section-pad);
    scroll-margin-top: 60px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    scroll-snap-align: start;
    position: relative;
}
.section > .container { width: 100%; }

.section:nth-of-type(odd) { background: var(--bg); }
.section:nth-of-type(even) { background: var(--bg-alt); }

/* Gradient separator — line that draws on scroll */
.section + .section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: min(420px, 70vw);
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--purple) 25%, var(--green) 75%, transparent);
    opacity: 0.55;
    border-radius: 2px;
    transform: translateX(-50%) scaleX(0);
    transition: transform 1.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.8s var(--ease-smooth);
}

/* Center glow dot */
.section + .section::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--purple);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.4), 0 0 24px rgba(124, 58, 237, 0.15);
    transform: translateX(-50%) scale(0);
    transition: transform 0.6s var(--ease-spring);
    transition-delay: 0s;
    z-index: 1;
}

/* Animate in when section scrolls into view */
.section + .section.divider-in::before {
    transform: translateX(-50%) scaleX(1);
}
.section + .section.divider-in::after {
    transform: translateX(-50%) scale(1);
    transition-delay: 0.7s;
}

.section h2 {
    font-family: var(--font-display);
    font-size: var(--fs-headline);
    font-weight: 700;
    letter-spacing: var(--ls-tight);
    line-height: var(--lh-headline);
    margin: 0 0 var(--space-3);
    text-align: center;
    color: var(--text);
}

.lead {
    color: var(--text-secondary);
    font-size: var(--fs-body-lg);
    text-align: center;
    max-width: 580px;
    margin-inline: auto;
    margin-bottom: var(--space-7);
}

/* ========================================
   CARDS (base)
   ======================================== */
.card {
    background: var(--bg-pure);
    border: 1px solid var(--line-neutral);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: var(--space-5);
    transition: box-shadow var(--duration) var(--ease-smooth),
                transform var(--duration) var(--ease-out),
                border-color var(--duration) var(--ease-smooth);
}
.card:hover {
    box-shadow: var(--shadow-lg), var(--glow-purple);
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, 0.15);
}

/* ========================================
   ABOUT — editorial numbered blocks
   ======================================== */
.about-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.about-block {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: var(--space-6);
    padding: var(--space-6) var(--space-4);
    border-bottom: 1px solid var(--line-neutral);
    border-radius: var(--radius);
    margin-inline: calc(-1 * var(--space-4));
    align-items: start;
    transition: background var(--duration) var(--ease-smooth);
}
.about-block:last-child { border-bottom: none; }
.about-block:first-child { padding-top: var(--space-4); }

.about-block:nth-child(1):hover { background: rgba(124, 58, 237, 0.025); }
.about-block:nth-child(2):hover { background: rgba(5, 150, 105, 0.025); }
.about-block:nth-child(3):hover { background: rgba(202, 138, 4, 0.02); }

.about-label {}

.about-num {
    font-family: var(--font-display);
    font-size: clamp(52px, 6vw, 72px);
    font-weight: 800;
    line-height: 1;
    display: block;
    letter-spacing: -0.04em;
    transition: transform var(--duration) var(--ease-spring);
}
.about-block:hover .about-num { transform: scale(1.06); }

.about-block:nth-child(1) .about-num { color: rgba(124, 58, 237, 0.12); }
.about-block:nth-child(2) .about-num { color: rgba(5, 150, 105, 0.10); }
.about-block:nth-child(3) .about-num { color: rgba(202, 138, 4, 0.10); }

.about-label h3 {
    font-family: var(--font-display);
    font-size: var(--fs-body-lg);
    font-weight: 700;
    margin: var(--space-2) 0 0;
    letter-spacing: var(--ls-normal);
}
.about-block:nth-child(1) h3 { color: var(--purple); }
.about-block:nth-child(2) h3 { color: var(--green); }
.about-block:nth-child(3) h3 { color: var(--gold); }

.about-body { padding-top: var(--space-1); }
.about-body p {
    color: var(--text-secondary);
    line-height: var(--lh-body);
    margin: 0 0 var(--space-3);
}
.about-body p:last-child { margin-bottom: 0; }

.checklist {
    padding-left: 20px;
    color: var(--text-secondary);
    line-height: 1.9;
    margin: 0;
}

@media (max-width: 860px) {
    .about-block {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    .about-label {
        display: flex;
        align-items: center;
        gap: var(--space-3);
    }
    .about-num { font-size: 40px; }
    .about-label h3 { margin-top: 0; }
}

/* ========================================
   TAGS
   ======================================== */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.tags li {
    padding: 6px 14px;
    background: var(--purple-soft);
    border: 1px solid rgba(124, 58, 237, 0.10);
    border-radius: 980px;
    font-size: var(--fs-caption);
    color: var(--purple);
    font-weight: 500;
    transition: background var(--duration-fast) var(--ease-smooth),
                color var(--duration-fast) var(--ease-smooth),
                border-color var(--duration-fast) var(--ease-smooth),
                transform var(--duration-fast) var(--ease-spring);
}
.tags li:hover {
    background: var(--purple);
    color: var(--text-on-accent);
    border-color: var(--purple);
    transform: translateY(-1px);
}

/* ========================================
   SKILLS — inline flowing groups
   ======================================== */
.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.skill-group {
    display: flex;
    align-items: baseline;
    gap: var(--space-4);
    flex-wrap: wrap;
    padding: var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--line-neutral);
    border-radius: var(--radius);
    margin-inline: calc(-1 * var(--space-4));
    transition: background var(--duration) var(--ease-smooth);
}
.skill-group:last-child { border-bottom: none; }
.skill-group:hover { background: rgba(5, 150, 105, 0.02); }

.skill-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-caption);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    min-width: 150px;
    margin: 0;
    flex-shrink: 0;
    padding-top: 2px;
}

.skill-group:nth-child(1) .skill-title { color: var(--purple); }
.skill-group:nth-child(2) .skill-title { color: var(--green); }
.skill-group:nth-child(3) .skill-title { color: var(--gold); }
.skill-group:nth-child(4) .skill-title { color: var(--purple); }

.skill-group .tags { flex: 1; }

/* Skill tags — green tinted */
.skill-group .tags li {
    background: var(--green-soft);
    border-color: rgba(5, 150, 105, 0.10);
    color: var(--green);
}
.skill-group .tags li:hover {
    background: var(--green);
    color: var(--text-on-accent);
    border-color: var(--green);
}

@media (max-width: 600px) {
    .skill-group {
        flex-direction: column;
        gap: var(--space-2);
    }
    .skill-title { min-width: unset; }
}

/* ========================================
   PROJECTS — stacked showcase
   ======================================== */
.cards {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.project-item {
    padding: var(--space-6) var(--space-4);
    border-bottom: 1px solid var(--line-neutral);
    border-radius: var(--radius);
    margin-inline: calc(-1 * var(--space-4));
    transition: background var(--duration) var(--ease-smooth);
}
.project-item:first-child { padding-top: var(--space-4); }
.project-item:last-child { border-bottom: none; }

.project-item:nth-child(odd):hover { background: rgba(124, 58, 237, 0.02); }
.project-item:nth-child(even):hover { background: rgba(5, 150, 105, 0.02); }

.project-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.project-num {
    font-family: var(--font-display);
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    flex-shrink: 0;
    transition: transform var(--duration) var(--ease-spring);
}
.project-item:hover .project-num { transform: scale(1.08); }

.project-item:nth-child(1) .project-num { color: rgba(124, 58, 237, 0.14); }
.project-item:nth-child(2) .project-num { color: rgba(5, 150, 105, 0.12); }
.project-item:nth-child(3) .project-num { color: rgba(202, 138, 4, 0.12); }
.project-item:nth-child(4) .project-num { color: rgba(124, 58, 237, 0.14); }
.project-item:nth-child(5) .project-num { color: rgba(5, 150, 105, 0.12); }

.project-header h3 {
    font-family: var(--font-display);
    font-size: var(--fs-title);
    font-weight: 700;
    letter-spacing: var(--ls-tight);
    margin: 0;
    color: var(--text);
}

.project-body {
    padding-left: calc(clamp(28px, 3.5vw, 40px) + var(--space-4));
}

.project-body p {
    color: var(--text-secondary);
    line-height: var(--lh-body);
    max-width: 620px;
    margin: 0 0 var(--space-3);
}

.project-body .tags { margin-bottom: var(--space-3); }

.project-body .cta {
    margin-top: var(--space-2);
    justify-content: flex-start;
}

.project-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--gold-soft);
    color: var(--gold);
    border-radius: 980px;
    font-size: var(--fs-caption);
    font-weight: 600;
    border: 1px solid rgba(202, 138, 4, 0.12);
}

.link {
    color: var(--accent-ink);
    text-decoration: none;
}
.link[aria-disabled="true"] {
    opacity: .5;
    pointer-events: none;
}

@media (max-width: 480px) {
    .project-body { padding-left: 0; }
}

/* ========================================
   CONTACT
   ======================================== */
.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: var(--space-5);
}
.contact-grid .card { transform: none; }
.contact-grid .card:hover { transform: none; }

.contact-grid .card h3 {
    font-family: var(--font-display);
    font-size: var(--fs-title);
    font-weight: 600;
    letter-spacing: var(--ls-normal);
    margin-top: 0;
    margin-bottom: var(--space-4);
    color: var(--text);
}

.form .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--space-3);
}
.form label {
    font-size: var(--fs-caption);
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0;
}

input[type="text"],
input[type="email"],
textarea {
    border: 1px solid var(--line-neutral);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font: inherit;
    font-size: var(--fs-body);
    background: var(--bg);
    color: var(--text);
    min-height: 48px;
    transition: border-color var(--duration) var(--ease-smooth),
                box-shadow var(--duration) var(--ease-smooth);
}
textarea {
    min-height: 130px;
    resize: vertical;
}
input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
}
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.10), 0 0 20px rgba(124, 58, 237, 0.05);
}

.field.inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}
.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--purple);
    border-radius: 4px;
    cursor: pointer;
}
.checkbox label {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: var(--fs-caption);
    cursor: pointer;
}
.checkbox label a {
    color: var(--purple);
    text-decoration: none;
}
.checkbox label a:hover { text-decoration: underline; }

.error {
    color: #dc2626;
    font-size: var(--fs-caption);
    min-height: 18px;
}
.form-note {
    color: var(--text-tertiary);
    font-size: var(--fs-caption);
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: var(--space-3);
}
.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: var(--fs-body);
    min-width: 140px;
    justify-content: center;
    border-radius: 980px;
    transition: transform var(--duration-fast) var(--ease-spring),
                background var(--duration-fast) var(--ease-smooth),
                box-shadow var(--duration) var(--ease-smooth);
}
.contact-link svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.contact-link.whatsapp-btn {
    background: var(--green);
    color: #fff;
    border: none;
}
.contact-link.whatsapp-btn:hover {
    background: var(--green-deep);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--glow-green);
}

@media (max-width: 860px) {
    .contact-grid { grid-template-columns: 1fr; }
    .contact-links {
        justify-content: center;
        flex-direction: column;
    }
    .contact-link {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    background: var(--text);
    color: var(--text-tertiary);
    padding-block: var(--space-6);
    border-top: none;
    text-align: center;
    font-size: var(--fs-caption);
    scroll-snap-align: end;
}
.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    margin-bottom: var(--space-3);
}
.footer-links a {
    color: rgba(250, 248, 245, 0.55);
    text-decoration: none;
    padding: 4px 12px;
    transition: color var(--duration-fast) var(--ease-smooth);
}
.footer-links a:hover { color: var(--purple-light); }

.footer-sep {
    color: rgba(255, 255, 255, 0.12);
    font-size: 10px;
    user-select: none;
}
.footer-copy {
    color: rgba(250, 248, 245, 0.35);
    margin: 0;
}

/* ========================================
   TOAST
   ======================================== */
.toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%) translateY(10px);
    color: #fff;
    padding: 12px 24px;
    border-radius: 980px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration) var(--ease-smooth),
                transform var(--duration) var(--ease-smooth),
                visibility var(--duration) var(--ease-smooth);
    z-index: 1000;
    visibility: hidden;
    font-size: var(--fs-caption);
    font-weight: 500;
}
.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.toast.error { background: rgba(220, 38, 38, 0.92); }
.toast.success { background: rgba(5, 150, 105, 0.92); }

/* ========================================
   PROSE PAGE (Privacy Policy, etc.)
   ======================================== */
.prose-page {
    padding-block: clamp(100px, 14vw, 160px) var(--section-pad);
}

.prose-page h1 {
    font-family: var(--font-display);
    font-size: var(--fs-headline);
    font-weight: 700;
    letter-spacing: var(--ls-tight);
    line-height: var(--lh-headline);
    margin: 0 0 var(--space-3);
    color: var(--text);
}

.prose-page .lead {
    text-align: left;
    margin-inline: 0;
    margin-bottom: var(--space-7);
}

.prose-page h2 {
    font-family: var(--font-display);
    font-size: var(--fs-title);
    font-weight: 700;
    letter-spacing: var(--ls-tight);
    color: var(--text);
    margin: var(--space-7) 0 var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--purple-soft);
}

.prose-page h3 {
    font-family: var(--font-display);
    font-size: var(--fs-body-lg);
    font-weight: 600;
    color: var(--purple);
    margin: var(--space-5) 0 var(--space-2);
}

.prose-page p {
    color: var(--text-secondary);
    line-height: var(--lh-body);
    margin: 0 0 var(--space-3);
    max-width: 720px;
}

.prose-page ul {
    color: var(--text-secondary);
    line-height: 1.85;
    padding-left: 24px;
    margin: 0 0 var(--space-4);
    max-width: 720px;
}

.prose-page ul li {
    margin-bottom: var(--space-2);
}

.prose-page ul li strong {
    color: var(--text);
    font-weight: 600;
}

.prose-page a {
    color: var(--purple);
    text-decoration: underline;
    text-decoration-color: rgba(124, 58, 237, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--duration-fast) var(--ease-smooth);
}
.prose-page a:hover {
    text-decoration-color: var(--purple);
}

.prose-date {
    margin-top: var(--space-7) !important;
    padding-top: var(--space-4);
    border-top: 1px solid var(--line-neutral);
    font-size: var(--fs-caption);
    color: var(--text-tertiary) !important;
    font-style: italic;
}

/* === UTILITIES === */
.hidden { display: none !important; }

/* ========================================
   SCROLL-TO-TOP
   ======================================== */
.scroll-to-top-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--bg-pure);
    color: var(--purple);
    border: 1px solid var(--line-neutral);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    box-shadow: var(--shadow-sm);
    transition: opacity var(--duration) var(--ease-smooth),
                visibility var(--duration) var(--ease-smooth),
                transform var(--duration-fast) var(--ease-spring),
                box-shadow var(--duration) var(--ease-smooth);
    z-index: 99;
}
.scroll-to-top-btn.show {
    opacity: 1;
    visibility: visible;
}
.scroll-to-top-btn:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow), var(--glow-purple);
    border-color: rgba(124, 58, 237, 0.2);
}
.scroll-to-top-btn:active { transform: scale(0.95); }
.scroll-to-top-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* ========================================
   SCROLL REVEAL
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(32px) scale(0.97);
    filter: blur(5px);
    transition: opacity var(--duration-reveal) var(--ease-out),
                transform var(--duration-reveal) var(--ease-out),
                filter var(--duration-reveal) var(--ease-out);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

/* Stagger children */
.reveal-group > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-group > .reveal:nth-child(2) { transition-delay: 0.12s; }
.reveal-group > .reveal:nth-child(3) { transition-delay: 0.24s; }
.reveal-group > .reveal:nth-child(4) { transition-delay: 0.36s; }
.reveal-group > .reveal:nth-child(5) { transition-delay: 0.48s; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 860px) {
    html { scroll-snap-type: none; }
    .hero, .section {
        min-height: auto;
        scroll-snap-align: none;
    }
    .hero { padding-block: clamp(60px, 14vw, 100px); }
}

@media (max-width: 520px) {
    .footer-links { flex-direction: column; gap: 4px; }
    .footer-sep { display: none; }
}

@media (max-width: 480px) {
    .site-header .nav { padding-block: 10px; }
    .brand span { font-size: var(--fs-body); }

    .hero-copy h1 { font-size: clamp(30px, 10vw, 46px); }
    .hero-copy .sub { font-size: var(--fs-body); }

    .cta { flex-direction: column; gap: 12px; }
    .cta .btn {
        width: 100%;
        text-align: center;
        padding: 14px 24px;
    }

    .section { padding-block: clamp(48px, 10vw, 80px); }
    .section h2 { font-size: clamp(24px, 7vw, 32px); }

    .card { padding: var(--space-4); }
    .tags li { padding: 5px 10px; }

    .contact-link { padding: 12px 16px; min-width: unset; }

    .scroll-to-top-btn {
        bottom: 20px; right: 20px;
        width: 40px; height: 40px;
    }
    .scroll-to-top-btn svg { width: 18px; height: 18px; }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
        filter: none;
    }
    .hero-copy > * {
        opacity: 1;
        transform: none;
        filter: none;
        animation: none;
    }
    .hero-orb { animation: none; }
}