@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Inter:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');


:root{
    --ink:        #1D1C1A;
    --ink-soft:   #5B5852;
    --paper:      #F1F0EC;
    --paper-dim:  #E8E6DF;
    --line:       #D2D0C7;
    --accent:     #2A3EB1;   /* blu da stampa */
    --hi:         #E6F53C;   /* evidenziatore */

    --f-serif: 'Courier Prime', 'Courier New', monospace;
    --f-sans:  'Inter', system-ui, sans-serif;

    --container: 1240px;
    --edge: clamp(20px, 5vw, 72px);
    --gutter: clamp(16px, 2vw, 28px);
    --ease: cubic-bezier(.2,.7,.2,1);
}

*,*::before,*::after{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }

body{
    background:var(--paper); color:var(--ink);
    font-family:var(--f-sans); font-optical-sizing:auto;
    font-size:1.125rem; line-height:1.65;
    -webkit-font-smoothing:antialiased; overflow-x:hidden; width:100%;
}
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
ul{ list-style:none; }
button{ font:inherit; background:none; border:none; cursor:pointer; color:inherit; }
a:focus-visible, button:focus-visible{ outline:2px solid var(--accent); outline-offset:4px; }
::selection{ background:var(--hi); color:var(--ink); }

.container{ max-width:var(--container); margin-inline:auto; padding-inline:var(--edge); }
.cursor-dot, .cursor-ring{ display:none; }

/* ---------------- tipografia ---------------- */
h1,h2,h3{ font-family:var(--f-serif); font-weight:400; letter-spacing:-0.01em; line-height:1.04; }
em{ font-style:italic; color:inherit; }
.section-label{ font-style:italic; font-size:1.05rem; color:var(--ink-soft); margin-bottom:16px; }
.logo{ font-family:var(--f-serif); }

/* ---------------- evidenziatore: un solo gesto, ripetuto ---------------- */
.main-nav a, .about-text a, .article-box-link, .skill-name, .card-title, .btn-primary, .project-next-title{
    background-image:linear-gradient(var(--hi), var(--hi));
    background-repeat:no-repeat; background-position:0 92%; background-size:0% .5em;
    -webkit-box-decoration-break:clone; box-decoration-break:clone;
    transition:background-size .4s var(--ease), color .2s ease;
}
.main-nav a:hover, .about-text a:hover, .article-box-link:hover, .btn-primary:hover,
.skill-row:hover .skill-name, .project-card:hover .card-title, .project-next:hover .project-next-title{ background-size:100% .5em; }

/* ---------------- header ---------------- */
.site-header{ position:fixed; inset:0 0 auto 0; z-index:500; padding:24px var(--edge); display:flex; justify-content:center; transition:background .3s ease, padding .3s ease; }
.site-header.scrolled{ background:var(--paper); padding-block:14px; box-shadow:0 1px 0 var(--ink); }
.header-inner{ display:flex; align-items:baseline; justify-content:space-between; width:100%; max-width:var(--container); padding-inline:0; }
.logo{ font-size:1.2rem; letter-spacing:-0.01em; }
.main-nav ul{ display:flex; gap:32px; }
.main-nav a{ font-family:var(--f-sans); font-size:.9rem; padding:0 2px; }

.hamburger{ display:none; flex-direction:column; gap:6px; width:26px; z-index:600; }
.hamburger span{ height:1px; background:var(--ink); transition:transform .3s ease, opacity .3s ease; }
.hamburger.open span:nth-child(1){ transform:translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2){ opacity:0; }
.hamburger.open span:nth-child(3){ transform:translateY(-7px) rotate(-45deg); }

@media (max-width:860px){
    .hamburger{ display:flex; }
    .main-nav{ position:fixed; inset:0; background:var(--hi); display:flex; align-items:center; justify-content:center; transform:translateX(100%); transition:transform .5s cubic-bezier(.77,0,.18,1); }
    .main-nav.open{ transform:translateX(0); }
    .main-nav ul{ flex-direction:column; gap:20px; text-align:center; }
    .main-nav a{ font-family:var(--f-serif); font-size:2rem; background-image:none; }
}

/* ---------------- hero ---------------- */
.hero{ min-height:100svh; display:flex; flex-direction:column; justify-content:space-between; padding-top:112px; }
.hero-body{ order:1; flex:1; width:100%; display:flex; flex-direction:column; justify-content:flex-end; padding-bottom:clamp(32px, 6vh, 72px); }
.hero-eyebrow{ font-style:italic; font-size:1.15rem; color:var(--ink-soft); margin-bottom:24px; }
.hero-title{ font-size:clamp(2.4rem, 8.6vw, 7.2rem); line-height:.98; letter-spacing:-0.015em; }

.hero-bottom{ display:grid; grid-template-columns:repeat(12, 1fr); column-gap:var(--gutter); row-gap:24px; align-items:end; margin-top:48px; padding-top:20px; border-top:1px solid var(--ink); }
.hero-tagline{ grid-column:1 / span 5; max-width:38ch; font-size:1.2rem; color:var(--ink-soft); }
.btn-primary{ grid-column:10 / span 3; justify-self:start; font-family:var(--f-sans); font-size:.95rem; border-bottom:1px solid var(--ink); padding:0 2px 2px; transition:background-size .4s var(--ease), color .2s ease, transform .15s var(--ease); }
.btn-primary:active{ transform:translateY(2px); }
.btn-primary .arr{ display:none; }
@media (max-width:760px){ .hero-tagline, .btn-primary{ grid-column:1 / -1; } }

