/* =========================================================
   conform — preview "Inkwell · refined"
   Stessa identità (petrol · ink · off-white caldo · fil rouge,
   Epilogue + Instrument Serif). Craft più moderno e premium:
   gerarchia tipografica più sicura, motion d'ingresso orchestrato,
   meno scaffolding "eyebrow/numeri", composizioni meno a griglia.
   ========================================================= */

:root {
  /* Surfaces */
  --bg:           #FBFAF7;
  --surface:      #FFFFFF;
  --surface-2:    #F3F1EA;
  --surface-tint: #F6EFEC;

  /* Lines */
  --border:        #EAE7DF;
  --border-strong: #D7D3C8;

  /* Ink */
  --ink-faint:   #B5B3AC;
  --ink-mute:    #7E7D77;   /* leggermente più scuro: contrasto label */
  --ink-soft:    #54534F;   /* body secondario: ~7:1 su --bg */
  --ink-deep:    #26272A;
  --ink:         #0E0F12;
  --ink-black:   #06070A;

  /* Petrol — fil rouge */
  --accent:        #0E6B6B;
  --accent-deep:   #0A5252;
  --accent-bright: #16B3B0;
  --accent-soft:   #DBEEEC;

  /* Glow */
  --glow-accent: rgba(14, 107, 107, 0.16);

  /* Shadows — più morbide e stratificate */
  --shadow-sm:  0 1px 2px rgba(14,15,18,0.04), 0 2px 6px rgba(14,15,18,0.04);
  --shadow-md:  0 2px 8px rgba(14,15,18,0.04), 0 14px 30px rgba(14,15,18,0.06);
  --shadow-lg:  0 8px 24px rgba(14,15,18,0.06), 0 36px 70px rgba(14,15,18,0.08);
  --shadow-accent: 0 10px 30px rgba(14, 107, 107, 0.20);

  /* Radii */
  --r-sm: 0.5rem;
  --r-md: 0.875rem;
  --r-lg: 1.25rem;
  --r-xl: 1.75rem;

  /* Type */
  --display: 'Instrument Serif', 'Epilogue', serif;

  /* Easing */
  --ease-out:  cubic-bezier(.16, 1, .3, 1);     /* ease-out-expo-ish */
  --ease-soft: cubic-bezier(.2, .8, .2, 1);

  /* z-index scale */
  --z-progress: 100;
  --z-nav: 60;
  --z-mobile-menu: 59;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Epilogue', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "ss02";
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Container --- */
.container-xl {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 768px)  { .container-xl { padding: 0 2rem; } }
@media (min-width: 1024px) { .container-xl { padding: 0 3rem; } }

/* =========================================================
   SCROLL PROGRESS
   ========================================================= */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  box-shadow: 0 0 8px var(--glow-accent);
  z-index: var(--z-progress);
  transition: width 0.08s linear;
}

/* =========================================================
   NAVBAR — floating capsule
   ========================================================= */
#navbar {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-nav);
  width: calc(100% - 2rem);
  max-width: 1180px;
  background: rgba(251, 250, 247, 0.72);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid rgba(234, 231, 223, 0.9);
  border-radius: 999px;
  transition: box-shadow 0.4s var(--ease-soft), background 0.4s ease, border-color 0.4s ease, transform 0.5s var(--ease-out);
}
#navbar.scrolled {
  background: rgba(251, 250, 247, 0.93);
  border-color: rgba(215, 211, 200, 0.95);
  box-shadow: var(--shadow-md);
}
#navbar .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.65rem 0.55rem 1.4rem;
  gap: 1rem;
}
@media (max-width: 768px) {
  #navbar { top: 0.75rem; width: calc(100% - 1.5rem); }
  #navbar .nav-inner { padding: 0.5rem 0.5rem 0.5rem 1.1rem; }
}

/* Logo */
.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  letter-spacing: -0.04em;
  display: inline-flex;
  align-items: baseline;
}
.logo .fil-l { color: var(--accent); position: relative; }
.logo .fil-l::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}
html.js .logo .fil-l::after { animation: line-grow 1.6s var(--ease-out) 0.5s forwards; }
@keyframes line-grow { to { transform: scaleX(1); } }

