/* =====================================================================
   GBRemote — Public Web
   Fase 1: header + hero
   ===================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/Archivo-Variable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  /* colore */
  --ink: #030507;
  --graphite: #0d1116;
  --steel: #8b95a1;
  --mist: #c9d1da;
  --paper: #f5f8fb;
  --brand: #0a84ff;
  --brand-deep: #0b5fe0;

  /* tipografia */
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;

  /* unità hero: segue il più piccolo tra larghezza e altezza del viewport,
     così la composizione resta proporzionata al render a 1440×900 */
  --u: min(1vw, 1.6vh);

  --gutter: calc(var(--u) * 5.3);
  --header-h: calc(var(--u) * 7.6);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip-link:focus {
  transform: none;
}

/* ---------------------------------------------------------------------
   Pulsanti
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75em;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.35s var(--ease-out), border-color 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out), transform 0.35s var(--ease-out), color 0.35s;
}

.btn__arrow {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s var(--ease-out);
}
.btn:hover .btn__arrow {
  transform: translateX(3px);
}

.btn--light {
  background: #fff;
  color: #06080b;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4), 0 0 28px rgba(210, 228, 255, 0.28);
}
.btn--light:hover {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6), 0 0 42px rgba(210, 228, 255, 0.45);
}

.btn--ghost {
  background: rgba(6, 9, 12, 0.35);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #fff;
}

.btn--header {
  height: calc(var(--u) * 3);
  min-height: 40px;
  padding: 0 calc(var(--u) * 1.75);
  font-size: max(14px, calc(var(--u) * 1));
}

.btn--lg {
  height: calc(var(--u) * 3.4);
  min-height: 46px;
  padding: 0 calc(var(--u) * 2.5);
  font-size: max(15px, calc(var(--u) * 1.1));
}

.btn--video {
  padding-left: calc(var(--u) * 0.4);
  padding-right: calc(var(--u) * 2.1);
  gap: calc(var(--u) * 1.1);
}

.btn__play {
  display: grid;
  place-items: center;
  width: calc(var(--u) * 2.65);
  height: calc(var(--u) * 2.65);
  min-width: 36px;
  min-height: 36px;
  border: 1.5px solid #fff;
  border-radius: 50%;
}
.btn__play svg {
  width: 44%;
  height: 44%;
  margin-left: 8%;
  fill: #fff;
}
.btn--video:hover .btn__play {
  background: #fff;
}
.btn--video:hover .btn__play svg {
  fill: #06080b;
}

.btn--block {
  width: 100%;
  height: 54px;
  font-size: 16px;
}

/* ---------------------------------------------------------------------
   Header
   --------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}

.site-header__inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
  min-height: 72px;
  padding: calc(var(--u) * 0.6) var(--gutter) 0;
  transition: height 0.5s var(--ease-out), padding 0.5s var(--ease-out);
}

.brand {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 0.9);
  flex: none;
  margin-left: calc(var(--u) * -0.35);
}

.brand__mark {
  width: calc(var(--u) * 9.2);
  min-width: 78px;
  height: auto;
  transition: width 0.5s var(--ease-out);
}

.brand__word {
  width: calc(var(--u) * 13.6);
  min-width: 118px;
  height: auto;
  margin-top: calc(var(--u) * 0.45);
  transition: width 0.5s var(--ease-out);
}

.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  padding-left: calc(var(--u) * 3.4);
}

.main-nav ul {
  display: flex;
  gap: calc(var(--u) * 3.1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  position: relative;
  display: block;
  padding: 10px 0;
  font-size: max(14px, calc(var(--u) * 1.04));
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  transition: color 0.25s;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}
.main-nav a:hover {
  color: #fff;
}
.main-nav a:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
}

.mobile-nav[hidden] {
  display: none;
}

/* header compatto dopo lo scroll */
.site-header.is-scrolled {
  background: rgba(3, 5, 7, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}
.site-header.is-scrolled .site-header__inner {
  height: 72px;
  padding-top: 0;
}
.site-header.is-scrolled .brand__mark {
  width: 74px;
  min-width: 0;
}
.site-header.is-scrolled .brand__word {
  width: 112px;
  min-width: 0;
}

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  max-height: 1180px;
  overflow: hidden;
  background: var(--ink);
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: url("../img/hero/hero-environment.webp") 62% 50% / cover no-repeat;
  transform: scale(1.04);
  transform-origin: 62% 50%;
}

