/* ══════════════════════════════════════════════════════════
   home.css — Homepage-specific styles
   matteogiorgi.com · loaded only on index.php
══════════════════════════════════════════════════════════ */

/* Space Mono font (used in hero label, stats, service carousel) */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

/* ── RESET overrides ── */
html { scroll-behavior: auto }

/* ── DNA BACKGROUND CANVAS ── */
#bgc {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; transition: opacity .6s ease;
}

/* ── SCROLL PROGRESS BAR ── */
#spb {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--orange), var(--teal));
  width: 0%; z-index: 9997;
}

/* ── GLOBAL SCANLINES overlay (fixed, fades with DNA) ── */
#gsl {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,.045) 3px, rgba(0,0,0,.045) 4px);
}

/* ── HERO ── */
#hero {
  position: relative; height: 100vh;
  display: flex; align-items: center; z-index: 5;
}
#hero::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg,
    rgba(10,10,14,.97) 0%, rgba(10,10,14,.82) 40%,
    rgba(10,10,14,.08) 58%, transparent 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  padding: 0 5.5vw; max-width: 600px;
}
.hero-label {
  display: flex; align-items: center; gap: .9rem;
  font-family: 'Space Mono', monospace;
  font-size: .62rem; letter-spacing: .28em; text-transform: uppercase;
  color: rgba(255,255,255,.42); margin-bottom: 1.8rem;
}
.hero-label-line {
  width: 2.2rem; height: 2px; background: var(--orange); flex-shrink: 0;
}
.hero-name {
  font-size: clamp(3.8rem, 8.5vw, 8rem); font-weight: 900;
  line-height: .9; letter-spacing: -.02em; margin-bottom: 1.6rem;
}
.hero-name span { color: var(--orange) }
.hero-desc {
  font-size: clamp(.87rem, 1.22vw, 1rem); font-weight: 300;
  line-height: 1.78; color: rgba(255,255,255,.62);
  max-width: 490px; margin-bottom: 2.2rem;
}
.hero-desc strong { color: #fff; font-weight: 600 }
.hero-badges {
  display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2.5rem;
}
.badge {
  display: flex; align-items: center; gap: .5rem;
  border: 1px solid rgba(255,255,255,.12); border-radius: 100px;
  padding: .3rem .85rem .3rem .6rem; font-size: .64rem;
  color: rgba(255,255,255,.5); background: rgba(255,255,255,.04);
  backdrop-filter: blur(6px);
}
.badge svg { width: 14px; height: 14px; flex-shrink: 0; opacity: .85 }
.hero-ctas {
  display: flex; align-items: center; gap: .85rem;
  flex-wrap: nowrap; white-space: nowrap;
}
.btn-primary {
  display: inline-flex; align-items: center;
  background: var(--orange); color: #fff; border: none;
  padding: .72rem 1.55rem; border-radius: 8px;
  font-weight: 700; font-size: .85rem; cursor: pointer;
  text-decoration: none; transition: transform .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,107,53,.35) }
.btn-ghost {
  display: inline-flex; align-items: center;
  color: rgba(255,255,255,.75); font-size: .85rem; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
  border: 1px solid rgba(0,214,207,.45); border-radius: 8px;
  padding: .72rem 1.35rem; background: rgba(0,214,207,.04); white-space: nowrap;
}
.btn-ghost:hover { color: #fff; border-color: rgba(0,214,207,.85); background: rgba(0,214,207,.1) }
.btn-wa {
  display: inline-flex; align-items: center; gap: .45rem;
  background: #25d366; color: #fff; border: none;
  padding: .72rem 1.25rem; border-radius: 8px;
  font-weight: 700; font-size: .85rem; cursor: pointer;
  text-decoration: none; transition: transform .2s, box-shadow .2s; white-space: nowrap;
}
.btn-wa:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(37,211,102,.3) }

