/* PragmaKreative — foglio di stile unico del sito statico. Token da tokens.css. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--pk-color-crema);
  color: var(--pk-color-blu-inchiostro);
  font-family: var(--pk-font-body);
  font-size: var(--pk-size-body);
  line-height: var(--pk-line-height-testi);
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--pk-color-corallo-scuro-testo);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  color: var(--pk-color-blu-inchiostro);
  font-family: var(--pk-font-title);
  font-weight: 700;
  line-height: var(--pk-line-height-titoli);
}

h1 { font-size: clamp(var(--pk-size-h2), 6vw + 0.5rem, var(--pk-size-display)); }
h2 { font-size: clamp(var(--pk-size-h3), 4vw + 0.5rem, var(--pk-size-h2)); }
h3 { font-size: var(--pk-size-h4); }

p {
  margin: 0 0 1em;
}

:focus-visible {
  outline: 3px solid var(--pk-color-blu-inchiostro);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -120px;
  z-index: 10;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--pk-color-lime-spunta);
  color: var(--pk-color-blu-inchiostro);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: min(100% - 40px, 1120px);
  margin-inline: auto;
}

section {
  padding: 56px 0;
}

@media (min-width: 768px) {
  section {
    padding: 88px 0;
  }
}

/* Header e footer */

.site-header {
  border-bottom: 1px solid rgba(23, 24, 59, 0.12);
  background: var(--pk-color-crema);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding: 14px 0;
}

.logo img {
  height: 40px;
  width: auto;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  padding: 6px 2px;
  color: var(--pk-color-blu-inchiostro);
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--pk-color-corallo-pragma);
  text-decoration-thickness: 3px;
}

.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--pk-color-corallo-pragma);
  text-decoration-thickness: 3px;
}

.site-footer {
  margin-top: 0;
  padding: 40px 0 48px;
  border-top: 8px solid var(--pk-color-corallo-pragma);
  background: var(--pk-color-crema);
}

.footer-inner {
  display: grid;
  gap: 24px;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
}

.footer-inner .logo img {
  height: 32px;
}

.footer-inner .nav ul {
  justify-content: flex-start;
}

.copy {
  margin: 0;
  font-size: var(--pk-size-small);
}

.legal {
  margin: 0;
  font-size: var(--pk-size-small);
  grid-column: 1 / -1;
}

/* Bottoni: CTA unica = pill lime con testo inchiostro */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.4rem;
  border: 2px solid var(--pk-color-blu-inchiostro);
  border-radius: 999px;
  background: var(--pk-color-lime-spunta);
  color: var(--pk-color-blu-inchiostro);
  font-family: var(--pk-font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(0.95);
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-link {
  font-weight: 600;
}

.btn-cta-header {
  padding: 0.5rem 1.1rem;
  min-height: 44px;
  font-size: 0.95rem;
}

/* Layout generale */

.hero {
  display: grid;
  gap: 32px;
  align-items: center;
  padding-top: 48px;
  padding-bottom: 40px;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    padding-top: 80px;
  }
}

.lead {
  max-width: 36ch;
  font-size: var(--pk-size-lead);
  line-height: var(--pk-line-height-testi);
}

.intro {
  max-width: 60ch;
}

.visual {
  margin: 0;
}

.band-coral {
  background: var(--pk-color-corallo-pragma);
  color: var(--pk-color-blu-inchiostro);
}

.band-coral h2,
.band-coral h3,
.band-coral p,
.band-coral a {
  color: var(--pk-color-blu-inchiostro);
}

.band-coral .btn {
  background: var(--pk-color-lime-spunta);
}

.split {
  display: grid;
  gap: 32px;
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .steps.four {
    grid-template-columns: repeat(4, 1fr);
  }
}

.step-card,
.card,
.value,
.box {
  padding: 24px;
  border-radius: 22px;
  background: #ffffff;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--pk-color-corallo-pragma);
  color: var(--pk-color-blu-inchiostro);
  font-family: var(--pk-font-title);
  font-size: var(--pk-size-h4);
  font-weight: 700;
}