/* ticker: ora è la base dell'hero, non l'apertura */
.hero-marquee{ order:2; overflow:hidden; border-top:1px solid var(--ink); border-bottom:1px solid var(--ink); padding-block:14px; }
.hero-marquee-track{ display:flex; width:max-content; padding-left:100%; animation:ticker 48s linear infinite; }
.hero-marquee:hover .hero-marquee-track{ animation-play-state:paused; }
.hero-marquee-item{ display:flex; align-items:center; font-size:clamp(1.4rem, 2.6vw, 2.2rem); font-weight:400; font-style:italic; letter-spacing:-0.01em; white-space:nowrap; }
.hero-marquee-item::after{ content:""; width:.36em; height:.36em; border-radius:50%; background:var(--accent); margin-inline:1.1em; animation:dot-pulse 1.8s ease-in-out infinite; }
@keyframes ticker{ to{ transform:translateX(-100%); } }
@keyframes dot-pulse{ 0%,100%{ transform:scale(1); opacity:1; } 50%{ transform:scale(1.55); opacity:.5; } }

/* una sola sequenza d'ingresso, all'apertura */
.hero-title{ animation:title-in 1.1s var(--ease) both; }
.hero-eyebrow{ animation:fade-in .8s .15s ease both; }
.hero-bottom > *{ animation:fade-in .8s .7s ease both; }
@keyframes title-in{ from{ clip-path:inset(100% 0 0 0); transform:translateY(36px); } to{ clip-path:inset(-10% 0 -10% 0); transform:none; } }
@keyframes fade-in{ from{ opacity:0; } to{ opacity:1; } }

/* ---------------- typewriter: caret + typing ---------------- */
.caret{
    display:inline-block; width:.5ch; height:.9em;
    background:var(--ink); margin-left:3px; vertical-align:-0.1em;
    animation:blink-caret 1s step-end infinite;
}
.typewriter{
    display:inline-block; overflow:hidden; white-space:nowrap;
    border-right:2px solid var(--ink); width:0;
    animation:typing 1.6s steps(var(--chars, 16), end) forwards,
              blink-caret .75s step-end infinite;
}
@keyframes typing{ from{ width:0; } to{ width:var(--chars, 16) ch; } }
@keyframes blink-caret{ 50%{ border-color:transparent; background-color:transparent; } }

