/* Virtalia - foglio di stile del sito (home, privacy, termini) */

:root {
  --paper: #f3f3f0;
  --surface: #ffffff;
  --ink: #1d1d1b;
  --ink-2: #4a4a46;
  --ink-3: #6f6f69;
  --line: #d8d8d2;
  --line-strong: #1d1d1b;
  --orange: #f28c00;
  --orange-deep: #d97706;
  --shard-1: #a9a9a4;
  --shard-2: #6f6f6b;
  --night: #1d1d1b;
  --night-2: #2b2b2b;
  --night-line: #3d3d3a;
  --night-text: #c9c9c3;

  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;

  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
}
.skip:focus { left: 0; }

.label {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Intestazione ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

.logo {
  display: inline-flex;
  color: var(--logo-ink, var(--ink));
  text-decoration: none;
  flex-shrink: 0;
}
.logo svg { height: 34px; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.site-nav a {
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 0;
  background: linear-gradient(var(--orange), var(--orange)) left bottom / 0 2px no-repeat;
  transition: background-size .2s ease;
}
.site-nav a:hover { background-size: 100% 2px; }

.lang {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ink-3);
  padding-left: 28px;
  border-left: 1px solid var(--line);
}
.site-nav .lang a { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--ink-3); }
.site-nav .lang a:hover { color: var(--ink); }
.lang [aria-current] { color: var(--ink); font-weight: 700; }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  background: none;
  border: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-toggle span,
.menu-toggle span::before {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform .2s ease;
}
.menu-toggle span { position: relative; transform: translateY(-4px); }
.menu-toggle span::before { content: ""; position: absolute; top: 8px; left: 0; }
.menu-toggle[aria-expanded="true"] span { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span::before { transform: translateY(-8px) rotate(-90deg); }

/* ---------- Pulsanti ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-solid { background: var(--solid, var(--ink)); border-color: var(--solid, var(--ink)); color: #fff; }
.btn-solid:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }

.btn-accent { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.btn-accent:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.btn-small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: default; pointer-events: none; }

.text-link {
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  background: linear-gradient(var(--ink), var(--ink)) left calc(100% - 12px) / 100% 1.5px no-repeat;
}
.text-link:hover { background-image: linear-gradient(var(--orange), var(--orange)); }
.text-link svg { width: 14px; height: 14px; }

/* ---------- Apertura ---------- */

.hero { padding: clamp(40px, 7vw, 88px) 0 0; overflow: hidden; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: end;
}

.hero-copy { padding-bottom: clamp(48px, 7vw, 96px); }

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.5rem, 6.2vw, 5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.035em;
  text-wrap: balance;
  margin-top: 20px;
}
.hero h1 .dot { color: var(--orange); }

.hero-lede {
  margin-top: 28px;
  max-width: 34em;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--ink-2);
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
}

.skyline { position: relative; align-self: end; }
.skyline svg { width: 100%; height: auto; overflow: visible; }
.skyline a { cursor: pointer; }
.skyline polygon { transition: fill .15s ease; }
.skyline .s1 { fill: var(--shard-1); }
.skyline .s2 { fill: var(--shard-2); }
.skyline .s3 { fill: var(--orange); }
.skyline .s4 { fill: var(--orange-deep); }
.skyline a:hover polygon, .skyline a:focus-visible polygon { fill: var(--ink); }
.skyline text {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  fill: var(--ink-3);
}
.skyline a:hover text { fill: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .js .skyline polygon {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: rise .7s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(var(--i) * 70ms + 100ms);
  }
  @keyframes rise {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
  }
}

.hero-rule { border-top: 1.5px solid var(--line-strong); }

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.facts li {
  padding: 18px 20px 20px 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.facts li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.facts strong {
  display: block;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.02em;
  text-transform: none;
  color: var(--ink);
  margin-bottom: 2px;
}

/* ---------- Sezioni ---------- */

.section { padding: clamp(72px, 10vw, 136px) 0 0; }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(20px, 5vw, 72px);
  align-items: end;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.section-head h2 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.03em;
  text-wrap: balance;
  margin-top: 14px;
}
.section-head p { color: var(--ink-2); max-width: 30em; }

