/* APOTEMA Studio - versione corretta
   Struttura Aruba:
   /index.html
   /chi-siamo.html
   /servizi.html
   /team.html
   /contatti.html
   /contatti-grazie.html
   /formmail.php
   /privacy.html
   /cookie-policy.html
   /style.css
   /assets/logo-apotema.png
*/

:root {
  --paper: #f7fbfd;
  --paper-2: #eaf6fb;
  --white: #ffffff;
  --ink: #17242b;
  --muted: #5d6d75;
  --line: #d4e8f0;
  --gold: #006da0;
  --gold-dark: #00547c;
  --stone: #263941;
  --blueprint: #006da0;
  --blueprint-dark: #0b415f;
  --sky: #12a9df;
  --ice: #eef9fd;
  --shadow: 0 22px 54px rgba(0, 109, 160, 0.10);
  --max: 1180px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(4,143,199,.055) 1px, transparent 1px),
    linear-gradient(rgba(4,143,199,.04) 1px, transparent 1px),
    var(--paper);
  background-size: 38px 38px;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.62;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold-dark); }
img { max-width: 100%; display: block; }

.container {
  width: min(var(--max), calc(100% - 42px));
  margin-inline: auto;
}

.topline {
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .03em;
}

.topline__inner {
  min-height: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.topline a {
  color: var(--blueprint-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(220px, 330px) 1fr;
  gap: 28px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 78px;
}

.brand__logo {
  width: min(100%, 310px);
  height: auto;
  object-fit: contain;
}

.brand__fallback {
  display: none;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  letter-spacing: .18em;
  font-size: 28px;
  text-transform: uppercase;
}

.menu {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 20px;
  font-size: 13px;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.menu a {
  color: var(--stone);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.menu a:hover,
.menu a[aria-current="page"] {
  color: var(--gold-dark);
  border-bottom-color: var(--gold);
}

.hero {
  min-height: 640px;
  display: grid;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8,32,45,.90), rgba(8,32,45,.62) 48%, rgba(8,32,45,.34)),
    linear-gradient(180deg, rgba(8,32,45,.22), rgba(8,32,45,.48));
  z-index: 1;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .14;
  background:
    linear-gradient(90deg, rgba(255,255,255,.46) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.32) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(90deg, transparent, black 18%, black 82%, transparent);
  z-index: 2;
  pointer-events: none;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--blueprint-dark);
}

.hero-bg__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: heroBackground 30s infinite;
  filter: saturate(.86) contrast(1.05);
  transform: scale(1.03);
}

.hero-bg__image--two { animation-delay: 6s; }
.hero-bg__image--three { animation-delay: 12s; }
.hero-bg__image--four { animation-delay: 18s; }
.hero-bg__image--five { animation-delay: 24s; }

@keyframes heroBackground {
  0% { opacity: 0; transform: scale(1.045); }
  6% { opacity: 1; transform: scale(1.015); }
  18% { opacity: 1; transform: scale(1); }
  25% { opacity: 0; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1.045); }
}

.hero__layout {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 820px);
  gap: 34px;
  align-items: center;
  padding: 92px 0 84px;
}

.hero__content {
  position: relative;
  z-index: 1;
  color: white;
  max-width: 820px;
}

.kicker {
  margin: 0 0 18px;
  color: var(--blueprint);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.hero .kicker {
  color: #8fe8ff;
  text-shadow: 0 2px 14px rgba(0,0,0,.30);
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 24px;
  max-width: 900px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 7vw, 96px);
  line-height: .94;
  letter-spacing: 0;
  font-weight: 400;
}

.hero h1 {
  color: white;
  text-shadow: 0 3px 22px rgba(0,0,0,.30);
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.04;
  font-weight: 400;
  letter-spacing: 0;
  margin-bottom: 14px;
}

h3 {
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  line-height: 1.16;
  font-weight: 400;
}

.hero__lead {
  max-width: 680px;
  color: rgba(255,255,255,.86);
  font-size: clamp(18px, 2vw, 22px);
  margin-bottom: 34px;
  text-shadow: 0 2px 16px rgba(0,0,0,.28);
}

.actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: white;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.btn:hover {
  color: white;
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  transform: translateY(-1px);
}

.btn--ghost {
  background: rgba(255,255,255,.10);
  color: white;
  border-color: rgba(255,255,255,.48);
}

.btn--ghost:hover {
  background: var(--blueprint-dark);
  color: white;
  border-color: var(--blueprint-dark);
}

.hero__facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 620px;
  margin-top: 42px;
  color: rgba(255,255,255,.86);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

.hero__facts span {
  padding-top: 13px;
  border-top: 1px solid rgba(255,255,255,.34);
}

.section { padding: 92px 0; }
.section--white { background: rgba(255,255,255,.86); }

.page-hero {
  padding: 82px 0 58px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255,255,255,.88), rgba(234,246,251,.86)),
    var(--paper-2);
}

.page-hero h1 {
  color: var(--ink);
  font-size: clamp(42px, 6vw, 78px);
  max-width: 900px;
}

.page-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
}

.split {
  display: grid;
  grid-template-columns: .88fr 1.12fr;
  gap: 56px;
  align-items: start;
}

.section-title {
  border-left: 2px solid var(--gold);
  padding-left: 22px;
}

.section-title p {
  color: var(--muted);
  font-size: 16px;
}

.prose {
  color: var(--muted);
  font-size: 17px;
}

.prose p { margin-bottom: 18px; }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 36px;
}

.quote-panel {
  background:
    linear-gradient(135deg, rgba(0,109,160,.96), rgba(11,65,95,.96));
  color: white;
  padding: 42px;
  position: relative;
  overflow: hidden;
}