/* ---------------- reveal: blocchi che entrano in sequenza ---------------- */
.reveal{ opacity:0; transform:translateY(24px); transition:opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.visible{ opacity:1; transform:none; }
.category-block.reveal{ opacity:1; transform:none; }
:is(.about-text, .skills-left, .skills-list, .projects-header, .edu-list).reveal{ opacity:1; transform:none; }
:is(.about-text, .skills-left, .skills-list, .projects-header, .edu-list).reveal > *{ opacity:0; transform:translateY(20px); transition:opacity .8s var(--ease), transform .8s var(--ease); }
:is(.about-text, .skills-left, .skills-list, .projects-header, .edu-list).reveal.visible > *{ opacity:1; transform:none; }
:is(.about-text, .skills-left, .skills-list, .edu-list).reveal > :nth-child(2){ transition-delay:.08s; }
:is(.about-text, .skills-left, .skills-list, .edu-list).reveal > :nth-child(3){ transition-delay:.16s; }
:is(.about-text, .skills-left, .skills-list, .edu-list).reveal > :nth-child(4){ transition-delay:.24s; }
:is(.about-text, .skills-left, .skills-list, .edu-list).reveal > :nth-child(5){ transition-delay:.32s; }
:is(.about-text, .skills-left, .skills-list, .edu-list).reveal > :nth-child(n+6){ transition-delay:.4s; }

/* stagger più fitto per le righe di competenze dentro ogni gruppo già visibile */
.skill-group .skill-row{ transition:background-color .2s ease; }
.skill-group.reveal.visible .skill-row{ animation:fade-in .6s var(--ease) both; }
.skill-group.reveal.visible .skill-row:nth-child(2){ animation-delay:.06s; }
.skill-group.reveal.visible .skill-row:nth-child(3){ animation-delay:.12s; }
.skill-group.reveal.visible .skill-row:nth-child(4){ animation-delay:.18s; }
.skill-group.reveal.visible .skill-row:nth-child(n+5){ animation-delay:.24s; }

/* ---------------- about: immagine cols 1–5, testo cols 7–12 ---------------- */
.about-section{ padding-block:clamp(88px, 12vw, 160px); border-top:1px solid var(--ink); }
.about-inner{ display:grid; grid-template-columns:repeat(12, 1fr); column-gap:var(--gutter); align-items:start; }
.about-img-wrap{ grid-column:1 / span 5; position:sticky; top:104px; }
.about-img{ width:100%; aspect-ratio:4/5; object-fit:cover; }
.about-img-tag{ margin-top:10px; padding-top:8px; border-top:1px solid var(--ink); font-family:var(--f-sans); font-size:.8rem; color:var(--ink-soft); }
.about-text{ grid-column:7 / span 6; }
.about-h2{ font-size:clamp(2.4rem, 5.2vw, 4.2rem); margin-bottom:40px; }
.about-text p{ margin-bottom:20px; color:var(--ink-soft); max-width:58ch; }
.about-text a{ color:var(--accent); border-bottom:1px solid currentColor; }
@media (max-width:860px){
    .about-img-wrap, .about-text{ grid-column:1 / -1; position:static; }
    .about-img-wrap{ margin-bottom:40px; }
}

/* ---------------- competenze: cols 1–4 / 6–12 ---------------- */
/* Trova la regola esistente intorno alla riga 168 e modificala così: */
.skills-section {
    margin-top: clamp(40px, 6vw, 120px); /* Aggiunge spazio SOPRA la linea divisoria */
    padding-block: clamp(72px, 10vw, 128px);
    border-top: 1px solid var(--ink);
}
.skills-inner{ display:grid; grid-template-columns:repeat(12, 1fr); column-gap:var(--gutter); row-gap:48px; }
.skills-left{ grid-column:1 / span 4; }
.skills-list{ grid-column:6 / span 7; }
.skills-left h2{ font-size:clamp(2.1rem, 4vw, 3.2rem); margin-bottom:24px; }
.skills-left p{ color:var(--ink-soft); max-width:36ch; }
.article-box{ margin-top:40px; padding-left:16px; border-left:1px solid var(--ink); }
.article-box-label{ margin-bottom:4px; }
.article-box-title{ font-style:italic; margin-bottom:6px; }
.article-box-link{ font-size:1rem; border-bottom:1px solid var(--line); word-break:break-word; }

.skill-group{ margin-bottom:56px; }
.skill-group-title{ font-size:1.05rem; font-style:italic; font-weight:400; letter-spacing:0; color:var(--ink-soft); padding-bottom:12px; border-bottom:1px solid var(--ink); }
.skill-row{ display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; row-gap:2px; column-gap:var(--gutter); padding-block:14px; border-bottom:1px solid var(--line); }
.skill-name{ font-size:1.2rem; }
.skill-cat{ font-family:var(--f-sans); font-size:.85rem; color:var(--ink-soft); }
@media (max-width:860px){ .skills-left, .skills-list{ grid-column:1 / -1; } }
@media (max-width:480px){ .skill-row{ flex-direction:column; align-items:flex-start; } }

/* ---------------- progetti: righe di 8+4 colonne, altezza immagine costante ---------------- */
.projects-section{ padding-block:clamp(88px, 12vw, 160px) 0; border-top:1px solid var(--ink); --plate-h:clamp(220px, 32vw, 440px); }
.projects-header{ display:grid; grid-template-columns:repeat(12, 1fr); column-gap:var(--gutter); align-items:end; margin-bottom:clamp(48px, 8vw, 96px); }
.projects-header > div{ grid-column:1 / span 8; }
.projects-header h2{ font-size:clamp(2.4rem, 5.2vw, 4.2rem); }
.projects-count{ grid-column:12; justify-self:end; font-family:var(--f-serif); font-size:.95rem; color:var(--ink-soft); }

.project-grid{ display:grid; grid-template-columns:repeat(12, 1fr); column-gap:var(--gutter); row-gap:clamp(48px, 6vw, 88px); align-items:start; }
.project-card:nth-child(1){ grid-column:1 / span 8; }
.project-card:nth-child(2){ grid-column:9 / span 4; }
.project-card:nth-child(3){ grid-column:1 / span 4; }
.project-card:nth-child(4){ grid-column:5 / span 8; }
.project-card:nth-child(5){ grid-column:1 / span 8; }
.project-card:nth-child(6){ grid-column:9 / span 4; }

.project-card{ display:flex; flex-direction:column; }
.card-img-wrap{ order:1; height:var(--plate-h); overflow:hidden; background:var(--paper-dim); }
.card-img-el{ width:100%; height:100%; object-fit:cover; transition:scale .8s var(--ease); }
.project-card:hover .card-img-el{ scale:1.04; }

.card-info{ order:2; display:block; margin-top:12px; padding-top:12px; border-top:1px solid var(--ink); }
.card-title{ display:inline; font-family:var(--f-serif); font-size:1.5rem; font-weight:400; letter-spacing:0; line-height:1.3; }
.card-tag{ display:block; font-style:italic; color:var(--ink-soft); margin-top:4px; }
.card-spec, .card-arrow{ display:none; }

@media (max-width:760px){
    .projects-section{ --plate-h:68vw; }
    .project-card:nth-child(n){ grid-column:1 / -1; }
    .projects-header > div{ grid-column:1 / -1; }
    .projects-count{ display:none; }
}

/* le tavole si "stampano" entrando nello schermo (dove il browser lo supporta) */
@supports (animation-timeline: view()){
    .card-img-wrap{ animation:plate-in linear both; animation-timeline:view(); animation-range:entry 5% entry 65%; }
    .card-img-el{ animation:plate-settle linear both; animation-timeline:view(); animation-range:entry 0% cover 55%; }
    @keyframes plate-in{ from{ clip-path:inset(0 0 100% 0); } to{ clip-path:inset(0 0 0 0); } }
    @keyframes plate-settle{ from{ transform:scale(1.22); } to{ transform:scale(1); } }
}

/* ---------------- formazione: dossier di studio, anno in Courier + titolo in Inter ---------------- */
.education-section{ padding-block:clamp(88px, 12vw, 160px); border-top:1px solid var(--ink); }
.edu-row{
    display:grid; grid-template-columns:repeat(12, 1fr); column-gap:var(--gutter); row-gap:6px;
    padding-block:32px; border-top:1px solid var(--ink); align-items:baseline;
}
.edu-year{ grid-column:1 / span 3; font-family:var(--f-serif); font-size:1.05rem; color:var(--ink-soft); }
.edu-title{ grid-column:5 / span 8; }
.edu-title strong{ display:block; font-weight:500; font-size:1.2rem; margin-bottom:4px; }
.edu-title span{ color:var(--ink-soft); font-size:.95rem; }
.badge-current{
    display:inline-block; background:var(--hi); color:var(--ink); font-family:var(--f-sans);
    font-size:.72rem; font-weight:500; padding:2px 9px; margin-left:10px; letter-spacing:0.02em;
    vertical-align:2px;
}
@media (max-width:760px){ .edu-year, .edu-title{ grid-column:1 / -1; } .edu-year{ margin-bottom:4px; } }

/* ---------------- footer: la pagina gialla ---------------- */
.site-footer{ margin-top:clamp(96px, 12vw, 176px); padding-block:clamp(56px, 8vw, 96px) 32px; background:var(--hi); border-top:1px solid var(--ink); }
.footer-headline{ font-family:var(--f-serif); font-size:clamp(2.2rem, 7vw, 5.6rem); font-weight:400; line-height:1; letter-spacing:-0.01em; margin-bottom:clamp(48px, 7vw, 96px); }
.footer-grid{ display:grid; grid-template-columns:repeat(12, 1fr); column-gap:var(--gutter); row-gap:32px; padding-bottom:48px; }
.footer-col:nth-child(1){ grid-column:1 / span 5; }
.footer-col:nth-child(2){ grid-column:7 / span 3; }
.footer-col:nth-child(3){ grid-column:10 / span 3; }
.footer-col h4{ font-size:1.05rem; font-style:italic; font-weight:400; margin-bottom:12px; padding-bottom:8px; border-bottom:1px solid var(--ink); }
.footer-col a, .footer-col p{ display:block; margin-bottom:6px; }
.footer-col a{ width:fit-content; transition:background .2s ease, color .2s ease; }
.footer-col a:hover{ background:var(--ink); color:var(--hi); }
.footer-bottom{ display:flex; justify-content:space-between; align-items:baseline; padding-top:16px; border-top:1px solid var(--ink); flex-wrap:wrap; gap:12px; }
.footer-logo{ font-family:var(--f-serif); font-size:1.1rem; }
.footer-copy{ font-family:var(--f-sans); font-size:.8rem; }
@media (max-width:760px){ .footer-col:nth-child(n){ grid-column:1 / -1; } }

/* ============================================================
   PAGINE PROGETTO
   ============================================================ */
.project-hero{ min-height:70svh; display:flex; flex-direction:column; justify-content:flex-end; padding-top:140px; padding-bottom:56px; }
.project-hero .back-link{ font-family:var(--f-sans); font-size:.9rem; color:var(--ink-soft); width:fit-content; margin-bottom:48px; transition:color .2s ease; }
.project-hero .back-link:hover{ color:var(--accent); }
.project-hero h1{ font-size:clamp(2.2rem, 6.4vw, 4.6rem); max-width:16ch; margin-bottom:14px; animation:title-in 1s var(--ease) both; }
.project-caption{ font-family:var(--f-serif); color:var(--ink-soft); font-size:.95rem; letter-spacing:0.01em; margin-bottom:28px; }
.project-meta{ display:flex; gap:48px; flex-wrap:wrap; margin-top:24px; padding-top:20px; border-top:1px solid var(--ink); }
.meta-item .section-label{ margin-bottom:4px; }
.meta-item p{ font-family:var(--f-serif); font-size:1rem; }

.project-body{ padding-block:72px; }
.project-body .lede{ font-family:var(--f-sans); font-weight:500; font-size:clamp(1.3rem, 2.6vw, 1.8rem); line-height:1.4; max-width:32ch; margin-bottom:64px; }
.project-block{ display:grid; grid-template-columns:repeat(12, 1fr); column-gap:var(--gutter); row-gap:12px; padding-block:40px; border-top:1px solid var(--ink); }
.project-block:last-child{ border-bottom:1px solid var(--ink); }
.project-block > :first-child{ grid-column:1 / span 3; }
.project-block > :last-child{ grid-column:5 / span 7; }
.project-block p{ color:var(--ink-soft); max-width:62ch; }
.project-block p + p{ margin-top:16px; }
@media (max-width:760px){ .project-block > *{ grid-column:1 / -1 !important; } }

.placeholder-gallery{ display:grid; grid-template-columns:repeat(12, 1fr); gap:var(--gutter); margin-top:64px; }
.placeholder-tile{ grid-column:span 6; aspect-ratio:4/3; border:1px solid var(--ink); background:var(--paper-dim); display:flex; align-items:center; justify-content:center; text-align:center; padding:20px; font-family:var(--f-sans); font-size:.85rem; color:var(--ink-soft); }
@media (max-width:640px){ .placeholder-tile{ grid-column:1 / -1; } }

.project-next{ display:flex; justify-content:space-between; align-items:baseline; gap:20px; flex-wrap:wrap; margin-top:96px; padding:28px 0; border-top:1px solid var(--ink); border-bottom:1px solid var(--ink); }
.project-next-label{ font-style:italic; color:var(--ink-soft); margin-bottom:4px; }
.project-next-title{ font-family:var(--f-serif); font-size:clamp(1.6rem, 3.2vw, 2.2rem); font-weight:400; letter-spacing:0; }
.project-next-arrow{ font-size:1.6rem; transition:transform .3s var(--ease); }
.project-next:hover .project-next-arrow{ transform:translateX(6px); }

/* ---------------- showcase di progetto: mockup telefono + video orizzontale ---------------- */
.phone-showcase{ margin-bottom:100px; }
@media (min-width:1024px){
    .phone-grid{
        display:grid; grid-template-columns:repeat(4, 1fr) !important;
        gap:15px !important; justify-content:center; align-items:center;
    }
}
.phone-mockup {
    position: relative;
    border-radius: 40px;          /* Curvatura perfetta degli angoli iPhone */
    overflow: hidden;             /* Taglia via lo sfondo fuori dal raggio */
    background: transparent !important;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12); /* Ombra morbida e pulita sul sito */
    border: none !important;
}

