:root {
    /* Palette brand */
    --color-kachi-iro:   #1f2b51;
    --color-platinum:    #f7f6f8;
    --color-slate:       #6b7381;
    --color-champagne:   #d4af37;
  
    --color-bg:          var(--color-kachi-iro);
    --color-surface:     #0b1020;
    --color-text:        var(--color-platinum);
    --color-text-muted:  var(--color-slate);
    --color-accent:      var(--color-champagne);
  
    /* Layout */
    --container-max: 1200px;
    --section-padding: clamp(3rem, 8vw, 6rem);
    /* Navbar fissa: offset per ancore (#section) — altezza logo 32px + padding + bordo */
    --header-offset: 3.75rem;
  
    /* Tipografia */
    --font-heading: "Syne", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }
  
  /* Resetta il minimo */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  
  html {
    scroll-padding-top: calc(var(--header-offset) + env(safe-area-inset-top, 0px));
  }

  body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--color-text);
    background: radial-gradient(circle at top, #243264 0, #050814 55%, #02030a 100%);
  }
  
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }
  
  a {
    color: inherit;
    text-decoration: none;
  }
  
  .skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    padding: 0.5rem 1rem;
    background: #000;
    color: #fff;
    z-index: 1000;
  }
  
  .skip-link:focus {
    left: 0.5rem;
    top: 0.5rem;
  }
  
  /* Layout generico */
  
  .container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 1.5rem;
  }
  
  .section {
    padding-block: var(--section-padding);
  }
  
  /* Header */
  
  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.62));
    border-bottom: 1px solid rgba(31, 43, 81, 0.16);
    backdrop-filter: blur(6px) saturate(1.12);
    -webkit-backdrop-filter: blur(6px) saturate(1.12);
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
  }

  .js .header {
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .js .header.is-visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  
  .header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 0.45rem;
  }
  
  .header__logo img {
    height: 32px;
  }

  .header__toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(31, 43, 81, 0.3);
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
  }

  .header__toggle-line {
    width: 18px;
    height: 2px;
    background: var(--color-kachi-iro);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  
  .header__nav {
    display: flex;
    gap: 1.75rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  
  .header__link {
    color: rgba(31, 43, 81, 0.72);
    position: relative;
  }
  
  .header__link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.3rem;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.2s ease;
  }
  
  .header__link:hover {
    color: var(--color-kachi-iro);
  }
  
  .header__link:hover::after {
    width: 100%;
  }

  .header__link:focus-visible,
  .btn:focus-visible,
  .header__toggle:focus-visible,
  .cta__field input:focus-visible,
  .cta__field textarea:focus-visible {
    outline: 2px solid rgba(212, 175, 55, 0.95);
    outline-offset: 2px;
  }
  
  .header__link--accent {
    color: var(--color-kachi-iro);
  }
  
  /* HERO */
  
  .hero {
    position: relative;
    padding-block: clamp(1.5rem, 4vh, 3.5rem);
    min-height: clamp(340px, 56vh, 620px);
    color: var(--color-text);
    overflow: hidden;
  }
  
  .hero__background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
  }

  .hero__background::before {
    content: "";
    position: absolute;
    inset: -8%;
    background-image: url("../assets/images/bg-gg.jpg");
    background-size: cover;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    will-change: transform;
    transform: translate3d(0, 0, 0) scale(1.08);
    animation: hero-kenburns 30s ease-in-out infinite alternate;
  }

  .hero__background-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

