/* ============================================
   FOTOCANDO — Stylesheet
   Design: "Notte in quota" — scuro, accento azzurro cielo + ambra (Step 4, colori presi dalle foto)
   ============================================ */

/* ---------- Accessibilità: skip-link + focus + reduced motion ---------- */
.skip-link {
  position: absolute;
  top: -200px;
  left: 8px;
  z-index: 9999;
  background: var(--accent);
  color: var(--bg);
  padding: 12px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 8px;
  outline: none;
}

/* Focus visible: outline ghiaccio al posto del default blu del browser */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Disattiva (quasi) tutte le animazioni per chi le ha disabilitate nel SO */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* ---------- Variabili design ---------- */
:root {
  --bg: #0c1117;              /* notte in quota: nero bluastro */
  --bg-elev: #141b23;
  --bg-elev-2: #1b2430;
  --fg: #e9eef2;              /* bianco neve, leggermente freddo */
  --fg-muted: #9aa8b4;
  --fg-dim: #718090;
  --accent: #5eb0ea;          /* azzurro cielo, preso dalle foto */
  --accent-dim: #3082c2;
  --accent-warm: #f2a65a;     /* ambra dei tramonti: solo numeri e piccoli dettagli */
  --line: #25303b;
  --line-strong: #34424f;

  /* Display = Archivo in versione "larga" (font-stretch 125%), leggero */
  --ff-display: 'Archivo', system-ui, sans-serif;
  --display-stretch: 125%;
  --display-weight: 300;
  --ff-body: 'Archivo', system-ui, sans-serif;
  --ff-mono: 'JetBrains Mono', ui-monospace, monospace;

  --max-w: 1440px;
  --pad-x: clamp(20px, 5vw, 80px);

  --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Body ---------- */
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  letter-spacing: 0.005em;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

button {
  font-family: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

/* ---------- Tipografia ---------- */
h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-stretch: var(--display-stretch);
  font-weight: var(--display-weight);
  line-height: 1;
  letter-spacing: -0.02em;
}

.h-display {
  font-size: clamp(2.6rem, 7vw, 6.5rem);
}

.h-1 {
  font-size: clamp(2rem, 4.6vw, 3.75rem);
}

.h-2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.h-3 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.lead {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--fg-muted);
  max-width: 60ch;
  line-height: 1.6;
}

.eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.section {
  padding: clamp(60px, 10vw, 140px) 0;
}

/* ============================================
   HEADER / NAV
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 24px var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, rgba(12,17,23,0.8), transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background var(--transition), padding var(--transition);
}

.site-header.scrolled {
  background: rgba(12,17,23,0.95);
  padding: 16px var(--pad-x);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
}

/* Logo: otturatore a linea + wordmark "FOTOCANDO" in Archivo largo.
   Markup diretto nelle pagine (niente più SVG iniettato dal JS). */
.brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--accent);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* (la rotazione al passaggio del mouse era pensata per l'otturatore: tolta col logo montagna) */

.brand-word {
  font-family: var(--ff-display);
  font-stretch: var(--display-stretch);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  color: var(--fg);
}

.brand { gap: 14px; height: 44px; }
.site-header.scrolled .brand { height: 36px; }

.nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-list {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-list a {
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  position: relative;
  padding: 4px 0;
}

.nav-list a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--fg);
}

.nav-list a:hover::after,
.nav-list a.active::after {
  width: 100%;
}

/* Lang switch */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line-strong);
  padding: 4px;
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
}

.lang-switch button {
  padding: 4px 8px;
  color: var(--fg-dim);
  text-transform: uppercase;
  transition: all var(--transition);
}

.lang-switch button.active {
  background: var(--accent);
  color: var(--bg);
}

/* Switch lingua come link (pagine /it/ e /en/) */
.lang-switch a {
  padding: 4px 8px;
  color: var(--fg-dim);
  text-transform: uppercase;
  transition: all var(--transition);
}
.lang-switch a.active {
  background: var(--accent);
  color: var(--bg);
}

/* Burger menu mobile */
.burger {
  display: none;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  transition: all var(--transition);
}

.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================
   HERO (home)
   ============================================ */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  padding: 140px var(--pad-x) 72px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: var(--bg-elev);
}