/* Nav links */
.nav-links {
  display: none;
  align-items: center;
  gap: 1.85rem;
  list-style: none; margin: 0; padding: 0;
}
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.3s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transition: right 0.45s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { right: 0; }
.nav-links a.active { color: var(--ink); font-weight: 600; }
.nav-links a.active::after { right: 0; }

/* Mobile menu */
.mobile-menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer; color: var(--ink);
}
@media (min-width: 768px) {
  .mobile-menu-btn { display: none; }
  .nav-cta { display: inline-flex !important; }
}
.nav-cta { display: none; }

#mobile-menu {
  display: none;
  position: fixed;
  top: 4.5rem; left: 0.75rem; right: 0.75rem;
  background: rgba(251, 250, 247, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  z-index: var(--z-mobile-menu);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
}
#mobile-menu.open { display: block; }
#mobile-menu a {
  display: block;
  padding: 0.85rem 0.5rem;
  font-size: 1rem; font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}
#mobile-menu a:last-of-type { border: none; }
#mobile-menu .btn-accent { width: 100%; justify-content: center; margin-top: 0.75rem; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn-primary, .btn-accent, .btn-ghost, .btn-ghost-dark, .btn-ghost-white {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.72rem 1.45rem;
  font-family: inherit; font-size: 0.875rem; font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: 999px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.3s var(--ease-out), background 0.25s ease,
              border-color 0.25s ease, box-shadow 0.35s ease, color 0.25s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: var(--ink-black); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(14,15,18,0.22); }

.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: var(--shadow-accent); }
.btn-accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); transform: translateY(-2px); box-shadow: 0 16px 38px rgba(14,107,107,0.30); }
.btn-accent .material-symbols-outlined { transition: transform 0.4s var(--ease-out); }
.btn-accent:hover .material-symbols-outlined { transform: translate(2px, -2px); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(14,15,18,0.03); }

.btn-ghost-dark { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost-dark:hover { background: var(--ink); color: #fff; }

.btn-ghost-white { background: transparent; color: #fff; border-color: rgba(255,255,255,0.32); }
.btn-ghost-white:hover { border-color: #fff; background: rgba(255,255,255,0.08); }

.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.95rem 1.7rem; font-size: 0.95rem; }

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
h1, h2, h3, h4 { margin: 0; color: var(--ink); }

.h-xl { font-size: clamp(2.7rem, 6vw, 5rem);   font-weight: 700; line-height: 0.98; letter-spacing: -0.045em; text-wrap: balance; }
.h-lg { font-size: clamp(2rem, 4.6vw, 3.35rem); font-weight: 700; line-height: 1.04; letter-spacing: -0.035em; text-wrap: balance; }
.h-md { font-size: clamp(1.5rem, 3vw, 2rem);    font-weight: 700; line-height: 1.1;  letter-spacing: -0.025em; text-wrap: balance; }

/* Label refinato — sostituisce l'eyebrow meccanico.
   Sentence-case, tick petrol, usato con parsimonia. */
.label {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.8125rem; font-weight: 600;
  color: var(--ink-mute);
  letter-spacing: -0.005em;
}
.label::before {
  content: ""; width: 22px; height: 1.5px; background: var(--accent); display: inline-block;
}
.label.no-tick::before { display: none; }
.label.on-dark { color: rgba(255,255,255,0.62); }

/* eyebrow legacy (micro-label, footer headings, numbered TOC) */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.625rem;
  font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--ink-mute);
}
.eyebrow::before {
  content: ""; width: 24px; height: 1.5px; background: var(--accent); display: inline-block;
}
.eyebrow.no-line::before { display: none; }
.eyebrow.numbered { color: var(--ink-soft); }
.eyebrow .num { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; }
.section-dark .eyebrow { color: rgba(255,255,255,0.55); }

.display-italic { font-family: var(--display); font-style: italic; font-weight: 400; letter-spacing: -0.015em; }
.display-italic.accent { color: var(--accent); }

.lead { font-size: 1.125rem; line-height: 1.65; color: var(--ink-soft); }
@media (min-width: 768px) { .lead { font-size: 1.1875rem; } }

.prose { color: var(--ink-soft); line-height: 1.75; max-width: 62ch; text-wrap: pretty; }
.prose strong { color: var(--ink); font-weight: 600; }

.muted { color: var(--ink-soft); }
.muted-strong { color: var(--ink-mute); }

/* Section header pattern (editoriale, niente numeri ripetuti) */
.section-head { max-width: 760px; }
.section-head .label { margin-bottom: 1.1rem; }
.section-head h2 { margin: 0; }

/* =========================================================
   FIL ROUGE
   ========================================================= */
.fil-rouge-left { border-left: 2px solid var(--accent); }
.divider-accent { width: 36px; height: 2px; background: var(--accent); display: block; }

/* =========================================================
   STATUS PILL
   ========================================================= */
.status-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.85rem 0.4rem 0.68rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem; font-weight: 500;
  color: var(--ink-soft); letter-spacing: -0.01em;
  box-shadow: var(--shadow-sm);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); position: relative; flex-shrink: 0; }
