/* ============================================================
   FONT LOCALI — cartella /font
   I nomi dei file devono corrispondere ESATTAMENTE a quelli sul disco,
   maiuscole comprese: il server di Netsons è Linux e le distingue.
   Gli intervalli di peso (es. 400 700) evitano il grassetto finto.
   ============================================================ */

/* ---------- PP Right Gothic ---------- */
@font-face {
  font-family: 'PP Right Gothic';
  src: url('font/PPRightGothic-Light.woff2') format('woff2'),
       url('font/PPRightGothic-Light.woff') format('woff');
  font-weight: 100 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Right Gothic';
  src: url('font/PPRightGothic-Medium.woff2') format('woff2'),
       url('font/PPRightGothic-Medium.woff') format('woff');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Right Gothic';
  src: url('font/PPRightGothic-MediumItalic.woff2') format('woff2'),
       url('font/PPRightGothic-MediumItalic.woff') format('woff');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tagli alternativi, pronti se ti servono ---------- */
@font-face {
  font-family: 'PP Right Gothic Compact';
  src: url('font/PPRightGothic-CompactBlack.woff2') format('woff2'),
       url('font/PPRightGothic-CompactBlack.woff') format('woff');
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Right Gothic Narrow';
  src: url('font/PPRightGothic-NarrowLight.woff2') format('woff2'),
       url('font/PPRightGothic-NarrowLight.woff') format('woff');
  font-weight: 100 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Right Gothic Wide';
  src: url('font/PPRightGothic-WideMedium.woff2') format('woff2'),
       url('font/PPRightGothic-WideMedium.woff') format('woff');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Right Gothic Wide';
  src: url('font/PPRightGothic-WideMediumItalic.woff2') format('woff2'),
       url('font/PPRightGothic-WideMediumItalic.woff') format('woff');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'PP Right Gothic Wide';
  src: url('font/PPRightGothic-WideBlack.woff2') format('woff2'),
       url('font/PPRightGothic-WideBlack.woff') format('woff');
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- PP Playground ---------- */
@font-face {
  font-family: 'PP Playground';
  src: url('font/PPPlayground-Thin.woff2') format('woff2'),
       url('font/PPPlayground-Thin.woff') format('woff');
  font-weight: 100 200;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'PP Playground';
  src: url('font/PPPlayground-Light.woff2') format('woff2'),
       url('font/PPPlayground-Light.woff') format('woff');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'PP Playground';
  src: url('font/PPPlayground-Medium.woff2') format('woff2'),
       url('font/PPPlayground-Medium.woff') format('woff');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

/* ---------- Sora di scorta ----------
   Sora arriva da Google Fonts con tutti i pesi; questo file locale copre
   il caso in cui Google non risponda: un solo taglio, ma è il tuo. */
@font-face {
  font-family: 'Sora Locale';
  src: url('font/Sora-Regular.woff2') format('woff2'),
       url('font/Sora-Regular.woff') format('woff');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   VARIABILI
   ============================================================ */
:root {
  --bg-dark: #0d0d0d;
  --bg-raised: #111111;
  --text-white: #f5f8e2;
  --text-soft: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.45);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.28);
  --accent-color: #ee5b51;

  --nav-bg: rgba(13, 13, 13, 0.82);      /* barra in alto quando si scorre */
  --veil-strong: rgba(13, 13, 13, 0.85); /* velo sulle immagini dei progetti */
  --veil-soft: rgba(13, 13, 13, 0.35);
  --field-focus: rgba(255, 255, 255, 0.04);

  --font-main: "Sora", "Sora Locale", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "PP Right Gothic", "Arial Narrow", Arial, sans-serif;
  --font-hero: "PP Playground", "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive;

  /* SCALA TIPOGRAFICA */
  --t-micro: 11px;
  --t-small: 13px;
  --t-body: clamp(16px, 1.05vw, 18px);
  --t-lead: clamp(20px, 2.4vw, 30px);
  --t-h2: clamp(30px, 4.2vw, 52px);
  --t-display: clamp(46px, 9vw, 116px);

  /* RITMO VERTICALE */
  --space-section: clamp(80px, 12vh, 160px);
  --gutter: clamp(20px, 5vw, 64px);

  --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   BASE
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-main);
  font-size: var(--t-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

section[id], header[id] { scroll-margin-top: 96px; }

::selection { background: var(--accent-color); color: var(--bg-dark); }

/* ---------- TEXTURE SU TUTTO ---------- */
/* Non è un filtro sopra la finestra: è appoggiata alla pagina e scorre con lei.
   Due strati: trama diagonale + grana SVG generata dal browser.
   Manopole: opacity (densità) e background-size (grossezza del grano). */
.page-content::before,
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.08;
  background-image:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.085) 0 1px, transparent 1px 7px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.62'/%3E%3C/svg%3E");
  background-size: auto, 200px 200px;
}

a { color: inherit; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent-color);
  color: var(--bg-dark);
  padding: 12px 20px;
  font-size: var(--t-small);
  text-decoration: none;
}
.skip-link:focus { left: 16px; top: 16px; }