/* Indice dei prodotti */

.index { border-top: 1.5px solid var(--line-strong); }
.index a {
  display: grid;
  grid-template-columns: 56px minmax(0, 220px) minmax(0, 1fr) auto 20px;
  gap: 20px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color .15s ease, padding .15s ease;
}
.index a:hover { background: var(--surface); padding-left: 12px; padding-right: 12px; }
.index .n { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.index .name {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.index .what { color: var(--ink-2); font-size: 16px; }
.index .os {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: right;
}
.index .arrow { align-self: center; width: 16px; height: 16px; color: var(--ink-3); transition: transform .15s ease, color .15s ease; }
.index a:hover .arrow { color: var(--orange-deep); transform: translateY(3px); }

/* Schede prodotto */

.products { margin-top: clamp(64px, 9vw, 120px); }

.product {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(36px, 5vw, 64px) 0;
  border-top: 1.5px solid var(--line-strong);
}

.product-id { position: relative; }
.product-id .n {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-id .n::before {
  content: "";
  width: 9px;
  height: 18px;
  background: var(--orange);
  clip-path: polygon(0 100%, 55% 100%, 100% 0, 45% 22%);
}
.product h3 {
  font-family: var(--display);
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.035em;
  margin-top: 14px;
  overflow-wrap: anywhere;
}
.product .tagline {
  margin-top: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  max-width: 20em;
}
.product .os {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.product-body > p { color: var(--ink-2); max-width: 38em; }

.features {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
  border-top: 1px solid var(--line);
}
.features li {
  position: relative;
  padding: 12px 0 12px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.45;
}
.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  width: 7px;
  height: 12px;
  background: var(--orange);
  clip-path: polygon(0 100%, 55% 100%, 100% 0, 45% 22%);
}

.product-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
}

/* ---------- Contatti e piè di pagina ---------- */

.night {
  margin-top: clamp(24px, 4vw, 56px);
  background: var(--night);
  color: #fff;
}

.contact { padding: clamp(64px, 9vw, 120px) 0; }
.contact .label { color: var(--night-text); }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
}
.contact h2 {
  font-family: var(--display);
  font-size: clamp(2.1rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -.035em;
  text-wrap: balance;
  margin-top: 14px;
}
.contact p { color: var(--night-text); max-width: 28em; }
.mail {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
  text-decoration: none;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--orange);
  transition: color .15s ease;
}
.mail:hover { color: var(--orange); }

.site-footer { border-top: 1px solid var(--night-line); padding: 48px 0 32px; }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr);
  gap: 40px clamp(24px, 5vw, 72px);
}
.site-footer .logo { color: #fff; }
.site-footer .logo svg { height: 30px; }
.footer-about p { margin-top: 16px; color: var(--night-text); font-size: 15px; max-width: 24em; }
.site-footer h4 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--night-muted, #8f8f89);
  margin-bottom: 14px;
}
.footer-list { columns: 2; column-gap: 24px; }
.footer-list.single { columns: 1; }
.footer-list li { break-inside: avoid; }
.footer-list a {
  display: inline-block;
  padding: 5px 0;
  font-size: 15px;
  color: var(--night-text);
  text-decoration: none;
}
.footer-list a:hover { color: #fff; }
.footer-legal {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--night-line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--night-muted, #8f8f89);
}

/* ---------- Finestra di download ---------- */

.modal {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 10px 10px 0 rgba(29, 29, 27, .18);
}
.modal::backdrop { background: rgba(29, 29, 27, .55); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 14px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-close {
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close svg { width: 16px; height: 16px; }
.modal-close:hover { color: var(--orange-deep); }
.modal-body { padding: 24px; }
.modal h3 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
}
.modal .sub { margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.modal label { display: block; margin-top: 22px; font-weight: 600; }
.modal label b { font-family: var(--mono); font-size: 1.1em; }
.modal input {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 8px;
  padding: 0 14px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 18px;
}
.modal input:focus-visible { outline-offset: 1px; }
.modal .error { margin-top: 10px; color: #b3261e; font-size: 14px; font-weight: 600; }
.modal .row { margin-top: 20px; display: flex; gap: 10px; }
.modal .row .btn-accent { flex: 1; }
.modal .note { margin-top: 16px; font-size: 13px; color: var(--ink-3); }
.modal [hidden] { display: none; }

/* ---------- Comparsa allo scorrimento ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
  .js .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Pagine legali ---------- */

.legal main { padding: clamp(40px, 7vw, 88px) 0 0; }
.legal .container {
  max-width: calc(760px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.legal .site-header .container,
.legal .night .container {
  max-width: var(--wrap);
}
.legal .site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}
.legal h1 {
  font-family: var(--display);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.035em;
}
.legal .agg {
  margin: 16px 0 40px;
  padding-bottom: 20px;
  border-bottom: 1.5px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.legal main h2 {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 40px 0 10px;
}
.legal main p, .legal main li { color: var(--ink-2); }
.legal main p + p { margin-top: 12px; }
.legal main ul { margin-top: 8px; }
.legal main li { position: relative; padding: 6px 0 6px 20px; }
.legal main li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 7px;
  height: 12px;
  background: var(--orange);
  clip-path: polygon(0 100%, 55% 100%, 100% 0, 45% 22%);
}
.legal main strong { color: var(--ink); }
.legal main a { color: var(--ink); text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.legal main a:hover { color: var(--orange-deep); }
.legal code { font-family: var(--mono); font-size: .9em; background: var(--surface); border: 1px solid var(--line); padding: 1px 5px; }
.legal .night { margin-top: clamp(56px, 8vw, 104px); }
.legal .site-header { border-bottom-color: var(--line); }
.legal .site-nav a { white-space: nowrap; }
.legal .site-footer { border-top: 0; padding: 28px 0; }
.legal .footer-legal { margin-top: 0; padding-top: 0; border-top: 0; }
.legal .footer-legal a { color: var(--night-text); text-decoration: none; }
.legal .footer-legal a:hover { color: #fff; }

/* ---------- Schermi stretti ---------- */

@media (max-width: 900px) {
  .hero-grid, .section-head, .product, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { align-items: start; }
  .hero-copy { padding-bottom: 0; }
  .skyline { max-width: 420px; margin-top: 8px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts li:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .index a { grid-template-columns: 36px minmax(0, 1fr) 16px; gap: 4px 12px; }
  .index .what { grid-column: 2; grid-row: 2; font-size: 15px; }
  .index .os { grid-column: 2; grid-row: 3; text-align: left; margin-top: 4px; }
  .index .arrow { grid-column: 3; grid-row: 1; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .site-header .wrap, .legal .site-header .container { height: 64px; }
  .logo svg { height: 30px; }
  .menu-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--paper);
    border-bottom: 1.5px solid var(--line-strong);
  }
  .site-nav.is-open { display: flex; }
  .site-nav > a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; background: none; }
  .lang { padding: 18px 0 0; border-left: 0; }
  .site-nav .lang a, .lang span { font-size: 14px; padding: 8px 4px; }
  .legal .site-nav { display: flex; position: static; flex-direction: row; padding: 0; border: 0; gap: 18px; }
  .legal .site-nav > a { padding: 6px 0; border: 0; font-size: 14px; }
  .features { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .legal .site-nav > a:first-child { display: none; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .btn { width: 100%; }
  .modal .row { flex-direction: column-reverse; }
}

@media print {
  .site-header, .skyline, .menu-toggle, #virtalia-cookie-banner { display: none !important; }
  .night { background: none; color: var(--ink); }
}
