/* ==========================================================================
   VELTRI STUDIO — foglio di stile
   Indice: 1 Variabili · 2 Base · 3 Layout · 4 Componenti · 5 Header
           6 Hero · 7 Sezioni · 8 Footer · 9 Animazioni · 10 Responsive
   ========================================================================== */

/* 1. VARIABILI ----------------------------------------------------------- */
:root {
  --black: #0B0B0D;
  --black-2: #141417;
  --white: #F7F7F5;
  --grey: #B6B6BC;
  --grey-dim: #8E8E96;
  --silver: #D9D9DE;
  --line: rgba(217, 217, 222, 0.16);
  --line-strong: rgba(217, 217, 222, 0.32);

  --font: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4.5rem, 10vw, 8rem);
  --radius: 6px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 2. BASE ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nav-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

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

::selection { background: var(--white); color: var(--black); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.7rem 1rem;
  background: var(--white);
  color: var(--black);
  font-weight: 600;
  border-radius: var(--radius);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* 3. LAYOUT -------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section-alt {
  background: var(--black-2);
  border-block: 1px solid var(--line);
}

.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 6vw, 4rem); }

/* 4. COMPONENTI ---------------------------------------------------------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--grey);
}

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.5rem, 6.2vw, 4.75rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); letter-spacing: -0.03em; }
h3 { font-size: 1.3rem; line-height: 1.25; }

.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--grey); max-width: 38rem; }
.section-intro { margin-top: 1.25rem; color: var(--grey); max-width: 38rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.875rem; margin-top: 2.25rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--white); color: var(--black); }
.btn-primary:hover { background: var(--silver); }

.btn-ghost { border-color: var(--line-strong); color: var(--white); }
.btn-ghost:hover { border-color: var(--white); background: rgba(247, 247, 245, 0.06); }

.projects-intro .btn { margin-top: 2rem; }

/* 5. HEADER -------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
/* Lo sfondo sfocato sta in un pseudo-elemento: backdrop-filter sull'header
   renderebbe il menu mobile (position: fixed) relativo all'header stesso */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(11, 11, 13, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: background-color 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header.is-scrolled::before { background: rgba(11, 11, 13, 0.92); }

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Logo tipografico */
.logo, .logo-footer { display: inline-flex; align-items: baseline; gap: 0.6rem; line-height: 1; }
.logo-name { font-weight: 800; font-size: 1.2rem; letter-spacing: 0.22em; }
.logo-sep { width: 1.25rem; height: 1px; background: var(--grey); align-self: center; }
.logo-sub { font-weight: 500; font-size: 0.78rem; letter-spacing: 0.34em; color: var(--grey); }

.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav ul { display: flex; gap: 1.75rem; }
.main-nav ul a {
  position: relative;
  padding-block: 0.4rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--grey);
  transition: color 0.2s var(--ease);
}
.main-nav ul a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--white);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.main-nav ul a:hover, .main-nav ul a.is-active { color: var(--white); }
.main-nav ul a:hover::after, .main-nav ul a.is-active::after { transform: scaleX(1); }

.nav-cta { min-height: 42px; padding: 0.55rem 1.2rem; font-size: 0.88rem; }

.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
}
.menu-toggle-bar {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 1.5px;
  background: var(--white);
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.menu-toggle-bar:nth-child(1) { top: 17px; }
.menu-toggle-bar:nth-child(2) { top: 24px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) { top: 20.5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) { top: 20.5px; transform: rotate(-45deg); }

/* 6. HERO ---------------------------------------------------------------- */
.hero {
  padding-top: calc(var(--header-h) + clamp(3rem, 8vw, 6rem));
  padding-bottom: clamp(4rem, 9vw, 7rem);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero-copy h1 { margin-bottom: 1.75rem; }

/* Composizione di finestre */
.hero-visual { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 520px; margin-inline: auto; }

.hero-grid-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 72%);
}