/* scena prodotto */
.hero-visual {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.hero-visual__canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}
.hero-visual.is-ready .hero-visual__canvas {
  opacity: 1;
}

.hero-visual__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
  opacity: 1;
  transition: opacity 0.8s;
}
.js .hero-visual__poster {
  opacity: 0;
}
.js .hero-visual.is-fallback .hero-visual__poster {
  opacity: 1;
}

/* ombra laterale per la leggibilità del testo sopra la scena */
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 5, 7, 0.78) 0%, rgba(3, 5, 7, 0.45) 26%, rgba(3, 5, 7, 0) 44%),
    linear-gradient(180deg, rgba(3, 5, 7, 0.55) 0%, rgba(3, 5, 7, 0) 16%),
    linear-gradient(0deg, rgba(3, 5, 7, 0.6) 0%, rgba(3, 5, 7, 0) 18%);
}

.hero__content {
  position: absolute;
  left: var(--gutter);
  top: calc(var(--u) * 16.1);
  width: calc(var(--u) * 40);
}

.hero__kicker {
  margin: 0 0 calc(var(--u) * 1.75);
  font-size: max(10px, calc(var(--u) * 0.8));
  font-weight: 500;
  font-stretch: 112%;
  letter-spacing: 0.56em;
  line-height: 1;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.hero__title {
  margin: 0;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.hero__line {
  display: block;
}
.hero__line > span {
  display: block;
}

.hero__line--thin {
  font-size: calc(var(--u) * 3.85);
  font-weight: 200;
  font-stretch: 125%;
  letter-spacing: -0.004em;
  line-height: 1.08;
  color: #fff;
  text-shadow: 0 0 22px rgba(170, 205, 255, 0.18);
}

.hero__line--bold {
  font-size: calc(var(--u) * 5.95);
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.012em;
  line-height: 0.96;
  color: #fff;
  text-shadow:
    0 0 2px rgba(255, 255, 255, 0.55),
    0 0 18px rgba(180, 212, 255, 0.5),
    0 0 46px rgba(40, 132, 255, 0.42);
}
.hero__line--thin + .hero__line--bold {
  margin-top: calc(var(--u) * 0.2);
}

.hero__claims {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(var(--u) * 33);
  margin: calc(var(--u) * 2.1) 0 0;
  font-size: max(10px, calc(var(--u) * 0.86));
  font-weight: 500;
  font-stretch: 110%;
  letter-spacing: 0.52em;
  line-height: 1;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}
.hero__claims > span:not(.hero__dot) {
  margin-right: -0.52em; /* annulla la spaziatura dopo l'ultima lettera: pallini centrati */
}
.hero__dot {
  letter-spacing: 0;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.8);
}

.hero__lead {
  margin: calc(var(--u) * 1.55) 0 0;
  max-width: 42ch;
  font-size: max(15px, calc(var(--u) * 1.13));
  font-weight: 400;
  line-height: 1.34;
  color: rgba(233, 238, 244, 0.9);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--u) * 1.75);
  margin-top: calc(var(--u) * 2);
}

.hero__pillars {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--u) * 3.6);
  display: flex;
  gap: calc(var(--u) * 2.7);
  margin: 0;
  padding: 0;
  list-style: none;
}
.hero__pillars li {
  padding: calc(var(--u) * 0.15) 0 calc(var(--u) * 0.15) calc(var(--u) * 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.6);
  font-size: max(10px, calc(var(--u) * 0.74));
  font-weight: 500;
  font-stretch: 105%;
  letter-spacing: 0.06em;
  line-height: 1.45;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  min-width: calc(var(--u) * 7.6);
}

