/* ==========================================================================
   NaiConnect — Stile Apple-style, minimal, high-end
   Font: Font Ufficiale NaiConnect (assets)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Font Ufficiale NaiConnect
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'NaiConnect';
  src: url('../assets/font-naiconnect/Semigrassetto.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NaiConnect';
  src: url('../assets/font-naiconnect/Medio.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NaiConnect';
  src: url('../assets/font-naiconnect/Grassetto.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Typography — NaiConnect + fallback */
  --font-sans: 'NaiConnect', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: var(--font-sans);
  --font-menu: 'NaiConnect', var(--font-sans);
  --font-body: 'NaiConnect', var(--font-sans);
  --font-title: 'NaiConnect', var(--font-sans);

  /* Spacing — ritmo ampio in stile Apple */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 8rem;
  --section-padding: clamp(4rem, 10vw, 8rem);

  /* Colors — palette neutra e raffinata */
  --color-bg: #fbfbfb;
  --color-bg-alt: #f5f5f7;
  --color-surface: #ffffff;
  --color-text: #1d1d1f;
  --color-text-muted: #6e6e73;
  --color-accent: #0071e3;
  --color-accent-hover: #0077ed;
  --color-border: rgba(0, 0, 0, 0.08);

  /* Motion */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.4s;
  --duration-slow: 0.6s;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 720px;
  --header-height: 5.25vh;
  --nav-gap: 3.5rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

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

/* --------------------------------------------------------------------------
   Header fisso — nero, vetro, full width, contenuto centrato (Apple)
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  will-change: transform;
  height: var(--header-height);
  max-height: 50px;
  min-height: 44px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.06);
  transition: background 0.4s ease,
              border-color 0.4s ease,
              box-shadow 0.4s ease;
}

[data-header-dark] .header {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.header--light {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.04);
}

.header--light .logo-img {
  filter: invert(1) opacity(0.8);
}

.header--light .logo:hover {
  opacity: 1;
}

.header--light .logo:hover .logo-img {
  filter: invert(1);
  opacity: 1;
}

.header--light .menu-toggle span {
  background: var(--color-text);
}

.header-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

@media (min-width: 900px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto auto 1fr;
    align-items: center;
    gap: 0;
    padding: 0 var(--space-lg);
  }

  .logo {
    grid-column: 2;
    transform: translateY(1px);
    margin-right: var(--nav-gap);
  }

  .header-inner .nav {
    grid-column: 3;
    position: static;
    transform: none;
  }

  .header-actions {
    grid-column: 4;
  }
}

.logo {
  display: inline-flex;
  align-items: center;
  color: #fff;
  transition: opacity 0.25s var(--ease-out);
}

.logo:hover {
  color: #fff;
  opacity: 0.75;
}

.logo:active,
.logo:focus,
.logo:visited {
  color: #fff;
  opacity: 1;
}

.logo-img {
  height: 1.35rem;
  width: auto;
  display: block;
  object-fit: contain;
  transition: opacity 0.25s var(--ease-out),
              filter 0.4s ease;
}

.logo:hover .logo-img {
  opacity: 0.75;
}

/* Nav centrale stile Apple — bianco, solo hover */
.nav {
  display: none;
}

@media (min-width: 900px) {
  .nav {
    display: block;
    flex: 0 1 auto;
  }

  .nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--nav-gap);
  }

  .nav-list a {
    font-family: var(--font-menu);
    font-weight: 600;
    padding: var(--space-xs) 0.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #fff;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.4s ease;
  }

  .nav-list a:hover {
    color: rgba(255, 255, 255, 0.75);
  }

  .nav-list a:active,
  .nav-list a:focus,
  .nav-list a:visited {
    color: #fff;
  }

  .nav-list a:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
  }

  .header--light .nav-list a,
  .header--light .nav-list a:active,
  .header--light .nav-list a:focus,
  .header--light .nav-list a:visited {
    color: #555;
  }

  .header--light .nav-list a:hover {
    color: #000;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

@media (min-width: 900px) {
  .header-actions {
    grid-column: 4;
    justify-self: end;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 980px;
  border: none;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              opacity var(--duration-fast) var(--ease-out);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

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

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

.btn-ghost:hover {
  background: rgba(0, 113, 227, 0.08);
  color: var(--color-accent-hover);
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--duration-normal) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out),
              background 0.4s ease;
}

@media (min-width: 900px) {
  .menu-toggle {
    display: none;
  }
}

/* Mobile nav */
.nav-mobile {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-surface);
  padding: var(--space-xl);
  overflow-y: auto;
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform var(--duration-normal) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out),
              visibility var(--duration-normal);
  z-index: 99;
}

