:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #050505;
  --marker-font: "Knewave", cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: #fff !important; }
html { overflow-x: hidden; }
body {
  min-height: 100svh;
  overflow-x: hidden;
  background: #fff !important;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
img { display: block; user-select: none; -webkit-user-drag: none; }

.page {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: #fff !important;
}

.hero {
  min-height: 100svh;
  position: relative;
  overflow: hidden;
  background: #fff !important;
}

/*
  Una sola scena: FF_Logo.svg resta INTERO.
  Mano e volto non vengono mai scalati separatamente.
*/
.scene {
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(1000px, 78vw);
  aspect-ratio: 1000 / 690;
  transform: translate(-50%, -50%);
}

.character {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 52%;
  width: min(900px, 90%);
  height: auto;
  transform: translate(-50%, -50%);
}

.bubble {
  position: absolute;
  z-index: 4;
  display: block;
  width: 22%;
  min-width: 170px;
  color: var(--ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transform-origin: 50% 50%;
  transition: transform 150ms ease;
}

.bubble img { width: 100%; height: auto; }

.bubble span {
  position: absolute;
  left: 50%;
  top: 39%;
  width: 82%;
  transform: translate(-50%, -50%) rotate(-2deg);
  text-align: center;
  white-space: nowrap;
  color: #050505;

  /* Effetto pennarello scritto a mano: grande, spesso e irregolare. */
  font-family: var(--marker-font);
  font-size: clamp(25px, 2vw, 35px);
  font-weight: 400;
  font-style: normal;
  line-height: 0.94;
  letter-spacing: 0.025em;
  -webkit-text-stroke: 0.45px #050505;
  text-shadow:
    0.35px 0 #050505,
    -0.25px 0 #050505,
    0 0.3px #050505;
  pointer-events: none;
}

/* Vignette attorno al volto, non in una griglia a tre colonne. */
.bubble-contact {
  left: 13.5%;
  top: 7%;
  transform: rotate(-2deg);
}

.bubble-cv {
  right: 10.5%;
  top: 57%;
  transform: rotate(2deg);
}

/* Il file destro e' gia' specchiato. Lo ruotiamo solo per avere la coda verso il volto. */
.bubble-cv img { transform: rotate(180deg); }
.bubble-cv span {
  top: 61%;
  transform: translate(-50%, -50%) rotate(1deg);
}

@media (hover: hover) and (pointer: fine) {
  .bubble-contact:hover { transform: rotate(-3deg) scale(1.025); }
  .bubble-cv:hover { transform: rotate(3deg) scale(1.025); }
}

.bubble:focus-visible { outline: 3px solid #111; outline-offset: 5px; }

.site-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  color: #ffffff;
  padding:
    12px
    max(24px, env(safe-area-inset-right))
    calc(12px + env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
}

.footer-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  font-family: var(--marker-font);
  font-weight: 400;
  line-height: 1;
}

.footer-name {
  font-size: 16px;
  letter-spacing: -0.035em;
}

.footer-status {
  font-size: 13px;
  letter-spacing: 0.035em;
}

@media (max-width: 700px) {
  .scene {
    top: 45.5%;
    width: 112vw;
    max-width: 440px;
    aspect-ratio: 520 / 500;
  }

  .character {
    left: 52.5%;
    top: 52%;
    width: 100%;
  }

  .bubble {
    width: 25%;
    min-width: 0;
  }

  .bubble-contact {
    /* Mobile: piu vicina al volto, in modo simile alla vignetta CV. */
    left: 10%;
    top: 15%;
  }

  .bubble-cv {
    right: 6%;
    top: 59%;
  }

  .bubble span {
    width: 86%;
    font-size: clamp(15px, 4.6vw, 20px);
    letter-spacing: 0.03em;
    -webkit-text-stroke: 0.25px #050505;
  }

  .site-footer {
    min-height: 78px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .footer-name { font-size: 13px; }
  .footer-status { font-size: 11px; }
}

@media (max-width: 390px) {
  .scene { width: 112vw; }
}

@media (prefers-reduced-motion: reduce) {
  .bubble { transition: none; }
}

/* =========================================================
   CONTACT PAGE - v19
   Stesso linguaggio visivo della home V14.
   ========================================================= */

.contact-page,
.contact-page .page,
.contact-layout {
  background: #fff !important;
}

.contact-layout {
  min-height: 100svh;
  padding-bottom: 92px;
  overflow-x: hidden;
  overflow-y: auto;
}

.home-link {
  position: fixed;
  top: max(28px, env(safe-area-inset-top));
  left: max(34px, env(safe-area-inset-left));
  z-index: 30;
  color: #050505;
  text-decoration: none;
  font-family: var(--marker-font);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.025em;
  -webkit-text-stroke: 0.25px #050505;
  transform: rotate(-2deg);
  transition: transform 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .home-link:hover { transform: rotate(1deg) scale(1.05); }
}

.contact-section {
  width: min(1180px, calc(100% - 72px));
  min-height: calc(100svh - 92px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 0.88fr) minmax(420px, 1.12fr);
  align-items: center;
  gap: clamp(34px, 5vw, 86px);
  padding: 94px 0 74px;
}

.contact-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.contact-visual img {
  width: min(100%, 500px);
  height: auto;
  transform: rotate(-1deg);
}

.contact-content {
  width: 100%;
  max-width: 610px;
}

.contact-heading {
  margin-bottom: 30px;
}

.contact-heading h1 {
  position: relative;
  display: inline-block;
  margin: 0 0 10px;
  color: #050505;
  font-family: var(--marker-font);
  font-size: clamp(46px, 5vw, 76px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.018em;
  -webkit-text-stroke: 0.65px #050505;
  transform: rotate(-1.5deg);
}

.contact-heading h1::after {
  content: "";
  position: absolute;
  left: 4%;
  right: -2%;
  bottom: -9px;
  height: 5px;
  background: #050505;
  border-radius: 60% 40% 55% 45%;
  transform: rotate(-1deg);
}

.contact-heading p {
  max-width: 540px;
  margin: 24px 0 0;
  font-family: var(--marker-font);
  font-size: clamp(17px, 1.55vw, 22px);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.018em;
}

.contact-form {
  display: grid;
  gap: 20px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  padding-left: 7px;
  font-family: var(--marker-font);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.035em;
  transform: rotate(-0.4deg);
  transform-origin: left center;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 4px solid #050505;
  outline: 0;
  background: #fff;
  color: #050505;
  padding: 15px 18px 14px;
  font: 600 17px/1.35 Arial, Helvetica, sans-serif;
  border-radius: 24px 19px 27px 18px / 19px 25px 20px 26px;
  box-shadow: 2px 2px 0 rgba(5, 5, 5, 0.12);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.form-field:nth-child(2) input {
  border-radius: 20px 27px 18px 24px / 24px 18px 27px 19px;
}

.form-field textarea {
  min-height: 180px;
  resize: vertical;
  border-radius: 28px 21px 30px 18px / 20px 28px 22px 31px;
}

.form-field input:focus,
.form-field textarea:focus {
  transform: rotate(-0.25deg);
  box-shadow: 4px 4px 0 #050505;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.marker-button {
  appearance: none;
  border: 4px solid #050505;
  border-radius: 55% 45% 52% 48% / 47% 54% 46% 53%;
  background: #050505;
  color: #fff;
  padding: 13px 31px 12px;
  cursor: pointer;
  font-family: var(--marker-font);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.045em;
  transform: rotate(-1.5deg);
  transition: transform 130ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .marker-button:hover { transform: rotate(1deg) scale(1.04); }
}

.marker-button:focus-visible {
  outline: 3px solid #050505;
  outline-offset: 5px;
}

.form-note {
  flex: 1 1 250px;
  margin: 0;
  color: #333;
  font-family: var(--marker-font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.018em;
}

.form-note.is-warning {
  color: #050505;
  font-weight: 400;
}

@media (max-width: 820px) {
  .contact-layout { padding-bottom: 78px; }

  .home-link {
    top: max(20px, env(safe-area-inset-top));
    left: max(20px, env(safe-area-inset-left));
    font-size: 17px;
  }

  .contact-section {
    width: min(100% - 34px, 600px);
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 78px 0 62px;
  }

  .contact-visual {
    order: 2;
    margin-top: 2px;
  }

  .contact-visual img {
    width: min(68vw, 300px);
  }

  .contact-content { order: 1; max-width: none; }

  .contact-heading {
    text-align: center;
    margin-bottom: 24px;
  }

  .contact-heading h1 {
    font-size: clamp(46px, 13vw, 64px);
  }

  .contact-heading p {
    margin-left: auto;
    margin-right: auto;
    font-size: 17px;
  }

  .contact-form { gap: 17px; }

  .form-field input,
  .form-field textarea {
    border-width: 3px;
    font-size: 16px;
    padding: 14px 16px 13px;
  }

  .form-field textarea { min-height: 150px; }

  .form-actions {
    justify-content: center;
    text-align: center;
    gap: 13px;
  }

  .marker-button {
    font-size: 22px;
    padding: 12px 28px 11px;
  }

  .form-note { flex-basis: 100%; max-width: 330px; }
}

@media (max-width: 390px) {
  .contact-section { width: calc(100% - 28px); }
  .contact-heading p { font-size: 15px; }
  .form-field label { font-size: 16px; }
}

/* =========================================================
   V20 - LOGO + INVIO DIRETTO + hCAPTCHA
   ========================================================= */
.brand-mark {
  position: absolute;
  z-index: 40;
  top: clamp(18px, 4vh, 38px);
  left: clamp(18px, 4vw, 68px);
  width: clamp(88px, 6.4vw, 122px);
  display: block;
  color: #000;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.brand-mark img {
  width: 100%;
  height: auto;
  display: block;
}

.brand-mark:focus-visible {
  outline: 3px solid #111;
  outline-offset: 6px;
}

.contact-page .brand-mark {
  position: fixed;
}

.contact-page .home-link {
  left: auto;
  right: max(34px, env(safe-area-inset-right));
}

.human-check {
  width: 100%;
  display: grid;
  gap: 9px;
  padding-top: 2px;
}

.human-check-title {
  padding-left: 7px;
  font-family: var(--marker-font);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.035em;
  transform: rotate(-0.4deg);
  transform-origin: left center;
}

.h-captcha {
  min-height: 78px;
  display: flex;
  align-items: center;
  max-width: 100%;
}

.marker-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.form-note.is-success {
  color: #050505;
  font-weight: 400;
}

.form-note.is-error {
  color: #050505;
  font-weight: 400;
  text-decoration: underline;
}

@media (max-width: 820px) {
  .brand-mark {
    top: 18px;
    left: 18px;
    width: clamp(72px, 22vw, 90px);
  }

  .contact-page .brand-mark {
    top: max(14px, env(safe-area-inset-top));
    left: max(16px, env(safe-area-inset-left));
    width: 72px;
  }

  .contact-page .home-link {
    top: max(22px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
  }

  .human-check-title {
    font-size: 16px;
  }

  .h-captcha {
    justify-content: center;
  }
}

/* =========================================================
   V22 - HEADER RESPONSIVE PAGINA CONTATTI
   Logo e HOME vivono in una fascia dedicata: niente overlay.
   ========================================================= */
.contact-page .contact-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding:
    max(14px, env(safe-area-inset-top))
    max(34px, env(safe-area-inset-right))
    14px
    max(34px, env(safe-area-inset-left));
  background: #fff;
}

/* Piccola linea irregolare, coerente con il tratto del sito. */
.contact-page .contact-header::after {
  content: "";
  position: absolute;
  left: max(34px, env(safe-area-inset-left));
  right: max(34px, env(safe-area-inset-right));
  bottom: 0;
  height: 3px;
  background: #050505;
  border-radius: 70% 30% 60% 40%;
  transform: rotate(-0.08deg);
  opacity: 0.98;
}

.contact-page .contact-header .brand-mark,
.contact-page .contact-header .home-link {
  position: static;
  inset: auto;
  margin: 0;
}

.contact-page .contact-header .brand-mark {
  flex: 0 0 auto;
  width: clamp(82px, 6.4vw, 118px);
}

.contact-page .contact-header .home-link {
  flex: 0 0 auto;
  font-size: clamp(18px, 1.6vw, 22px);
  transform: rotate(-2deg);
  white-space: nowrap;
}

/* L'header occupa spazio reale: il contenuto non deve compensare con padding enorme. */
.contact-page .contact-section {
  min-height: calc(100svh - 104px - 92px);
  padding-top: 34px;
}

@media (max-width: 820px) {
  .contact-page .contact-header {
    min-height: 78px;
    gap: 18px;
    padding:
      max(10px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      10px
      max(16px, env(safe-area-inset-left));
  }

  .contact-page .contact-header::after {
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    height: 2.5px;
  }

  .contact-page .contact-header .brand-mark {
    width: clamp(66px, 20vw, 82px);
  }

  .contact-page .contact-header .home-link {
    font-size: clamp(16px, 5vw, 19px);
  }

  .contact-page .contact-section {
    width: min(calc(100% - 30px), 600px);
    min-height: auto;
    padding: 28px 0 62px;
  }
}

@media (max-width: 390px) {
  .contact-page .contact-header {
    min-height: 72px;
  }

  .contact-page .contact-header .brand-mark {
    width: 64px;
  }

  .contact-page .contact-header .home-link {
    font-size: 16px;
  }

  .contact-page .contact-section {
    width: calc(100% - 24px);
    padding-top: 24px;
  }
}
