:root {
  --color-primary: #991636;
  --color-primary-tint1: #B54B63;
  --color-secondary: #F49739;
  --color-dark-base: #232323;
  --color-dark-e1: #2E2E2E;
  --color-text-primary: #EAEAEA;
  --color-text-secondary: #C5C5C5;
  --font-serif: 'Exo 2', sans-serif;
  --font-sans: 'Montserrat', sans-serif;
  
  /* New Glass System Variables */
  --glass-bg: rgba(8, 5, 5, 0.8);
  --border: rgba(255, 255, 255, 0.12);
  --accent: #F49739;
  --blur: 5px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #030303;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2rem;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
  pointer-events: none;
}

/* Language Switcher - Fixed Position */
.language-switcher {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 101;
  display: flex;
  background: rgba(10, 10, 10, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  padding: 4px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lang-btn {
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lang-btn.active {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(153, 22, 54, 0.3);
}

.lang-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

.logo-container {
  width: 760px;
  max-width: 88vw;
  height: auto;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px; /* Spazio extra per lo zoom */
  pointer-events: auto;
}

 .logo-container * {
  pointer-events: auto;
 }

.logo-container svg {
  width: 100%;
  height: auto;
  overflow: visible !important;
}

/* Hero Section */
.hero {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.webgl-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#webgl-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Scanline Effect - Intensificato */
.scanline-effect {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.5) 0px,
    rgba(0, 0, 0, 0.5) 2px,
    transparent 2px,
    transparent 4px
  );
  animation: scanline 6s linear infinite;
}

@keyframes scanline {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(8px);
  }
}

/* Chromatic aberration */
.chromatic-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(90deg, 
      transparent 0%, 
      rgba(153, 22, 54, 0.05) 50%,
      transparent 100%
    ),
    linear-gradient(-90deg, 
      transparent 0%, 
      rgba(244, 151, 57, 0.05) 50%,
      transparent 100%
    );
  background-size: 200% 100%;
  animation: chromatic 6s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
}

@keyframes chromatic {
  0% { 
    background-position: 0% 50%;
    opacity: 0.2;
  }
  100% { 
    background-position: 100% 50%;
    opacity: 0.4;
  }
}

.hero-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-stack {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.hero-content {
  position: relative;
  z-index: 5;
  text-align: center;
  pointer-events: none;
  padding: 2rem 0;
}

#hero-title { 
    font-family: 'Exo 2', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 6.2vw, 4.2rem); /* Ridotto del 40% */
    line-height: 0.85; 
    letter-spacing: 0.1em; /* Stato normale */
    margin-bottom: 1.5rem;
    opacity: 0; /* Inizialmente invisibile */
}

.hero-content strong {
    font-family: 'Exo 2', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    letter-spacing: 0.4em; /* Stato normale */
    color: var(--accent);
    text-transform: uppercase;
    opacity: 0; /* Inizialmente invisibile */
}

@media (pointer: coarse) and (hover: none) and (orientation: landscape) and (max-height: 500px) {
  nav {
    padding: 0.75rem 1rem;
  }

  .logo-container {
    max-width: 60vw;
    padding: 10px;
  }

  .hero-content {
    padding: 1rem 0;
  }

  #hero-title {
    font-size: clamp(1.6rem, 4.2vw, 3rem);
    margin-bottom: 0.75rem;
  }

  .hero-content strong {
    font-size: 0.85rem;
    letter-spacing: 0.25em;
  }

  .language-switcher {
    top: 0.75rem;
    right: 0.75rem;
    transform: scale(0.9);
    transform-origin: top right;
  }
}

/* Container Floating Rule */
main#content-flow {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 125vh;
}

/* The Monolith Panel */
.glass-panel {
    background-color: var(--glass-bg);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4rem;
    margin-bottom: 8rem;
    color: #EAEAEA;
    box-shadow: 0 40px 80px rgba(0,0,0,0.6);
}

.irony-note {
    margin-top: 2rem;
    opacity: 0.7;
    font-style: italic;
    border-top: 1px solid rgba(255,255,255,0.1); /* Linea separatrice sottile */
    padding-top: 1rem;
}
@media (max-width: 768px) {
    .glass-panel {
        padding: 2rem;
    }
}

/* Typography Hierarchy */
.badge-est {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: block;
}

h1 { 
    font-family: 'Exo 2', sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 9vw, 6.5rem); 
    line-height: 1.05; 
    letter-spacing: -0.04em; 
    margin-bottom: 2rem;
    color: #aaaaaa;
}

.hero-sub {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    line-height: 1.5;
    max-width: 45ch;
    color: #CCCCCC;
}

h2 {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    color: #bcbcbc;
}

h2 p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.7;
    color: #CCCCCC;
    text-align: justify;
    text-justify: inter-word;
    margin-bottom: 1.5rem;
    max-width: 65ch;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

.cousin-quote {
    font-family: var(--font-sans);
    font-style: italic;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    line-height: 1.5;
    padding-left: 2rem;
    border-left: 3px solid var(--color-primary);
    margin: 3rem 0;
    color: #EAEAEA;
    max-width: 50ch;
}

h3 {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    margin-bottom: 1.5rem;
    color: var(--accent);
}