.nav-mobile.is-open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

.nav-mobile-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-top: var(--space-xl);
}

.nav-mobile-list a {
  display: block;
  padding: var(--space-md);
  font-family: var(--font-menu);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Sezioni comuni
   -------------------------------------------------------------------------- */
.section {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.hero.section {
  padding-top: var(--header-height);
  padding-bottom: 0;
  margin-bottom: 10px;
}


.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

@media (min-width: 768px) {
  .section-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
  }

  .section-inner--reverse .product-content {
    order: 2;
  }

  .section-inner--reverse .product-media {
    order: 1;
  }
}

.section-title {
  font-family: var(--font-title);
  font-weight: 700;
  margin: 0 0 var(--space-md);
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.section-subtitle {
  margin: 0 0 var(--space-lg);
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 32ch;
}

/* Reveal on scroll — stato iniziale (prima dell’animazione) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

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

/* --------------------------------------------------------------------------
   Hero Orbis — 100vh, sfondo nero, bottoni sempre sopra
   -------------------------------------------------------------------------- */
.hero {
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #000;
  position: relative;
  cursor: pointer;
}

.hero-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-content {
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 2;
}
#orbis .hero-content {
  margin-top: 8rem;
  margin-bottom: -4rem;
}

.hero-title-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 0;
}

.hero-logo {
  height: clamp(5.5rem, 18vw, 10rem);
  width: auto;
  object-fit: contain;
  margin-left: -15px;
}

.hero-title {
  font-family: var(--font-title);
  font-weight: 700;
  margin: 0;
  font-size: clamp(3rem, 9vw, 5.5rem);
  letter-spacing: 0.02em;
  line-height: 1;
  color: #fff;
  text-box-trim: both;
  text-box-edge: cap alphabetic;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  position: relative;
  z-index: 3;
  margin-top: -1rem;
}

.hero-actions .btn {
  transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out);
}

.hero-actions .btn-primary:hover {
  background: #0077ed;
  color: #fff;
}

.hero-actions .btn-ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.hero-actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4), 0 0 20px rgba(255, 255, 255, 0.15);
}

.hero-media {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-image {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
}

.hero-screen {
  position: absolute;
  top: 21%;
  left: 12.5%;
  width: 75%;
  height: 41%;
  object-fit: cover;
  z-index: 2;
}

/* --------------------------------------------------------------------------
   Hero Jarvis — sfondo immagine
   -------------------------------------------------------------------------- */
.hero.hero--jarvis {
  height: 80vh;
  min-height: 80vh;
  background: #000 url('../assets/jarvis/homejarvis.png') center center / cover no-repeat;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: calc(var(--header-height) + clamp(2rem, 5vh, 10rem));
  margin-bottom: 0;
}

.hero--jarvis .hero-actions {
  margin-top: var(--space-sm);
}

/* --------------------------------------------------------------------------
   Griglia Prodotti (Ares, Pro, Lite, Fire)
   -------------------------------------------------------------------------- */
.products-grid-section {
  padding: 10px;
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

.product-card {
  background: #000 center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(1.5rem, 4vh, 3.5rem);
  aspect-ratio: 16 / 10;
  text-decoration: none;
  border-radius: 0;
}

.product-card-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.product-card-box .btn {
  margin-top: -0.5rem;
}

#ares { background-image: url('../assets/ares/ares.avif'); }
#pro  { background-image: url('../assets/pro/pro.avif'); }
#lite { background-image: url('../assets/lite/lite.avif'); }
#fire { background-image: url('../assets/fire/fire.avif'); }

.product-card-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 4rem);
  color: #fff;
  margin: 0;
}