.status-dot::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: var(--accent); opacity: 0.55;
  animation: pulse 2s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes pulse {
  0% { transform: scale(0.7); opacity: 0.6; }
  80%, 100% { transform: scale(2.4); opacity: 0; }
}

/* =========================================================
   CHIPS
   ========================================================= */
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.32rem 0.72rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem; font-weight: 500;
  color: var(--ink-soft); letter-spacing: -0.005em;
}
.chip-accent { background: transparent; color: var(--accent-deep); border-color: var(--accent); font-weight: 600; }
.chip-soft { background: var(--surface-tint); color: var(--accent-deep); border-color: transparent; }
.chip-tabular { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* =========================================================
   CARDS
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s ease, border-color 0.3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }

.card-glass {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(234,231,223,0.85);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

.card-dark {
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
}
.card-dark::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(800px 300px at 100% 0%, rgba(22,179,176,0.18), transparent 60%),
    radial-gradient(600px 240px at 0% 100%, rgba(22,179,176,0.08), transparent 65%);
  pointer-events: none;
}

/* Service card — riga petrol come "indice" della pratica */
.service-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.85rem;
  overflow: hidden;
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s ease, border-color 0.3s ease;
}
.service-card .svc-index {
  font-family: var(--display); font-style: italic;
  font-size: 1.05rem; color: var(--accent);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }

