/* ============================================================
   HOME CSS — Solferino Technology
   index.html specific styles
   ============================================================ */

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg);
}

/* Dark fluid hero variant */
.hero-section--dark {
  background: #050505;
}

/* WebGL fluid canvas — sits behind all content */
.fluid-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none; /* events handled by hero-section parent */
}

/* Text overrides for dark hero */
.hero-section--dark .brand-word {
  color: var(--bg);
}

.hero-section--dark .hero-brand-line--accent .brand-word {
  color: var(--accent);
}

.hero-section--dark .hero-slogan .t-editorial {
  color: rgba(249,248,246,0.9);
}

.hero-section--dark .hero-slogan .t-editorial em {
  color: var(--accent);
}

.hero-section--dark .hero-meta .t-label {
  color: rgba(249,248,246,0.45);
}

.hero-section--dark .svg-path {
  stroke: rgba(249,248,246,0.08) !important;
}

.hero-section--dark .svg-path--accent {
  stroke: rgba(0,74,173,0.5) !important;
}

.hero-section--dark .svg-node {
  fill: rgba(249,248,246,0.2) !important;
}

.hero-section--dark .scroll-line {
  background: linear-gradient(to bottom, rgba(249,248,246,0.5) 0%, transparent 100%);
}

.hero-inner {
  position: relative;
  z-index: 2; /* above canvas */
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  padding-top: var(--nav-h);
}

/* SVG Structural Path */
.hero-svg-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.hero-svg {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  opacity: 0.12;
}

.svg-path {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  transition: none; /* GSAP handles this */
}

.svg-node {
  opacity: 0;
  transform-origin: center;
}

.hero-interno {
  display: flex;
  align-items: center;   /* allinea verticalmente al centro */
  gap: 24px;              /* spazio tra logo e testo */
  flex-direction: row;    /* logo a sinistra, testo a destra (default) */
}

#stage {
  display: none;
}

/* Brand Name */
.hero-brand {
  position: relative;
  z-index: 2;
  margin-bottom: clamp(24px, 3vw, 40px);
}

.hero-brand-line {
  line-height: 0.9;
}

.brand-word {
  display: block;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(4rem, 10vw, 11.5rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--text);
  /* initial state handled by GSAP — no overflow:hidden needed */
  will-change: transform, opacity;
}

.hero-brand-line--accent .brand-word {
  color: var(--accent);
}

/* Hero slogan */
.hero-slogan {
  position: relative;
  z-index: 2;
  max-width: 640px;
  opacity: 0;
  transform: translateY(20px);
  will-change: transform, opacity;
  margin-bottom: clamp(16px, 2vw, 32px);
}

.hero-slogan .t-editorial {
  font-size: clamp(1.4rem, 2.8vw, 2.8rem);
  color: var(--text);
}

.hero-slogan .t-editorial em {
  color: var(--accent);
}

/* Scroll indicator */
.hero-scroll-indicator {
  position: absolute;
  right: var(--gutter);
  bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  z-index: 2;
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--text) 0%, transparent 100%);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* Meta bar */
.hero-meta {
  position: relative;
  display: flex;
  gap: 32px;
  z-index: 2;
}

.hero-meta span { color: var(--muted); }

.hero-button {
  display: none;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   SERVICES SECTION
   ============================================================ */
.services-section {
  background: var(--bg);
}

.services-sticky {
  padding: clamp(40px, 5vw, 80px) var(--gutter) var(--section-pad);
  max-width: var(--container-max);
  margin: 0 auto;
}

.services-headline {
  margin-bottom: clamp(40px, 6vw, 80px);
}

.services-headline .t-headline em {
  color: var(--accent);
}

/* Services grid — 2x2 editorial layout */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.service-card {
  background: var(--bg);
  padding: clamp(28px, 4vw, 52px);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: background 0.4s ease;
  opacity: 0;
  transform: translateY(32px);
  will-change: transform, opacity;
}

.service-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.5s ease;
}

.service-card:hover { background: #f4f3f1; }
.service-card:hover::before { width: 100%; }

.service-number {
  color: var(--muted);
  align-self: start;
}

.service-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}

.service-desc {
  color: #5a5a5a;
  max-width: 340px;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-tags span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 2px;
}

.service-link {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: gap 0.3s ease;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.service-link:hover { gap: 14px; }

/* ============================================================
   WHY SECTION
   ============================================================ */
.why-section {
  padding-top: var(--section-pad);
  background: var(--bg);
  overflow: hidden;
}

/* Marquee */
.marquee-wrapper {
  width: 100%;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  margin-bottom: var(--section-pad);
  background: var(--bg);
}

.marquee-track { overflow: hidden; }

.marquee-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  white-space: nowrap;
  animation: marqueeScroll 22s linear infinite;
}

.marquee-inner span {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  flex-shrink: 0;
}

.marquee-dot {
  font-size: 0.5rem !important;
  color: var(--accent) !important;
  font-weight: 900 !important;
}

@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Pause on hover — no JS speed modulation */
.marquee-wrapper:hover .marquee-inner {
  animation-play-state: paused;
}

/* Why inner */
.why-inner {
  padding-bottom: var(--section-pad);
}

.why-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: clamp(48px, 7vw, 96px);
}

.why-headline em {
  color: var(--accent);
}

/* Why grid — 2x2, editorial asymmetric */
.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px) clamp(24px, 6vw, 80px);
}

.why-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(24px);
  will-change: transform, opacity;
}

/* Stagger odd items down for asymmetric feel */
.why-item:nth-child(odd) { margin-top: 0; }
.why-item:nth-child(even) { margin-top: clamp(24px, 4vw, 56px); }

.why-item-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.why-number { color: var(--accent); flex-shrink: 0; margin-top: 3px; }

.why-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.why-text { color: #5a5a5a; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .services-grid   { grid-template-columns: 1fr; }
  .why-grid        { grid-template-columns: 1fr; }
  .why-item:nth-child(even) { margin-top: 0; }

  .hero-meta {
    flex-direction: column;
    gap: 4px;
    bottom: 24px;
    position: static;
    margin-top: clamp(24px, 5vw, 40px);
    flex-wrap: wrap;
  }
  
  .hero-button {
    display: flex;
    padding-top: 5vw;
  }

  .hero-scroll-indicator { bottom: 24px; }
  
  .hero-interno {
    flex-direction: column-reverse;
    gap: 0;
  }

  #logo-svg {
    width: 65%;
    height: 65%;
  }
  
  #stage {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .hero-inner {
    padding-top: 0;
  }
  
  .marquee-inner {
    animation: marqueeScroll 16s linear infinite;
  }
}

@media (max-width: 480px) {
  .service-card { padding: 24px 20px; }
  
  .marquee-inner {
    animation: marqueeScroll 11s linear infinite;
  }
}

/* ============================================================
   HERO — mobile tweaks (small phones)
   ============================================================ */
@media (max-width: 480px) {
  .brand-word {
    font-size: clamp(2.6rem, 13vw, 4rem);
  }

  .hero-slogan .t-editorial {
    font-size: clamp(1.05rem, 4.5vw, 1.4rem);
  }

  .hero-meta {
    gap: 16px;
  }

  .hero-scroll-indicator { display: none; }
}