/* TIPI RICORRENTI ------------------------------------------- */
.eyebrow {
  font-family: var(--font-main);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: var(--t-h2);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.body-text {
  font-family: var(--font-main);
  font-size: var(--t-body);
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 62ch;
}

.highlight { color: var(--accent-color); }
.muted { color: var(--text-muted); }

/* ============================================================
   NAVIGAZIONE + BURGER
   ============================================================ */
.nav-custom {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 28px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 12;
  font-family: var(--font-main);
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease, padding 0.4s ease;
}

.nav-custom.scrolled {
  background-color: var(--nav-bg);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 16px var(--gutter);
}

.nav-custom a {
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: color 0.3s ease;
}

.nav-right a { margin-left: 32px; }

/* Il logo sostituisce il nome scritto */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.nav-left a { display: inline-flex; align-items: center; gap: 10px; }

.nav-logo {
  display: block;
  height: 30px;
  width: auto;
  transition: height 0.4s ease, filter 0.4s ease;
}

.nav-custom.scrolled .nav-logo { height: 24px; }

/* Voce CV: link semplice, così "Scrivimi" resta l'azione principale */
.nav-cv { white-space: nowrap; }

/* La barra ora ha quattro voci: su desktop stretti si stringono un po' */
@media (min-width: 769px) and (max-width: 950px) {
  .nav-right a { margin-left: 20px; }
}

.nav-back {
  width: 17px;
  height: 17px;
  flex: none;
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-left a:hover .nav-back { transform: translateX(-4px); }

/* Bottone di contatto in alto a destra */
.nav-cta {
  padding: 9px 22px;
  border-radius: 50px;
  background: var(--accent-color);
  color: var(--bg-dark) !important;
  transition: background-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

.nav-cta:hover {
  background: transparent;
  color: var(--accent-color) !important;
  box-shadow: inset 0 0 0 1px var(--accent-color);
}

/* Sottolineatura che cresce: dice "è un link" senza cambiare colore */
.nav-right a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-right a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-custom a:hover { color: var(--accent-color); }

.burger-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 15;
  padding: 5px;
}

.burger-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-white);
  transition: var(--transition-smooth);
  backface-visibility: hidden;
}

.burger-toggle.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger-toggle.is-active span:nth-child(2) { opacity: 0; }
.burger-toggle.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.menu-overlay {
  position: fixed;
  inset: 0;
  height: 100vh;
  background: var(--bg-dark);
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 var(--gutter);
  transform: translateY(-100%);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-overlay.is-open { transform: translateY(0); }

.menu-overlay a {
  font-family: var(--font-serif);
  font-size: clamp(36px, 11vw, 64px);
  font-weight: 500;
  color: var(--text-white);
  text-decoration: none;
  margin: 6px 0;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.menu-overlay.is-open a {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  z-index: 0;
  overflow: hidden;
}

/* Il contenuto scorre sopra la hero, che resta ferma dietro */
.page-content {
  position: relative;
  z-index: 1;
  margin-top: 100vh;
  margin-top: 100svh;
  background: var(--bg-dark);
  box-shadow: 0 -48px 96px rgba(0, 0, 0, 0.65);
}

.hero-media { position: absolute; inset: 0; }

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}



/* Velatura sulle pagine progetto, dove la hero è un'immagine senza scrim */
.hero:not(.hero-home)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 75% 60% at 50% 50%, rgba(13,13,13,0.62) 0%, rgba(13,13,13,0.32) 60%, rgba(13,13,13,0.2) 100%),
    linear-gradient(to bottom, rgba(13,13,13,0.65) 0%, rgba(13,13,13,0) 22%);
}

.hero-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 100%;
  max-width: 820px;
  padding: 0 var(--gutter);
  text-align: center;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: var(--t-display);
  font-weight: 600;
  font-variation-settings: "SOFT" 0, "WONK" 0;
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}

.hero-tagline {
  font-family: var(--font-main);
  font-size: var(--t-lead);
  line-height: 1.4;
  color: var(--text-soft);
  max-width: 34ch;
  margin: 0 auto 40px;
}

.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

