/*FONTFACE-START*/
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
/*FONTFACE-END*/

:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);

  /* palette ricavata dalla cover */
  --sand: #E4DFD9;
  --black: #1F1F1F;
  --blue: #1834FC;
  --blue-dark: #0F24C9;

  --bg: #E4DFD9;
  --ink: #1F1F1F;
  --muted: #5F5A54;
  --rule: #1F1F1F;
  --accent: #1834FC;

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161514;
    --ink: #E4DFD9;
    --muted: #A39D95;
    --rule: #E4DFD9;
    --accent: #8496FF;
  }
}
:root[data-theme="dark"] {
  --bg: #161514;
  --ink: #E4DFD9;
  --muted: #A39D95;
  --rule: #E4DFD9;
  --accent: #8496FF;
}

*, *::before, *::after { box-sizing: inherit; }
html { height: 100%; scroll-behavior: smooth; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 68px); }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Titoli: stessa famiglia larga e pesante della cover */
.display {
  font-family: var(--sans);
  font-weight: 900;
  font-stretch: 125%;
  text-transform: uppercase;
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0;
}
h2.display { font-size: clamp(1.9rem, 5.4vw, 4.25rem); }

.btn {
  display: inline-block; background: var(--blue); color: var(--sand);
  font: inherit; font-weight: 700; font-stretch: 112%; text-decoration: none; cursor: pointer;
  padding: 14px 26px; border: 0; border-radius: 0;
  transition: background .2s;
}
.btn:hover { background: var(--blue-dark); }

/* ---------- HERO (resta sempre sabbia: la foto ha lo sfondo incorporato) ---------- */
.hero { background: var(--sand); color: var(--black); }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--rule);
}
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 16px; padding-bottom: 16px;
}
.brand { font-weight: 800; font-stretch: 112%; text-decoration: none; letter-spacing: 0.005em; }
.bar nav { display: flex; gap: clamp(12px, 3vw, 32px); font-size: 0.95rem; font-weight: 500; }
.brand, .bar nav a { white-space: nowrap; }
.bar nav a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.bar nav a:hover { border-bottom-color: var(--blue); }
.topbar :focus-visible { outline-color: var(--blue); }
.cover { overflow: hidden; display: flex; justify-content: center; }
.cover-inner { position: relative; width: 84%; margin-top: clamp(10px, 2vw, 26px); }
.cover-photo { display: block; width: 100%; height: auto; }
@media (max-width: 720px) {
  .cover-inner { width: 134%; margin-left: -17%; }
}

.hi-balloon {
  position: absolute; left: 51.3%; top: 5%; width: 5.6%; height: auto;
  pointer-events: none;
  opacity: 0;
  animation: hi-loop 5s ease-in-out 1.1s infinite;
}
@keyframes hi-loop {
  0%   { opacity: 0; transform: scale(0.6) translateY(8px); }
  8%   { opacity: 1; transform: scale(1) translateY(0); }
  60%  { opacity: 1; transform: scale(1) translateY(0); }
  72%  { opacity: 0; transform: scale(0.85) translateY(4px); }
  100% { opacity: 0; transform: scale(0.6) translateY(8px); }
}
@media (prefers-reduced-motion: reduce) {
  .hi-balloon, .hi-balloon-core { animation: none; opacity: 1; }
}

/* ---------- BENVENUTO E BIO ---------- */
.welcome {
  padding-top: clamp(12px, 2.2vw, 26px); padding-bottom: clamp(56px, 9vw, 120px);
}
.hello {
  margin: 0 0 clamp(26px, 3.6vw, 40px);
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.5rem, 3.3vw, 2.6rem); line-height: 1.15; letter-spacing: -0.005em;
}
.bio p { margin: 0; max-width: none; }
@media (min-width: 700px) { .hello { white-space: nowrap; } }

/* ---------- CREATIVE CORE ---------- */
.core { padding-top: clamp(8px, 2vw, 16px); padding-bottom: clamp(56px, 9vw, 120px); }
.core-title {
  color: var(--blue); margin: 0 0 clamp(28px, 4vw, 44px);
}
@media (min-width: 360px) { .core-title { white-space: nowrap; } }
.core-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(28px, 4vw, 40px);
  align-items: start;
}
.core-text { grid-column: 1 / span 6; }
.core-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule); }
.core-list li {
  margin: 0; padding: 18px 0; border-bottom: 1px solid var(--rule);
  max-width: 62ch; line-height: 1.55;
}
.core-list strong { font-weight: 800; font-stretch: 110%; text-transform: uppercase; font-size: 0.98em; }
.core-photo {
  grid-column: 7 / span 6; margin: 0; align-self: start; background: var(--sand);
  position: sticky; top: clamp(90px, 8vw, 120px);
}
.core-photo img.core-photo-img { width: 100%; height: auto; display: block; }
.hi-balloon-core {
  position: absolute; left: 43%; top: 6%; width: 11.5%; height: auto;
  pointer-events: none;
  opacity: 0;
  animation: hi-loop 5s ease-in-out 1.6s infinite;
}