/* ── STATS BAR ── */
#stats {
  position: relative; z-index: 5;
  background: rgba(10,10,14,.62); padding: 3.2rem 5.5vw;
}
#stats::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.11) 2px, rgba(0,0,0,.11) 4px);
  z-index: 12;
}
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
}
.stat-item { text-align: center; padding: 0 1rem; position: relative }
.stat-item + .stat-item::before {
  content: ''; position: absolute; left: 0; top: 15%; height: 70%;
  width: 1px; background: rgba(255,255,255,.09);
}
.stat-num {
  font-family: 'Roboto', sans-serif;
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  font-weight: 900; color: var(--orange);
  line-height: 1; margin-bottom: .5rem; letter-spacing: -.02em;
  position: relative;
}
.stat-lbl {
  font-family: 'Space Mono', monospace;
  font-size: .58rem; letter-spacing: .26em;
  text-transform: uppercase; color: rgba(255,255,255,.38);
}

/* ── INTRO ── */
#intro {
  position: relative; z-index: 5;
  background: linear-gradient(to bottom, rgba(10,10,14,.62) 0%, rgba(10,10,14,.65) 65%, rgba(10,10,14,.65) 100%);
  padding: 5.5rem 5.5vw 10rem; text-align: center;
}
#intro::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.11) 2px, rgba(0,0,0,.11) 4px);
  z-index: 12;
}
.intro-tag {
  font-family: 'Space Mono', monospace;
  font-size: .6rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--orange); margin-bottom: 1.5rem;
}
.intro-title {
  font-size: clamp(2.4rem, 5.5vw, 4.4rem); font-weight: 900;
  line-height: 1.05; letter-spacing: -.025em;
  color: #fff; margin-bottom: 1.5rem;
}
.intro-title em { font-style: normal; color: var(--orange) }
.intro-div {
  width: 48px; height: 3px; background: var(--orange);
  border-radius: 2px; margin: 0 auto 2rem;
}
.intro-desc {
  font-size: clamp(.95rem, 1.3vw, 1.1rem); font-weight: 300;
  line-height: 1.85; color: rgba(255,255,255,.6);
  max-width: 660px; margin: 0 auto;
}