/* --------------------------------------------------------------------------
   NaiCloud
   -------------------------------------------------------------------------- */
.section--cloud {
  background: #000;
  margin: 0 10px 10px 10px;
  padding: 0 var(--space-lg);
  height: 80vh;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cloud-devices {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 55%;
  height: 100%;
}

.cloud-imac-wrap {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 55%;
  z-index: 1;
}

.cloud-imac {
  width: 100%;
  display: block;
  position: relative;
  z-index: 1;
}

.cloud-imac-screen {
  position: absolute;
  top: 4%;
  left: 3%;
  width: 94%;
  height: 66%;
  object-fit: fill;
  z-index: 2;
}

.cloud-tablet-wrap {
  position: absolute;
  left: 38%;
  bottom: 4%;
  width: 30%;
  z-index: 2;
  transform: rotate(90deg) translateX(-100%);
  transform-origin: bottom left;
}

.cloud-tablet {
  width: 100%;
  display: block;
  position: relative;
  z-index: 1;
}

.cloud-tablet-screen {
  position: absolute;
  top: 45.2%;
  left: 44%;
  width: 120%;
  height: 54%;
  max-width: none;
  object-fit: fill;
  z-index: 2;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.cloud-iphone-wrap {
  position: absolute;
  left: 67%;
  bottom: 3%;
  width: 22%;
  z-index: 3;
}

.cloud-iphone {
  width: 100%;
  display: block;
  position: relative;
  z-index: 1;
}

.cloud-iphone-screen {
  position: absolute;
  top: 5.2%;
  left: 20%;
  width: 60%;
  height: 89.5%;
  max-width: none;
  object-fit: fill;
  z-index: 2;
  border-radius: clamp(8px, 2vw, 18px);
}

.section--cloud-box {
  position: relative;
  z-index: 4;
  text-align: center;
  margin-right: auto;
  margin-left: 10%;
}

.section--cloud .section-title {
  color: #fff;
  font-size: clamp(2rem, 5vw, 4rem);
}

.section--cloud .section-subtitle {
  color: rgba(255, 255, 255, 0.7);
}

.section--cloud .hero-actions {
  margin-top: var(--space-md);
}

@media (max-width: 768px) {
  .section--cloud {
    flex-direction: column;
    height: auto;
    min-height: auto;
    padding: var(--space-3xl) var(--space-lg) var(--space-xl);
  }

  .cloud-devices {
    position: relative;
    width: 100%;
    height: auto;
    right: auto;
    bottom: auto;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-top: var(--space-xl);
  }

  .cloud-imac-wrap {
    position: relative;
    left: auto;
    bottom: auto;
    width: 60%;
  }

  .cloud-tablet-wrap {
    position: relative;
    left: auto;
    bottom: auto;
    width: 25%;
    margin-left: -5%;
  }

  .cloud-iphone-wrap {
    position: relative;
    left: auto;
    bottom: auto;
    width: 18%;
    margin-left: -3%;
  }

  .section--cloud-box {
    margin-left: auto;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Sezione legale
   -------------------------------------------------------------------------- */
.legal-section {
  background: #f5f5f5;
}

.legal-inner {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.legal-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  text-align: left;
}

.legal-text {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  text-align: left;
}

main .legal-inner {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 2.5rem 3rem;
  border-bottom: none;
  margin-bottom: -4rem;
  max-width: 1100px;
}

main .legal-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #000;
}

.legal-text h2,
.legal-text h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #000;
  margin: 1.2rem 0 0.4rem;
}

.legal-text p {
  margin: 0 0 0.1rem;
}

.legal-text ul {
  list-style: disc;
  padding-left: 0;
  margin-left: 0;
}

.legal-text li {
  margin-bottom: 0.2rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  padding: 0;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--color-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 600px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-heading {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-sm);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.25rem;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-links a:hover {
  color: var(--color-text);
  text-decoration: none;
}

.footer-bottom {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-lg) 0 var(--space-xl);
  text-align: center;
}

.footer-contact {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-xs);
}

.footer-contact a {
  color: var(--color-accent);
  text-decoration: underline;
}

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

.footer-copy {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  margin: 0;
}

.footer-piva {
  color: var(--color-text);
}