.grid-cards {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .grid-cards.two {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .grid-cards.four {
    grid-template-columns: repeat(4, 1fr);
  }
  .grid-cards.three {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-link h3 {
  margin-top: 12px;
}

.card-visual {
  height: 88px;
  margin-bottom: 4px;
}

.card-visual svg {
  width: 100%;
  height: 100%;
}

.card-visual {
  width: 100%;
}

.note {
  margin-top: 24px;
  font-weight: 600;
}

.box-pair {
  display: grid;
  gap: 18px;
}

@media (min-width: 768px) {
  .box-pair {
    grid-template-columns: 1fr 1fr;
  }
}

.box-ai {
  background: var(--pk-color-azzurro-kreative);
  color: #ffffff;
}

.box-ai h3,
.box-ai p {
  color: #ffffff;
}

.box-umano {
  background: var(--pk-color-lime-spunta);
  color: var(--pk-color-blu-inchiostro);
}

.box-umano h3,
.box-umano p {
  color: var(--pk-color-blu-inchiostro);
}

.box-fai-da-te {
  margin-top: 18px;
  border: 2px solid var(--pk-color-blu-inchiostro);
  background: transparent;
}

/* Esempi */

.gallery {
  display: grid;
  gap: 18px;
  align-items: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .gallery.three {
    grid-template-columns: repeat(3, 1fr);
  }
  .gallery.all {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gallery figure,
.examples figure {
  margin: 0;
  padding: 12px;
  border-radius: 22px;
  background: #ffffff;
}

.gallery img,
.examples img {
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.gallery figcaption,
.examples figcaption {
  margin-top: 10px;
  font-size: var(--pk-size-small);
}

.examples {
  display: grid;
  gap: 18px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  align-items: start;
}

@media (min-width: 768px) {
  .examples {
    grid-template-columns: repeat(3, 1fr);
  }
}

.banda-esempi {
  padding: 22px 24px;
  border-left: 8px solid var(--pk-color-azzurro-kreative);
  border-radius: 22px;
  background: #ffffff;
  color: var(--pk-color-blu-inchiostro);
}

.banda-esempi p {
  margin: 0;
}

/* FAQ */

.faq-list {
  display: grid;
  gap: 16px;
}

.faq-list .box {
  padding: 22px 24px;
}

/* Contatti e modulo */

.form {
  display: grid;
  gap: 18px;
  max-width: 640px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.consent label {
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--pk-color-blu-inchiostro);
  border-radius: 14px;
  background: #ffffff;
  color: var(--pk-color-blu-inchiostro);
  font: inherit;
}

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

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--pk-color-errore);
  box-shadow: inset 0 0 0 1px var(--pk-color-errore);
}

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.consent input {
  width: 24px;
  height: 24px;
  margin-top: 3px;
  accent-color: var(--pk-color-azzurro-kreative);
}

.consent small {
  display: block;
  margin-top: 4px;
  font-size: var(--pk-size-small);
}

.field-error {
  display: none;
  font-size: var(--pk-size-small);
  font-weight: 600;
  color: var(--pk-color-errore);
}

.field-error.is-visible {
  display: block;
}

.form-status {
  min-height: 1.5em;
  margin: 0;
  font-weight: 600;
}

.form-status.is-ok {
  color: var(--pk-color-conferma);
}

.form-status.is-error {
  color: var(--pk-color-errore);
}

.form-status.is-info {
  color: var(--pk-color-blu-inchiostro);
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.noscript-note {
  padding: 16px 20px;
  border-radius: 14px;
  background: #ffffff;
  font-weight: 600;
}

/* Preferenze di movimento */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Visual decorativi per sezione (SVG inline dal marchio) */

.visually-hidden-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hero-svg {
  width: 100%;
  max-width: 380px;
  margin-inline: auto;
}

.strip-svg {
  width: 100%;
  height: auto;
  margin-bottom: 28px;
}

.steps-svg {
  width: 100%;
  max-width: 260px;
}

.mosaic-svg {
  width: 100%;
  max-width: 340px;
  margin-inline: auto;
}

.faq-svg,
.contact-svg {
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
}

.cta-art {
  display: flex;
  justify-content: flex-end;
}

.cta-svg {
  width: 112px;
  height: 112px;
}

/* Revisione visiva: header su una riga da desktop, icone valori piccole */

.value-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 14px;
}

@media (min-width: 900px) {
  .header-inner {
    flex-wrap: nowrap;
    width: min(100% - 40px, 1240px);
  }
  .nav ul {
    flex-wrap: nowrap;
    gap: 4px 14px;
  }
  .nav a,
  .btn-cta-header {
    white-space: nowrap;
  }
  .btn-cta-header {
    flex-shrink: 0;
  }
}

/* Hero spaziale — scena SVG animata solo CSS (build_sito.py: visual_hero).
   Ciclo 12 s: 0–5 s orbita e rotazione · 5–7 s convergenza nel simbolo 2x2 ·
   7–10 s simbolo fermo con glow corallo · 10–12 s riapertura in orbita.
   Stato base (attributi SVG) = simbolo ricomposto: è ciò che vede chi ha
   prefers-reduced-motion, perché la regola globale sopra azzera le animazioni. */

.hero-spazio .hs-orb {
  animation: hs-orb 12s linear infinite;
}

.hero-spazio .hs-travel {
  animation: hs-travel 12s infinite;
}

.hero-spazio .hs-self {
  animation: hs-self 12s linear infinite;
}

.hero-spazio .hs-glow {
  opacity: 0.6;
  animation: hs-glow 12s ease-in-out infinite;
}

.hero-spazio .hs-shoot {
  opacity: 0;
  animation: hs-shoot 12s linear infinite;
}

.hero-spazio .hs-shoot-2 {
  animation-delay: -6s;
}

.hero-spazio .hs-run {
  animation: hs-run var(--hs-p, 12s) linear infinite;
}

.hero-spazio .hs-tw {
  animation: hs-tw var(--hs-p, 4s) ease-in-out infinite;
  animation-delay: var(--hs-l, 0s);
}

@keyframes hs-orb {
  0% { transform: rotate(0deg); }
  41.67% { transform: rotate(360deg); }
  100% { transform: rotate(360deg); }
}

@keyframes hs-travel {
  0%,
  41.67% {
    transform: translate(var(--ox), var(--oy)) scale(var(--os));
    animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1);
  }
  58.33%,
  83.33% {
    transform: translate(var(--gx), var(--gy)) scale(1);
    animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1);
  }
  100% {
    transform: translate(var(--ox), var(--oy)) scale(var(--os));
  }
}

@keyframes hs-self {
  0% { transform: rotate(0deg); }
  41.67% { transform: rotate(720deg); }
  100% { transform: rotate(720deg); }
}

@keyframes hs-glow {
  0%,
  41.67% { opacity: 0; }
  58.33%,
  83.33% { opacity: 0.6; }
  100% { opacity: 0; }
}

@keyframes hs-shoot {
  0%,
  58% {
    opacity: 0;
    transform: translate(0, 0);
  }
  62% {
    opacity: 1;
    transform: translate(0, 0);
  }
  74%,
  100% {
    opacity: 0;
    transform: translate(-150px, 56px);
  }
}

@keyframes hs-run {
  to { transform: rotate(360deg); }
}

@keyframes hs-tw {
  0%,
  100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Hero con video di sfondo (testo crema su inchiostro, contrasto AA) */
.hero-video {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  display: flex;
  align-items: center;
  background: var(--pk-color-blu-inchiostro);
  color: var(--pk-color-crema);
}
.hero-video .hv-still,
.hero-video .hv-still img,
.hero-video .bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(23, 24, 59, 0.88) 0%, rgba(23, 24, 59, 0.7) 40%, rgba(23, 24, 59, 0) 65%);
}
.hero-video .hv-text {
  position: relative;
  z-index: 1;
  padding-top: 64px;
  padding-bottom: 64px;
}
.hero-video .hv-text > div { max-width: 520px; }
.hero-video h1,
.hero-video .lead { color: var(--pk-color-crema); }
@media (max-width: 700px) {
  .hero-video { align-items: flex-start; min-height: 620px; }
  .hero-video::after {
    background: linear-gradient(180deg, rgba(23, 24, 59, 0.85) 0%, rgba(23, 24, 59, 0.55) 45%, rgba(23, 24, 59, 0) 70%);
  }
  .hero-video .hv-text { padding-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-video .bg-video,
  .hero-video .hv-toggle { display: none; }
}
/* Focus chiaro sull'hero scuro (WCAG 1.4.11): crema su inchiostro */
.hero-video :focus-visible {
  outline-color: var(--pk-color-crema);
}
/* Pausa/riproduci animazione di sfondo (WCAG 2.2.2), bersaglio 44px */
.hero-video .hv-toggle {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--pk-color-crema);
  border-radius: 999px;
  background: var(--pk-color-blu-inchiostro);
  color: var(--pk-color-crema);
  cursor: pointer;
}
.hero-video .hv-toggle .hv-icon {
  width: 14px;
  height: 16px;
  border-left: 5px solid currentColor;
  border-right: 5px solid currentColor;
}
.hero-video .hv-toggle[aria-pressed="true"] .hv-icon {
  width: 0;
  height: 0;
  border: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 14px solid currentColor;
  margin-left: 3px;
}

/* Selettore lingua (KRE-444): IT · EN · SQ, lingua attiva marcata con aria-current */
.lang-switch ul {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--pk-color-blu-inchiostro);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.lang-switch a:hover {
  text-decoration: underline;
  text-decoration-color: var(--pk-color-corallo-pragma);
  text-decoration-thickness: 3px;
}

.lang-switch a[aria-current="true"] {
  background: var(--pk-color-blu-inchiostro);
  color: var(--pk-color-crema);
}

@media (max-width: 899px) {
  .lang-switch {
    order: 2;
  }
  .nav,
  .btn-cta-header {
    min-width: 0;
  }
  .nav ul {
    flex-wrap: wrap;
  }
  .nav a,
  .footer-inner,
  .hero h1,
  .card h3,
  .step-card h3,
  .box h2,
  .box h3 {
    overflow-wrap: anywhere;
    hyphens: auto;
  }
}