.phone-mockup-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 40px;
    
    /* STRINGI I BORDI: Zoom leggero per "mangiare" il bordo verde della foto */
    transform: scale(1.08); 
    transform-origin: center;
}
.portrait-screen{ aspect-ratio:9 / 19.5; }
.phone-mockup-video{ width:100%; height:100%; object-fit:cover; display:block; }
@media (max-width:960px){
    .phone-grid{ grid-template-columns:repeat(2, 1fr) !important; gap:20px !important; }
}
@media (max-width:480px){
    .phone-grid{ grid-template-columns:1fr !important; gap:30px !important; }
}

.video-landscape-wrapper{ width:100%; margin-bottom:100px; }
.project-video-landscape{
    width:100%; aspect-ratio:16 / 9; border-radius:16px; overflow:hidden;
    box-shadow:0 12px 30px rgba(0,0,0,0.1); display:block;
}

/* ---------------- case study index + chapter labels (riusabili su tutte le schede progetto) ---------------- */
.case-index{ font-family:var(--f-serif); font-size:.75rem; text-transform:uppercase; letter-spacing:.1em; color:var(--accent); margin-bottom:14px; }
.chapter-label{ font-family:var(--f-serif); font-size:.72rem; letter-spacing:.08em; text-transform:uppercase; color:var(--accent); }

