/* ============================================================
   Matteo Malinverni - Portfolio Cyber-Fitness
   Palette: nero #0D0D0D, bianco, accento neon #CCFF00
   ============================================================ */

/* ---------- Font self-hosted ---------- */
@font-face {
    font-family: 'Syne';
    src: url('/assets/fonts/syne-600.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Syne';
    src: url('/assets/fonts/syne-700.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Syne';
    src: url('/assets/fonts/syne-800.woff2') format('woff2');
    font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/inter-400.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/inter-500.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/inter-600.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/inter-700.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- Variabili ---------- */
:root {
    --bg: #0D0D0D;
    --bg-soft: #141414;
    --bg-card: #171717;
    --white: #F5F5F5;
    --muted: #8A8A8A;
    --accent: #CCFF00;
    --accent-dim: rgba(204, 255, 0, 0.15);
    --line: rgba(255, 255, 255, 0.08);
    --radius: 18px;
    --font-head: 'Syne', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --container: 1200px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
    background: var(--bg);
    color: var(--white);
    font-family: var(--font-body);
    font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #000; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.accent { color: var(--accent); }
.section-tag {
    font-family: var(--font-head);
    font-size: 0.8rem; letter-spacing: 0.25em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 1.25rem;
}

/* ---------- Bottoni ---------- */
.btn {
    --pad: 0.95rem 1.9rem;
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: var(--pad);
    font-family: var(--font-head); font-weight: 700;
    font-size: 0.95rem; letter-spacing: 0.02em;
    border-radius: 100px; border: 1px solid transparent;
    cursor: pointer; transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s;
    will-change: transform;
}
.btn--accent {
    background: var(--accent); color: #0A0A0A;
    box-shadow: 0 0 0 rgba(204,255,0,0);
}
.btn--accent:hover {
    box-shadow: 0 0 35px rgba(204,255,0,0.55), 0 0 8px rgba(204,255,0,0.8);
    transform: translateY(-2px);
}
.btn--ghost {
    background: transparent; color: var(--white); border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Preloader ---------- */
.preloader {
    position: fixed; inset: 0; z-index: 10000;
    background: var(--bg); display: grid; place-items: center;
    transition: opacity .6s var(--ease), visibility .6s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.preloader__text {
    font-family: var(--font-head); font-weight: 800; font-size: 3rem;
    color: var(--accent); letter-spacing: 0.1em;
    animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

/* ---------- Header ---------- */
.site-header {
    position: fixed; top: 0; inset-inline: 0; z-index: 900;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
    transition: background .4s, backdrop-filter .4s, padding .4s;
}
.site-header.scrolled {
    background: rgba(13,13,13,0.72); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line); padding-block: 0.7rem;
}
.brand img { height: 34px; width: auto; }
.nav { display: flex; gap: 2rem; }
.nav a { font-size: 0.9rem; font-weight: 500; color: var(--muted); transition: color .25s; position: relative; }
.nav a:hover { color: var(--white); }
.nav a::after {
    content: ''; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
    background: var(--accent); transition: width .3s var(--ease);
}
.nav a:hover::after { width: 100%; }
.nav__toggle { display: none; }

/* ---------- Menu mobile ---------- */
.mobile-menu {
    position: fixed; inset: 0; z-index: 800;
    background: var(--bg); flex-direction: column;
    align-items: center; justify-content: center; gap: 1.75rem;
    display: none; opacity: 0; transition: opacity .4s;
}
.mobile-menu.open { display: flex; opacity: 1; }
.mobile-menu a { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; }

/* ---------- HERO ---------- */
.hero {
    position: relative; min-height: 100svh;
    display: flex; align-items: center;
    padding-top: 6rem; overflow: hidden;
}
.hero__glow {
    position: absolute; top: 20%; left: 50%; transform: translateX(-50%);
    width: 60vw; height: 60vw; max-width: 720px; max-height: 720px;
    background: radial-gradient(circle, rgba(204,255,0,0.14), transparent 62%);
    filter: blur(40px); z-index: 0;
}
.hero__grid {
    position: absolute; inset: 0; z-index: 0; opacity: .35;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(circle at 50% 40%, #000 10%, transparent 72%);
}
.hero .container { position: relative; z-index: 1; }
.hero__eyebrow {
    font-family: var(--font-head); font-size: 0.85rem;
    letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
    margin-bottom: 1.5rem;
}
.hero__title {
    font-family: var(--font-head); font-weight: 800;
    font-size: clamp(2.75rem, 1.5rem + 6.5vw, 7rem);
    line-height: 0.98; letter-spacing: -0.02em; text-transform: uppercase;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .word { display: inline-block; }
.hero__lead {
    max-width: 42ch; margin-top: 1.75rem; color: var(--muted);
    font-size: clamp(1rem, 0.95rem + 0.4vw, 1.25rem);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }
.hero__scroll {
    position: absolute; bottom: 1.75rem; left: 50%; transform: translateX(-50%);
    font-size: 0.72rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem; z-index: 1;
}
.hero__scroll span {
    width: 1px; height: 42px;
    background: linear-gradient(var(--accent), transparent);
    animation: scrollLine 1.8s ease-in-out infinite;
}
@keyframes scrollLine { 0%,100% { transform: scaleY(.4); opacity:.4;} 50%{transform: scaleY(1); opacity:1;} }

/* ---------- CHI SONO ---------- */
.about { padding: clamp(5rem, 10vw, 9rem) 0; }
.about__grid {
    display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
}
.about__title {
    font-family: var(--font-head); font-weight: 800; text-transform: uppercase;
    font-size: clamp(2.4rem, 1.5rem + 4vw, 4.5rem); line-height: 0.95; letter-spacing: -0.02em;
}
.about__role { margin-top: 1rem; color: var(--accent); font-weight: 500; font-size: 0.95rem; }
.about__intro { position: sticky; top: 7rem; }
.about__text { font-size: clamp(1.05rem, 1rem + 0.5vw, 1.4rem); line-height: 1.65; }
.counters {
    margin-top: 3rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
    border-top: 1px solid var(--line); padding-top: 2rem;
}
.counter__num {
    display: block; font-family: var(--font-head); font-weight: 800;
    font-size: clamp(2rem, 1.5rem + 2vw, 3.2rem); color: var(--white); line-height: 1;
}
.counter__text { color: var(--accent); }
.counter__label { display: block; margin-top: 0.5rem; color: var(--muted); font-size: 0.82rem; }

/* ---------- IL METODO (Bento) ---------- */
.metodo { padding: clamp(4rem, 8vw, 7rem) 0; }
.metodo__head { margin-bottom: 3rem; }
.metodo__title {
    font-family: var(--font-head); font-weight: 800; text-transform: uppercase;
    font-size: clamp(2rem, 1.4rem + 3.5vw, 4rem); letter-spacing: -0.02em; line-height: 1;
}
.bento {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem;
    grid-auto-rows: minmax(190px, auto);
}
.bento__card {
    position: relative; background: var(--bg-card);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.75rem; overflow: hidden;
    transform-style: preserve-3d; transition: border-color .4s, background .4s;
    display: flex; flex-direction: column; justify-content: flex-end; gap: 0.6rem;
}
.bento__card::before {
    content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
    background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), var(--accent), transparent 45%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity .35s; pointer-events: none;
}
.bento__card:hover { background: var(--bg-soft); }
.bento__card:hover::before { opacity: 1; }
.bento__card--lg { grid-column: span 2; grid-row: span 2; }
.bento__card--tall { grid-row: span 2; }
.bento__card--wide { grid-column: span 2; }
.bento__index { font-family: var(--font-head); color: var(--accent); font-size: 0.85rem; letter-spacing: 0.1em; }
.bento__card h3 { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.15rem, 1rem + 0.6vw, 1.7rem); line-height: 1.1; }
.bento__card p { color: var(--muted); font-size: 0.95rem; }
.bento__card--lg h3 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.6rem); }

/* ---------- CTA / CONTATTI ---------- */
.cta { position: relative; padding-top: clamp(4rem, 8vw, 7rem); overflow: hidden; }
.cta__glow {
    position: absolute; bottom: -10%; right: -5%; width: 45vw; height: 45vw; max-width: 600px; max-height: 600px;
    background: radial-gradient(circle, rgba(204,255,0,0.10), transparent 62%); filter: blur(30px); z-index: 0;
}
.cta__grid {
    position: relative; z-index: 1;
    display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center;
    min-height: 80svh;
}
.cta__title {
    font-family: var(--font-head); font-weight: 800; text-transform: uppercase;
    font-size: clamp(2.6rem, 1.5rem + 5vw, 5.5rem); line-height: 0.95; letter-spacing: -0.02em;
}
.cta__text { margin-top: 1.5rem; color: var(--muted); max-width: 40ch; }
.cta__contacts { list-style: none; margin-top: 1.75rem; }
.cta__contacts a { font-family: var(--font-head); font-weight: 600; border-bottom: 1px solid var(--accent); padding-bottom: 2px; }

/* ---------- Form ---------- */
.contact-form {
    background: var(--bg-card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: clamp(1.5rem, 3vw, 2.5rem);
    display: flex; flex-direction: column; gap: 1.1rem;
}
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field--row { flex-direction: row; gap: 1rem; }
.field--row > div { flex: 1; display: flex; flex-direction: column; gap: 0.45rem; }
.field label { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.field label span { text-transform: none; letter-spacing: 0; }
.field input, .field select, .field textarea {
    background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
    padding: 0.85rem 1rem; color: var(--white); font-family: var(--font-body); font-size: 1rem;
    transition: border-color .25s, box-shadow .25s; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim);
}
.field textarea { resize: vertical; min-height: 110px; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: #ff4d4d; }
.contact-form__submit { justify-content: center; margin-top: 0.5rem; }
.form-status { font-size: 0.9rem; min-height: 1.2em; }
.form-status.ok { color: var(--accent); }
.form-status.err { color: #ff6b6b; }
.form-privacy { font-size: 0.75rem; color: var(--muted); }
.cf-turnstile:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: clamp(3rem, 6vw, 5rem); padding: 2.5rem 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.footer img { height: 28px; width: auto; opacity: 0.85; }
.footer p { color: var(--muted); font-size: 0.82rem; }

/* ---------- Reveal (stato iniziale, gestito da GSAP) ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); }
.js-ready [data-reveal] { will-change: transform, opacity; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .about__grid { grid-template-columns: 1fr; }
    .about__intro { position: static; }
    .counters { grid-template-columns: repeat(2, 1fr); }
    .cta__grid { grid-template-columns: 1fr; min-height: auto; padding-block: 2rem; }
    .bento { grid-template-columns: repeat(2, 1fr); }
    .bento__card--lg, .bento__card--wide { grid-column: span 2; }
    .bento__card--lg, .bento__card--tall { grid-row: auto; }
}
@media (max-width: 720px) {
    .nav, .nav__cta { display: none; }
    .nav__toggle {
        display: flex; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; z-index: 901;
    }
    .nav__toggle span { width: 26px; height: 2px; background: var(--white); transition: transform .3s, opacity .3s; }
    .nav__toggle.open span:first-child { transform: translateY(7px) rotate(45deg); }
    .nav__toggle.open span:last-child { transform: translateY(-7px) rotate(-45deg); }
    .field--row { flex-direction: column; }
    /* L'indicatore scroll su mobile si accavalla con le CTA: lo nascondiamo */
    .hero__scroll { display: none; }
    .hero { padding-top: 5.5rem; padding-bottom: 3rem; }
}
@media (max-width: 560px) {
    .bento { grid-template-columns: 1fr; }
    .bento__card--lg, .bento__card--wide { grid-column: span 1; }
    .counters { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Accessibilita': riduzione movimento ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    [data-reveal] { opacity: 1 !important; transform: none !important; }
    html { scroll-behavior: auto; }
}