.hero__rail {
  position: absolute;
  left: calc(100% - var(--u) * 11.2);
  margin: 0;
  padding-left: calc(var(--u) * 1.35);
  border-left: 1px solid rgba(255, 255, 255, 0.55);
  font-size: max(9px, calc(var(--u) * 0.72));
  font-weight: 500;
  font-stretch: 112%;
  letter-spacing: 0.34em;
  line-height: 1.9;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
}
.hero__rail--top {
  top: calc(var(--u) * 7.4);
  padding-block: calc(var(--u) * 0.4) calc(var(--u) * 2.2);
}
.hero__rail--bottom {
  bottom: calc(var(--u) * 3.4);
  left: calc(100% - var(--u) * 12.2);
  padding-block: calc(var(--u) * 0.6) calc(var(--u) * 0.6);
}

/* ---------------------------------------------------------------------
   Intro orchestrata (una sola sequenza al caricamento)
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  [data-intro] {
    animation: intro-fade 1.1s var(--ease-out) both;
  }
  .hero__line > span[data-intro] {
    animation: intro-rise 1.3s var(--ease-out) both;
  }
  [data-intro="1"] { animation-delay: 0.25s; }
  [data-intro="2"] { animation-delay: 0.35s; }
  [data-intro="3"] { animation-delay: 0.47s; }
  [data-intro="4"] { animation-delay: 0.59s; }
  [data-intro="5"] { animation-delay: 0.9s; }
  [data-intro="6"] { animation-delay: 1.0s; }
  [data-intro="7"] { animation-delay: 1.1s; }
  [data-intro="8"] { animation-delay: 1.35s; }
  [data-intro="9"] { animation-delay: 1.6s; }

  .hero__backdrop {
    animation: backdrop-settle 3.2s var(--ease-out) both;
  }
}

@keyframes intro-fade {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
/* reveal a maschera: la riga sale da sotto la propria linea di base;
   a fine animazione la maschera si allarga per non tagliare il bagliore */
@keyframes intro-rise {
  0% { transform: translateY(100%); clip-path: inset(-10% -10% 100% -10%); }
  99% { transform: none; clip-path: inset(-10% -10% 0 -10%); }
  100% { transform: none; clip-path: none; }
}
@keyframes backdrop-settle {
  from { transform: scale(1.1); opacity: 0.2; }
  to { transform: scale(1.04); opacity: 1; }
}

/* ---------------------------------------------------------------------
   Dialog video
   --------------------------------------------------------------------- */