.quote-panel::after {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(255,255,255,.18);
  pointer-events: none;
}

.quote-panel p {
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,.82);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.service-card {
  min-height: 260px;
  padding: 32px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.82);
  box-shadow: 0 16px 38px rgba(31,37,37,.06);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.service-card:hover {
  transform: translateY(-3px);
  border-color: rgba(173,143,91,.55);
  box-shadow: 0 24px 56px rgba(31,37,37,.10);
}

.service-card::before {
  content: attr(data-num);
  position: absolute;
  right: 24px;
  top: 18px;
  color: rgba(4,143,199,.13);
  font-size: 68px;
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
}

.service-card ul {
  margin: 0;
  padding-left: 18px;
}

.service-card li { margin-bottom: 7px; }

.band {
  padding: 70px 0;
  background:
    linear-gradient(90deg, rgba(11,65,95,.94), rgba(0,84,124,.92)),
    linear-gradient(135deg, var(--blueprint), var(--blueprint-dark));
  color: white;
}

.band p {
  color: rgba(255,255,255,.76);
  font-family: Arial, Helvetica, sans-serif;
  max-width: 740px;
}

.band .btn { margin-top: 12px; }

.team {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 28px;
}

.portrait {
  min-height: 420px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(234,246,251,.88));
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 30px;
  box-shadow: var(--shadow);
}

.portrait img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.details-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
}

.details-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.details-list strong {
  display: block;
  color: var(--ink);
  margin-bottom: 2px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.contact-card {
  background: white;
  border: 1px solid var(--line);
  padding: 32px;
  min-height: 180px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--blueprint), var(--sky));
}

.contact-card span {
  display: block;
  color: var(--gold-dark);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.contact-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.map-block {
  margin-top: 22px;
  padding: 32px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(0,84,124,.95), rgba(11,65,95,.95)),
    var(--blueprint);
  color: white;
}

.map-frame {
  margin-top: 18px;
  border: 1px solid rgba(255,255,255,.2);
  min-height: 340px;
  position: relative;
  background: rgba(255,255,255,.08);
}

.map-frame iframe {
  display: block;
  width: 100%;
  height: 340px;
  border: 0;
}

.map-frame iframe:not([src]) {
  display: none;
}

.map-consent {
  min-height: 340px;
  display: grid;
  place-content: center;
  gap: 18px;
  padding: 32px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
}

.map-consent p {
  max-width: 560px;
  margin: 0 auto;
  color: rgba(255,255,255,.86);
}

.form-wrapper {
  margin-top: 22px;
  padding: 32px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

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

.field--full {
  grid-column: 1 / -1;
}

.field label {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  padding: 14px 15px;
  font-size: 16px;
  color: var(--ink);
}

.field textarea {
  min-height: 170px;
  resize: vertical;
}

.helper {
  color: var(--muted);
  font-size: 14px;
  margin: -4px 0 14px;
}

.message {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-left: 3px solid var(--gold);
  background: rgba(166,138,93,.12);
  color: var(--muted);
}

.message--success {
  border-left-color: #3d7a49;
  background: rgba(61,122,73,.12);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  background: rgba(255,255,255,.5);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
}

.footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.notice {
  padding: 16px 18px;
  background: rgba(166,138,93,.12);
  border-left: 3px solid var(--gold);
  color: var(--muted);
  margin-top: 22px;
}

.legal { max-width: 920px; }

.legal h2 {
  margin-top: 38px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.1;
  font-weight: 400;
}

.legal h3 {
  margin-top: 28px;
  font-size: 22px;
  font-weight: 400;
}

.legal ul { padding-left: 20px; }

.legal-box {
  padding: 26px;
  margin: 24px 0;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
}

.legal-updated {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  margin-top: 8px;
}

.footer__links {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 1040px) {
  .nav {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 0;
  }

  .brand {
    min-height: auto;
    justify-content: center;
  }

  .menu {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 18px;
  }
}

@media (max-width: 960px) {
  .hero { min-height: auto; }
  .hero__layout { grid-template-columns: 1fr; padding: 74px 0 70px; }
  .split, .team, .contact-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
}

@media (max-width: 640px) {
  .container { width: min(var(--max), calc(100% - 28px)); }
  .topline__inner { justify-content: center; text-align: center; padding: 8px 0; }
  .nav { gap: 6px; padding: 10px 0 12px; }
  .brand__logo { width: min(100%, 230px); }
  .menu {
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 11px;
    font-size: 11px;
    letter-spacing: .04em;
  }
  .menu a { padding: 8px 0; white-space: nowrap; }
  .hero__layout { padding: 56px 0; gap: 34px; }
  .hero::before {
    background:
      linear-gradient(90deg, rgba(8,32,45,.88), rgba(8,32,45,.70)),
      linear-gradient(180deg, rgba(8,32,45,.22), rgba(8,32,45,.50));
  }
  .hero__facts { grid-template-columns: 1fr; font-size: 10px; gap: 8px; max-width: 320px; }
  h1 { font-size: clamp(42px, 15vw, 62px); }
  .actions .btn { width: 100%; }
  .section { padding: 58px 0; }
  .grid-3 { grid-template-columns: 1fr; }
  .panel, .quote-panel, .service-card, .contact-card, .map-block, .form-wrapper { padding: 24px; }
  .portrait { min-height: 280px; }
  .footer__links { display: grid; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg__image {
    animation: none;
    opacity: 0;
    transform: none;
  }

  .hero-bg__image--one { opacity: 1; }
}