.btn-ghost,
.btn-plain {
  font-family: var(--font-main);
  font-size: var(--t-small);
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 14px 30px;
  border-radius: 50px;
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

.btn-ghost {
  background: var(--accent-color);
  border: 1px solid var(--accent-color);
  color: var(--bg-dark);
}
.btn-ghost:hover { background: transparent; color: var(--accent-color); }

.btn-plain {
  border: 1px solid var(--line-strong);
  color: var(--text-white);
}
.btn-plain:hover { border-color: var(--text-white); background: rgba(255,255,255,0.06); }

.hero-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px var(--gutter);
  border-top: 1px solid var(--line);
}

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Entrata orchestrata: un solo momento, al caricamento */
.hero-home .hero-name,
.hero-home .hero-tagline,
.hero-home .hero-actions,
.hero-home .hero-footer {
  opacity: 0;
  transform: translateY(24px);
  animation: heroIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-home .hero-name     { animation-delay: 0.15s; }
.hero-home .hero-tagline  { animation-delay: 0.32s; }
.hero-home .hero-actions  { animation-delay: 0.46s; }
.hero-home .hero-footer   { animation-delay: 0.60s; }

@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}

/* TITOLO HERO PAGINE PROGETTO ------------------------------- */
.hero-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  padding: 0 var(--gutter);
  text-align: center;
  z-index: 2;
  pointer-events: none;
  color: var(--text-white);
  line-height: 1;
}

.hero-title-project {
  font-family: var(--font-hero);
  font-size: clamp(64px, 8.5vw, 110px);
  font-weight: 400;
  letter-spacing: 0;
  font-style: italic;
}

.year {
  position: absolute;
  bottom: 28px;
  right: var(--gutter);
  z-index: 3;
  font-family: var(--font-main);
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-section {
  background: var(--bg-dark);
  padding: var(--space-section) 0;
}

.about-statement {
  font-family: var(--font-serif);
  font-size: clamp(23px, 2.9vw, 38px);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.015em;
  max-width: 30ch;
  margin-bottom: 32px;
  text-wrap: balance;
}

.about-body {
  font-family: var(--font-main);
  font-size: var(--t-body);
  line-height: 1.7;
  color: var(--text-soft);
  max-width: 56ch;
}

.about-figure { margin: 0; }

.about-image {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 5;
  margin-left: auto;
  border-radius: 12px;

}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  filter: grayscale(100%) contrast(1.08) brightness(0.92);
  transition: filter 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-figure:hover img {
  filter: grayscale(0%) contrast(1) brightness(1);
  transform: scale(1.02);
}

/* Righe dati: stesso linguaggio a filetti della lista progetti */
.about-facts {
  margin: clamp(56px, 8vw, 96px) 0 0;
  border-top: 1px solid var(--line);
}

.fact-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.fact-row dt {
  font-family: var(--font-main);
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 4px;
}

.fact-row dd {
  margin: 0;
  font-size: var(--t-small);
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 70ch;
}

/* ============================================================
   PROGETTI
   ============================================================ */
.projects {
  background: var(--bg-dark);
  padding: 0;
}

.projects-header { padding-bottom: clamp(40px, 6vw, 72px); }

.project-item { position: relative; width: 100%; }

.project-link { text-decoration: none; color: inherit; }

.project-box {
  position: relative;
  min-height: clamp(180px, 24vw, 260px);
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
  overflow: hidden;
}
/* Nessun bordo sull'ultima riga: lo dà già il bordo alto della sezione contatti */

.project-row {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: baseline;
  gap: 24px;
  padding: 0 var(--gutter);
}

.project-index {
  font-family: var(--font-main);
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  color: var(--text-muted);
  transition: color 0.4s ease;
}

.project-title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 6vw, 76px);
  font-weight: 600;
  line-height: 1;
  margin: 0;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s ease;
}

.project-meta {
  font-family: var(--font-main);
  font-size: var(--t-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: right;
  transition: color 0.4s ease;
}

.project-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

.project-box::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to right, var(--veil-strong), var(--veil-soft));
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project-link:hover .project-image { opacity: 1; transform: scale(1); }
.project-link:hover .project-box::after { opacity: 1; }
.project-link:hover .project-title { transform: translateX(12px); color: var(--bg-dark); }

/* Sopra il velo scuro si schiarisce tutta la riga, non solo il titolo */
.project-link:hover .project-index,
.project-link:hover .project-meta,
.project-link:focus-visible .project-index,
.project-link:focus-visible .project-meta { color: var(--bg-dark); }

.project-link:focus-visible .project-title { color: var(--bg-dark); }
.project-link:focus-visible .project-image { opacity: 1; }
.project-link:focus-visible .project-box::after { opacity: 1; }