/* ---------- SEZIONI ---------- */
.section { padding-top: clamp(24px, 4vw, 56px); padding-bottom: clamp(56px, 9vw, 120px); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head p { margin: 0; color: var(--muted); max-width: 46ch; }
@media (min-width: 900px) {
  #audit .section-head p { white-space: nowrap; max-width: none; }
}

/* ---------- PORTFOLIO E CV (download in due lingue) ---------- */
.dl-list { border-top: 2px solid var(--rule); }
.dl-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px 32px;
  padding: clamp(22px, 3vw, 36px) 0; border-bottom: 1px solid var(--rule);
}
.dl-title {
  margin: 0; font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  font-size: clamp(1.35rem, 4vw, 3rem); line-height: 1; letter-spacing: -0.01em;
}
.dl-note { margin: 14px 0 0; max-width: 48ch; color: var(--muted); }
.dl-links { display: flex; gap: 14px; }
.dl-link {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 22px; border: 2px solid var(--rule); text-decoration: none;
  font-weight: 700; font-stretch: 112%;
  transition: background .2s, color .2s, border-color .2s;
}
.dl-meta { color: var(--muted); font-weight: 500; font-stretch: 100%; font-size: 0.9rem; transition: color .2s; }
.dl-icon { width: 24px; height: 24px; flex: none; }
.dl-link:hover, .dl-link:focus-visible { background: var(--blue); border-color: var(--blue); color: var(--sand); }
.dl-link:hover .dl-meta, .dl-link:focus-visible .dl-meta { color: var(--sand); }
.dl-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---------- AUDIT E PREZZI ---------- */
.audit-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(28px, 4vw, 56px) clamp(20px, 3vw, 40px); align-items: start; }
.audit-card {
  grid-column: 1 / span 5; background: var(--blue); color: var(--sand);
  padding: clamp(24px, 3vw, 40px);
}
.audit-card h3 {
  margin: 0 0 16px; font-weight: 900; font-stretch: 122%; text-transform: uppercase;
  font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1;
}
.audit-card p { margin: 0 0 16px; }
.audit-card ol { margin: 0 0 28px; padding-left: 1.3em; }
.audit-card li { margin-bottom: 8px; padding-left: 4px; }
.audit-card .audit-price {
  display: block; text-align: center; background: var(--sand); color: var(--blue);
  font-size: 1.15rem; padding: 16px 26px; border-radius: 999px;
}
.audit-card .audit-price:hover { background: #fff; }
.audit-card :focus-visible { outline-color: var(--sand); }

.price-wrap { grid-column: 6 / span 7; }
.prices-second { margin-top: clamp(32px, 4vw, 48px); }
.prices { width: 100%; border-collapse: collapse; }
.prices caption { text-align: left; font-weight: 800; font-stretch: 118%; font-size: 1.15rem; padding-bottom: 14px; color: var(--accent); }
.prices thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.prices th, .prices td { padding: 18px 0; border-top: 1px solid var(--rule); text-align: left; vertical-align: baseline; }
.prices tbody tr:first-child th, .prices tbody tr:first-child td { border-top: 2px solid var(--rule); }
.prices tbody tr:last-child th, .prices tbody tr:last-child td { border-bottom: 1px solid var(--rule); }
.prices tbody th { font-weight: 700; font-stretch: 112%; padding-right: 20px; width: 34%; }
.prices .d { color: var(--muted); padding-right: 20px; }
.prices .p { text-align: right; font-weight: 800; font-stretch: 112%; white-space: nowrap; }
.price-note { color: var(--muted); font-size: 0.95rem; margin: 18px 0 0; max-width: 60ch; }

/* ---------- CONTATTI (sempre blu) ---------- */
.contact { background: var(--blue); color: var(--sand); padding: clamp(64px, 10vw, 130px) 0; }
.contact-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 48px clamp(20px, 3vw, 40px); align-items: start; }
.contact-intro { grid-column: 1 / span 5; }
.contact-intro h2 { margin-bottom: 24px; font-size: clamp(1.7rem, 3.3vw, 2.7rem); line-height: 1.02; }
.contact-intro p { margin: 0 0 24px; font-size: 1.15rem; max-width: 40ch; }
.mail {
  display: inline-block; font-weight: 800; font-stretch: 118%;
  font-size: clamp(1.05rem, 2.3vw, 1.5rem); line-height: 1.15; white-space: nowrap;
  text-decoration-thickness: 3px; text-underline-offset: 7px;
}
.mail:hover { text-decoration-color: transparent; }
.contact .links { display: flex; gap: 24px; margin: 28px 0 0; flex-wrap: wrap; font-weight: 600; font-size: 1rem; }
.contact :focus-visible { outline-color: var(--sand); }

