/* ==========================================================================
   Display: base typography + Header, Navbar, Logo, Menu hamburger, Footer
   Includere in tutte le pagine insieme a style.css
   Fuori dalle query: solo stili DESKTOP (default).
   Le varie view (tablet/mobile) sono definite dentro le rispettive media query.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@300;400;500;600;700;800&display=swap');

@font-face {
  font-family: 'Host Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/npm/@fontsource/host-grotesk@5.2.5/files/host-grotesk-latin-400-normal.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/npm/@fontsource/host-grotesk@5.2.5/files/host-grotesk-latin-400-normal.woff') format('woff');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: 'Noto Sans Mono', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, monospace, sans-serif;
}

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

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ==========================================================================
   DESKTOP – Header + navbar
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.header-inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-brand {
  font-family: 'Host Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ffffff;
}

.site-logo {
  height: 78px;
  width: auto;
  margin-top: 6px;
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffffff;
  transition: color 0.18s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--color-accent),
    var(--color-secondary)
  );
  transition: width 0.18s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #ffffff;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 100%;
}

.nav-link-home:hover,
.nav-link-home:focus-visible {
  color: transparent;
}

.nav-link-home {
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.9rem;
  background: linear-gradient(
    120deg,
    var(--color-accent),
    var(--color-secondary),
    var(--color-magenta)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 22px rgba(59, 130, 246, 0.55);
}

.nav-link-home::after {
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-accent),
    var(--color-secondary),
    var(--color-magenta)
  );
}

/* Link attivo (pagina corrente) */
.nav-link-active,
.mobile-nav-link-active {
  font-weight: 700;
  letter-spacing: 0.28em;
  font-size: 0.9rem;
  background: linear-gradient(
    120deg,
    var(--color-accent),
    var(--color-secondary),
    var(--color-magenta)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 22px rgba(59, 130, 246, 0.55);
}

.nav-link-active::after,
.mobile-nav-link-active::after {
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-accent),
    var(--color-secondary),
    var(--color-magenta)
  );
}

.nav-link-active:hover,
.nav-link-active:focus-visible,
.mobile-nav-link-active:hover,
.mobile-nav-link-active:focus-visible {
  color: transparent;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.nav-toggle-line {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  transition: transform 0.18s ease, opacity 0.18s ease, width 0.18s ease;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.nav-toggle:active {
  transform: scale(0.97);
}

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

.nav-toggle.is-open .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

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

/* Desktop: menu hamburger (drawer + backdrop) nascosto, si vede solo la navbar */
.mobile-menu-backdrop,
.mobile-menu-drawer {
  display: none;
}

/* ==========================================================================
   DESKTOP – Footer
   ========================================================================== */

.site-footer {
  border-top: 0px solid rgba(148, 163, 184, 0.4);
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0.9)
  );
  padding: 1.75rem 1.5rem 1.9rem;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.footer-line {
  margin: 0.1rem 0;
}

.footer-links a {
  color: var(--color-text-main);
  position: relative;
  padding: 0 0.1rem;
  transition: color 0.18s ease;
}

.footer-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15rem;
  width: 0;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--color-accent),
    var(--color-secondary)
  );
  transition: width 0.18s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: #e5e7eb;
}

.footer-links a:hover::after,
.footer-links a:focus-visible::after {
  width: 100%;
}

.footer-separator {
  margin: 0 0.3rem;
  color: rgba(148, 163, 184, 0.7);
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1rem;
}

.footer-social-link {
  color: #ffffff;
  transition: opacity 0.2s ease;
}

.footer-social-link:hover,
.footer-social-link:focus-visible {
  opacity: 0.75;
}

.footer-social-link svg {
  display: block;
}

/* ==========================================================================
   MEDIA QUERIES – View tablet e mobile (solo override rispetto al desktop)
   ========================================================================== */

/* Tablet portrait (769px–1024px, verticale) */
@media (max-width: 1024px) and (min-width: 769px) and (orientation: portrait) {
  .header-inner {
    padding-inline: 1.25rem;
  }

  .site-logo {
    height: 48px;
  }

  .logo-brand {
    font-size: 0.95rem;
    letter-spacing: 0.15em;
  }

  .nav-list {
    gap: 1.4rem;
  }
}

