:root {
  --bg-deep: #f8fafc;
  --glass: rgba(255, 255, 255, 0.78);
  --text: #1f2933;
  --muted: #3c4856;
  --accent: #f97316;
  --accent-strong: #f25c05;
  --border: rgba(17, 24, 39, 0.08);
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.15);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:target {
  scroll-margin-top: 16px;
  /* evita che il titolo finisca “attaccato” sopra */
  animation: targetPulse 900ms ease;
}

@keyframes targetPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.0);
    background-color: rgba(249, 115, 22, 0.00);
  }

  20% {
    box-shadow: 0 0 0 6px rgba(249, 115, 22, 0.18);
    background-color: rgba(249, 115, 22, 0.08);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.0);
    background-color: rgba(249, 115, 22, 0.00);
  }
}



html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(249, 115, 22, 0.12), transparent 32%),
    radial-gradient(circle at 80% 10%, rgba(242, 92, 5, 0.1), transparent 28%),
    linear-gradient(160deg, #ffffff 0%, #f2f5fa 60%, #e8edf5 100%);
  color: var(--text);

  font-family: "Space Grotesk", "Trebuchet MS", Arial, sans-serif;


  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul {
  margin: 0;
  padding: 0;
}

a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: color 200ms ease;
}

a:hover {
  color: var(--accent-strong);
}

#wrapper {
  width: min(1100px, calc(100% - 32px));
  margin: 28px auto 40px auto;
}

#content {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.75));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}

/* Header */
#header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 10px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
  position: relative;
  z-index: 10;
  /* importante: menu sopra gli altri blocchi su mobile */
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 4px;
  flex: 1;
}

.logo-row .logo {
  height: 86px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.15));
}

/* Desktop nav */
.nav-desktop ul {
  list-style: none;
  display: flex;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-desktop li {
  flex: 1;
  height: 44px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-desktop li+li {
  border-left: 1px solid rgba(255, 255, 255, 0.28);
}

.nav-desktop a {
  font-size: 12px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Native mobile menu (details/summary) */
.nav-details {
  display: none;
  /* shown only on mobile */
  position: relative;
}

.nav-details>summary {
  list-style: none;
}

.nav-details>summary::-webkit-details-marker {
  display: none;
}

/* Hamburger */
.hamburger {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.hamburger .bar {
  width: 22px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: transform 220ms ease, opacity 180ms ease;
}

/* hamburger -> X when open */
.nav-details[open] .hamburger {
  background: var(--accent-strong);
}

.nav-details[open] .hamburger .bar:nth-child(2) {
  transform: translateY(8px) rotate(45deg);
}

.nav-details[open] .hamburger .bar:nth-child(3) {
  opacity: 0;
}

.nav-details[open] .hamburger .bar:nth-child(4) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile dropdown nav (animated, reliable on iOS) */
.nav-mobile {
  position: absolute;
  right: 0;
  top: calc(44px + 10px);
  width: min(340px, 92vw);
  z-index: 9999;

  /* niente max-height: lo lasciamo sempre "presente" */
  pointer-events: none;
}

/* Animiamo IL PANNELLO (ul) con transform */
.nav-mobile ul {
  transform-origin: top center;
  transform: translateY(-12px) scaleY(0);

  opacity: 0;

  transition: transform 360ms ease, opacity 200ms ease;

  /* il resto come avevi già */
  list-style: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}


.nav-details[open] .nav-mobile {
  pointer-events: auto;
}

.nav-details[open] .nav-mobile ul {
  transform: translateY(0) scaleY(1);
  opacity: 1;
}

/* 1) OVERRIDE UA: evita che <details> nasconda il contenuto con display:none */
.nav-details:not([open])>.nav-mobile {
  display: block;
  /* forza visibilità nel layout */
}

/* 2) Pannello menu: sempre presente, ma "chiuso" via transform/opacity */
.nav-mobile {
  position: absolute;
  right: 0;
  top: calc(44px + 10px);
  width: min(340px, 92vw);
  z-index: 9999;

  pointer-events: none;
  /* da chiuso non cliccabile */
}

/* 3) Animazione sul box reale (ul) */
.nav-mobile ul {
  transform-origin: top center;
  transform: translateY(-10px) scaleY(0.85);
  opacity: 0;
  filter: blur(0.2px);
  /* micro: rende l’apertura più “smooth” */

  transition: transform 360ms cubic-bezier(.2, .9, .2, 1), opacity 220ms ease;

  /* il resto come già avevi */
  list-style: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.nav-details[open] .nav-mobile {
  pointer-events: auto;
}

.nav-details[open] .nav-mobile ul {
  transform: translateY(0) scaleY(1);
  opacity: 1;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .nav-mobile ul {
    transition: none;
    transform: none;
    opacity: 1;
  }

  :target {
    animation: none;
  }
}




.nav-mobile ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.nav-mobile li {
  height: 48px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-mobile li+li {
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.nav-mobile a {
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 14px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero */
#mainimg {
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.3)),
    url(../images/Messina_Strait.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  height: 360px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 40px 32px 40px;
}

.hero-overlay {
  background: rgba(17, 24, 39, 0.52);
  color: #fff;
  padding: 18px 22px;
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#mainimg h3 {
  font-size: 52px;
  font-weight: 700;
}

#mainimg h4 {
  font-size: 20px;
  font-weight: 500;
  margin-top: 6px;
}

/* Content */
#contentarea {
  padding: 28px 32px 36px 32px;
}

#leftbar {
  width: 100%;
  border-radius: calc(var(--radius) - 4px);
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#leftbar h2 {
  font-size: 30px;
  color: var(--accent-strong);
  font-weight: 700;
  padding: 0 32px 10px 32px;
}

#leftbar h3 {
  font-size: 22px;
  font-weight: 600;
  padding: 0 32px 8px 32px;
}

#leftbar h4 {
  font-size: 18px;
  color: var(--accent);
  font-weight: 700;
  padding: 22px 32px 18px 32px;
}

#leftbar p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  text-align: justify;
  padding: 0 32px 10px 32px;
}