/* ---------------- WTY: reel verticali ---------------- */
.reels-grid{ display:flex; justify-content:center; gap:24px; flex-wrap:wrap; margin-bottom:clamp(80px, 10vw, 120px); }
.reel-card{
    width:100%; max-width:280px; aspect-ratio:9/16; border-radius:6px; overflow:hidden;
    background:var(--paper-dim); border:1px solid var(--line); box-shadow:0 10px 30px -15px rgba(0,0,0,0.08);
}
.reel-card video{ width:100%; height:100%; object-fit:cover; display:block; }

/* ---------------- WTY: tris di poster sfalsato, come su una parete espositiva ---------------- */
.poster-triptych{
    display:grid; grid-template-columns:repeat(12, 1fr); column-gap:var(--gutter); row-gap:32px;
    margin-bottom:clamp(80px, 10vw, 120px); align-items:start;
}
.poster-card{ background:var(--paper-dim); border-radius:6px; overflow:hidden; }
.poster-card .card-img-wrap{ aspect-ratio:1 / 1.414; margin-bottom:0; } /* proporzione A3 */
.poster-card .card-info{ padding:16px 18px; }
.poster-card .card-title{ font-size:1rem; margin-bottom:2px; }
.poster-card .card-tag{ font-family:var(--f-serif); font-size:.68rem; font-style:normal; }
.poster-a{ grid-column:1 / span 4; }
.poster-b{ grid-column:5 / span 4; margin-top:56px; }
.poster-c{ grid-column:9 / span 4; }
@media (max-width:760px){ .poster-a, .poster-b, .poster-c{ grid-column:1 / -1; margin-top:0; } }