@keyframes hero-kenburns {
  0% {
    transform: translate3d(-1%, 0.6%, 0) scale(1.07);
  }
  100% {
    transform: translate3d(1%, -0.6%, 0) scale(1.11);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__background::before {
    animation: none;
    transform: translate3d(0, 0, 0) scale(1.08);
  }
}
  
  .hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
    pointer-events: none;
  }
  
  .hero__inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
  }

  .hero__brand {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .hero__logo-mark {
    display: block;
    width: clamp(180px, 26vw, 340px);
    max-width: 100%;
    margin: 0;
    filter: drop-shadow(0 8px 28px rgba(212, 175, 55, 0.5));
  }
  
  .hero__eyebrow {
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
  }
  
  .hero__title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2.4rem, 4.4vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: 0.02em;
    margin: 0 0 1rem;
  }

  .hero__title-line {
    display: block;
  }
  
  .hero__subtitle {
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--color-text-muted);
    max-width: 32rem;
    margin: 0 0 1.75rem;
  }
  
  .hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.6rem;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  }
  
  .btn--primary {
    background: var(--color-accent);
    color: #111;
    box-shadow: 0 12px 32px rgba(212, 175, 55, 0.35);
  }
  
  .btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 42px rgba(212, 175, 55, 0.5);
  }
  
  .btn--ghost {
    background: transparent;
    color: var(--color-text);
    border-color: rgba(247, 246, 248, 0.2);
  }
  
  .btn--ghost:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
  }
  
  /* TECHNOLOGY */
  
  .section__title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin: 0 0 0.75rem;
  }
  
  .section__subtitle {
    font-size: 0.98rem;
    color: var(--color-text-muted);
    max-width: 34rem;
    margin: 0 0 2rem;
  }
  
  .technology {
    background: radial-gradient(circle at top, #10193a 0, #050814 60%, #02020a 100%);
  }

  .technology__inner {
    padding-top: 50px;
  }
  
  .technology__grid {
    display: grid;
    gap: 1.5rem;
  }

  .technology__logo {
    display: block;
    width: clamp(120px, 16vw, 200px);
    margin: 0 auto 1rem;
    opacity: 0.85;
  }
  
  .technology__item {
    padding: 1.4rem 1.5rem;
    border-radius: 1rem;
    background: rgba(5, 8, 20, 0.9);
    border: 1px solid rgba(247, 246, 248, 0.08);
  }
  
  .technology__item h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
  }
  
  .technology__item p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text-muted);
  }
  
  /* CRAFT */
  
  .craft {
    background: var(--color-platinum);
    color: var(--color-kachi-iro);
  }
  
  .craft__inner {
    max-width: 900px;
    margin-inline: auto;
    display: flex;
    justify-content: center;
  }

  .craft__text {
    text-align: center;
    max-width: 760px;
    margin-inline: auto;
  }

  .craft__logo {
    width: clamp(170px, 24vw, 300px);
    margin: 0 auto 1.2rem;
    display: block;
  }
  
  .craft .section__title {
    color: var(--color-kachi-iro);
  }
  
  .craft .section__body {
    color: var(--color-slate);
    font-size: 1rem;
    line-height: 1.8;
  }
  
  /* CTA */
  
  .cta {
    background: radial-gradient(circle at top, rgba(212, 175, 55, 0.15), #050814 55%, #020109 100%);
    text-align: center;
  }
  
  .cta__title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin: 0 0 0.75rem;
  }
  
  .cta__subtitle {
    font-size: 1rem;
    color: var(--color-text-muted);
    max-width: 32rem;
    margin: 0 auto 1.75rem;
  }
  
  .cta__form {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 1.4rem;
    border-radius: 1rem;
    border: 1px solid rgba(247, 246, 248, 0.16);
    background: rgba(8, 12, 28, 0.72);
    backdrop-filter: blur(8px);
    display: grid;
    gap: 0.85rem;
    text-align: left;
  }