/* ============================================================
   MEDIA PAGINE PROGETTO
   ============================================================ */
.media-section img,
.media-section video { border-radius: 0; }

.reveal-item {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-item.is-visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   CONTATTI
   ============================================================ */
.contact-section {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-dark);
}

.contact-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(58% 62% at 3% 100%, rgba(238, 91, 81, 0.20) 0%, transparent 66%);
}

.contact-section > .container-fluid { position: relative; z-index: 1; }

/* Le due colonne hanno altezze diverse: il form si centra invece di
   lasciare tutto il vuoto sotto al bottone */
.form-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-form { width: 100%; }

.label-mono {
  font-family: var(--font-main);
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.value-mono {
  font-family: var(--font-main);
  font-size: var(--t-body);
  color: var(--text-white);
  margin: 0;
}

.value-mono a {
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.value-mono a:hover { color: var(--accent-color); border-color: var(--accent-color); }

.social-row { display: flex; flex-wrap: wrap; gap: 20px; }

.form-control-custom {
  background-color: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-white);
  font-family: var(--font-main);
  font-size: var(--t-small);
  padding: 15px 20px;
  width: 100%;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.form-control-custom::placeholder { color: var(--text-muted); }

.form-control-custom:focus {
  outline: none;
  border-color: var(--accent-color);
  background-color: var(--field-focus);
}

textarea.form-control-custom { min-height: 200px; resize: vertical; }

.btn-submit {
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  font-family: var(--font-main);
  font-size: var(--t-small);
  letter-spacing: 0.04em;
  padding: 13px 32px;
  border-radius: 50px;
  transition: background-color 0.3s ease, color 0.3s ease;
  cursor: pointer;
}

.btn-submit:hover:not(:disabled) { background: var(--accent-color); color: var(--bg-dark); }
.btn-submit:disabled { opacity: 0.5; cursor: wait; }

.form-feedback {
  font-family: var(--font-main);
  font-size: var(--t-small);
}

/* ============================================================
   FOOTER
   ============================================================ */
.bg-custom-dark { background-color: var(--bg-dark); }

.footer { padding: 26px 0; }

.footer-text {
  font-family: var(--font-main);
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.footer-top { text-decoration: none; transition: color 0.3s ease; }
.footer-top:hover { color: var(--accent-color); }

/* ============================================================
   SCINTILLE AL CLICK
   ============================================================ */
.sparkle {
  position: fixed;
  width: 2px;
  height: 2px;
  background: var(--accent-color);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999999;
  transform: translate(0, 0) scale(1);
  opacity: 1;
  transition: transform 300ms ease-out, opacity 300ms ease-out;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .about-image { margin-left: 0; }
  .fact-row { grid-template-columns: 160px 1fr; }
}

@media (max-width: 768px) {
  .nav-right { display: none; }
  .burger-toggle { display: flex; }
  .nav-custom, .nav-custom.scrolled { padding: 18px 20px; }

  .hero { height: 100svh; }
  .hero-bg { object-position: 50% 50%; }

  .hero-scrim {
    background:
      radial-gradient(ellipse 95% 45% at 50% 50%, rgba(13,13,13,0.9) 0%, rgba(13,13,13,0.55) 60%, rgba(13,13,13,0.4) 100%),
      linear-gradient(to bottom, rgba(13,13,13,0.7) 0%, rgba(13,13,13,0) 20%);
  }

  .hero-tagline { font-size: 17px; max-width: 30ch; margin-bottom: 28px; }
  .hero-actions { gap: 10px; }
  .btn-ghost, .btn-plain { padding: 12px 22px; }

  .hero-footer { padding: 14px 20px; }

  /* Senza hover: l'immagine di progetto resta visibile */
  .project-image { opacity: 0.5; transform: scale(1); }
  .project-box::after { opacity: 1; }
  .project-row { grid-template-columns: 1fr; gap: 8px; padding: 28px 20px; }

  /* Senza hover il velo è sempre acceso, quindi il testo nasce già chiaro */
  .project-title,
  .project-index,
  .project-meta { color: var(--bg-dark); }
  .project-meta { text-align: left; }
  .project-box { min-height: 200px; }

  .about-image { width: 72%; }
  .fact-row { grid-template-columns: 1fr; gap: 8px; padding: 18px 0; }

  .footer .container { justify-content: center; text-align: center; }
}

/* ============================================================
   ACCESSIBILITÀ: MOTION RIDOTTO
   ============================================================ */
@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;
  }
  .hero-home .hero-name,
  .hero-home .hero-tagline,
  .hero-home .hero-actions,
  .hero-home .hero-footer { opacity: 1; transform: none; }
  .reveal-item { opacity: 1; transform: none; }
}

/* ============================================================
   PROSSIMO PROGETTO (pagine di caso)
   ============================================================ */
.next-project { border-top: 1px solid var(--line); }

.next-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(48px, 8vw, 96px) var(--gutter);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.5s ease;
}

