:root {
  --notte: #170b28;
  --notte-2: #211336;
  --viola: #8b5cf6;
  --viola-scuro: #5b21b6;
  --lavanda: #c4b5fd;
  --chiaro: #f4f0fb;
  --testo: #ece6f6;
  --muted: #a397ba;
  --bordo: rgba(196, 181, 253, .14);
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body { font-family: "Bricolage Grotesque", sans-serif; background: var(--notte); color: var(--testo); line-height: 1.6; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }
.serif { font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400; letter-spacing: 0; }
a { color: inherit; }

/* circuito decorativo sul lato destro di tutta la pagina (circuito.svg, alto 4000px, non si ripete).
   Sta dietro a tutto: sezioni chiare e card lo coprono, resta visibile solo sul viola scuro.
   Maschera 1: sfuma verso sinistra (testi puliti). Maschera 2: pieno nella hero, più leggero sotto. */
body { position: relative; }
body::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 55%; z-index: -1; background: url("../img/circuito.svg") right top no-repeat; opacity: .1; pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, #000 35%, transparent 90%), linear-gradient(#000 100vh, rgba(0, 0, 0, .4) calc(100vh + 300px));
  mask-image: linear-gradient(to left, #000 35%, transparent 90%), linear-gradient(#000 100vh, rgba(0, 0, 0, .4) calc(100vh + 300px));
  -webkit-mask-composite: source-in; mask-composite: intersect; }

/* header */
header { position: fixed; inset: 0 0 auto; z-index: 10; background: rgba(23, 11, 40, .72); backdrop-filter: blur(12px); border-bottom: 1px solid var(--bordo); }
header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { text-decoration: none; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.logo .serif { color: var(--lavanda); font-size: 1.2em; }
nav { display: flex; gap: 2rem; align-items: center; }
nav a { text-decoration: none; font-size: .92rem; color: var(--muted); }
nav a:hover { color: #fff; }
nav .nav-cta { color: #fff; border: 1px solid var(--bordo); padding: .45rem 1rem; border-radius: 10px; }
nav .nav-cta:hover { border-color: var(--lavanda); }

/* hero: luce dal basso che sfuma nel fondo prima del bordo, così allo scroll non si vede lo stacco */
.hero { min-height: 100vh; display: flex; flex-direction: column; position: relative; overflow: hidden; padding: 9rem 0 3.5rem; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 55% at 60% 100%, rgba(139, 92, 246, .38), rgba(91, 33, 182, .12) 55%, transparent 75%); -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; width: 100%; }

/* parte alta: titolo centrato in verticale nello spazio libero */
.hero-titolo { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.kicker { display: inline-flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .9rem; margin-bottom: 2.5rem; }
.kicker::before { content: ""; width: 28px; height: 1px; background: var(--muted); }
.hero h1 { position: relative; font-size: clamp(2.8rem, 8vw, 6.4rem); font-weight: 500; line-height: 1.02; letter-spacing: -.035em; max-width: 13ch; color: #fff; }
.hero h1 .serif { color: var(--lavanda); font-size: 1.08em; }/* "RM" fa parte del titolo (letto dagli screen reader) ma è mostrato come filigrana dietro, sbordando a sinistra e in alto/basso */
.hero h1 .rm { position: absolute; z-index: -1; left: -.06em; top: 50%; transform: translate(-6%, -50%); font-size: clamp(14rem, 40vw, 36rem); font-weight: 700; line-height: .8; letter-spacing: -.06em; color: rgba(255, 255, 255, .05); pointer-events: none; user-select: none; }

/* parte bassa: testo e pulsanti, fuori dalla filigrana */
.hero-piede { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 2rem; padding-top: 4rem; }
.hero-piede p { color: var(--muted); max-width: 46ch; font-size: 1.12rem; }
.azioni { display: flex; gap: .75rem; flex-wrap: wrap; }

/* pulsanti */
.btn { display: inline-block; padding: .9rem 1.6rem; border-radius: 12px; text-decoration: none; font-weight: 500; transition: background .2s, border-color .2s; }
.btn-pieno { background: var(--viola); color: #fff; }
.btn-pieno:hover { background: var(--viola-scuro); }
.btn-vuoto { border: 1px solid var(--bordo); }
.btn-vuoto:hover { border-color: var(--lavanda); }
/* freccia SVG: segue colore e dimensione del testo, spessore simile al peso 500 del font */
.freccia { width: 1em; height: 1em; margin-left: .35em; vertical-align: -.12em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.btn:hover .freccia { transform: translateX(3px); }
.btn-bianco { background: #fff; color: var(--viola-scuro); }
.btn-bianco:hover { background: var(--chiaro); }

/* sezioni */
section { padding: clamp(4.5rem, 9vw, 7rem) 0; }
.sec-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 3rem; }
.sec-head small { display: block; color: var(--viola); font-size: .85rem; font-weight: 500; margin-bottom: .6rem; }
h2 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 500; line-height: 1.05; letter-spacing: -.03em; color: #fff; }
h2 .serif { color: var(--lavanda); font-size: 1.08em; }
.sec-head p { color: var(--muted); max-width: 42ch; }

/* servizi */
.servizi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card { background: var(--notte-2); border: 1px solid var(--bordo); border-radius: 18px; padding: 2rem; display: flex; flex-direction: column; min-height: 240px; transition: border-color .25s, transform .25s; }
.card:hover { border-color: rgba(196, 181, 253, .45); transform: translateY(-3px); }
.card .num { font-family: "Instrument Serif", serif; font-style: italic; font-size: 2.6rem; line-height: 1; color: var(--lavanda); }
.card h3 { font-size: 1.3rem; font-weight: 500; color: #fff; margin: 0 0 .4rem; padding-top: 2rem; letter-spacing: -.01em; }
.card p { color: var(--muted); font-size: .95rem; }
.card.intro { grid-column: span 2; background: linear-gradient(140deg, var(--viola-scuro), var(--viola)); border: 0; justify-content: space-between; }
.card.intro blockquote { font-family: "Instrument Serif", serif; font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.15; color: #fff; text-wrap: balance; }
.card.intro p { color: #ede9fe; margin-top: 1.5rem; max-width: 50ch; }

/* trasparenza */
.light { background: var(--chiaro); color: #2a1a40; }
.light h2 { color: var(--notte); }
.light h2 .serif { color: var(--viola-scuro); }
.light .sec-head small { color: var(--viola-scuro); }
.light .sec-head p { color: #6b5c84; }
.voce { display: grid; grid-template-columns: 1fr auto; gap: .2rem 2rem; align-items: center; background: #fff; border-radius: 14px; padding: 1.4rem 1.6rem; margin-bottom: .75rem; box-shadow: 0 1px 2px rgba(23, 11, 40, .05); }
.voce[hidden] { display: none; } /* senza questa regola display:grid annulla l'attributo hidden */
.voce b { font-weight: 500; font-size: 1.1rem; }
.voce small { color: #7a6b91; grid-column: 1; }
.voce .euro { grid-row: span 2; grid-column: 2; font-family: "Instrument Serif", serif; font-size: 1.8rem; color: var(--viola-scuro); font-variant-numeric: tabular-nums; }
.nota { margin-top: 1.25rem; font-size: .85rem; color: #7a6b91; }

/* contatti */
.contatti { background: linear-gradient(140deg, #2a1050, var(--viola-scuro)); border-radius: 24px; padding: clamp(2rem, 5vw, 4rem); display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; position: relative; overflow: hidden; }
.contatti::after { content: "RM"; position: absolute; right: -1rem; bottom: -4rem; font-weight: 700; letter-spacing: -.06em; font-size: 16rem; line-height: 1; color: rgba(255, 255, 255, .05); pointer-events: none; }
.contatti small { color: var(--lavanda); font-size: .85rem; font-weight: 500; }
.contatti h2 { margin: .6rem 0 2rem; }
.contatti dl { position: relative; z-index: 1; }
.contatti dt { color: var(--lavanda); font-size: .8rem; }
.contatti dd { margin: 0 0 1.2rem; color: #fff; word-break: break-word; }

footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-top: 2rem; padding-bottom: 2rem; color: var(--muted); font-size: .85rem; }

@media (max-width: 820px) {
  nav a:not(.nav-cta) { display: none; }
  .servizi, .contatti { grid-template-columns: 1fr; }
  .card.intro { grid-column: auto; }

  /* circuito su mobile: scalato (60%), a tutta larghezza, solo nella hero e sfumato verso sinistra */
  body::before { width: 100%; background-size: 480px auto;
    -webkit-mask-image: linear-gradient(to left, #000 20%, transparent 85%), linear-gradient(#000 65vh, transparent 100vh);
    mask-image: linear-gradient(to left, #000 20%, transparent 85%), linear-gradient(#000 65vh, transparent 100vh); }

  /* hero mobile: schermo intero (svh = altezza reale con barre del browser), titolo e pulsanti come un unico blocco centrato */
  .hero { min-height: 100svh; justify-content: center; padding: 6rem 0 3rem; }
  .hero-titolo { flex: none; }
  .kicker { margin-bottom: 1.5rem; }
  .hero h1 { font-size: 13vw; }
  .hero-piede { padding-top: 2.5rem; }
  .hero-piede .azioni { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .hero-piede .btn { padding: .75rem 1.25rem; font-size: .95rem; }
  .hero-piede .btn-vuoto { border: 0; padding-left: 0; padding-right: 0; color: var(--muted); } /* secondario come semplice link, allineato al titolo */
}