.cta__form-status {
  min-height: 1.25rem;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

.cta__form-status[data-type="success"] {
  color: rgba(142, 255, 188, 0.95);
}

.cta__form-status[data-type="error"] {
  color: rgba(255, 164, 164, 0.95);
}

.cta__field--hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cta__form .cf-turnstile {
  margin-top: 0.25rem;
}

  .cta__field {
    display: grid;
    gap: 0.35rem;
  }

  .cta__field label {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
  }

  .cta__field input,
  .cta__field textarea {
    width: 100%;
    border: 1px solid rgba(247, 246, 248, 0.2);
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text);
    font: inherit;
    padding: 0.75rem 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .cta__field input::placeholder,
  .cta__field textarea::placeholder {
    color: rgba(247, 246, 248, 0.5);
  }

  .cta__field input:focus,
  .cta__field textarea:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.75);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
  }

  .cta__submit {
    justify-self: start;
    margin-top: 0.35rem;
  }
  
  /* FOOTER */
  
  .footer {
    padding-block: 1.5rem;
    background: #020309;
    border-top: 1px solid rgba(247, 246, 248, 0.08);
    font-size: 0.8rem;
    color: var(--color-text-muted);
  }
  
  .footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }
  
  .footer__nav {
    display: flex;
    gap: 1rem;
  }
  
  /* RESPONSIVE */
  
  @media (max-width: 768px) {
    .header__toggle {
      display: inline-flex;
    }

    .header.is-menu-open .header__toggle-line:nth-child(1) {
      transform: translateY(7px) rotate(45deg);
    }

    .header.is-menu-open .header__toggle-line:nth-child(2) {
      opacity: 0;
    }

    .header.is-menu-open .header__toggle-line:nth-child(3) {
      transform: translateY(-7px) rotate(-45deg);
    }

    .header__nav {
      position: absolute;
      top: calc(100% + 0.4rem);
      right: 1.5rem;
      left: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 0.9rem;
      padding: 1rem;
      border-radius: 0.9rem;
      border: 1px solid rgba(31, 43, 81, 0.16);
      background: rgba(255, 255, 255, 0.84);
      backdrop-filter: blur(10px) saturate(1.12);
      -webkit-backdrop-filter: blur(10px) saturate(1.12);
      opacity: 0;
      pointer-events: none;
      transform: translateY(-6px);
      transition: opacity 0.22s ease, transform 0.22s ease;
      z-index: 30;
    }

    .header.is-menu-open .header__nav {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }
  
    .hero__inner {
      grid-template-columns: minmax(0, 1fr);
      text-align: center;
      gap: 1rem;
    }

    .hero__brand {
      order: -1;
    }

    .hero__logo-mark {
      width: clamp(150px, 44vw, 220px);
      margin-inline: auto;
    }

    .hero__subtitle {
      margin-inline: auto;
    }

    .hero__actions {
      justify-content: center;
    }
  
    .technology__grid {
      grid-template-columns: minmax(0, 1fr);
    }

    .cta__form {
      padding: 1rem;
    }

    .cta__submit {
      justify-self: center;
      width: 100%;
      max-width: 280px;
    }
  
  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 769px) {
  .header__toggle {
    display: none;
  }

  .technology__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- GSAP: stati iniziali (evita flash prima che lo script parta) ---------- */
.gsap-reveal {
  opacity: 0;
  transform: translateY(40px);
}

.reduce-motion .gsap-reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* ---------- Hero scroll hint ---------- */
.hero__scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  /* Sopra overlay (1) e contenuto hero (2), solo decorativa */
  z-index: 3;
  width: 28px;
  height: 44px;
  border: 2px solid rgba(247, 246, 248, 0.35);
  border-radius: 999px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10px;
  pointer-events: none;
}

.hero__scroll-hint-icon {
  width: 4px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 2px;
  animation: scroll-hint-bounce 2s ease-in-out infinite;
}

@keyframes scroll-hint-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(6px); opacity: 0.6; }
}

/* ---------- Products section ---------- */
.products {
  background: radial-gradient(circle at top, #0d1228 0, #050814 55%, #02020a 100%);
}

.products__grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 1.5rem;
}

.product-card {
  background: rgba(5, 8, 20, 0.85);
  border: 1px solid rgba(247, 246, 248, 0.08);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.product-card:hover {
  border-color: rgba(212, 175, 55, 0.35);
  transform: translateY(-2px);
}

.product-card__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}

.product-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

.product-card__viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid rgba(247, 246, 248, 0.08);
  background:
    radial-gradient(circle at 30% 20%, rgba(212, 175, 55, 0.28), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(247, 246, 248, 0.24), transparent 64%),
    rgba(34, 46, 78, 0.95);
}

.product-card__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* ---------- Craft: centered responsive ---------- */
@media (max-width: 768px) {
  .craft__logo {
    width: clamp(140px, 42vw, 220px);
  }
}

/* ---------- Mobile portrait: blocchi a piena altezza viewport (UX) ---------- */
@media (max-width: 768px) and (orientation: portrait) {
  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-block: clamp(1rem, 3vh, 2.5rem);
    padding-bottom: max(clamp(1rem, 3vh, 2.5rem), env(safe-area-inset-bottom, 0px));
  }

  .hero__inner {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
  }

  #products .products__grid {
    gap: 0;
    margin-top: 1rem;
  }

  #products .product-card {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
  }

  #products .product-card__viewer {
    flex: 0 0 auto;
    width: min(100%, 88vw, 58vh);
    max-width: 100%;
    aspect-ratio: 1;
    margin-inline: auto;
    margin-bottom: 0.75rem;
  }

  #products .product-card__desc {
    margin-bottom: 0;
  }

  #technology.technology.section {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: clamp(1rem, 3vh, 2rem);
    padding-bottom: max(clamp(1rem, 3vh, 2rem), env(safe-area-inset-bottom, 0px));
  }

  #technology .technology__inner {
    padding-top: 0;
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
  }

  #cta.cta.section {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: clamp(1.25rem, 4vh, 2.5rem);
    padding-bottom: max(clamp(1.25rem, 4vh, 2.5rem), env(safe-area-inset-bottom, 0px));
  }

  #cta .cta__inner {
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
  }
}