.service-card.featured { background: var(--ink); color: #fff; border-color: var(--ink); }
.service-card.featured .muted { color: rgba(255,255,255,0.66); }
.service-card.featured .svc-index { color: var(--accent-bright); }

.svc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.svc-list li { display: flex; align-items: center; gap: 0.6rem; font-size: 0.875rem; color: var(--ink-soft); }
.svc-list li::before { content: ""; width: 14px; height: 1.5px; background: var(--accent); flex-shrink: 0; }
.featured .svc-list li { color: rgba(255,255,255,0.8); }
.featured .svc-list li::before { background: var(--accent-bright); }

/* Bento */
.bento-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) {
  .bento-grid { grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
  .bento-grid > .feat { grid-column: 1; grid-row: 1 / span 2; }
}

/* =========================================================
   ARROW LINK
   ========================================================= */
.arrow-link {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.875rem; font-weight: 600;
  color: var(--ink); letter-spacing: -0.01em;
  position: relative;
  transition: color 0.3s ease;
}
.arrow-link .material-symbols-outlined { font-size: 16px; transition: transform 0.4s var(--ease-out); }
.arrow-link::after {
  content: ""; position: absolute; left: 0; right: 22px; bottom: -3px;
  height: 1.5px; background: currentColor; opacity: 0.2;
  transition: opacity 0.3s ease, background 0.3s ease;
}
.arrow-link:hover { color: var(--accent); }
.arrow-link:hover::after { background: var(--accent); opacity: 1; }
.arrow-link:hover .material-symbols-outlined { transform: translateX(4px); }
.arrow-link.on-dark { color: #fff; }
.arrow-link.on-dark:hover { color: var(--accent-bright); }

/* =========================================================
   SECTION RHYTHM
   ========================================================= */
.section { padding: 6rem 0; }
@media (min-width: 1024px) { .section { padding: 8rem 0; } }
.section-tight { padding: 4.5rem 0; }
@media (min-width: 1024px) { .section-tight { padding: 6rem 0; } }

.section-alt { background: var(--surface-2); }
.section-dark { background: var(--ink-black); color: #fff; position: relative; overflow: hidden; }
.section-dark .muted { color: rgba(255,255,255,0.66); }
.section-dark .label { color: rgba(255,255,255,0.6); }

/* =========================================================
   GLOWS / GRID
   ========================================================= */
.glow-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.glow-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.6;
  animation: drift 16s ease-in-out infinite;
  will-change: transform;
}
.glow-orb.accent { width: 520px; height: 520px; background: radial-gradient(circle, rgba(14,107,107,0.30) 0%, rgba(14,107,107,0) 70%); }
.glow-orb.blush  { width: 460px; height: 460px; background: radial-gradient(circle, rgba(255,178,152,0.50) 0%, rgba(255,178,152,0) 70%); }
.glow-orb.warm   { width: 380px; height: 380px; background: radial-gradient(circle, rgba(255,220,195,0.65) 0%, rgba(255,220,195,0) 70%); }
.glow-orb.deep-accent { width: 600px; height: 600px; background: radial-gradient(circle, rgba(22,179,176,0.26) 0%, rgba(22,179,176,0) 70%); }
@keyframes drift {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%  { transform: translate(40px,-30px) scale(1.06); }
  66%  { transform: translate(-30px,25px) scale(0.96); }
}

.grid-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(14,15,18,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,15,18,0.045) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 45%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 45%, black 30%, transparent 75%);
}
.grid-overlay.dark {
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
}

/* =========================================================
   HERO THREAD — la firma "fil rouge" (Home)
   Quattro pratiche su un'unica linea continua.
   ========================================================= */
.thread {
  position: relative;
  margin-top: 0.5rem;
}
.thread-rail { position: relative; }
.thread-svg { display: block; width: 100%; height: 60px; overflow: visible; }
.thread-svg .rail-line {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.5;
}
.thread-svg .rail-draw {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  pathLength: 1;
}
html.js .thread.in .thread-svg .rail-draw {
  animation: drawRail 1.6s var(--ease-out) 0.2s forwards;
}
@keyframes drawRail { to { stroke-dashoffset: 0; } }