/* ---------------- WTY: galleria evento, documentaria: una foto grande + due impilate ---------------- */
.event-gallery{
    display:grid; grid-template-columns:repeat(12, 1fr); column-gap:var(--gutter); row-gap:var(--gutter);
    margin-bottom:clamp(80px, 10vw, 120px);
}
.event-photo{
    overflow:hidden; border-radius:6px;
    background:repeating-linear-gradient(135deg, var(--paper-dim), var(--paper-dim) 10px, var(--line) 10px, var(--line) 11px);
}
.event-photo img{ width:100%; height:100%; object-fit:cover; display:block; transition:transform .6s cubic-bezier(.16,1,.3,1); }
.event-photo:hover img{ transform:scale(1.04); }
.event-photo-a{ grid-column:1 / span 7; aspect-ratio:4/3; }
.event-photo-b{ grid-column:8 / span 5; aspect-ratio:16/10; }
.event-photo-c{ grid-column:8 / span 5; aspect-ratio:16/10; }
@media (max-width:760px){ .event-photo-a, .event-photo-b, .event-photo-c{ grid-column:1 / -1; } }

/* ---------------- sistema generico riusabile: griglia media + tile con proporzioni ---------------- */
.part-title{ font-weight:700; margin-top:10px; }
.gallery-block{ max-width:1000px; margin:0 auto 56px; }
.gallery-label{ font-weight:600; color:var(--ink); margin-bottom:16px; border-bottom:1px solid var(--line); padding-bottom:8px; font-size:.95rem; }
.gallery-caption{ font-family:var(--f-serif); font-size:.65rem; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.05em; margin-top:12px; padding-inline:4px; }
.text-link{ color:var(--accent); font-weight:500; text-decoration:underline; }

.media-grid{ display:grid; gap:24px; margin-bottom:56px; }
.media-grid.cols-2{ grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); max-width:820px; margin-left:auto; margin-right:auto; }
.media-grid.cols-3{ grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); }

.media-card{ background:var(--paper-dim); border-radius:6px; overflow:hidden; }
.media-card .card-info{ padding:16px 18px; }
.media-card .card-title{ font-size:.95rem; margin-bottom:2px; }
.media-card .card-tag{ font-family:var(--f-serif); font-size:.68rem; font-style:normal; }

.media-tile{
    overflow:hidden; border-radius:6px;
    background:repeating-linear-gradient(135deg, var(--paper-dim), var(--paper-dim) 10px, var(--line) 10px, var(--line) 11px);
}
.media-tile img, .media-tile video{ width:100%; height:100%; object-fit:cover; display:block; transition:transform .6s cubic-bezier(.16,1,.3,1); }
.media-tile:hover img{ transform:scale(1.04); }
.ratio-916{ aspect-ratio:9/16; }
.ratio-43{ aspect-ratio:4/3; }
.ratio-169{ aspect-ratio:16/9; }
.ratio-a3{ aspect-ratio:1/1.414; }

@media (max-width:480px){ :root{ --edge:18px; } }

/* ---------------- guida della griglia: premi "G" (vedi snippet JS) ---------------- */
body.show-grid::after{
    content:""; position:fixed; inset:0; z-index:9999; pointer-events:none; box-sizing:border-box;
    padding-inline:max(var(--edge), calc((100% - var(--container)) / 2 + var(--edge)));
    padding-right:calc(max(var(--edge), calc((100% - var(--container)) / 2 + var(--edge))) - var(--gutter));
    background-clip:content-box;
    background-image:repeating-linear-gradient(to right, rgba(42,62,177,.10) 0, rgba(42,62,177,.10) calc(100% / 12 - var(--gutter)), transparent calc(100% / 12 - var(--gutter)), transparent calc(100% / 12));
}