/* Sfondo del hero: oggi un'illustrazione di creste (segnaposto),
   domani la tua foto — vedi il commento in index.html */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media svg,
.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Quale parte della foto resta visibile quando lo schermo la ritaglia
   (sul telefono si vede solo una striscia verticale): qui il rider è a sinistra, poco sopra il centro */
.hero-media img { object-position: 31% 40%; }

/* Velo scuro in basso: tiene leggibile il titolo anche su foto chiare (neve!) */
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12,17,23,0.95) 0%, rgba(12,17,23,0.82) 28%, rgba(12,17,23,0.5) 48%, rgba(12,17,23,0.12) 66%, rgba(12,17,23,0) 78%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 64px;
  align-items: end;
  position: relative;
  z-index: 2;
}

.hero-grid > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero-title {
  font-size: clamp(2.6rem, 6.2vw, 6.25rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.hero-title .accent {
  color: var(--accent);
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-self: end;
}

.hero-meta .lead {
  color: #c5d0d8;
}

.hero-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-meta-row span:first-child { color: var(--fg-muted); }
.hero-meta-row a { color: var(--accent); }
.hero-meta-row a:hover { color: var(--fg); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-meta-row span:last-child { color: var(--fg); }

/* Leggibilità del testo sopra le foto del hero (neve e cielo chiari):
   scritte piccole in bianco con ombra morbida, accento schiarito */
.hero .eyebrow {
  color: #f2f6f9;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.75), 0 0 14px rgba(0,0,0,0.55);
}
.hero .eyebrow::before { background: #8cc8f2; height: 2px; box-shadow: 0 0 6px rgba(0,0,0,0.5); }
.hero-title { text-shadow: 0 2px 28px rgba(0,0,0,0.35); }
.hero-title .accent { color: #7cc0f0; }
.hero-meta .lead { color: #e6ecf1; text-shadow: 0 1px 2px rgba(0,0,0,0.6), 0 0 18px rgba(0,0,0,0.4); }
.hero-meta-row { border-top-color: rgba(255,255,255,0.16); text-shadow: 0 1px 2px rgba(0,0,0,0.7); }
.hero-meta-row span:first-child { color: #c9d3db; }
.hero-meta-row a { color: #8cc8f2; font-weight: 600; }

.hero-credit {
  position: absolute;
  top: 120px;
  right: var(--pad-x);
  z-index: 2;
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border: 1px solid var(--line);
  padding: 8px 12px;
}

/* Grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* ============================================
   CATEGORIE preview (home)
   ============================================ */
.categories {
  position: relative;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 60px;
  flex-wrap: wrap;
  gap: 24px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.cat-card {
  position: relative;
  aspect-ratio: 20/21;
  overflow: hidden;
  background: var(--bg-elev);
  cursor: pointer;
  display: block;
}

.cat-card-img {
  position: absolute;
  inset: 0;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cat-card-img svg,
.cat-card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cat-card:hover .cat-card-img {
  transform: scale(1.04);
}

.cat-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12,17,23,0.85) 0%, rgba(12,17,23,0.2) 45%, transparent 100%);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 2;
}

.cat-placeholder {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.cat-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.cat-num {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--accent-warm);
}

.cat-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cat-title {
  font-family: var(--ff-display);
  font-stretch: var(--display-stretch);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.cat-sub {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c5d0d8;
}

/* Motorsport: fascia più piccola, in secondo piano */
.cat-strip {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 3fr 9fr;
  gap: 40px;
  align-items: center;
  background: var(--bg-elev);
  padding: 20px;
  transition: background var(--transition);
}

.cat-strip:hover { background: var(--bg-elev-2); }

.cat-strip picture { display: block; }

.cat-strip img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.cat-strip-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-right: 20px;
  flex-wrap: wrap;
}

.cat-strip .cat-title { font-size: clamp(1.4rem, 2.4vw, 2.25rem); }

.cat-strip-note {
  color: var(--fg-muted);
  font-size: 1rem;
}

/* ============================================
   ABOUT teaser (home)
   ============================================ */
.about-teaser {
  position: relative;
  background: var(--bg);
}

.about-teaser-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 80px;
  align-items: start;
}

.about-teaser-img {
  aspect-ratio: 4/5;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-elev), var(--bg-elev-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  text-transform: uppercase;
  position: relative;
}

.about-teaser-img img,
.about-teaser-img picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-teaser-img::before {
  content: "";
  z-index: 1;
  position: absolute;
  top: -12px;
  left: -12px;
  width: 60px;
  height: 60px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}

.about-teaser-img::after {
  content: "";
  z-index: 1;
  position: absolute;
  bottom: -12px;
  right: -12px;
  width: 60px;
  height: 60px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

.about-teaser-content > * + * {
  margin-top: 32px;
}

.about-teaser-content h2 {
  font-size: clamp(2rem, 3.6vw, 3rem);
}

.about-teaser-content .quote {
  font-size: 1.4rem;
  font-style: italic;
  line-height: 1.4;
  padding-left: 24px;
  border-left: 2px solid var(--accent);
  color: var(--fg);
  font-family: var(--ff-body);
  font-weight: 300;
}

/* ============================================
   CHIUSURA / Scrivimi
   ============================================ */
.cta-section {
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.cta-grid {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 64px;
  align-items: end;
}

.cta-grid > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.cta-section h2 {
  font-size: clamp(2.2rem, 5.2vw, 4.75rem);
  line-height: 1;
}

.cta-section h2 .accent {
  color: var(--accent);
}

.cta-section .lead {
  color: #c5d0d8;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 36px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "→";
  font-size: 1.1rem;
  transition: transform var(--transition);
}

.btn:hover {
  background: transparent;
  color: var(--accent);
}

.btn:hover::after {
  transform: translateX(6px);
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--bg);
  padding: 80px var(--pad-x) 32px;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

.footer-brand .brand {
  height: auto;
  margin-bottom: 12px;
}

.footer-brand .brand-mark { width: 36px; height: 36px; }
.footer-brand .brand-word { font-size: 1.25rem; }

.footer-tagline {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: var(--fg-dim);
  margin-bottom: 16px;
}

.footer-brand p {
  color: var(--fg-muted);
  max-width: 35ch;
}

.footer-col h4 {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 20px;
  text-transform: uppercase;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--fg-dim);
  text-transform: uppercase;
  flex-wrap: wrap;
  gap: 16px;
}

/* ============================================
   PORTFOLIO page
   ============================================ */
.page-hero {
  padding: 180px var(--pad-x) 80px;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  margin-top: 16px;
}

.page-hero .lead {
  margin-top: 32px;
}

.portfolio-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.portfolio-tab {
  padding: 16px 32px;
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}

.portfolio-tab:hover { color: var(--fg); }

.portfolio-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.gallery-item {
  background: var(--bg-elev);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  text-transform: uppercase;
  transition: transform var(--transition);
}

.gallery-item:hover {
  transform: translateY(-4px);
}

.gallery-item::before {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-elev), var(--bg-elev-2));
}

/* Quando c'è una foto vera dentro la tile, il placeholder grigio sparisce
   e la foto riempie tutto lo spazio (rispettando l'aspect ratio della tile). */
.gallery-item:has(img)::before { display: none; }
.gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Layout asimmetrico moodboard */
.gallery-item.size-tall    { grid-column: span 4; aspect-ratio: 3/4; }
.gallery-item.size-wide    { grid-column: span 8; aspect-ratio: 16/9; }
.gallery-item.size-square  { grid-column: span 6; aspect-ratio: 1/1; }
.gallery-item.size-large   { grid-column: span 7; aspect-ratio: 4/3; }
.gallery-item.size-small   { grid-column: span 5; aspect-ratio: 3/2; }
.gallery-item.size-portrait{ grid-column: span 4; aspect-ratio: 2/3; }
.gallery-item.size-full    { grid-column: span 12; aspect-ratio: 21/9; }
.gallery-item.size-half    { grid-column: span 6; aspect-ratio: 3/2; }  /* metà larghezza, formato foto naturale — griglia 2×2 ordinata */

/* Galleria "a righe giustificate": ogni foto tiene le sue proporzioni (niente ritagli),
   le righe si riempiono in ordine e hanno tutte la stessa altezza.
   Ogni .gallery-item porta il suo rapporto larghezza/altezza in style="--r: 1.5". */
.gallery-justified {
  --h: 300px;                 /* altezza "ideale" di una riga */
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gallery-justified::after {   /* impedisce all'ultima riga di allargarsi a dismisura */
  content: "";
  flex-grow: 999999;
}

.gallery-justified .gallery-item {
  flex-grow: var(--r);
  flex-basis: calc(var(--r) * var(--h));
  aspect-ratio: var(--r);
  grid-column: auto;
}

.gallery-justified .gallery-item:hover { transform: none; }
.gallery-justified .gallery-item img { transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease; }
.gallery-justified .gallery-item:hover img { transform: scale(1.03); }

@media (max-width: 1024px) {
  .gallery-justified { --h: 220px; gap: 8px; }
}

@media (max-width: 720px) {
  .gallery-justified .gallery-item {
    flex-basis: 100% !important;
    aspect-ratio: var(--r) !important;
    grid-column: auto !important;
  }
}

.gallery-section {
  display: none;
}

.gallery-section.active {
  display: block;
}

/* ============================================
   BIO page
   ============================================ */
.bio-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 100px;
  align-items: start;
}

.bio-portrait {
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, var(--bg-elev), var(--bg-elev-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  text-transform: uppercase;
  position: sticky;
  top: 120px;
}

.bio-portrait { overflow: hidden; }
.bio-portrait picture,
.bio-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Segnaposto ritratto: riquadro scuro con il marchio al centro.
   Quando arriva la foto di Gianluca: sostituire il <div class="portrait-placeholder"> con <picture>/<img>. */
.portrait-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  color: var(--line-strong);
}

.portrait-placeholder svg {
  width: 22%;
  max-width: 120px;
  height: auto;
}

.bio-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.bio-block h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  margin-bottom: 24px;
}

.bio-block p {
  color: var(--fg-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 60ch;
}

.bio-block p strong {
  color: var(--fg);
  font-weight: 600;
}

/* Stats / numeri */
.bio-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.bio-stat-num {
  font-family: var(--ff-display);
  font-stretch: var(--display-stretch);
  font-weight: 300;
  font-size: 3rem;
  color: var(--accent-warm);
  line-height: 1;
}

.bio-stat-lbl {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--fg-muted);
  text-transform: uppercase;
  margin-top: 8px;
}

.bio-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bio-list li {
  padding-left: 24px;
  position: relative;
  color: var(--fg-muted);
  line-height: 1.6;
}

.bio-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 12px;
  height: 1px;
  background: var(--accent);
}

/* Lista attrezzatura con icone a linea (corpo macchina / obiettivo) */
.gear-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 0;
}
.gear-list li::before { display: none; }
.gear-ico {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--accent);
}

/* ============================================
   SERVIZI page
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-top: 40px;
}

.service-card {
  background: var(--bg-elev);
  padding: 48px 40px;
  position: relative;
  transition: background var(--transition);
  display: flex;
  flex-direction: column;
  gap: 20px;
  border: 1px solid transparent;
}

.service-card:hover {
  background: var(--bg-elev-2);
  border-color: var(--line-strong);
}

.service-num {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.service-card h3 {
  font-size: 2rem;
  line-height: 1;
}

.service-card p {
  color: var(--fg-muted);
  line-height: 1.6;
}

.service-card .service-list {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-card .service-list li {
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  color: var(--fg);
  padding-left: 20px;
  position: relative;
}

.service-card .service-list li::before {
  content: "+";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.not-doing {
  margin-top: 80px;
  padding: 48px;
  border: 1px dashed var(--line-strong);
  text-align: center;
}

.not-doing h4 {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.not-doing p {
  color: var(--fg-muted);
  max-width: 60ch;
  margin: 0 auto;
}

/* ============================================
   CONTATTI page
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 80px;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.contact-block .eyebrow {
  margin-bottom: 12px;
}

.contact-block h3 {
  font-family: var(--ff-display);
  font-size: 2rem;
  color: var(--fg);
}

.contact-block a {
  color: var(--accent);
  font-family: var(--ff-mono);
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.contact-block a:hover {
  color: var(--fg);
}

.contact-form {
  background: var(--bg-elev);
  padding: 48px;
  border: 1px solid var(--line);
}

.form-row {
  margin-bottom: 28px;
}

.form-row label {
  display: block;
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--fg-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  padding: 12px 0;
  color: var(--fg);
  font-family: var(--ff-body);
  font-size: 1rem;
  transition: border-color var(--transition);
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.form-row textarea {
  resize: vertical;
  min-height: 120px;
  border: 1px solid var(--line-strong);
  padding: 16px;
}

.form-row textarea:focus {
  border-color: var(--accent);
}

/* ============================================
   LIGHTBOX (portfolio)
   ============================================ */
.no-scroll { overflow: hidden; }

/* L'item della gallery che contiene una foto reale è cliccabile */
.gallery-item:has(img) { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 16px;
  padding: 80px clamp(24px, 6vw, 96px) 32px;
  background: rgba(12, 17, 23, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.lightbox-counter {
  color: var(--accent-warm);
  flex-shrink: 0;
}

.lightbox-caption:empty { display: none; }
.lightbox-caption {
  text-align: right;
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  background: rgba(12, 17, 23, 0.6);
  color: var(--fg);
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  z-index: 2;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(12, 17, 23, 0.85);
  outline: none;
}

.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev  { left: 24px;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 24px; top: 50%; transform: translateY(-50%); }

@media (max-width: 720px) {
  .lightbox { padding: 64px 16px 16px; }
  .lightbox-close { top: 16px; right: 16px; width: 40px; height: 40px; }
  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 72px;
    transform: none;
    width: 40px;
    height: 40px;
  }
  .lightbox-prev { left: 16px; }
  .lightbox-next { right: 16px; }
  .lightbox-bar  { font-size: 0.7rem; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox { transition: none; }
}

/* ============================================
   ANIMAZIONI ENTRY
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease, transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .hero-grid,
  .cta-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .cat-strip {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .about-teaser-grid,
  .bio-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .bio-portrait {
    position: relative;
    top: 0;
    max-width: 500px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  /* Gallery — semplifico su tablet */
  .gallery-item.size-tall,
  .gallery-item.size-square,
  .gallery-item.size-large,
  .gallery-item.size-small,
  .gallery-item.size-portrait {
    grid-column: span 6;
  }

  .gallery-item.size-wide,
  .gallery-item.size-full {
    grid-column: span 12;
  }
}

@media (max-width: 720px) {
  .nav-list {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 40px var(--pad-x);
    gap: 24px;
    border-bottom: 1px solid var(--line);
  }

  .nav-list.open {
    display: flex;
  }

  .burger {
    display: flex;
  }

  .cat-grid {
    grid-template-columns: 1fr;
  }

  .hero-credit {
    top: 84px;
  }

  /* Telefono: foto verticale di Laax, rider in alto a destra sopra il titolo */
  .hero-media img { object-position: 85% 0%; }

  /* Su telefono il testo occupa metà schermo: velo più alto e deciso */
  .hero-media::after {
    background: linear-gradient(to top, rgba(12,17,23,0.96) 0%, rgba(12,17,23,0.88) 38%, rgba(12,17,23,0.7) 50%, rgba(12,17,23,0.3) 58%, rgba(12,17,23,0) 68%);
  }

  .hero-title {
    font-size: clamp(2.3rem, 11vw, 3.4rem);
  }

  .brand-word { font-size: 0.9rem; letter-spacing: 0.18em; }
  .brand-mark { width: 24px; height: 24px; }

  .bio-stats {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .gallery-item {
    grid-column: span 12 !important;
    aspect-ratio: 4/3 !important;
  }

  .portfolio-tab {
    padding: 12px 18px;
    font-size: 0.7rem;
  }

  .contact-form {
    padding: 32px 24px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Print-friendly fallback */
@media print {
  .site-header, .site-footer, .grain { display: none; }
  body { background: white; color: black; }
}

/* ============================================
   REVISIONE DESIGN 02/10 — motto, scelte, mobile
   ============================================ */

/* Hero: pulsanti sotto il titolo */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-actions .btn-ghost {
  background: rgba(12,17,23,0.35);
  border-color: rgba(233,238,242,0.35);
  color: var(--fg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hero-actions .btn-ghost:hover { border-color: var(--fg); }

/* Scelte in home: stessa griglia della galleria, un po' più alta */
.picks .gallery-justified { --h: 330px; }
.picks .gallery-justified::after { display: none; } /* qui anche l'ultima riga va a tutta larghezza */
.picks .section-header { margin-bottom: 48px; }

/* Card categorie: numeri e testi leggibili anche sulla neve */
.cat-card-overlay {
  background: linear-gradient(to top, rgba(12,17,23,0.92) 0%, rgba(12,17,23,0.6) 32%, rgba(12,17,23,0.12) 62%, transparent 100%);
}
.cat-card .cat-num,
.cat-card .cat-title,
.cat-card .cat-sub { text-shadow: 0 1px 2px rgba(0,0,0,0.6), 0 0 16px rgba(0,0,0,0.35); }

/* Footer: il motto grande, a tutta larghezza */
.footer-motto {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.3em;
  margin: 0 0 72px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
  font-family: var(--ff-display);
  font-stretch: var(--display-stretch);
  font-weight: 300;
  font-size: 5.7vw;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--fg);
  white-space: nowrap;
}
.footer-motto .dot { color: var(--accent); }

/* Etichette sopra i titoli della bio uguali al resto del sito */
.bio-block p.eyebrow {
  font-size: 0.75rem;
  line-height: normal;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 16px;
  max-width: none;
}

/* Voce Instagram: solo nel menu del telefono */
.nav-extra { display: none; }

@media (max-width: 720px) {
  /* Aree toccabili da almeno 44 px */
  .burger { width: 44px; height: 44px; align-items: center; margin-right: -10px; }
  .lang-switch { padding: 2px; }
  .lang-switch button,
  .lang-switch a {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Menu a tutto schermo con voci grandi */
  .nav-list {
    top: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    padding: 110px var(--pad-x) 40px;
    gap: 0;
    z-index: -1;
    background: var(--bg);
    border-bottom: 0;
  }
  .nav-list li { border-bottom: 1px solid var(--line); }
  .nav-list a {
    display: block;
    padding: 18px 0;
    font-family: var(--ff-display);
    font-stretch: var(--display-stretch);
    font-weight: 300;
    font-size: 2rem;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--fg);
  }
  .nav-list a::after { display: none; }
  .nav-list a.active { color: var(--accent); }
  .nav-list .nav-extra { display: block; border-bottom: 0; margin-top: auto; }
  .nav-list .nav-extra a {
    font-family: var(--ff-mono);
    font-stretch: normal;
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--fg-muted);
  }

  /* Hero: niente righe Based/Follow, spazio ai pulsanti */
  .hero-meta > div:last-child { display: none; }
  .hero-actions { flex-wrap: nowrap; gap: 10px; }
  .hero-actions .btn { padding: 15px 16px; font-size: 0.72rem; letter-spacing: 0.12em; gap: 10px; }

  /* Scelte su telefono: righe miste da 1 e 2 foto, più dinamiche */
  .picks .gallery-justified { --h: 150px; }
  .picks .gallery-justified .gallery-item { flex-basis: calc(var(--r) * var(--h)) !important; }

  /* Galleria: le foto arrivano subito */
  .page-hero { padding: 104px var(--pad-x) 20px; border-bottom: 0; }
  .page-hero .h-display { font-size: clamp(2.4rem, 12vw, 3.2rem); }
  .page-hero .lead { display: none; }
  .portfolio-tabs {
    position: sticky;
    top: 64px;
    z-index: 50;
    background: var(--bg);
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 calc(-1 * var(--pad-x)) 20px;
    padding: 0 var(--pad-x);
  }
  .portfolio-tabs::-webkit-scrollbar { display: none; }
  .portfolio-tab { padding: 16px 14px; white-space: nowrap; flex: none; }
  .portfolio-tab:first-child { padding-left: 0; }

  .footer-motto { margin-bottom: 48px; padding-bottom: 32px; }
}

@media (max-width: 380px) {
  .picks .gallery-justified { --h: 135px; }
  .brand-word { font-size: 0.78rem; letter-spacing: 0.14em; }
  .nav { gap: 10px; }
}