#leftbar ul {
  font-size: 15px;
  color: var(--muted);
  text-align: justify;
  padding: 0 48px 0 48px;
  list-style: disc;
  line-height: 1.55;
}

.pi {
  font-size: 15px;
  color: var(--muted);
  text-align: justify;
  padding: 0 32px 5px 64px;
}

/* Footer */
#bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px 22px 28px;
  background: rgba(255, 255, 255, 0.88);
  border-top: 1px solid var(--border);
}

#email,
#validtext {
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

#email {
  flex: 1;
}

#validtext {
  min-width: 210px;
  text-align: right;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */
@media (max-width: 768px) {
  #wrapper {
    width: 100%;
    margin: 16px auto 24px auto;
  }

  #header {
    padding: 14px 16px 8px 16px;
    gap: 12px;
  }

  .logo-row {
    gap: 12px;
  }

  .logo-row .logo {
    height: 64px;
  }

  .nav-desktop {
    display: none;
  }

  .nav-details {
    display: block;
  }

  #mainimg {
    height: 240px;
    padding: 0 16px 16px 16px;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
  }

  #mainimg h3 {
    font-size: 36px;
  }

  #mainimg h4 {
    font-size: 16px;
  }

  #contentarea {
    padding: 20px;
  }

  #leftbar h2 {
    font-size: 24px;
    padding: 0 20px 8px 20px;
  }

  #leftbar h3 {
    font-size: 18px;
    padding: 0 20px 8px 20px;
  }

  #leftbar h4 {
    font-size: 16px;
    padding: 18px 20px 14px 20px;
  }

  #leftbar p,
  #leftbar ul,
  .pi {
    font-size: 16px;
    line-height: 1.7;
  }

  #leftbar p {
    padding: 0 20px 10px 20px;
  }

  #leftbar ul {
    padding: 0 28px;
  }

  .pi {
    padding: 0 20px 6px 28px;
  }

  #bottom {
    flex-direction: column;
    gap: 10px;
    padding: 16px;
  }

  #email,
  #validtext {
    width: 100%;
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .logo-row .logo {
    height: 52px;
  }

  #mainimg {
    height: 220px;
  }

  #mainimg h3 {
    font-size: 28px;
  }

  #mainimg h4 {
    font-size: 14px;
  }

  #contentarea {
    padding: 16px;
  }

  #leftbar ul {
    padding: 0 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .nav-mobile {
    transition: none;
  }

  :target {
    animation: none;
  }
}