.win {
  position: absolute;
  z-index: 1;
  background: var(--black-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}
.win-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}
.win-bar i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--grey-dim); }
.win-url { flex: 1; height: 10px; margin-left: 10px; border-radius: 5px; background: rgba(217, 217, 222, 0.1); }
.win-body { padding: 18px; display: grid; gap: 10px; }

.win-main { top: 6%; left: 0; width: 78%; animation: float 9s ease-in-out infinite; }
.win-menu { bottom: 4%; right: 0; width: 50%; background: var(--black); animation: float 9s ease-in-out -3s infinite; }
.win-qr {
  top: 2%; right: 4%;
  width: 22%;
  aspect-ratio: 1;
  display: block;
  padding: clamp(8px, 2.4vw, 14px);
  background: var(--white);
  border-color: var(--white);
  animation: float 9s ease-in-out -6s infinite;
}
.qr-glyph { width: 100%; height: auto; stroke: var(--black); stroke-width: 3; fill: none; }
.qr-glyph .fill { fill: var(--black); stroke: none; }

.ph { display: block; border-radius: 3px; background: rgba(217, 217, 222, 0.14); }
.ph-title { height: 22px; width: 70%; background: var(--silver); border-radius: 3px; }
.ph-line { height: 8px; }
.ph-line.strong { background: var(--silver); }
.w20 { width: 20%; } .w40 { width: 40%; } .w50 { width: 50%; }
.w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; }
.ph-row { display: flex; gap: 8px; margin-top: 6px; }
.ph-btn { height: 22px; width: 74px; border-radius: 999px; border: 1px solid var(--line-strong); }
.ph-btn.solid { background: var(--white); border-color: var(--white); }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.ph-tile { aspect-ratio: 4 / 3; border-radius: 4px; border: 1px solid var(--line); background: rgba(217, 217, 222, 0.05); }
.ph-item { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); }

/* 7. SEZIONI ------------------------------------------------------------- */
/* Servizi */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }

.card {
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: var(--black-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); }

.icon {
  width: 40px; height: 40px;
  margin-bottom: 1.75rem;
  fill: none;
  stroke: var(--silver);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card h3 { margin-bottom: 0.9rem; }
.card > p { color: var(--grey); font-size: 1rem; }

.checklist { margin: 1.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--line); display: grid; gap: 0.6rem; }
.checklist li { position: relative; padding-left: 1.5rem; font-size: 0.95rem; color: var(--silver); line-height: 1.5; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.5em;
  width: 0.7rem; height: 1px;
  background: var(--white);
}
.card-note { margin-top: auto; padding-top: 1.5rem; font-size: 0.85rem; color: var(--grey-dim); line-height: 1.5; }

/* Metodo */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.step { padding: 2rem 1.75rem 0.5rem 0; }
.step + .step { padding-left: 1.75rem; border-left: 1px solid var(--line); }
.step-num { display: block; margin-bottom: 2.5rem; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.2em; color: var(--grey); }
.step h3 { margin-bottom: 0.8rem; }
.step p { color: var(--grey); font-size: 0.98rem; }

/* Studio */
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.studio-text { display: grid; gap: 1.4rem; color: var(--grey); font-size: 1.1rem; }
.studio-text p:first-child { color: var(--white); font-size: 1.25rem; }

/* Competenze */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.skills li {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: space-between;
  min-height: 150px;
  padding: 1.5rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  transition: background-color 0.3s var(--ease);
}
.skills li:hover { background: rgba(247, 247, 245, 0.04); }
.skill-idx { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.2em; color: var(--grey-dim); }

