:root {
  --noise-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --bg: #050a10;
  --bg-elevated: rgba(8, 18, 32, 0.65);
  --accent: #00f0ff;
  --accent-soft: rgba(0, 240, 255, 0.35);
  --accent-glow: rgba(0, 240, 255, 0.12);
  --text: #e8f4ff;
  --text-muted: rgba(232, 244, 255, 0.82);
  --border: rgba(0, 240, 255, 0.22);
  /* Sans di sistema: leggibile, neutro, niente webfont */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Consolas", monospace;
}

html {
  background-color: #050a10;
  color-scheme: dark;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: var(--noise-tile);
  background-size: 160px 160px;
  background-repeat: repeat;
  mix-blend-mode: soft-light;
}

/* Griglia + bagliore ambient (animato leggero) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 0%, transparent 70%);
  animation: page-grid-drift 28s linear infinite;
}

@keyframes page-grid-drift {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(48px, 48px);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(0, 240, 255, 0.9);
  outline-offset: 3px;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 0 auto;
  /* Token condivisi con theme.css (:root) se presenti */
  padding: var(--site-wrap-pad-y, 2rem) var(--site-wrap-pad-x, 1.35rem) 4.5rem;
}

.wrap--wide {
  max-width: 62rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Back link ─── */
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.25rem;
  padding: 0.45rem 0.85rem 0.45rem 0.65rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(5, 14, 24, 0.6);
  box-shadow: 0 0 20px var(--accent-glow);
  transition:
    border-color 0.3s ease,
    box-shadow 0.35s ease,
    transform 0.25s ease,
    color 0.2s ease;
}

.back::before {
  content: "◀";
  font-size: 0.65em;
  opacity: 0.85;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.back:hover,
.back:focus-visible {
  outline: none;
  border-color: rgba(0, 240, 255, 0.55);
  box-shadow:
    0 0 28px rgba(0, 240, 255, 0.2),
    0 0 0 1px rgba(0, 240, 255, 0.15);
  transform: translateX(-2px);
  color: #bfffff;
}

.back:hover::before,
.back:focus-visible::before {
  transform: translateX(-4px);
}

/* ─── Header pagina ─── */
.page-head {
  margin-bottom: 2.5rem;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  padding: 0.25rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(0, 40, 50, 0.4) 0%, rgba(5, 12, 22, 0.9) 100%);
  box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.06);
}

.page-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: page-kicker-pulse 2s ease-in-out infinite;
}

@keyframes page-kicker-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.page-title {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #f2fbff 0%, var(--accent) 45%, #7aefff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(0, 240, 255, 0.15);
}

.page-lead {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 38ch;
}

.page-lead--tight {
  max-width: 52ch;
  margin-bottom: 0.75rem;
}

.page-lead--wide {
  max-width: 100%;
}

/* Riquadro intro “wow” (es. Come lavoro) */
.page-intro-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 1.35rem 0 0;
  max-width: 40rem;
  padding: 1.2rem 1.35rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: linear-gradient(148deg, rgba(10, 26, 40, 0.94) 0%, rgba(5, 14, 24, 0.9) 100%);
  box-shadow:
    inset 0 1px 0 rgba(0, 240, 255, 0.16),
    0 14px 42px rgba(0, 0, 0, 0.38),
    0 0 52px rgba(0, 200, 255, 0.14);
}

.page-intro-card::before,
.page-intro-card::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
}

.page-intro-card::before {
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    205deg,
    rgba(0, 240, 255, 0.14) 0%,
    transparent 42%,
    rgba(0, 240, 255, 0.05) 100%
  );
}

.page-intro-card::after {
  top: -40%;
  left: -95%;
  width: 32%;
  height: 180%;
  transform: skewX(-16deg);
  z-index: 1;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(0, 240, 255, 0.2) 40%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(0, 240, 255, 0.2) 60%,
    transparent 100%
  );
  mix-blend-mode: screen;
  animation: contact-details-shine 7.2s ease-in-out infinite;
}

.page-intro-card__lead {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.page-intro-card__lead strong {
  display: block;
  margin: 0 0 0.7rem;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.45;
  color: rgba(240, 252, 255, 0.98);
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  .page-intro-card::after {
    animation: none;
    opacity: 0;
  }
}

.page-lead strong {
  color: rgba(240, 252, 255, 0.95);
  font-weight: 600;
}

.page-feature-list {
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem 1.5rem;
  max-width: 52rem;
}

.page-feature-intro {
  margin: 1.25rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  max-width: 42ch;
}

.page-feature-intro + .page-feature-list {
  margin-top: 0.85rem;
}

@media (min-width: 560px) {
  .page-feature-list--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.page-feature-list li {
  position: relative;
  padding-left: 1.15rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.page-feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-soft);
}

.page-feature-list li strong {
  color: var(--text);
  font-weight: 600;
}

.page-lead a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-details {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 1.35rem 0 0;
  padding: 1rem 1.1rem;
  max-width: 28rem;
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 10px;
  background: rgba(5, 14, 24, 0.45);
}

.contact-details::before,
.contact-details::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
}

.contact-details::before {
  inset: 0;
  z-index: 0;
}

.contact-details::after {
  top: -40%;
  left: -95%;
  width: 30%;
  height: 180%;
  transform: skewX(-16deg);
  z-index: 1;
  animation: contact-details-shine 7.8s ease-in-out infinite;
}