/* ── SERVICES CAROUSEL ── */
#sw { height: 1000vh; position: relative }
#ss {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  background: rgba(10,10,14,.65);
}
#ss::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.11) 2px, rgba(0,0,0,.11) 4px);
  z-index: 12;
}
.dim {
  position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity .6s;
  background: radial-gradient(ellipse 80% 90% at 50% 50%, rgba(10,10,14,0) 30%, rgba(10,10,14,.72) 100%);
}
.scan { display: none }
.ct {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  perspective: 2000px; perspective-origin: 50% 50%;
}
.sc {
  position: absolute;
  width: clamp(300px, 48vw, 760px); height: clamp(200px, 62vh, 520px);
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 40px 120px rgba(0,0,0,.85);
  will-change: transform, opacity, filter;
}
.sc.anim { transition: transform .95s cubic-bezier(.22,.6,.36,1), opacity .95s ease, filter .95s ease }
.sc.s-past  { transform: translateX(-62%) translateY(-48%) translateZ(-180px) rotateY(48deg)  rotateZ(-10deg) scale(.08); opacity: 0;   filter: brightness(.6) blur(1px) }
.sc.s-prev  { transform: translateX(-38%) translateY(-30%) translateZ(-220px) rotateY(30deg)  rotateZ(-6deg)  scale(.3);  opacity: .32; filter: brightness(.45) blur(3px) }
.sc.s-active{ transform: none; opacity: 1; filter: brightness(1) }
.sc.s-next  { transform: translateX(52%)  translateY(28%)  translateZ(-220px) rotateY(-18deg) rotateZ(2.5deg) scale(.72); opacity: .42; filter: brightness(.3) blur(2.5px) }
.sc.s-future{ transform: translateX(98%)  translateY(54%)  translateZ(-300px) rotateY(-26deg) rotateZ(4.5deg) scale(.44); opacity: 0;   filter: brightness(.15) }
.sc-cv   { position: absolute; inset: 0; width: 100%; height: 100% }
.sc-ov   { position: absolute; inset: 0; background: linear-gradient(145deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.18) 50%, rgba(0,0,0,.55) 100%) }
.sc-sl   { position: absolute; inset: 0; pointer-events: none; opacity: .22; background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.1) 2px, rgba(0,0,0,.1) 4px) }
.sc-num  { position: absolute; top: 1.8rem; left: 2.5rem; font-family: 'Space Mono', monospace; font-size: .56rem; letter-spacing: .22em; color: rgba(255,255,255,.3) }
.sc-tag  { position: absolute; top: 1.8rem; right: 1.8rem; font-family: 'Space Mono', monospace; font-size: .56rem; letter-spacing: .18em; text-transform: uppercase; padding: .33rem .8rem; border: 1px solid rgba(255,255,255,.2); border-radius: 100px; color: rgba(255,255,255,.52) }
.sc-body { position: absolute; inset: 0; padding: 2.2rem 2.8rem; display: flex; flex-direction: column; justify-content: flex-end }
.sc-title {
  font-family: 'Space Mono', monospace; font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 3.4rem); line-height: .92;
  color: #fff; margin-bottom: .75rem; position: relative;
  text-shadow: 0 4px 40px rgba(0,0,0,.7);
}
.sc-title::before, .sc-title::after {
  content: attr(data-t); position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
}
.sc-title::before { color: var(--orange); animation: gt 5s infinite; clip-path: polygon(0 0,100% 0,100% 32%,0 32%) }
.sc-title::after  { color: var(--teal);   animation: gb 5s infinite; clip-path: polygon(0 66%,100% 66%,100% 100%,0 100%) }
.sc-sub {
  font-size: .87rem; color: rgba(255,255,255,.76); font-weight: 300;
  line-height: 1.7; max-width: 380px; margin-bottom: 1.4rem;
  text-shadow: 0 2px 8px rgba(0,0,0,.8);
}
.sc-cta {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: 'Space Mono', monospace; font-size: .62rem;
  letter-spacing: .18em; text-transform: uppercase;
  color: #fff; text-decoration: none;
  border: 1px solid rgba(255,255,255,.3); border-radius: 100px;
  padding: .5rem 1.25rem; background: rgba(255,255,255,.07);
  backdrop-filter: blur(8px);
  transition: background .3s, border-color .3s, gap .3s; width: fit-content;
}
.sc-cta:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.6); gap: .85rem }
.sc-cta-arr { font-size: .9rem }
.bnav { position: absolute; bottom: 2.6rem; left: 2.4rem; z-index: 30 }
.bn-lbl {
  font-family: 'Space Mono', monospace; font-size: .54rem;
  letter-spacing: .3em; text-transform: uppercase;
  color: rgba(255,255,255,.2); margin-bottom: 1rem;
}
.bn-list { list-style: none; display: flex; flex-direction: column; gap: .3rem }
.bn-item {
  font-family: 'Space Mono', monospace; font-size: .74rem;
  color: rgba(255,255,255,.26); cursor: pointer;
  display: flex; align-items: center; gap: .5rem;
  padding: .08rem 0; transition: color .35s;
}
.bn-item.on { color: rgba(255,255,255,.9) }
.bn-arr { color: var(--orange); transition: transform .35s }
.bn-item.on .bn-arr { transform: translateX(4px) }
.rdots {
  position: absolute; right: 2rem; top: 50%; transform: translateY(-50%);
  z-index: 30; display: flex; flex-direction: column; gap: .65rem;
}
.rdot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,.18);
  transition: background .4s, height .4s, border-radius .4s;
}
.rdot.on { height: 18px; border-radius: 3px }
.shint {
  position: absolute; bottom: 2.6rem; right: 2.4rem; z-index: 30;
  display: flex; align-items: center; gap: .75rem;
  font-family: 'Space Mono', monospace; font-size: .54rem;
  letter-spacing: .24em; text-transform: uppercase; color: rgba(255,255,255,.18);
}
.sh-l {
  width: 36px; height: 1px; background: rgba(255,255,255,.14);
  animation: slp 2.2s ease-in-out infinite;
}

/* ── APPROCCIO section ── */
#approccio { background: rgba(10,10,14,.72) !important }

/* ── SETTORI ── */
.sectors-grid {
  display: flex; flex-wrap: wrap; gap: .65rem;
  margin-top: 2.5rem; justify-content: center;
}
.sector-pill {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.1rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 100px; font-size: .8rem; font-weight: 500;
  color: var(--text-2); transition: var(--tr);
  white-space: nowrap; cursor: default;
}
.sector-pill:hover {
  border-color: var(--orange); color: #fff;
  background: var(--orange-glow); transform: translateY(-2px);
}
.sector-pill .s-icon { font-size: 1rem; line-height: 1 }