/* Progetti */
.projects-intro { max-width: 46rem; padding: clamp(2rem, 5vw, 3.5rem); border: 1px solid var(--line); border-radius: 10px; }
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.project-card a { display: block; }
.project-card img { width: 100%; height: auto; border-radius: 8px; margin-bottom: 1rem; border: 1px solid var(--line); }
.project-card h3 { margin-bottom: 0.4rem; }
.project-card p { color: var(--grey); font-size: 0.95rem; }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.faq-list { border-top: 1px solid var(--line-strong); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  position: relative;
  padding: 1.4rem 3rem 1.4rem 0;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before, .faq-list summary::after {
  content: "";
  position: absolute;
  right: 4px; top: 50%;
  width: 14px; height: 1.5px;
  background: var(--white);
  transition: transform 0.3s var(--ease);
}
.faq-list summary::after { transform: rotate(90deg); }
.faq-list details[open] summary::after { transform: rotate(0deg); }
.faq-list summary:hover { color: var(--silver); }
.faq-list details p { padding: 0 3rem 1.6rem 0; color: var(--grey); }

/* Contatti */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(2rem, 6vw, 6rem); align-items: end; }
.contact-details { display: grid; gap: 0; border-top: 1px solid var(--line-strong); }
.contact-details > div { padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.contact-details dt { margin-bottom: 0.35rem; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--grey-dim); }
.contact-details dd { font-size: clamp(1.1rem, 2.2vw, 1.4rem); font-weight: 600; overflow-wrap: anywhere; }
.contact-details a { border-bottom: 1px solid var(--line-strong); transition: border-color 0.2s var(--ease); }
.contact-details a:hover { border-color: var(--white); }

/* 8. FOOTER -------------------------------------------------------------- */
.site-footer { padding-top: clamp(3rem, 6vw, 4.5rem); border-top: 1px solid var(--line); background: var(--black); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2.5rem; padding-bottom: 3rem; }
.logo-footer { margin-bottom: 1rem; }
.payoff { font-size: 0.78rem; letter-spacing: 0.22em; color: var(--grey); }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 0.6rem 1.75rem; }
.footer-nav a { font-size: 0.92rem; color: var(--grey); transition: color 0.2s var(--ease); }
.footer-nav a:hover { color: var(--white); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--grey-dim);
}
.legal-links { display: flex; gap: 1.25rem; }
.legal-links[hidden] { display: none; }
.legal-links a:hover { color: var(--white); }

/* 9. ANIMAZIONI ---------------------------------------------------------- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Il contenuto resta visibile se JavaScript non è attivo */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* 10. RESPONSIVE --------------------------------------------------------- */
@media (max-width: 1024px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(3) { padding-left: 0; border-left: 0; }
  .step:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 1.5rem; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  :root { --header-h: 64px; }

  .menu-toggle { display: block; }

  .main-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2rem;
    padding: 2rem var(--gutter) 2.5rem;
    background: var(--black);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0.3s;
  }
  .main-nav.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .main-nav ul { flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
  .main-nav ul li { border-bottom: 1px solid var(--line); }
  .main-nav ul a { display: block; padding: 1.1rem 0; font-size: 1.3rem; font-weight: 600; color: var(--white); }
  .main-nav ul a::after { display: none; }
  .nav-cta { width: 100%; min-height: 52px; }

  .hero-grid, .studio-grid, .faq-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { max-width: 440px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .logo-name { font-size: 1.05rem; letter-spacing: 0.18em; }
  .logo-sep { width: 0.75rem; }
  .logo-sub { font-size: 0.7rem; letter-spacing: 0.26em; }

  .btn-row .btn { width: 100%; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step, .step + .step { padding: 1.75rem 0 0.5rem; border-left: 0; }
  .step + .step { border-top: 1px solid var(--line); margin-top: 1rem; }
  .step-num { margin-bottom: 1.25rem; }
  .skills { grid-template-columns: minmax(0, 1fr); }
  .skills li { min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; gap: 1.25rem; padding: 1.25rem; }
  .faq-list summary, .faq-list details p { padding-right: 2rem; }
  .win-body { padding: 12px; gap: 8px; }
}
