/* COPERTO service — override e componenti oltre Tailwind */

:root {
  --ink: #0B3A33;
  --ink-deep: #072C26;
  --ink-600: #15564A;
  --brass: #C9954B;
  --brass-l: #E0B877;
  --charcoal: #12211E;
  --body: #5C6360;
  --bone: #F7F4EC;
  --line: #E5E0D5;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Le ancore non devono finire sotto l'header sticky */
[id] { scroll-margin-top: 5.5rem; }

/* ---------- Fondo verde: profondita' invece di tinta piatta ---------- */
.deep-green {
  background-color: var(--ink);
  background-image:
    radial-gradient(58% 48% at 12% 4%, rgba(30, 122, 104, .38), transparent 62%),
    radial-gradient(44% 42% at 92% 88%, rgba(201, 149, 75, .16), transparent 66%),
    linear-gradient(168deg, #0D443B 0%, #0B3A33 46%, #082F29 100%);
}

.deep-green-soft {
  background-color: var(--ink-deep);
  background-image:
    radial-gradient(52% 44% at 82% 0%, rgba(30, 122, 104, .26), transparent 64%),
    linear-gradient(180deg, #0A342D 0%, #072C26 100%);
}

/* Grana finissima: toglie l'effetto "campitura digitale" */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Header ---------- */
.site-header {
  transition: background-color .35s ease, box-shadow .35s ease,
              border-color .35s ease, backdrop-filter .35s ease;
}

.logo-swap { position: relative; display: block; transition: opacity .3s ease, visibility .3s ease; }
/* In home il marchio grande nella hero e' il logo: nella barra compare allo scroll */
.site-header:not(.is-scrolled) .logo-swap { opacity: 0; visibility: hidden; }
.logo-swap img { display: block; transition: opacity .3s ease; }
.logo-swap .logo-dark { position: absolute; inset: 0; opacity: 0; }
.site-header.is-scrolled .logo-swap .logo-light { opacity: 0; }
.site-header.is-scrolled .logo-swap .logo-dark  { opacity: 1; }

.nav-link { position: relative; transition: color .25s ease; }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -.35rem;
  height: 1px; width: 0;
  background: var(--brass);
  transition: width .3s ease;
}
.nav-link:hover::after,
.nav-link:focus-visible::after { width: 100%; }

/* ---------- Forme ---------- */
/* arco: semicerchio in alto, angoli morbidi in basso */
.arch {
  border-radius: 999px 999px 18px 18px;
  overflow: hidden;
}

.ring-brass-thin { box-shadow: 0 0 0 1px rgba(201, 149, 75, .45); }

/* ---------- Rivelazione allo scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1),
              transform .7s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .logo-swap img { transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Dettagli tipografici ---------- */
.eyebrow { letter-spacing: .22em; text-transform: uppercase; }
.rule-brass { width: 3rem; height: 2px; background: var(--brass); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Card ---------- */
.card { transition: box-shadow .3s ease, transform .3s ease, border-color .3s ease; }
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -16px rgba(11, 58, 51, .3);
  border-color: #DBD4C4;
}

.step-arrow { color: var(--brass); font-size: 1.5rem; line-height: 1; opacity: .55; }

::selection { background: var(--brass); color: #fff; }

/* ---------- Allineamento dei testi ----------
   La giustificazione migliora il testo solo quando la riga supera ~45 caratteri.
   Sotto quella soglia produce buchi di spazio bianco fra le parole.
   Misurazioni reali su questo layout (caratteri per riga):

                 640px   768px   1024px   1280px+
     bio           46      63       32        44
     riquadri      28      37       32        40

   Quindi: giustificati solo i testi lunghi delle schede di presentazione,
   e non fra 1024 e 1279px, dove la griglia a due colonne stringe la colonna
   a 32 caratteri. I riquadri piccoli restano allineati a sinistra: non
   raggiungono mai una larghezza sufficiente.
   Sillabazione italiana attiva (lang="it") per evitare i "fiumi" di bianco. */
.testo-giustificato { text-align: left; }

@media (min-width: 640px) {
  .testo-giustificato {
    text-align: justify;
    text-justify: inter-word;
    -webkit-hyphens: auto;
            hyphens: auto;
  }
}

/* Fascia in cui la colonna e troppo stretta: si torna ad allineato a sinistra */
@media (min-width: 1024px) and (max-width: 1279px) {
  .testo-giustificato { text-align: left; }
}