p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.7;
    color: #CCCCCC;
    text-align: justify;
    text-justify: inter-word;
    margin-bottom: 1.5rem;
    max-width: 65ch;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

 h1, h2, h3, h4, p, span, strong, small, label, button {
    transition: filter 256ms ease, opacity 256ms ease;
    will-change: filter, opacity;
 }

 body.lang-switching h1,
 body.lang-switching h2,
 body.lang-switching h3,
 body.lang-switching h4,
 body.lang-switching p,
 body.lang-switching span,
 body.lang-switching strong,
 body.lang-switching small,
 body.lang-switching label,
 body.lang-switching button {
    filter: blur(6px);
    opacity: 0.25;
 }

 @media (prefers-reduced-motion: reduce) {
    h1, h2, h3, h4, p, span, strong, small, label, button {
        transition: none;
    }
 }

strong { color: #FFFFFF; font-weight: 600; }

/* Grid for Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 8rem;
}

@media (max-width: 992px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

.service-card {
    margin-bottom: 0;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.service-card:hover {
    background-color: rgba(20, 20, 20, 0.85);
    border-color: var(--color-primary); 
    transform: translateY(-8px);
}

.cta-link {
    display: inline-block;
    padding: 1.5rem 3rem;
    background-color: var(--color-primary);
    color: white;
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.cta-link:hover {
    background-color: var(--color-primary-tint1);
    transform: scale(1.05);
}

/* Tracking In Expand Animation */
#hero-title.tracking-in-expand {
  -webkit-animation: tracking-in-expand .7s cubic-bezier(.215,.61,.355,1.000) both;
  animation: tracking-in-expand .7s cubic-bezier(.215,.61,.355,1.000) both;
}

.hero-content.tracking-in-expand strong {
  -webkit-animation: tracking-in-expand .7s cubic-bezier(.215,.61,.355,1.000) both;
  animation: tracking-in-expand .7s cubic-bezier(.215,.61,.355,1.000) both;
}

@-webkit-keyframes tracking-in-expand {
  0% {
    letter-spacing: -.5em;
    opacity: 0
  }
  40% {
    opacity: .6
  }
  100% {
    opacity: 1
  }
}

@keyframes tracking-in-expand {
  0% {
    letter-spacing: -.5em;
    opacity: 0
  }
  40% {
    opacity: .6
  }
  100% {
    opacity: 1
  }
}

/* Blur Out Animation */
.blur-out-expand {
  -webkit-animation: blur-out-expand 1s cubic-bezier(.25,.46,.45,.94) both;
  animation: blur-out-expand 1s cubic-bezier(.25,.46,.45,.94) both;
}

@-webkit-keyframes blur-out-expand {
  0% {
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
  }
  100% {
    filter: blur(12px);
    opacity: 0;
    transform: scale(1.2);
  }
}

@keyframes blur-out-expand {
  0% {
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
  }
  100% {
    filter: blur(12px);
    opacity: 0;
    transform: scale(1.2);
  }
}

/* Workflow Grid Layout */
.workflow-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.workflow-block {
    background: rgba(15, 15, 15, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.workflow-block:hover {
    background: rgba(20, 20, 20, 0.7);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
}

.workflow-block h4 {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.workflow-block p {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.workflow-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.workflow-section h3 {
    font-family: 'Exo 2', sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--color-text-primary);
    line-height: 1.1;
}

/* Responsive per Workflow Grid */
@media (max-width: 768px) {
    .workflow-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .workflow-section h3 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .workflow-block {
        padding: 1.5rem;
    }
}

/* Section Divider */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 20%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 80%, 
        transparent 100%);
    margin: 6rem 0;
    position: relative;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0.3;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.1;
    }
}

/* Services Grid con Delay */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    background: rgba(15, 15, 15, 0.85);
    border-color: var(--accent);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(153, 22, 54, 0.1);
}

.service-card h3 {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
    line-height: 1.2;
}

.service-card p {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.service-card strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

/* Contact Form Styles */
.contact-form {
    max-width: 500px;
    margin: 2rem auto 0;
    padding: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input,
.form-textarea {
    width: 100%;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 1rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    color: var(--color-text-primary);
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(25, 25, 25, 0.7);
    box-shadow: 0 0 0 3px rgba(153, 22, 54, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

.form-help {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
    font-style: italic;
}

.form-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, #b71e4a 100%);
    border: none;
    border-radius: 6px;
    padding: 1rem 2rem;
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(153, 22, 54, 0.3);
}

.form-submit:active {
    transform: translateY(0);
}

.form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-text {
    position: relative;
    z-index: 1;
}

.button-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

.form-submit.loading .button-text {
    opacity: 0.7;
}

.form-submit.loading .button-spinner {
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Cloudflare Turnstile Styles */
.cf-turnstile {
    margin: 1rem 0;
}

/* Form Success/Error States */
.form-success {
    background: rgba(34, 139, 34, 0.1);
    border: 1px solid rgba(34, 139, 34, 0.3);
    color: #90EE90;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

.form-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #ff6b6b;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

.tech-info {
    margin-top: 1rem;
    padding-top: 1rem;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.9rem;
    color: #444;
    text-align: center;
}

 .footer-social {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    width: 100%;
 }

 .footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 10, 10, 0.35);
    color: rgba(255, 255, 255, 0.75);
    transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease;
 }

 .footer-social-link:hover {
    transform: translateY(-2px);
    background: rgba(20, 20, 20, 0.5);
    color: #ffffff;
    border-color: rgba(244, 151, 57, 0.35);
 }

 .footer-social-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(244, 151, 57, 0.25);
 }