.thread-nodes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.thread-node {
  display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
  text-align: center;
  position: relative;
}
.thread-node .dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  position: relative; z-index: 1;
  transform: scale(0);
}
html.js .thread.in .thread-node .dot { animation: dotPop 0.6s var(--ease-out) forwards; }
.thread-node.n1 .dot { animation-delay: 0.5s; }
.thread-node.n2 .dot { animation-delay: 0.85s; }
.thread-node.n3 .dot { animation-delay: 1.2s; }
.thread-node.n4 .dot { animation-delay: 1.55s; background: var(--accent); }
@keyframes dotPop { 0% { transform: scale(0); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

.thread-node .t-name { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.thread-node .t-desc { font-size: 0.75rem; color: var(--ink-mute); max-width: 18ch; line-height: 1.4; }
html.js .thread.in .thread-node .t-name,
html.js .thread.in .thread-node .t-desc { animation: fadeUp 0.7s var(--ease-out) backwards; }
.thread-node.n1 .t-name, .thread-node.n1 .t-desc { animation-delay: 0.6s; }
.thread-node.n2 .t-name, .thread-node.n2 .t-desc { animation-delay: 0.95s; }
.thread-node.n3 .t-name, .thread-node.n3 .t-desc { animation-delay: 1.3s; }
.thread-node.n4 .t-name, .thread-node.n4 .t-desc { animation-delay: 1.65s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Thread responsive: verticale su mobile */
@media (max-width: 720px) {
  .thread-svg { display: none; }
  .thread-nodes {
    grid-template-columns: 1fr;
    gap: 0;
    border-left: 2px solid var(--border-strong);
    margin-left: 6px;
    position: relative;
  }
  html.js .thread.in .thread-nodes::before {
    content: ""; position: absolute; left: -2px; top: 0; width: 2px; height: 100%;
    background: var(--accent); transform-origin: top; transform: scaleY(0);
    animation: drawRail 1.4s var(--ease-out) 0.2s forwards;
  }
  @supports (animation-timeline: view()) { } /* no-op guard */
  .thread-node { flex-direction: row; align-items: flex-start; text-align: left; gap: 1rem; padding: 0.9rem 0 0.9rem 1.25rem; }
  .thread-node .dot { margin-left: -1.6rem; margin-top: 4px; }
  .thread-node .t-desc { max-width: none; }
}

/* =========================================================
   MARQUEE — credenziali (slim)
   ========================================================= */
.marquee {
  display: flex; overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.marquee-track { display: flex; gap: 3rem; flex-shrink: 0; align-items: center; animation: marquee 42s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.8125rem; font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
.marquee-item .material-symbols-outlined { font-size: 18px; color: var(--accent); }

/* =========================================================
   STAT
   ========================================================= */
.stat { display: flex; flex-direction: column; gap: 0.35rem; }
.stat-value { font-size: clamp(2.25rem, 4vw, 2.85rem); font-weight: 700; letter-spacing: -0.04em; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.8125rem; color: var(--ink-mute); letter-spacing: 0.01em; }

/* =========================================================
   IMAGE FRAME
   ========================================================= */
.img-frame { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--surface-2); }
.img-frame img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(55%) contrast(1.02); transition: filter 0.8s ease, transform 0.9s var(--ease-out); }
.img-frame:hover img { filter: grayscale(0%); transform: scale(1.03); }

/* =========================================================
   TIMELINE
   ========================================================= */
.timeline { position: relative; padding-left: 1.75rem; border-left: 1.5px solid var(--border); }
.timeline-item { position: relative; padding-bottom: 3rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -1.75rem; top: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  transform: translateX(-50%);
}
.timeline-item.active::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* =========================================================
   MOTION — reveal (progressive enhancement, headless-safe)
   Il contenuto è visibile di default; l'animazione si attiva
   solo quando JS aggiunge la classe `js` a <html>.
   ========================================================= */
html.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
html.js .reveal[data-dir="left"]  { transform: translateX(-24px); }
html.js .reveal[data-dir="right"] { transform: translateX(24px); }
html.js .reveal[data-dir="scale"] { transform: scale(0.96); }
html.js .reveal.in { opacity: 1; transform: none; }
html.js .reveal[style*="--rd"].in,
html.js .reveal.in { transition-delay: var(--rd, 0s); }

/* Hero load choreography */
html.js .hero-anim { opacity: 0; transform: translateY(16px); animation: heroIn 0.95s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
@keyframes heroIn { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html.js .reveal, html.js .hero-anim,
  .glow-orb, .status-dot::after, .marquee-track,
  html.js .logo .fil-l::after,
  html.js .thread.in .rail-draw,
  html.js .thread.in .dot,
  html.js .thread.in .t-name,
  html.js .thread.in .t-desc {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--ink-black);
  color: rgba(255,255,255,0.7);
  border-top: 2px solid var(--accent);
  position: relative; overflow: hidden;
}
.site-footer::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(900px 320px at 90% 0%, rgba(22,179,176,0.10), transparent 60%);
  pointer-events: none;
}
.site-footer .logo { color: #fff; }
.site-footer a { color: rgba(255,255,255,0.6); transition: color 0.3s ease; }
.site-footer a:hover { color: #fff; }
.footer-head { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255,255,255,0.4); }

/* =========================================================
   UTILITIES
   ========================================================= */
.text-accent { color: var(--accent); }
.text-mute { color: var(--ink-mute); }
.text-soft { color: var(--ink-soft); }
.divider-soft { height: 1px; background: var(--border); width: 100%; }
.divider-soft.on-dark { background: rgba(255,255,255,0.1); }
.tabular { font-variant-numeric: tabular-nums; }
.lined-top { border-top: 1px solid var(--border); }
.lined-top.on-dark { border-color: rgba(255,255,255,0.1); }
.text-white-70 { color: rgba(255,255,255,0.7); }
.text-white-50 { color: rgba(255,255,255,0.5); }

/* =========================================================
   LEGACY COMPONENTS — usati da servizi/risorse/contatti/privacy
   ========================================================= */

/* Chip scuro */
.chip-ink { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ISO type marker — standard certificabili vs linee guida */
.iso-type {
  display: inline-flex; align-items: center;
  font-size: 0.625rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.15rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--ink-mute);
  white-space: nowrap;
}
.iso-type.cert { color: var(--accent-deep); border-color: var(--accent); background: var(--accent-soft); }

/* Numero di sezione (TOC strip) */
.section-number { font-family: var(--display); font-style: italic; font-size: 1.25rem; color: var(--accent); letter-spacing: -0.01em; }

/* Numeri decorativi outline */
.deco-num {
  font-family: 'Epilogue', sans-serif;
  font-size: clamp(80px, 16vw, 200px); font-weight: 800; line-height: 0.85;
  color: transparent; -webkit-text-stroke: 1.5px rgba(14,15,18,0.07);
  letter-spacing: -0.05em; pointer-events: none; user-select: none;
}
.deco-num.on-dark { -webkit-text-stroke: 1.5px rgba(255,255,255,0.08); }

/* Sticky sidebar */
@media (min-width: 1024px) {
  .sticky-sidebar { position: sticky; top: 6rem; height: fit-content; }
}

/* Form */
.form-group { margin-bottom: 1.5rem; }
.form-label {
  display: block; font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-mute); margin-bottom: 0.5rem;
}
.form-input {
  width: 100%; font-family: inherit; font-size: 0.9375rem; color: var(--ink);
  background: transparent; border: none; border-bottom: 1.5px solid var(--border-strong);
  padding: 0.7rem 0; outline: none; border-radius: 0; -webkit-appearance: none;
  transition: border-color 0.3s ease;
}
.form-input:focus { border-bottom-color: var(--accent); }
.form-input::placeholder { color: var(--ink-faint); }
textarea.form-input { resize: vertical; min-height: 110px; }
select.form-input { cursor: pointer; }

/* Accordion (FAQ) */
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-trigger {
  width: 100%; background: transparent; border: none; padding: 1.25rem 0;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font-family: inherit; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink); cursor: pointer; text-align: left;
}
.accordion-trigger .material-symbols-outlined { color: var(--accent); font-size: 22px; transition: transform 0.4s var(--ease-soft); }
.accordion-trigger[aria-expanded="true"] .material-symbols-outlined { transform: rotate(45deg); }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.5s ease; font-size: 0.9375rem; color: var(--ink-soft); line-height: 1.7; }
.accordion-content-inner { padding-bottom: 1.25rem; max-width: 60ch; }

/* Download card */
.download-card {
  display: flex; gap: 1.25rem; padding: 1.5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 2px solid var(--accent); border-radius: var(--r-md);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s ease, border-color 0.3s ease;
}
.download-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.download-icon {
  width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--surface-tint);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.download-icon .material-symbols-outlined { color: var(--accent-deep); font-size: 22px; }

/* Article / blog card */
.article-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s ease, border-color 0.3s ease;
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.article-image { aspect-ratio: 16/10; overflow: hidden; position: relative; }
.article-image img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(40%); transition: transform 0.7s var(--ease-out), filter 0.7s ease; }
.article-card:hover .article-image img { transform: scale(1.04); filter: grayscale(0%); }
.article-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.article-meta { display: flex; gap: 0.85rem; font-size: 0.75rem; color: var(--ink-mute); align-items: center; }