form.contact-form { grid-column: 7 / span 6; }
.field { display: grid; gap: 4px; margin-bottom: 22px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--sand); background: transparent;
  border: 0; border-bottom: 2px solid var(--sand); border-radius: 0;
  padding: 10px 0; width: 100%;
}
.field textarea { min-height: 130px; resize: vertical; }
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M1 1l7 7 7-7' fill='none' stroke='%23E4DFD9' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center;
}
.field select option { color: #1F1F1F; background: #E4DFD9; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: 3px solid var(--sand); outline-offset: 4px;
}

.needs-field { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.needs-field legend { font-weight: 700; font-size: 0.95rem; padding: 0; margin: 0 0 10px; }
.needs-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.need-chip { position: relative; cursor: pointer; }
.need-chip input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.need-chip span {
  display: inline-block; padding: 10px 16px; border: 2px solid var(--sand);
  font-size: 0.92rem; font-weight: 600; line-height: 1.2;
  transition: background .2s, color .2s;
}
.need-chip input:checked + span { background: var(--sand); color: var(--blue); }
.need-chip input:focus-visible + span { outline: 3px solid var(--sand); outline-offset: 3px; }

.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; margin: 4px 0 26px; }
.consent input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--sand); flex: none; }
.consent a { font-weight: 600; }
.contact-form .btn { background: var(--sand); color: var(--blue); }
.contact-form .btn:hover { background: #fff; }
.hp { position: absolute; left: -9999px; }

footer.site { padding: 28px 0 40px; color: var(--muted); font-size: 0.9rem; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- PAGINE DI SERVIZIO (grazie, privacy, 404) ---------- */
.simple { max-width: 760px; padding-top: clamp(64px, 10vw, 140px); padding-bottom: clamp(64px, 10vw, 140px); }
.simple h1 { margin-bottom: 28px; font-size: clamp(2rem, 6vw, 4rem); }
.simple p, .simple li { max-width: 62ch; }
.simple h2 { font-weight: 800; font-stretch: 118%; font-size: 1.15rem; margin: 32px 0 8px; }
.simple .note { background: var(--blue); color: var(--sand); padding: 14px 18px; margin-bottom: 32px; }
.simple .btn { margin-top: 16px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px) {
  .hello { grid-column: 1 / -1; margin-bottom: 32px; }
  .bio { grid-column: 1 / span 9; }
  .audit-card, .price-wrap { grid-column: 1 / -1; }
  .core-text, .core-photo { grid-column: 1 / -1; }
  .core-photo { max-width: 420px; }
  .contact-intro, form.contact-form { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .xs-hide { display: none; }
}
@media (max-width: 430px) {
  .bar { flex-wrap: wrap; row-gap: 8px; padding-bottom: 14px; }
  .bar nav { width: 100%; justify-content: space-between; gap: 10px; font-size: 0.85rem; }
}
@media (max-width: 430px) {
  html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 96px); }
}
@media (max-width: 720px) {
  .bio { grid-column: 1 / -1; }
  .dl-row { grid-template-columns: 1fr; gap: 18px; }
  .dl-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
  .dl-link { justify-content: space-between; padding: 14px 16px; }
  .dl-meta { display: none; }

  .prices tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 16px 0; border-top: 1px solid var(--rule); }
  .prices tbody tr:first-child { border-top: 2px solid var(--rule); }
  .prices tbody tr:last-child { border-bottom: 1px solid var(--rule); }
  .prices th, .prices td { display: block; border: 0 !important; padding: 0; width: auto !important; }
  .prices tbody th { grid-column: 1; }
  .prices .p { grid-column: 2; grid-row: 1; }
  .prices .d { grid-column: 1 / -1; padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dl-link, .dl-meta, .btn { transition: none; }
}