/* Tablet landscape (769px–1366px, orizzontale) */
@media (max-width: 1366px) and (min-width: 769px) and (orientation: landscape) {
  .header-inner {
    padding-inline: 1.25rem;
  }

  .site-logo {
    height: 48px;
  }

  .logo-brand {
    font-size: 0.95rem;
    letter-spacing: 0.15em;
  }

  .nav-list {
    gap: 1.4rem;
  }
}

/* Mobile landscape (481px–768px, orizzontale) */
@media (max-width: 768px) and (min-width: 481px) and (orientation: landscape) {
  body.nav-open {
    overflow: hidden;
  }

  .site-nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 18;
  }

  .mobile-menu-drawer {
    display: block;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-12px);
    width: calc(100% - 2.5rem);
    max-width: 280px;
    max-height: calc(100vh - 2rem);
    background: #000000;
    border: 1px solid rgba(99, 102, 241, 0.8);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 19;
    overflow: hidden;
  }

  .mobile-menu-drawer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.75rem 1.5rem 1.5rem;
  }

  .mobile-menu-drawer nav {
    width: 100%;
    margin-bottom: 1.25rem;
  }

  .mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
  }

  .mobile-nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.18s ease, opacity 0.18s ease;
  }

  .mobile-nav-link:hover,
  .mobile-nav-link:focus-visible {
    color: #ffffff;
    opacity: 0.9;
  }

  .mobile-nav-link-home {
    font-weight: 700;
    letter-spacing: 0.28em;
    font-size: 0.9rem;
    background: linear-gradient(
      120deg,
      var(--color-accent),
      var(--color-secondary),
      var(--color-magenta)
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 22px rgba(59, 130, 246, 0.55);
  }

  .mobile-nav-link-home:hover,
  .mobile-nav-link-home:focus-visible {
    color: transparent;
  }

  .mobile-menu-close {
    padding: 0.55rem 1.5rem;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.8);
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.1s ease;
  }

  .mobile-menu-close:hover,
  .mobile-menu-close:focus-visible {
    border-color: rgba(96, 165, 250, 0.95);
    background: rgba(30, 41, 59, 0.95);
  }

  .mobile-menu-close:active {
    transform: scale(0.98);
  }

  .nav-open .mobile-menu-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .nav-open .mobile-menu-drawer {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) translateY(0);
  }
}

/* Mobile portrait (fino a 480px, verticale) */
@media (max-width: 480px) and (orientation: portrait) {
  :root {
    --header-height: 78px;
  }

  body.nav-open {
    overflow: hidden;
  }

  .site-nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .header-inner {
    padding-inline: 1rem;
  }

  .site-logo {
    height: 44px;
  }

  .logo-brand {
    font-size: 0.85rem;
    letter-spacing: 0.12em;
  }

  .footer-inner {
    font-size: 0.84rem;
  }

  .mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 18;
  }

  .mobile-menu-drawer {
    display: block;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-12px);
    width: calc(100% - 2.5rem);
    max-width: 280px;
    max-height: calc(100vh - 2rem);
    background: #000000;
    border: 1px solid rgba(99, 102, 241, 0.8);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 19;
    overflow: hidden;
  }

  .mobile-menu-drawer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.75rem 1.5rem 1.5rem;
  }

  .mobile-menu-drawer nav {
    width: 100%;
    margin-bottom: 1.25rem;
  }

  .mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
  }

  .mobile-nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.18s ease, opacity 0.18s ease;
  }

  .mobile-nav-link:hover,
  .mobile-nav-link:focus-visible {
    color: #ffffff;
    opacity: 0.9;
  }

  .mobile-nav-link-home {
    font-weight: 700;
    letter-spacing: 0.28em;
    font-size: 0.9rem;
    background: linear-gradient(
      120deg,
      var(--color-accent),
      var(--color-secondary),
      var(--color-magenta)
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 22px rgba(59, 130, 246, 0.55);
  }

  .mobile-menu-close {
    padding: 0.55rem 1.5rem;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.8);
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.1s ease;
  }

  .mobile-menu-close:hover,
  .mobile-menu-close:focus-visible {
    border-color: rgba(96, 165, 250, 0.95);
    background: rgba(30, 41, 59, 0.95);
  }

  .mobile-menu-close:active {
    transform: scale(0.98);
  }

  .nav-open .mobile-menu-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .nav-open .mobile-menu-drawer {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) translateY(0);
  }
}