/* ---------------- movimento ridotto ---------------- */
@media (prefers-reduced-motion: reduce){
    html{ scroll-behavior:auto; }
    *,*::before,*::after{ animation:none !important; transition-duration:0.01ms !important; }
    .reveal, .reveal > *{ opacity:1 !important; transform:none !important; }
    .hero-marquee-track{ padding-left:0; }
    .typewriter{ width:var(--chars, 16) ch; border-right:none; }
}
/* ---------------- layout diviso: testo sticky + documento (Scontrino) ---------------- */
.split-layout{ display:grid; grid-template-columns:repeat(12, 1fr); column-gap:var(--gutter); row-gap:48px; align-items:start; margin-bottom:var(--block-gap); }
.split-text{ grid-column:1 / span 6; position:sticky; top:104px; }
.split-media{ grid-column:8 / span 5; }
.split-text .lede{ font-size:clamp(1.25rem, 2.2vw, 1.6rem); line-height:1.4; max-width:none; margin-bottom:0; }
.split-note{ margin-top:32px; padding-top:20px; border-top:1px solid var(--ink); }
.split-note .chapter-label{ margin-bottom:12px; }
.split-note p{ color:var(--ink-soft); }
.split-note p + p{ margin-top:14px; }
.split-note strong{ color:var(--ink); font-weight:600; }
.document-frame{ background:#fff; border:1px solid var(--ink); padding:10px; }
.document-frame img{ width:100%; height:auto; display:block; }
@media (max-width:860px){ .split-text, .split-media{ grid-column:1 / -1; position:static; } }

/* ============================================================
   INCOLLA QUESTO BLOCCO IN FONDO A style.css (dopo tutto il resto)
   HOME v4 — segni di stampa, sticker, marker, numerazione
   ============================================================ */

   .hero, .hero-body{ position:relative; }

   /* ---------------- hero: titolo da copertina ---------------- */
   .hero-title{ font-size:clamp(3rem, 12vw, 10.5rem); line-height:.92; letter-spacing:-0.045em; }
   
   /* "pixel." viene evidenziato a mano, a fine sequenza d'ingresso */
   .hero-title em{
       background-image:linear-gradient(var(--hi), var(--hi));
       background-repeat:no-repeat; background-position:0 90%; background-size:0% .4em;
       animation:marker 1s 1.1s var(--ease) forwards;
   }
   @keyframes marker{ to{ background-size:100% .4em; } }
   
   /* ---------------- hero: segni di stampa ---------------- */
   .crop{ position:absolute; width:20px; height:20px; border:0 solid var(--ink); pointer-events:none; }
   .crop-tl{ top:0; left:var(--edge); border-width:1px 0 0 1px; }
   .crop-tr{ top:0; right:var(--edge); border-width:1px 1px 0 0; }
   .crop-bl{ bottom:clamp(32px, 6vh, 72px); left:var(--edge); border-width:0 0 1px 1px; }
   .crop-br{ bottom:clamp(32px, 6vh, 72px); right:var(--edge); border-width:0 1px 1px 0; }
   .hero-folio{ position:absolute; top:0; left:calc(var(--edge) + 32px); line-height:20px; font-family:var(--f-serif); font-size:.8rem; color:var(--ink-soft); }
   
   /* ---------------- hero: sticker rotante ---------------- */
   .sticker{
       position:absolute; top:56px; right:var(--edge);
       width:clamp(96px, 11vw, 148px); aspect-ratio:1; border-radius:50%;
       background:var(--hi); border:1px solid var(--ink);
       display:grid; place-items:center;
       transition:background .25s ease, color .25s ease;
   }
   .sticker svg{ position:absolute; inset:0; width:100%; height:100%; animation:spin 24s linear infinite; }
   .sticker text{ font-family:var(--f-serif); font-size:14px; fill:currentColor; }
   .sticker-core{ font-family:var(--f-sans); font-size:clamp(1.4rem, 2.4vw, 2rem); line-height:1; transition:transform .3s var(--ease); }
   .sticker:hover{ background:var(--ink); color:var(--hi); }
   .sticker:hover svg{ animation-play-state:paused; }
   .sticker:hover .sticker-core{ transform:rotate(45deg); }
   @keyframes spin{ to{ transform:rotate(360deg); } }
   
   @media (max-width:760px){
       .sticker{ top:44px; width:92px; }
       .hero-folio{ display:none; }
   }
   
   /* ---------------- ticker: voci alternate piene / a contorno ---------------- */
   .hero-marquee-item{ font-size:clamp(2rem, 5vw, 4.2rem); line-height:1.1; letter-spacing:-0.03em; }
   .hero-marquee-item:nth-child(even){ color:transparent; -webkit-text-stroke:1px var(--ink); }
   
   /* ---------------- progetti: numerazione = numero del case study ---------------- */
   .project-grid{ counter-reset:proj; }
   .project-card{ counter-increment:proj; }
   .project-card .card-info::before{
       content:"N° " counter(proj, decimal-leading-zero);
       display:block; margin-bottom:6px;
       font-family:var(--f-serif); font-size:.8rem; letter-spacing:.06em; color:var(--accent);
   }
   
   /* "06" gigante a contorno, come un numero di rivista */
   .projects-header .projects-count{
       grid-column:9 / -1; justify-self:end; align-self:end;
       font-family:var(--f-serif); font-size:clamp(4.5rem, 12vw, 10rem); line-height:.78; letter-spacing:-0.06em;
       color:transparent; -webkit-text-stroke:1px var(--ink);
   }
   
   /* ---------------- su di me: capolettera + foto con blocco giallo ---------------- */
   .about-text p:first-of-type::first-letter{
       float:left; font-family:var(--f-serif); font-size:3.6em; line-height:.8;
       padding:.06em .1em 0 0; color:var(--accent);
   }
   .about-photo{ position:relative; isolation:isolate; }
   .about-photo::before{ content:""; position:absolute; inset:14px -14px -14px 14px; background:var(--hi); z-index:-1; }
   .about-img-wrap .about-img-tag{ margin-top:28px; }
   
   /* ---------------- formazione: anni più presenti ---------------- */
   .edu-year{ font-size:1.25rem; color:var(--ink); }
   
   /* ---------------- barra di lettura: sottile linea blu sotto l'header ---------------- */
   @supports (animation-timeline: scroll()){
       .site-header::after{
           content:""; position:absolute; left:0; right:0; bottom:0; height:2px;
           background:var(--accent); transform-origin:0 50%;
           animation:read-progress linear both; animation-timeline:scroll(root);
       }
       @keyframes read-progress{ from{ transform:scaleX(0); } to{ transform:scaleX(1); } }
   }
   
   /* ---------------- movimento ridotto ---------------- */
   @media (prefers-reduced-motion: reduce){
       .hero-title em{ background-size:100% .4em; }
       .site-header::after{ display:none; }
   }


   /* ============================================================
   SOSTITUISCE il blocco cursore che avevi incollato in style.css
   (quello con "CURSORE — croce di registro di stampa": cancellalo tutto,
   comprese le regole .pointer, .pointer-ring, .pointer-shape, .pointer-label)
   e incolla questo in fondo al file.
   ============================================================ */

/* ---------------- FIX HOME: via i segni di stampa agli angoli ----------------
   (quello in basso a sinistra finiva sopra il tagline). Il colophon
   si allinea al margine del contenuto. Se vuoi, puoi anche cancellare
   le regole .crop* e i quattro <span class="crop …"> in index.html. */
.crop{ display:none; }
.hero-folio{ left:var(--edge); }

/* ---------------- CURSORE — il "pixel" ---------------- */

/* la freccia di sistema sparisce solo se il JS del cursore è partito */
html.has-pointer, html.has-pointer *{ cursor:none !important; }
html.has-pointer video[controls]{ cursor:auto !important; }

/* pixel: quadrato pieno, in negativo sul fondo (scuro sulla carta, blu sul giallo) */
.pointer-dot{
    position:fixed; top:0; left:0; z-index:10000; pointer-events:none;
    width:12px; height:12px; margin:-6px 0 0 -6px; box-sizing:border-box;
    background:#fff; border:1px solid #fff; mix-blend-mode:difference;
    opacity:0; will-change:transform;
    transition:opacity .25s ease, width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background .2s ease, scale .2s var(--ease);
}
html.pointer-visible .pointer-dot{ opacity:1; }
html.pointer-hide .pointer-dot{ opacity:0; }

/* su link: diventa un quadrato più grande, vuoto */
html.pointer-link .pointer-dot{ width:36px; height:36px; margin:-18px 0 0 -18px; background:transparent; }
html.pointer-down .pointer-dot{ scale:.7; }

/* etichetta gialla accanto al puntatore */
.pointer-tag{
    position:fixed; top:0; left:0; z-index:10001; pointer-events:none;
    padding:5px 10px; background:var(--hi); color:var(--ink); border:1px solid var(--ink);
    font-family:var(--f-serif); font-size:.8rem; line-height:1; white-space:nowrap;
    opacity:0; will-change:transform; transition:opacity .2s ease;
}
html.pointer-label .pointer-tag{ opacity:1; }
html.pointer-hide .pointer-tag{ opacity:0; }

/* effetto magnetico: sticker e bottone tornano a posto con morbidezza */
.sticker{ transition:background .25s ease, color .25s ease, transform .3s var(--ease); }
.btn-primary{ transition:background-size .4s var(--ease), color .2s ease, border-color .2s ease, transform .3s var(--ease); }

/* movimento ridotto: nessuna transizione sul cursore */
@media (prefers-reduced-motion: reduce){
    .pointer-dot, .pointer-tag{ transition:none !important; }
}
.project-card:nth-child(1){ grid-column:1 / span 8; }
.project-card:nth-child(2){ grid-column:9 / span 4; }
.project-card:nth-child(3){ grid-column:1 / span 4; }
.project-card:nth-child(4){ grid-column:5 / span 8; }
.project-card:nth-child(5){ grid-column:1 / span 8; }
.project-card:nth-child(6){ grid-column:9 / span 4; }
.project-card:nth-child(7){ grid-column:1 / -1; } /* COLPEVOLE a tutta larghezza */

/* Contenitore e ridimensionamento Video Progetto */
.video-container {
    width: 100%;
    max-width: 960px;          /* Limita la larghezza massima per non farlo diventare enorme */
    margin: 0 auto;            /* Centra il video nella pagina */
    border-radius: 20px;       /* Arrotonda gli angoli per uno stile moderno */
    overflow: hidden;          /* Taglia i bordi del player sugli angoli */
    background-color: #000;    /* Fondo nero durante il caricamento */
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08); /* Ombra morbida sul fondo */
}