/* ── GLITCH — dual-colour split clone (for single-line titles) ── */
.glitch-t { position: relative }
.glitch-t::before, .glitch-t::after {
  content: attr(data-t); position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; overflow: hidden; pointer-events: none;
  white-space: pre-line; opacity: 0;
}
.glitch-t::before { color: var(--orange); animation: gt 5s var(--gd, 0s) infinite; clip-path: polygon(0 0,100% 0,100% 32%,0 32%) }
.glitch-t::after  { color: var(--teal);   animation: gb 5s var(--gd, 0s) infinite; clip-path: polygon(0 66%,100% 66%,100% 100%,0 100%) }

/* ── GLITCH — chromatic text-shadow (for multi-line titles) ── */
.glitch-shadow { animation: gs 5s var(--gd, 0s) infinite }

/* ── KEYFRAMES ── */
@keyframes gt {
  0%,88%,100% { opacity:0; transform:translate(0) }
  89%  { opacity:1; transform:translate(-4px,-1px) }
  91%  { transform:translate(4px,1px) }
  93%  { opacity:0 }
}
@keyframes gb {
  0%,90%,100% { opacity:0; transform:translate(0) }
  91%  { opacity:1; transform:translate(4px,1px) }
  93%  { transform:translate(-4px,-1px) }
  95%  { opacity:0 }
}
@keyframes gs {
  0%,85%,100% { text-shadow:none; filter:none }
  86% { text-shadow:-4px -1px 0 rgba(255,107,53,.9), 4px 1px 0 rgba(0,214,207,.9); filter:brightness(1.1) }
  88% { text-shadow: 4px  1px 0 rgba(255,107,53,.9),-3px  0   0 rgba(0,214,207,.9) }
  90% { text-shadow:none; filter:none }
  91% { text-shadow:-2px  0   0 rgba(255,107,53,.75), 3px  0   0 rgba(0,214,207,.75) }
  93% { text-shadow:none }
}
@keyframes slp {
  0%,100% { width:36px }
  50%     { width:64px; opacity:.5 }
}

/* ══ MOBILE ══════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Hero */
  #hero {
    height: auto; min-height: auto;
    padding-top: 110px; padding-bottom: 3.5rem;
    align-items: flex-start;
  }
  #hero::before { background: rgba(10,10,14,.9) }
  .hero-inner { padding: 0 5vw; max-width: 100%; width: 100% }
  .hero-name  { font-size: 13vw }
  .hero-desc  { font-size: .86rem; max-width: 100%; line-height: 1.65 }
  .hero-badges { flex-wrap: wrap; gap: .45rem }
  .badge { font-size: .6rem; padding: .25rem .7rem .25rem .5rem }
  .hero-ctas { flex-wrap: wrap; gap: .65rem; white-space: normal }
  .btn-primary, .btn-ghost, .btn-wa {
    white-space: normal; font-size: .82rem; padding: .65rem 1.15rem;
  }

  /* Stats — 2×2 grid */
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: 2.4rem 0; padding: 0 }
  .stat-item + .stat-item::before { display: none }
  .stat-item:nth-child(3) { border-top: 1px solid rgba(255,255,255,.09) }
  .stat-item:nth-child(4) { border-top: 1px solid rgba(255,255,255,.09) }
  .stat-num { font-size: clamp(2.2rem, 11vw, 3.2rem) }
  .stat-lbl { font-size: .54rem }

  /* Service cards */
  .ct { padding-bottom: 22vh }
  .sc { width: 86vw; height: 76vw; min-height: 280px }
  .sc.s-prev { transform: translateX(-50%) translateY(-22%) scale(.68) rotateY(18deg);  filter: brightness(.22) blur(2px) }
  .sc.s-next { transform: translateX(52%)  translateY(20%)  scale(.68) rotateY(-16deg); filter: brightness(.22) blur(2px) }
  .sc-body  { padding: 1.4rem 1.6rem }
  .sc-title { font-size: clamp(1.6rem,7vw,2.6rem); margin-bottom: .5rem }
  .sc-sub   {
    font-size: .76rem; line-height: 1.52; margin-bottom: .8rem;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
  }
  .bnav { bottom: 4.5rem }
  .rdots, .shint { display: none }
}