.video-dialog {
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: #07090c;
  color: var(--paper);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
}
.video-dialog::backdrop {
  background: rgba(1, 2, 4, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.video-dialog__frame {
  position: relative;
  padding: 22px;
}
.video-dialog__title {
  margin: 0 56px 16px 4px;
  font-size: 15px;
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: 0.02em;
}
.video-dialog__media {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: radial-gradient(ellipse at 50% 40%, #121a26, #040506 70%);
  overflow: hidden;
}
.video-dialog__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-dialog__empty {
  max-width: 44ch;
  margin: 0;
  padding: 24px;
  text-align: center;
  color: var(--mist);
}
.video-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.video-dialog__close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* ---------------------------------------------------------------------
   Laptop 1280 e schermi desktop bassi
   --------------------------------------------------------------------- */
@media (max-width: 1320px) {
  .main-nav ul {
    gap: calc(var(--u) * 2.4);
  }
}

/* ---------------------------------------------------------------------
   Tablet (≤1100)
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
  :root {
    --u: min(1.25vw, 1.5vh);
    --gutter: 40px;
  }

  .main-nav,
  .btn--header {
    display: none;
  }

  .site-header__inner {
    justify-content: space-between;
    height: 88px;
    padding-top: 0;
  }
  .brand__mark { width: 88px; }
  .brand__word { width: 128px; }

  .nav-toggle {
    position: relative;
    display: grid;
    place-content: center;
    gap: 7px;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(3, 5, 7, 0.4);
    cursor: pointer;
  }
  .nav-toggle__bar {
    display: block;
    width: 18px;
    height: 1.5px;
    background: #fff;
    transition: transform 0.4s var(--ease-out);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
    transform: translateY(4.25px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
    transform: translateY(-4.25px) rotate(-45deg);
  }

  .mobile-nav {
    position: fixed;
    inset: 0;
    z-index: -1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 40px;
    padding: 120px var(--gutter) calc(40px + env(safe-area-inset-bottom));
    background: rgba(3, 5, 7, 0.96);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
  }
  .mobile-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .mobile-nav li + li {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .mobile-nav a:not(.btn) {
    display: block;
    padding: 16px 0;
    font-size: clamp(26px, 6.4vw, 40px);
    font-weight: 700;
    font-stretch: 125%;
    text-transform: uppercase;
    letter-spacing: -0.01em;
  }

  .hero {
    height: auto;
    min-height: 100svh;
    max-height: none;
    display: flex;
    flex-direction: column;
    padding: 120px var(--gutter) 40px;
  }

  .hero__content {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    max-width: 640px;
  }

  .hero__line--thin { font-size: clamp(34px, 5.4vw, 52px); }
  .hero__line--bold { font-size: clamp(52px, 8.4vw, 82px); }
  .hero__kicker { font-size: 11px; }
  .hero__claims {
    width: auto;
    max-width: 560px;
    font-size: 11px;
    letter-spacing: 0.4em;
    margin-top: 22px;
  }
  .hero__claims > span:not(.hero__dot) { margin-right: -0.4em; }
  .hero__lead { font-size: 17px; margin-top: 18px; }
  .hero__actions { margin-top: 26px; gap: 14px; }

  .hero-visual {
    position: relative;
    inset: auto;
    z-index: 0;
    order: 2;
    height: clamp(360px, 62vw, 620px);
    margin: -40px calc(var(--gutter) * -1) 0;
  }
  .hero__content { order: 1; z-index: 1; }
  .hero__pillars {
    position: relative;
    order: 3;
    left: auto;
    bottom: auto;
    margin-top: 8px;
    gap: 24px;
  }
  .hero__pillars li { font-size: 11px; padding-left: 12px; min-width: 0; }

  .hero__rail { display: none; }

  .hero__backdrop { background-position: 70% 60%; }
  .hero__shade {
    background:
      linear-gradient(180deg, rgba(3, 5, 7, 0.92) 0%, rgba(3, 5, 7, 0.7) 40%, rgba(3, 5, 7, 0.1) 62%, rgba(3, 5, 7, 0.55) 100%);
  }
}

/* ---------------------------------------------------------------------
   Mobile (≤ 600)
   --------------------------------------------------------------------- */
@media (max-width: 600px) {
  :root {
    --gutter: 22px;
  }
  .site-header__inner {
    height: 74px;
    min-height: 0;
  }
  .brand { gap: 8px; }
  .brand__mark { width: 70px; min-width: 0; }
  .brand__word { width: 104px; min-width: 0; margin-top: 2px; }
  .nav-toggle { width: 44px; height: 44px; }

  .hero { padding-top: 104px; padding-bottom: 32px; }

  .br-desktop { display: none; }

  .hero__kicker { letter-spacing: 0.46em; margin-bottom: 14px; }
  .hero__line--thin { font-size: clamp(27px, 8.3vw, 36px); }
  .hero__line--bold { font-size: clamp(44px, 13.4vw, 58px); }
  .hero__claims > span:not(.hero__dot) { margin-right: -0.28em; }
  .hero__claims {
    font-size: 9.5px;
    letter-spacing: 0.28em;
    justify-content: flex-start;
    gap: 0.6em;
    margin-top: 18px;
  }
  .hero__lead { font-size: 16px; line-height: 1.45; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; height: 54px; }
  .btn--video { justify-content: center; }

  .hero-visual {
    height: clamp(280px, 86vw, 400px);
    margin-top: 6px;
  }
  .hero__pillars {
    justify-content: space-between;
    gap: 10px;
  }
  .hero__pillars li { font-size: 10px; letter-spacing: 0.04em; padding-left: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