.next-link:hover { background-color: #131313; }

.next-title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 6vw, 76px);
  font-weight: 600;
  line-height: 1;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s ease;
}

.next-link:hover .next-title { transform: translateX(12px); color: var(--accent-color); }


/* ============================================================
   TEMA CHIARO — SOLO LA HOME (body class="page-light")
   Le altre pagine restano scure: qui si ribaltano solo le variabili.
   ============================================================ */
.page-light {
  --bg-dark: #F5F8E2;
  --bg-raised: #EDF1D3;
  --text-white: #0D0D0D;
  --text-soft: rgba(13, 13, 13, 0.84);
  --text-muted: rgba(13, 13, 13, 0.66);
  --line: rgba(13, 13, 13, 0.16);
  --line-strong: rgba(13, 13, 13, 0.32);

  --nav-bg: rgba(245, 248, 226, 0.88);
  --veil-strong: rgba(13, 13, 13, 0.88);
  --veil-soft: rgba(13, 13, 13, 0.48);
  --field-focus: rgba(13, 13, 13, 0.04);
}

/* La hero resta scura: dentro di lei le variabili tornano chiare */
.page-light .hero,
.page-light .nav-custom {
  --text-white: #F5F8E2;
  --text-soft: rgba(245, 248, 226, 0.74);
  --text-muted: rgba(245, 248, 226, 0.55);
  --line: rgba(245, 248, 226, 0.16);
  --line-strong: rgba(245, 248, 226, 0.30);
}

.page-light .nav-custom { color: #F5F8E2; }

/* Appena la barra si stacca dalla hero passa sopra il fondo chiaro */
.page-light .nav-custom.scrolled .nav-logo,
.page-light .menu-overlay.is-open ~ .nav-custom .nav-logo {
  filter: brightness(0);
}

.page-light .nav-custom.scrolled,
.page-light .menu-overlay.is-open ~ .nav-custom {
  color: #0D0D0D;
  --text-white: #0D0D0D;
  --text-soft: rgba(13, 13, 13, 0.74);
  --line: rgba(13, 13, 13, 0.16);
  --line-strong: rgba(13, 13, 13, 0.32);
}

/* Su fondo chiaro la grana in "screen" sparirebbe: serve "multiply" */
.page-light .page-content::before {
  mix-blend-mode: multiply;
  opacity: 0.26;
}

/* La foto in bianco e nero su carta chiara ha bisogno di meno contrasto */
.page-light .about-image img { filter: grayscale(100%) contrast(1.02) brightness(1.02); }
.page-light .about-figure:hover img { filter: grayscale(0%) contrast(1) brightness(1); }

/* I bordi Bootstrap sono bianchi e su carta chiara sparirebbero:
   ridefinisco il bianco di Bootstrap, così l'opacità al 25% resta la stessa */
.page-light .border-white { --bs-white-rgb: 13, 13, 13; }

/* Le etichette piccole su carta chiara reggono meglio con un filo di peso */
.page-light .eyebrow,
.page-light .label-mono,
.page-light .project-meta,
.page-light .fact-row dt,
.page-light .footer-text { font-weight: 500; }


/* ============================================================
   SITO SCORREVOLE (pagina progetto Expì)
   La pagina resta ferma: scorre solo il contenuto della finestra.
   ============================================================ */
.site-preview { padding: 0 0 clamp(48px, 7vw, 90px); }

.browser-frame {
  position: relative;
  max-width: 940px;
  margin: 0 auto 0 0 ;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-raised);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}

.browser-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.browser-url {
  margin-left: 14px;
  font-family: var(--font-main);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.browser-viewport {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  overflow-y: auto;
  /* Blocca lo scorrimento laterale: la pagina dentro sta tutta in larghezza */
  overflow-x: hidden;
  /* Arrivato in fondo non trascina con sé la pagina */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.browser-viewport::-webkit-scrollbar { width: 8px; }
.browser-viewport::-webkit-scrollbar-track { background: transparent; }
.browser-viewport::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 10px;
}

.browser-page {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.browser-hint {
  margin-top: 14px;
  font-family: var(--font-main);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .browser-viewport { aspect-ratio: 16 / 9; height: auto; }
  .browser-frame { border-radius: 8px; max-width: 100%; }
  .browser-bar { padding: 8px 12px; }
}