.video-container video {
    width: 100%;
    height: auto;              /* Mantiene le proporzioni originali (16:9, 4:3, ecc.) */
    display: block;
    object-fit: cover;
}

/* Layout Pagine Dettaglio Progetto */
.project-detail-page {
    padding-top: 140px;
    padding-bottom: 100px;
}

.back-link {
    display: inline-block;
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #000;
}

.project-hero {
    margin-bottom: 48px;
}

.project-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin: 12px 0 24px;
}

.project-lead {
    font-size: 1.25rem;
    line-height: 1.6;
    max-width: 800px;
    color: #444;
}

/* Player Video Centrato e Pulito */
.project-main-media {
    margin-bottom: 64px;
}

.video-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    background-color: #000;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
}

/* Griglia Dettagli + Concept */
.project-grid-info {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 80px;
}

.meta-item {
    margin-bottom: 28px;
}

.meta-item h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 6px;
}

.meta-item p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.project-description h3 {
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.project-description p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 20px;
}

/* Gallery & Navigazione */
.project-gallery h3 {
    font-size: 1.6rem;
    margin-bottom: 24px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 80px;
}

.gallery-item img {
    width: 100%;
    border-radius: 16px;
    display: block;
}

.project-nav {
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 40px;
    text-align: right;
}

.next-project {
    display: inline-flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.next-label {
    font-size: 0.85rem;
    color: #888;
}

.next-title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Responsiveness Mobile */
@media (max-width: 860px) {
    .project-grid-info {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}