@keyframes contact-details-shine {
  0%,
  68%,
  100% {
    left: -95%;
    opacity: 0;
  }
  16% {
    opacity: 0;
  }
  24% {
    opacity: 0.85;
  }
  54% {
    left: 128%;
    opacity: 0.8;
  }
  66% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-details::after {
    animation: none;
    opacity: 0;
  }
}

.contact-details__name {
  position: relative;
  z-index: 3;
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.contact-details__list {
  position: relative;
  z-index: 3;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.contact-details__list a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Storie “progetto su misura” (pagina Progetti) */
.story-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.story-card {
  padding: 1.15rem 1.2rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  backdrop-filter: blur(8px);
}

.story-card__title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: #f0fbff;
  line-height: 1.35;
}

.story-card p {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.story-card p:last-child {
  margin-bottom: 0;
}

.story-card__problem strong,
.story-card__custom strong,
.story-card__out strong {
  color: rgba(160, 250, 255, 0.95);
  font-weight: 600;
}

.page-cta {
  margin: 1.5rem 0 0;
}

.page-cta__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 6px;
  background: rgba(5, 16, 28, 0.65);
  box-shadow: 0 0 24px var(--accent-glow);
  transition:
    border-color 0.25s ease,
    box-shadow 0.3s ease,
    color 0.2s ease;
}

.page-cta__link:hover {
  border-color: rgba(0, 240, 255, 0.65);
  color: #d8ffff;
  box-shadow: 0 0 32px rgba(0, 240, 255, 0.2);
}

.page-cta + .page-cta {
  margin-top: 0.75rem;
}

/* Modulo contatti */
.contact-form {
  position: relative;
  max-width: 28rem;
}

.contact-form__note {
  margin: 0 0 1.25rem;
  font-size: 0.82rem;
  color: rgba(200, 230, 255, 0.65);
}

.contact-form__note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.contact-form__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0, 240, 255, 0.75);
}

.contact-form__optional {
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: none;
  color: rgba(200, 230, 255, 0.45);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(5, 14, 24, 0.85);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form textarea {
  resize: vertical;
  min-height: 8rem;
}

.contact-form input:hover,
.contact-form textarea:hover {
  border-color: rgba(0, 240, 255, 0.35);
}

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

.contact-form__status {
  min-height: 1.35rem;
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.contact-form__status--ok {
  color: rgba(120, 255, 210, 0.92);
}

.contact-form__status--error {
  color: rgba(255, 160, 160, 0.95);
}

.contact-form__submit {
  padding: 0.6rem 1.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  color: #050a10;
  background: linear-gradient(165deg, #7af0ff 0%, var(--accent) 100%);
  border: none;
  border-radius: 6px;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.25);
  transition: filter 0.2s ease, transform 0.15s ease;
}

.contact-form__submit:hover:not(:disabled) {
  filter: brightness(1.08);
}

.contact-form__submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.page-footer a {
  color: rgba(0, 240, 255, 0.55);
  text-decoration: none;
  letter-spacing: 0.12em;
}

.page-footer a:hover {
  color: rgba(180, 255, 255, 0.95);
  text-decoration: underline;
}

/* ─── Sezioni & reveal ─── */
.page-section {
  margin-top: 2.5rem;
}

.page-section__title {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.tech-grid {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.tech-card {
  position: relative;
  padding: 1.15rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease,
    box-shadow 0.4s ease;
}

.tech-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 240, 255, 0.5) 40%,
    rgba(0, 240, 255, 0.8) 50%,
    rgba(0, 240, 255, 0.5) 60%,
    transparent
  );
  opacity: 0.7;
}

.tech-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(0, 240, 255, 0.12),
    0 0 32px rgba(0, 200, 255, 0.12);
}

.tech-card__icon {
  display: inline-flex;
  margin-bottom: 0.65rem;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.4));
}

.tech-card__title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f0fbff;
}

.tech-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.25rem;
}

.tag {
  display: inline-block;
  padding: 0.28rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(180, 255, 255, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 4px;
  background: rgba(0, 30, 40, 0.45);
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--border);
  padding-left: 1.25rem;
}

.timeline li {
  position: relative;
  margin-bottom: 1.35rem;
  padding-left: 0.5rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-1.25rem - 4px);
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.timeline strong {
  display: block;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.timeline p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.page-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 240, 255, 0.12);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(0, 240, 255, 0.35);
}

/* Reveal: senza classe .js sul <html> il contenuto resta visibile (no JS) */
html.js [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(4px);
}

html.js [data-reveal].is-visible {
  animation: page-reveal-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--reveal-delay, 0ms);
}

@keyframes page-reveal-in {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* FAQ (pagina Contatti) */
.faq {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq__item {
  margin: 0;
  padding: 1rem 1.15rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  backdrop-filter: blur(8px);
}

.faq__q {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f0fbff;
  line-height: 1.35;
}

.faq__a {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.faq__a strong {
  color: rgba(160, 250, 255, 0.95);
  font-weight: 600;
}

.legal-block .page-lead + .page-lead {
  margin-top: 0.65rem;
}

.legal-meta {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: rgba(160, 200, 230, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none !important;
    opacity: 0.04;
  }

  body::after {
    opacity: 0.15;
  }

  .page-kicker::before {
    animation: none !important;
  }

  html.js [data-reveal]:not(.is-visible) {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  html.js [data-reveal].is-visible {
    animation: none !important;
  }

  .tech-card:hover {
    transform: none;
  }
}
