/* =========================================================
   SERICA — Landing
   Aesthetic direction: "Carte da catalogo · editorial industrial 2026"
   A digital reinterpretation of the Italian industrial publishing
   tradition (Olivetti, Pirelli, Cassina) for a Compliance OS aimed
   at PMI manifatturiere — typographic gravitas, warm parchment,
   stucco terracotta, gold seal, paper grain.
   ========================================================= */

:root {
  /* Parchment substrate — warm cream, leggero e arioso. */
  --paper:        #FDFBF6;
  --paper-2:      #F7F3EB;
  --paper-3:      #EFE9DE;
  --paper-warm:   #FFFEF9;
  --paper-deep:   #1D1812;

  /* Aliases preserved so legacy rules still work. */
  --bg:           var(--paper);
  --bg-2:         var(--paper-2);
  --bg-3:         var(--paper-3);
  --bg-4:         #D8C898;

  /* Ink — warm near-black with brown undertone (avoid jet). */
  --ink:          #16110E;
  --fg:           var(--ink);
  --fg-2:         rgba(22, 17, 14, 0.74);
  --fg-3:         rgba(22, 17, 14, 0.52);
  --fg-4:         rgba(22, 17, 14, 0.30);

  --rule:         rgba(22, 17, 14, 0.20);
  --rule-soft:    rgba(22, 17, 14, 0.10);
  --rule-mute:    rgba(22, 17, 14, 0.05);

  /* Stucco terracotta — Veronese, deeper than v13. */
  --accent:        #7A2E1F;
  --accent-2:      #A0473A;
  --accent-soft:   rgba(122, 46, 31, 0.10);
  --accent-line:   rgba(122, 46, 31, 0.35);

  /* Italian gold (zecchino / saffron-leaning), deeper than honey. */
  --gold:          #D9A646;
  --gold-deep:     #A87923;
  --gold-soft:     rgba(217, 166, 70, 0.32);

  /* Status — minted for the digital previews. */
  --ok:            #2E5238;
  --ok-soft:       rgba(46, 82, 56, 0.10);
  --warn:          #B98A2C;

  /* Typography — Fraunces variable, single family.
     Display is opsz 144 with WONK turned on for italics.
     Body is opsz 14 normal. */
  --ff-display:   "Fraunces", "Cormorant Garamond", "Times New Roman", serif;
  --ff-body:      "Fraunces", Georgia, "Times New Roman", serif;
  --ff-mono:      "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --max:          1440px;
  --pad-x:        clamp(20px, 4vw, 72px);

  --ease:         cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-deep:    cubic-bezier(0.16, 1, 0.3, 1);

  --logo-filter:  saturate(0) brightness(0.22) contrast(1.6);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  background: var(--bg);
  overflow-x: hidden;
  width: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.005em;
  font-variation-settings: "opsz" 14, "SOFT" 50, "WONK" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ss01" 1;
  overflow-x: hidden;
  width: 100%;
}

main {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 500;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0;
}
p { margin: 0; text-wrap: pretty; }
em {
  font-style: italic;
  font-variation-settings: "opsz" 96, "SOFT" 80, "WONK" 1;
}

/* ============ Backdrop — warm paper atmosphere ============ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1400px 900px at 92% -10%, rgba(217, 166, 70, 0.05), transparent 60%),
    radial-gradient(1200px 900px at 5% 110%, rgba(122, 46, 31, 0.04), transparent 60%),
    radial-gradient(900px 700px at 50% 50%, rgba(22, 17, 14, 0.010), transparent 70%);
  animation: backdrop-drift 22s ease-in-out infinite alternate;
}
@keyframes backdrop-drift {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-1.5%, 1%, 0); }
}

/* Paper grain — SVG fractal noise. Multiplied over parchment for a printed feel. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.09  0 0 0 0 0.07  0 0 0 0 0.05  0 0 0 0.65 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.6'/></svg>");
  background-size: 320px 320px;
  mix-blend-mode: multiply;
  opacity: 0.20;
}

/* Grid-lines re-tuned as faint cataloging marginalia, not blueprint. */
.grid-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(22, 17, 14, 0.030) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(22, 17, 14, 0.020) 1px, transparent 1px);
  background-size: 8.333vw 100%, 100% 8.333vw;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}

/* ============ Cursor glow ============ */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10,10,9,0.06), transparent 65%);
  pointer-events: none;
  z-index: 1;
  transform: translate3d(var(--mx, -50vw), var(--my, -50vh), 0) translate(-50%, -50%);
  transition: opacity .6s var(--ease);
  opacity: 0;
  mix-blend-mode: multiply;
}
body.has-cursor .cursor-glow { opacity: 1; }
@media (hover: none) { .cursor-glow { display: none; } }

/* ============ Registry bar ============ */
.registry-bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 9px var(--pad-x);
  border-bottom: 1px solid var(--rule);
  background: var(--fg);
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.registry-bar span { display: inline-flex; align-items: center; gap: 10px; }
.registry-bar .rb-dot {
  width: 5px; height: 5px;
  background: #ffffff;
  border-radius: 50%;
  animation: pulse 2.4s ease-in-out infinite;
}
.registry-bar .rb-block { color: #fff; font-variant-numeric: tabular-nums; }
@media (max-width: 820px) { .registry-bar .rb-mid { display: none; } }

/* ============ Navigation ============ */
.nav-shell {
  position: sticky;
  top: 0;
  z-index: 100;
  --nav-bar-h: 60px;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--pad-x);
  background: rgba(253, 251, 246, 0.78);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--rule-soft);
  transition: padding .4s var(--ease), background .4s var(--ease);
}
.nav-shell.is-scrolled .nav,
.nav.is-scrolled {
  padding-top: 12px;
  padding-bottom: 12px;
  background: rgba(253, 251, 246, 0.94);
}
.nav-mark { display: inline-flex; align-items: center; gap: 12px; }
.nav-mark-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(10, 10, 9, 0.10));
  transition: transform .4s var(--ease);
}
.nav-mark-icon svg { display: block; }
.nav-mark:hover .nav-mark-icon { transform: rotate(8deg); }
.nav-mark-icon + .nav-logo { padding-left: 0; }
.nav-logo {
  display: inline-block;
  font-family: var(--ff-display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1;
  font-variation-settings: "opsz" 60, "SOFT" 30, "WONK" 0;
}
.nav-mark-sub {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding-left: 14px;
  border-left: 1px solid var(--rule);
}
@media (max-width: 640px) { .nav-mark-sub { display: none; } }
@media (max-width: 480px) { .nav-logo { font-size: 19px; } }

.nav-links {
  display: flex;
  gap: 30px;
  font-family: var(--ff-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.nav-links a { position: relative; padding: 4px 0; transition: color .3s var(--ease); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border: 1px solid var(--fg);
  color: var(--bg);
  background: var(--fg);
  font-family: var(--ff-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: all .28s var(--ease);
}
.nav-cta:hover { background: var(--bg); color: var(--fg); }
.nav-cta svg { transition: transform .3s var(--ease); }
.nav-cta:hover svg { transform: translateX(3px); }

.nav-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-cta--drawer { display: none; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--paper-warm);
  border-radius: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color .28s var(--ease), background .28s var(--ease);
}
.nav-toggle:hover { border-color: var(--fg); background: var(--paper-2); }
.nav-toggle-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 18px;
  pointer-events: none;
}
.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--ink);
  transition: transform .32s var(--ease), opacity .32s var(--ease);
}
.nav-shell.is-menu-open .nav-toggle-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-shell.is-menu-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-shell.is-menu-open .nav-toggle-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 110;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(22, 17, 14, 0.42);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-cta-label--short { display: none; }

body.is-nav-open { overflow: hidden; }

@media (min-width: 901px) {
  .nav-shell {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 24px;
    padding: 18px var(--pad-x);
    background: rgba(253, 251, 246, 0.78);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    border-bottom: 1px solid var(--rule-soft);
    transition: padding .4s var(--ease), background .4s var(--ease);
  }
  .nav-shell.is-scrolled {
    padding-top: 12px;
    padding-bottom: 12px;
    background: rgba(253, 251, 246, 0.94);
  }
  .nav {
    display: contents;
    padding: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 0;
  }
  .nav-links {
    display: flex;
    justify-content: center;
    position: static;
    inset: auto;
    height: auto;
    width: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav-links a {
    padding: 4px 0;
    border-bottom: 0;
  }
  .nav-links a::after { display: block; }
}

@media (max-width: 900px) {
  .nav-shell { --nav-bar-h: 88px; }

  .nav {
    position: relative;
    z-index: 130;
    gap: 12px;
    min-height: var(--nav-bar-h);
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-bottom: 12px;
  }

  .nav-mark { min-width: 0; flex: 1 1 auto; }
  .nav-mark-sub { display: none; }
  .nav-tools { position: relative; z-index: 131; }

  .nav-toggle { display: inline-flex; }

  /* Su mobile: backoffice solo nel menu (evita conflitti tap con hamburger). */
  .nav-cta--bar { display: none; }

  .nav-backdrop:not([hidden]) {
    display: block;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-menu-offset, calc(env(safe-area-inset-top, 0px) + 7.25rem));
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    width: 100%;
    max-width: 100%;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    margin: 0;
    padding: 0 var(--pad-x) max(24px, env(safe-area-inset-bottom, 0px));
    background: var(--paper);
    border-top: 1px solid var(--rule-soft);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 13px;
    letter-spacing: 0.14em;
    overscroll-behavior: contain;
    box-sizing: border-box;
  }
  .nav-links > a:not(.nav-cta--drawer) {
    padding: 12px 2px;
    min-height: 40px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--rule-soft);
    -webkit-tap-highlight-color: transparent;
  }

  .nav-links > a:not(.nav-cta--drawer):first-child {
    border-top: 0;
  }
  .nav-links a::after { display: none; }
  .nav-shell.is-menu-open .nav-links { display: flex; }

  .nav-links a.nav-cta--drawer {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 12px 0 0;
    padding: 11px 12px;
    min-height: 42px;
    font-size: 9.5px;
    letter-spacing: 0.1em;
    gap: 6px;
    border-bottom: 0;
    flex-shrink: 0;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
    transition: none;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-links a.nav-cta--drawer:hover,
  .nav-links a.nav-cta--drawer:active,
  .nav-links a.nav-cta--drawer:focus,
  .nav-links a.nav-cta--drawer:focus-visible,
  .nav-links a.nav-cta--drawer:visited {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
    outline: none;
  }

  .nav-links a.nav-cta--drawer svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    transition: none;
  }

  .nav-links a.nav-cta--drawer:hover svg,
  .nav-links a.nav-cta--drawer:active svg {
    transform: none;
  }
}

@media (max-width: 380px) {
  .nav-links a.nav-cta--drawer {
    font-size: 9px;
    letter-spacing: 0.08em;
    padding: 10px 10px;
  }
}

/* ============ Common chapter ============ */
.chapter {
  position: relative;
  z-index: 1;
  padding: clamp(80px, 12vh, 160px) var(--pad-x);
  border-bottom: 1px solid var(--rule-soft);
}
.chapter-inner { width: 100%; max-width: var(--max); margin: 0 auto; }

.chapter-index {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(40px, 6vw, 72px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.chapter-index .ci-num { color: var(--fg); }
.chapter-index .ci-code { color: var(--fg-4); }

.chapter-head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-bottom: clamp(48px, 6vw, 96px);
  align-items: end;
}
.chapter-head h2 {
  grid-column: 1 / span 9;
  font-size: clamp(26px, 4.5vw, 68px);
  line-height: 0.92;
  letter-spacing: -0.028em;
  font-weight: 460;
  font-variation-settings: "opsz" 144, "SOFT" 25, "WONK" 0;
}
.chapter-head h2 em {
  font-style: italic;
  font-weight: 460;
  color: var(--accent);
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.chapter-head p {
  grid-column: 1 / span 6;
  margin-top: 20px;
  font-size: clamp(15px, 1.25vw, 17.5px);
  line-height: 1.55;
  color: var(--fg-2);
  max-width: 60ch;
}
.chapter-head p strong { color: var(--fg); font-weight: 500; }
@media (max-width: 900px) {
  .chapter-head { grid-template-columns: 1fr; }
  .chapter-head h2, .chapter-head p {
    grid-column: 1;
  }
}

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: clamp(56px, 8vh, 110px) var(--pad-x) 0;
}
.hero-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 5vw, 48px);
  align-items: center;
  min-height: auto;
  width: 100%;
  min-width: 0;
}
.hero-copy {
  max-width: 52rem;
}

@media (max-width: 720px) {
  .hero-issue {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .hero-issue .hi-meta { text-align: left; }
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 40px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  opacity: 0;
  animation: fade-up .9s var(--ease) .1s forwards;
}
.hero-meta .hm-num { color: var(--fg); }
.hero-meta .hm-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--fg);
  animation: pulse 2.4s ease-in-out infinite;
}

.hero-title {
  font-family: var(--ff-display);
  font-size: clamp(30px, 5.2vw, 76px);
  line-height: 0.92;
  letter-spacing: -0.028em;
  font-weight: 460;
  margin-bottom: 30px;
  font-variation-settings: "opsz" 144, "SOFT" 25, "WONK" 0;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line > * {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  animation: rise 1.1s var(--ease-deep) forwards;
}
.hero-title .line:nth-of-type(1) > * { animation-delay: .2s; }
.hero-title .line:nth-of-type(2) > * { animation-delay: .38s; }
.hero-title em {
  font-style: italic;
  font-weight: 460;
  color: var(--accent);
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}

/* Clean word-by-word reveal (section titles + CTA) */
.word-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: inherit;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.word-inner {
  display: inline-block;
  transform: translateY(105%);
  opacity: 0;
  transition:
    transform 0.9s var(--ease-deep),
    opacity 0.9s var(--ease-deep);
  will-change: transform, opacity;
}
.word-inner.is-in {
  transform: translateY(0);
  opacity: 1;
}

/* CTA h2 lines kept with overflow hidden for line-mask pattern */
.cta-inner h2 .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }

.hero-lede {
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.55;
  color: var(--fg-2);
  max-width: 56ch;
  margin-bottom: 32px;
  opacity: 0;
  animation: fade-up .9s var(--ease) .55s forwards;
}
.hero-lede .accent {
  color: var(--fg);
  font-weight: 500;
  position: relative;
  white-space: nowrap;
}
.hero-lede .accent::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--gold-deep));
  transform: scaleX(0);
  transform-origin: left;
  animation: underline-draw 1s var(--ease) 1.2s forwards;
}
@keyframes underline-draw {
  to { transform: scaleX(1); }
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fade-up .9s var(--ease) .7s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--fg);
  transition: all .3s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn > span, .btn > svg { position: relative; z-index: 1; }
.btn svg { transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .45s var(--ease-deep);
}
.btn-primary:hover { color: var(--fg); }
.btn-primary:hover::before { transform: scaleY(1); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--rule);
}
.btn-ghost::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fg);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .45s var(--ease-deep);
}
.btn-ghost:hover { color: var(--bg); border-color: var(--fg); }
.btn-ghost:hover::before { transform: scaleY(1); }

.magnetic { will-change: transform; }

/* ============ Hero visual ============ */
.hero-visual {
  position: relative;
  opacity: 0;
  animation: fade-up 1.1s var(--ease-deep) .35s forwards;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform .3s var(--ease);
}

/* ----- Chain of blocks ----- */
.chain-stack {
  position: absolute;
  top: -10px;
  left: -8%;
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 1;
  transform: rotate(-4deg);
  pointer-events: none;
}
@media (max-width: 1100px) { .chain-stack { display: none; } }

.chain-block {
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 10px 14px;
  min-width: 180px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateX(-20px);
  animation: block-in .8s var(--ease-deep) forwards;
  animation-delay: calc(1s + var(--i) * 0.18s);
  position: relative;
  box-shadow: 2px 2px 0 var(--fg);
}
.chain-block .cb-k { color: var(--fg); font-weight: 500; letter-spacing: 0.16em; display: inline-flex; align-items: center; gap: 6px; }
.chain-block .cb-v { color: var(--fg-2); letter-spacing: 0.08em; font-size: 11px; text-transform: none; }
.chain-block .cb-t { color: var(--fg-4); font-size: 9.5px; }
.chain-block.is-latest { border-color: var(--fg); }
.chain-block.is-latest::before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid var(--fg);
  animation: scan-pulse 3s ease-in-out infinite;
  pointer-events: none;
}
.chain-link {
  width: 1px;
  height: 22px;
  margin-left: 22px;
  background: var(--fg);
  opacity: 0;
  animation: link-in .5s var(--ease-deep) forwards;
  animation-delay: calc(1.1s + var(--i, 0) * 0.18s);
  position: relative;
  overflow: hidden;
}
.chain-link::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 30%;
  background: linear-gradient(180deg, rgba(10,10,9,0), var(--fg));
  animation: link-flow 2.2s ease-in-out infinite;
}

.live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--fg);
  border-radius: 50%;
  position: relative;
  vertical-align: middle;
  animation: pulse 1.6s ease-in-out infinite;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--fg);
  border-radius: 50%;
  opacity: 0.4;
  animation: ring 1.6s ease-out infinite;
}
.chain-block .live-dot { background: var(--fg); width: 5px; height: 5px; }

@keyframes block-in {
  to { opacity: 1; transform: translateX(0); }
}
@keyframes link-in {
  to { opacity: 1; }
}
@keyframes link-flow {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(350%); }
}
@keyframes scan-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%      { opacity: 0;    transform: scale(1.04); }
}
@keyframes ring {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ----- Artifact (QR) card ----- */
.artifact-card {
  width: 100%;
  max-width: 440px;
  margin: 0 0 0 auto;
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  z-index: 2;
}
.artifact-card::before,
.artifact-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--fg);
  width: 12px; height: 12px;
}
.artifact-card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.artifact-card::after  { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.artifact-card .ac-br-tl,
.artifact-card .ac-br-tr {
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--fg);
  width: 12px; height: 12px;
  bottom: -1px;
}
.artifact-card .ac-br-tl { left: -1px; border-right: 0; border-top: 0; }
.artifact-card .ac-br-tr { right: -1px; border-left: 0; border-top: 0; }

.artifact-head,
.artifact-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.artifact-foot {
  border-top: 1px solid var(--rule);
  border-bottom: 0;
  padding-top: 12px;
  padding-bottom: 0;
}
.artifact-head .ak,
.artifact-foot .ak { color: var(--fg-4); }
.artifact-head .av,
.artifact-foot .av { color: var(--fg); letter-spacing: 0.12em; }
.artifact-foot > div { display: flex; flex-direction: column; gap: 2px; }
.artifact-foot > div.right { text-align: right; align-items: flex-end; }

.qr-card {
  display: block;
  position: relative;
  aspect-ratio: 1;
  background: var(--bg);
  padding: 12px;
  border: 1px solid var(--rule);
  transition: transform .5s var(--ease), border-color .5s var(--ease);
  overflow: hidden;
}
.qr-card:hover { transform: translateY(-2px); border-color: var(--fg); }
.qr-corners::before,
.qr-corners::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--fg);
  width: 10px; height: 10px;
}
.qr-corners::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.qr-corners::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.qr-scan {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--fg), transparent);
  opacity: 0.5;
  animation: qr-scan 3.4s cubic-bezier(.5,0,.5,1) infinite;
  pointer-events: none;
  z-index: 3;
}
@keyframes qr-scan {
  0%   { top: 0; opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { top: 100%; opacity: 0; }
}
.qr { width: 100%; height: 100%; display: block; position: relative; z-index: 1; }
.qr svg { width: 100%; height: 100%; display: block; }

.artifact-caption {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  text-align: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  width: 100%;
}

/* ============ Trust row (marquee) ============ */
.trust-row {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: clamp(56px, 7vw, 96px) 0 0;
  padding: 20px 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 36px;
}
.trust-label {
  flex: 0 0 auto;
  padding: 0 var(--pad-x);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  border-right: 1px solid var(--rule);
  white-space: nowrap;
}
.trust-marks {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.trust-track {
  display: inline-flex;
  align-items: center;
  gap: 48px;
  white-space: nowrap;
  animation: marquee 55s linear infinite;
  font-family: var(--ff-display);
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg-2);
  text-transform: uppercase;
}
.trust-track span { display: inline-flex; align-items: center; gap: 48px; }
.trust-track i {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--fg-3);
  transform: rotate(45deg);
  font-style: normal;
}
@media (max-width: 760px) {
  .trust-row { flex-direction: column; align-items: stretch; gap: 16px; }
  .trust-label { border-right: 0; border-bottom: 1px solid var(--rule); padding-bottom: 14px; }
}

/* ============ Calendario regolatorio (ex «Il problema») ============ */
.reg-timeline-chapter {
  padding: 0;
  position: relative;
  z-index: 2;
}

.reg-timeline {
  background: var(--paper);
  color: var(--ink);
  padding: clamp(48px, 8vh, 64px) var(--pad-x);
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
}

.reg-timeline__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.reg-timeline__eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 24px;
}

.reg-timeline__title {
  font-family: var(--ff-display);
  font-size: clamp(26px, 4vw, 32px);
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 8px;
  max-width: 40rem;
  font-variation-settings: "opsz" 60, "SOFT" 25, "WONK" 0;
}
.reg-timeline__title em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "opsz" 96, "SOFT" 80, "WONK" 1;
}

.reg-timeline__lede {
  font-size: 14px;
  color: var(--fg-3);
  margin: 0 0 clamp(40px, 6vw, 56px);
  max-width: 40rem;
  line-height: 1.5;
}

.reg-timeline__track {
  position: relative;
}

.reg-timeline__line {
  display: none;
}

.reg-timeline__steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reg-timeline__step {
  position: relative;
  margin: 0;
  padding: 22px 0 22px 32px;
  border-top: 1px solid var(--rule-soft);
  min-width: 0;
}
.reg-timeline__step:first-child {
  border-top: 0;
  padding-top: 0;
}
.reg-timeline__step::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--rule);
}
.reg-timeline__step:first-child::before {
  top: 12px;
}
.reg-timeline__step:last-child::before {
  bottom: 12px;
}

.reg-timeline__when {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 8px;
}
.reg-timeline__when--urgent { color: var(--accent); }

.reg-timeline__milestone {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 2.75rem;
  margin: 0 0 12px;
}

.reg-timeline__year {
  font-family: var(--ff-display);
  font-size: clamp(20px, 4vw, 24px);
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
  font-variation-settings: "opsz" 48, "SOFT" 25, "WONK" 0;
}
.reg-timeline__year--gold { color: var(--gold); }
.reg-timeline__year--urgent { color: var(--accent); }

.reg-timeline__today {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 3px 8px;
  font-family: var(--ff-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  line-height: 1.3;
  border: 1px solid rgba(217, 166, 70, 0.55);
  background: rgba(217, 166, 70, 0.08);
  white-space: nowrap;
}
.reg-timeline__today::before {
  content: "↓";
  font-size: 9px;
  line-height: 1;
}

.reg-timeline__dot {
  display: block;
  width: 11px;
  height: 11px;
  margin: 0 0 14px -21px;
  background: var(--ink);
  border-radius: 50%;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.reg-timeline__dot--now {
  width: 15px;
  height: 15px;
  margin: 0 0 14px -23px;
  background: var(--gold);
  border: 1.5px solid var(--ink);
  box-sizing: border-box;
}
.reg-timeline__dot--urgent { background: var(--accent); }
.reg-timeline__dot--hollow {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  box-sizing: border-box;
}

.reg-timeline__label {
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 8px;
  font-family: var(--ff-body);
}
.reg-timeline__label--urgent { color: var(--accent); }

.reg-timeline__ref {
  font-family: var(--ff-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 8px;
}

.reg-timeline__desc {
  font-size: 11px;
  color: var(--fg-2);
  line-height: 1.5;
  margin: 0;
}

.reg-timeline__footer {
  margin-top: clamp(40px, 6vw, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--rule-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.reg-timeline__note {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 13px;
  color: var(--fg-2);
  max-width: 35rem;
  line-height: 1.5;
  margin: 0;
}
.reg-timeline__note em {
  font-style: italic;
  font-variation-settings: "opsz" 96, "SOFT" 80, "WONK" 1;
}

.reg-timeline__sources {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-3);
  text-align: right;
  margin: 0;
  line-height: 1.5;
}

/* Desktop: timeline orizzontale */
@media (min-width: 900px) {
  .reg-timeline__track {
    padding-top: 8px;
  }

  .reg-timeline__line {
    display: block;
    position: absolute;
    top: 5.65rem;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--rule);
  }

  .reg-timeline__steps {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(8px, 1.2vw, 16px);
  }

  .reg-timeline__step {
    padding: 0 clamp(4px, 0.6vw, 8px) 0;
    border-top: 0;
  }
  .reg-timeline__step::before {
    display: none;
  }

  .reg-timeline__dot {
    position: static;
    margin: 0 0 16px;
    top: auto;
    left: auto;
  }
  .reg-timeline__dot--now {
    margin: -2px 0 14px -2px;
  }

  .reg-timeline__milestone {
    min-height: 3.25rem;
    margin-bottom: 14px;
  }

  .reg-timeline__when {
    margin-bottom: 6px;
  }
}

@media (max-width: 640px) {
  .reg-timeline__step {
    padding-left: 26px;
  }
  .reg-timeline__footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .reg-timeline__sources { text-align: left; }
}

/* ============ Tre passi illustrati (ex «La soluzione») ============ */
.three-steps-chapter {
  padding: 0;
  position: relative;
  z-index: 2;
}

.three-steps {
  background: #faf7f0;
  color: var(--ink);
  padding: clamp(40px, 6vh, 48px) var(--pad-x);
}

.three-steps__head {
  text-align: center;
  margin-bottom: clamp(28px, 4vw, 36px);
}

.three-steps__eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 8px;
}

.three-steps__title {
  font-family: var(--ff-display);
  font-size: clamp(20px, 3.2vw, 22px);
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  font-variation-settings: "opsz" 60, "SOFT" 25, "WONK" 0;
}
.three-steps__title em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "opsz" 96, "SOFT" 80, "WONK" 1;
}

.three-steps__item {
  margin-bottom: 40px;
  border-top: 0.5px solid rgba(22, 17, 14, 0.15);
  padding-top: 24px;
}
.three-steps__item--last { margin-bottom: 0; }

.three-steps__num {
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  border: 0.5px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-mono);
  font-size: 11px;
  background: #faf7f0;
}

.three-steps__illus {
  display: block;
  width: 100%;
  max-width: 240px;
  margin: 0 auto 16px;
}

.three-steps__copy {
  text-align: center;
}

.three-steps__label {
  font-family: var(--ff-display);
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 6px;
  font-variation-settings: "opsz" 48, "SOFT" 25, "WONK" 0;
}

.three-steps__desc {
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.5;
  max-width: 280px;
  margin: 0 auto;
}

.three-steps__tags {
  margin-top: 14px;
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.three-steps__tags span {
  font-family: var(--ff-mono);
  font-size: 9px;
  padding: 3px 8px;
  border: 0.5px solid rgba(22, 17, 14, 0.3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* Step 01 — filiera (statico) */
.three-steps__illus--filiera .ts-arm__line {
  fill: none;
  stroke: rgba(26, 26, 26, 0.35);
  stroke-width: 0.8;
}
.three-steps__illus--filiera .ts-arm__label {
  font-family: var(--ff-mono);
  font-size: 6.5px;
  fill: rgba(26, 26, 26, 0.55);
  letter-spacing: 0.5px;
}
.three-steps__illus--filiera .ts-arm__dot {
  fill: #1a1a1a;
}

/* Step 02 — cassetti on-chain: compaiono in sequenza, pausa 2s, loop */
.three-steps__illus--chain .ts-drawer {
  opacity: 0;
  transform: translateY(6px);
  transform-box: fill-box;
  transform-origin: center top;
  animation-duration: 4.5s;
  animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}
.three-steps__illus--chain .ts-drawer--5 {
  animation-name: ts-drawer-5;
}
.three-steps__illus--chain .ts-drawer--4 {
  animation-name: ts-drawer-4;
}
.three-steps__illus--chain .ts-drawer--3 {
  animation-name: ts-drawer-3;
}
.three-steps__illus--chain .ts-drawer--2 {
  animation-name: ts-drawer-2;
}
.three-steps__illus--chain .ts-drawer--1 {
  animation-name: ts-drawer-1;
}

@keyframes ts-drawer-1 {
  0%, 2% { opacity: 0; transform: translateY(6px); }
  8%, 89% { opacity: 1; transform: translateY(0); }
  89%, 100% { opacity: 0; transform: translateY(6px); }
}
@keyframes ts-drawer-2 {
  0%, 10% { opacity: 0; transform: translateY(6px); }
  18%, 89% { opacity: 1; transform: translateY(0); }
  89%, 100% { opacity: 0; transform: translateY(6px); }
}
@keyframes ts-drawer-3 {
  0%, 18% { opacity: 0; transform: translateY(6px); }
  27%, 89% { opacity: 1; transform: translateY(0); }
  89%, 100% { opacity: 0; transform: translateY(6px); }
}
@keyframes ts-drawer-4 {
  0%, 27% { opacity: 0; transform: translateY(6px); }
  35%, 89% { opacity: 1; transform: translateY(0); }
  89%, 100% { opacity: 0; transform: translateY(6px); }
}
@keyframes ts-drawer-5 {
  0%, 35% { opacity: 0; transform: translateY(6px); }
  43%, 89% { opacity: 0.6; transform: translateY(0); }
  89%, 100% { opacity: 0; transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .three-steps__illus--chain .ts-drawer {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .three-steps__illus--chain .ts-drawer--5 {
    opacity: 0.6;
  }
}

@media (min-width: 900px) {
  .three-steps__item {
    display: grid;
    grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: clamp(24px, 4vw, 48px);
    align-items: start;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-top: 32px;
  }
  .three-steps__num {
    grid-column: 1;
    grid-row: 1;
    margin: 0 0 12px;
    justify-self: center;
  }
  .three-steps__illus {
    grid-column: 1;
    grid-row: 2 / span 2;
    margin: 0;
    max-width: 240px;
    justify-self: center;
  }
  .three-steps__copy {
    grid-column: 2;
    grid-row: 1 / span 3;
    text-align: left;
    align-self: center;
    padding-top: 8px;
  }
  .three-steps__desc { margin: 0; max-width: none; }
  .three-steps__tags { justify-content: flex-start; }
}

/* ============ Builders list (Perché) ============ */
.builders-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  list-style: none;
  padding: 0;
  margin: 0;
}
.builder-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: clamp(20px, 3vw, 44px);
  padding: clamp(20px, 2.6vw, 32px) 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: baseline;
  transition: background .35s var(--ease), padding .35s var(--ease);
  position: relative;
  overflow: hidden;
}
.builder-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--fg);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .5s var(--ease);
}
.builder-row:last-child { border-bottom: 0; }
.builder-row:hover { background: var(--bg-2); padding-left: 22px; padding-right: 22px; }
.builder-row:hover::before { transform: scaleY(1); }

.builder-row .br-num {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.builder-row .br-claim {
  font-family: var(--ff-display);
  font-size: clamp(14px, 1.5vw, 18px);
  line-height: 1.22;
  font-weight: 400;
  letter-spacing: -0.015em;
}
.builder-row .br-claim em { font-style: normal; color: var(--fg-3); font-weight: 300; }
.builder-row .br-tag {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
  text-align: right;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  transition: all .3s var(--ease);
}
.builder-row:hover .br-tag { border-color: var(--fg); color: var(--fg); }
@media (max-width: 720px) {
  .builder-row { grid-template-columns: 40px 1fr; }
  .builder-row .br-tag { display: none; }
}

/* ============ Case study ============ */
.case-chapter { background: var(--bg-2); }
.case-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: start;
}
@media (max-width: 1000px) { .case-grid { grid-template-columns: 1fr; } }

.case-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.case-copy h2 {
  font-size: clamp(26px, 4.2vw, 58px);
  line-height: 0.92;
  letter-spacing: -0.028em;
  font-weight: 460;
  margin-bottom: 28px;
  font-variation-settings: "opsz" 144, "SOFT" 25, "WONK" 0;
}
.case-copy h2 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 460;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.case-lede {
  font-size: clamp(15.5px, 1.25vw, 17.5px);
  line-height: 1.6;
  color: var(--fg-2);
  max-width: 52ch;
  margin-bottom: 40px;
}
.case-lede strong { color: var(--fg); font-weight: 500; }

.case-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 600px) { .case-stats { grid-template-columns: 1fr; } }
.case-stat {
  padding: 24px 18px 24px 0;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.case-stat:nth-child(n+2) { padding-left: 18px; }
.case-stat:last-child { border-right: 0; }
@media (max-width: 600px) {
  .case-stat { border-right: 0; border-top: 1px solid var(--rule); padding-left: 0; }
  .case-stat:first-child { border-top: 0; }
}
.case-stat .cs-k {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.case-stat .cs-v {
  font-family: var(--ff-display);
  font-size: clamp(22px, 2.8vw, 38px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.case-stat .cs-v em {
  font-style: normal;
  font-weight: 300;
  color: var(--fg-3);
  font-size: 0.45em;
  letter-spacing: 0.02em;
}

/* Ledger (blockchain stream) */
.case-ledger {
  background: var(--fg);
  color: var(--bg);
  padding: 22px;
  font-family: var(--ff-mono);
  font-size: 11.5px;
  line-height: 1.6;
  min-height: 380px;
  position: relative;
  overflow: hidden;
}
.case-ledger::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.02) 0,
      rgba(255,255,255,0.02) 1px,
      transparent 1px,
      transparent 3px
    );
  pointer-events: none;
}
.ledger-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
}
.ledger-pulse {
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.6s ease-in-out infinite;
}
.ledger-stream {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.ledger-line {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
  animation: ledger-in .55s var(--ease-deep) both;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.ledger-line .ll-t { color: rgba(255,255,255,0.45); }
.ledger-line .ll-msg { color: rgba(255,255,255,0.85); }
.ledger-line .ll-hash { color: #fff; text-align: right; }
@keyframes ledger-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============ CTA ============ */
.cta-chapter {
  padding: clamp(80px, 12vh, 160px) var(--pad-x);
  background: var(--bg);
  color: var(--fg);
  border-top: 1px solid var(--rule);
}
.cta-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
.cta-kicker {
  grid-column: 1 / span 12;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 14px;
}
.cta-inner h2 {
  grid-column: 1 / span 12;
  font-size: clamp(30px, 5.8vw, 96px);
  line-height: 0.9;
  letter-spacing: -0.028em;
  font-weight: 460;
  color: var(--ink);
  margin-bottom: 52px;
  font-variation-settings: "opsz" 144, "SOFT" 25, "WONK" 0;
}
.cta-inner h2 .line { display: block; overflow: hidden; }
.cta-inner h2 em {
  font-style: italic;
  font-weight: 460;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}

.cta-form {
  grid-column: 1 / span 8;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 20px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}
.cta-form label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.cta-form label.full { grid-column: 1 / -1; }
.cta-form label span {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.cta-form input,
.cta-form textarea {
  width: 100%;
  padding: 12px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  outline: none;
  resize: vertical;
  transition: border-color .3s var(--ease);
  font-family: var(--ff-body);
}
.cta-form input::placeholder,
.cta-form textarea::placeholder { color: var(--fg-4); }
.cta-form input:focus,
.cta-form textarea:focus { border-color: var(--fg); }
.cta-form button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 16px;
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.cta-form button[type="submit"]:hover { color: var(--fg); }
.form-sent {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--fg);
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sent-dot {
  width: 6px; height: 6px;
  background: var(--fg);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@media (max-width: 900px) { .cta-form { grid-column: 1 / -1; grid-template-columns: 1fr; } }

/* ============ Footer ============ */
.foot {
  padding: clamp(60px, 8vw, 100px) var(--pad-x) 36px;
  position: relative;
  z-index: 2;
  background: var(--bg);
  border-top: 1px solid var(--rule);
}
.foot-top {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(40px, 6vw, 80px);
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 800px) { .foot-top { grid-template-columns: 1fr; } }
.foot-brand { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.foot-mark {
  display: inline-block;
  font-family: var(--ff-display);
  font-size: clamp(30px, 3.8vw, 42px);
  font-weight: 500;
  letter-spacing: -0.035em;
  color: var(--fg);
  line-height: 1;
}
.foot-tag {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}
.foot-cols > div { display: flex; flex-direction: column; gap: 12px; }
.foot-col-k {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 4px;
}
.foot-cols a {
  font-family: var(--ff-display);
  font-size: 15px;
  color: var(--fg);
  transition: color .25s var(--ease);
}
.foot-cols a:hover { color: var(--fg-3); }

.foot-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--ff-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.foot-chain {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-2);
}
.mono { font-family: var(--ff-mono); color: var(--fg); font-variant-numeric: tabular-nums; }

/* ============ Reveal on scroll ============ */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease-deep), transform 1s var(--ease-deep);
}
[data-reveal].is-in { opacity: 1; transform: translateY(0); }


::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }

/* ============ Keyframes ============ */
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rise    { from { opacity: 0; transform: translateY(110%); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse   { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   AGGREGATOR — animated brand signature
   Gold sphere · concentric galaxy rings · orbital nodes · emitting sparks · halo
   Ported & tuned from v13. Strategic visual anchor, not decoration.
   ========================================================= */
.aggregator {
  position: relative;
  width: 320px;
  height: 180px;
  margin: 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.aggregator--sm { width: 180px; height: 110px; margin: 0 auto 20px; }

.agg-galaxy {
  position: absolute;
  inset: 0;
  left: -28%;
  right: -28%;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.agg-galaxy > svg {
  width: 100%;
  height: 100%;
  display: block;
}
.agg-ring {
  transform-origin: 0 0;
  animation: agg-ring-pulse 4s ease-in-out infinite;
}
.agg-node--hub,
.agg-node--gold {
  transform-origin: center;
  animation: agg-node-pulse 3.6s ease-in-out infinite;
}

.agg-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-soft) 0%, rgba(245, 224, 160, 0) 65%);
  animation: agg-halo-pulse 2.8s ease-in-out infinite;
  z-index: 2;
  transform: translate(-50%, -50%);
}

.agg-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.agg-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 0 50%;
  border-radius: 999px;
  will-change: transform, opacity;
}
.agg-spark--soft {
  background: linear-gradient(
    to right,
    rgba(245, 224, 160, 0) 0%,
    rgba(245, 224, 160, 0.55) 30%,
    #fbedb3 60%,
    #fffae6 85%,
    #ffffff 100%
  );
  box-shadow:
    0 0 3px rgba(251, 237, 179, 0.8),
    0 0 7px rgba(245, 224, 160, 0.5);
}
.agg-spark--bright {
  background: linear-gradient(
    to right,
    rgba(255, 250, 230, 0) 0%,
    rgba(255, 250, 230, 0.7) 25%,
    #fffae6 55%,
    #ffffff 80%,
    #ffffff 100%
  );
  box-shadow:
    0 0 5px rgba(255, 255, 255, 0.95),
    0 0 10px rgba(251, 237, 179, 0.85);
}

.agg-logo-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 76px;
  height: 76px;
}
.aggregator--sm .agg-logo-wrap { width: 48px; height: 48px; }
.agg-logo-spin {
  width: 100%;
  height: 100%;
  animation:
    agg-spin 5s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite,
    agg-float 5s ease-in-out infinite;
}
.agg-logo {
  width: 100%;
  height: 100%;
  filter:
    drop-shadow(0 6px 12px rgba(26, 26, 26, 0.22))
    drop-shadow(0 0 22px rgba(245, 224, 160, 0.55));
}
.agg-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes agg-ring-pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(1.04); }
}
@keyframes agg-node-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
@keyframes agg-halo-pulse {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.22); }
}
@keyframes agg-spin {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(50deg); }
  50%  { transform: rotate(180deg); }
  80%  { transform: rotate(310deg); }
  100% { transform: rotate(360deg); }
}
@keyframes agg-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* =========================================================
   MAC WINDOW — Pages-style preview chrome
   Used for hero visual + La piattaforma section.
   ========================================================= */
.mac-window {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 30px 60px -20px rgba(10, 10, 9, 0.18),
    0 10px 20px -10px rgba(10, 10, 9, 0.08);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.mac-window:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 36px 72px -22px rgba(10, 10, 9, 0.22),
    0 14px 26px -12px rgba(10, 10, 9, 0.10);
}

.mw-chrome {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule-soft);
  background: rgba(10, 10, 9, 0.03);
  min-width: 0;
}
.mw-dots { display: flex; gap: 6px; flex: 0 0 auto; }
.mw-dots span {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(10, 10, 9, 0.18);
}
.mw-dots span:nth-child(1) { background: #e0654c; }
.mw-dots span:nth-child(2) { background: #e6b450; }
.mw-dots span:nth-child(3) { background: #65c280; }
.mw-url {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mw-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mw-actions span {
  display: block;
  width: 16px; height: 4px;
  background: rgba(10, 10, 9, 0.20);
  border-radius: 2px;
}

.mw-body {
  padding: 24px 26px 26px;
  min-width: 0;
  overflow-x: clip;
}

/* ----- Mac window: Backoffice preview ----- */
.mw-bo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
  min-width: 0;
}
.mw-bo-header > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}
.mw-eyebrow {
  font-family: var(--ff-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 6px;
}
.mw-title {
  font-family: var(--ff-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.018em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
  min-width: 0;
  max-width: 100%;
}
.mw-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--fg);
  background: var(--gold);
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--fg);
  text-transform: uppercase;
}
.mw-pill-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--fg);
  animation: pulse 2s ease-in-out infinite;
}

.mw-score { display: flex; align-items: center; gap: 10px; }
.mw-score-svg { display: block; }
.mw-score-svg .score-track {
  fill: none;
  stroke: rgba(10, 10, 9, 0.10);
  stroke-width: 6;
}
.mw-score-svg .score-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  stroke-dasharray: 122.6 201;
  animation: score-fill 2.4s var(--ease-deep) forwards;
}
.mw-score-svg .score-text {
  font-family: var(--ff-display);
  font-size: 18px;
  font-weight: 600;
  fill: var(--fg);
}
.mw-score-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--fg-3);
  line-height: 1.4;
  text-transform: uppercase;
}
@keyframes score-fill { from { stroke-dasharray: 0 201; } }

.mw-bo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--fg-3);
  margin: 12px 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-soft);
}
.mw-bo-meta .sep { opacity: 0.35; }

.mw-cert-list { display: flex; flex-direction: column; gap: 2px; }
.mw-cert {
  display: grid;
  grid-template-columns: 64px 1fr 22px;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background .25s var(--ease);
  opacity: 0;
  transform: translateX(-6px);
  animation: cert-rise .5s var(--ease-deep) forwards;
}
.mw-cert:hover { background: var(--rule-mute); }
.mw-cert .cert-id {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--fg-3);
}
.mw-cert .cert-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg);
  min-width: 0;
  overflow-wrap: anywhere;
}
.mw-cert--missing .cert-label,
.mw-cert--missing .cert-id { color: var(--fg-4); }
.mw-cert .cert-status { display: flex; justify-content: flex-end; }
.mw-cert .cert-status svg { display: block; }
@keyframes cert-rise {
  to { opacity: 1; transform: translateX(0); }
}

/* ----- Mac window: DPP public preview ----- */
.mw-dpp-status {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--ok-soft);
  border: 1px solid rgba(45, 95, 63, 0.18);
  border-radius: 6px;
  margin: 14px 0 18px;
}
.mw-dpp-status-num {
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  color: var(--ok);
}
.mw-dpp-status-block { display: flex; flex-direction: column; gap: 2px; }
.mw-dpp-status-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--fg-3);
  text-transform: uppercase;
}
.mw-dpp-status-val { font-size: 14px; font-weight: 600; color: var(--fg); }
.mw-dpp-status-meta {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--fg-3);
  margin-left: auto;
  letter-spacing: 0.02em;
}
@media (max-width: 560px) { .mw-dpp-status-meta { margin-left: 0; width: 100%; } }

.mw-dpp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule-soft);
}
.mw-dpp-field-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--fg-3);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.mw-dpp-field-val {
  font-family: var(--ff-mono);
  font-size: 13px;
  color: var(--fg);
  letter-spacing: 0.02em;
}
.mw-dpp-qr {
  display: flex;
  gap: 16px;
  align-items: center;
}
.mw-dpp-qr-box {
  padding: 8px;
  border: 1px solid var(--rule);
  background: var(--bg);
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
}
.mw-dpp-qr-box svg { width: 100%; height: 100%; display: block; }
.mw-dpp-qr-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--fg-3);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.mw-dpp-qr-sub {
  font-size: 12.5px;
  color: var(--fg-2);
  line-height: 1.45;
  max-width: 28ch;
}

/* Subtle scan line accent on Mac windows (hero) */
.mac-window--hero {
  position: relative;
}
.mac-window--hero::after {
  content: "";
  position: absolute;
  left: 1px; right: 1px; top: 38px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
  opacity: 0;
  animation: mw-scan 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes mw-scan {
  0%   { transform: translateY(0); opacity: 0; }
  8%   { opacity: 0.55; }
  88%  { opacity: 0.55; }
  100% { transform: translateY(calc(100% - 40px)); opacity: 0; }
}

/* =========================================================
   Small accent details on existing components
   ========================================================= */

/* Soft gold tint to hero meta dot, registry dot, ledger pulse — keeps the editorial monochrome BUT signals the brand mark.
   Restraint: applied only on the 1px / 5px elements, never on large surfaces. */
.hero-meta .hm-dot {
  background: var(--fg);
  box-shadow: 0 0 0 0 var(--gold-soft);
  animation: pulse-gold 2.4s ease-in-out infinite;
}
@keyframes pulse-gold {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--gold-soft); }
  50%      { opacity: 0.4; box-shadow: 0 0 0 6px rgba(245, 224, 160, 0); }
}
.registry-bar .rb-dot {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold-soft);
}
.ledger-pulse { background: var(--gold); box-shadow: 0 0 8px var(--gold-soft); }

/* The hero accent underline stays monochrome.
   But: the chain-block.is-latest gets a tiny gold dot anchor (only if the chain-stack is rendered). */
.chain-block.is-latest .cb-k::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 4px var(--gold-soft);
  vertical-align: middle;
}

/* Hero: logo centrato sopra il titolo */
.hero-copy .aggregator {
  margin-left: auto;
  margin-right: auto;
}
.hero-copy .aggregator-caption {
  margin-left: auto;
  margin-right: auto;
}

/* Stat-strip used inside the platform mac window header tag area */
.mw-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.mw-tag .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

/* Inline pill used inline-flex in problem-cell big to lift accent */
.problem-cell.big .pc-k::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  background: var(--gold);
  vertical-align: middle;
  transform: rotate(45deg);
}

/* Hero visual placeholder when chain-stack/artifact removed */
.hero-visual--mac {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(420px, 56vw, 540px);
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.hero-visual--mac .mac-window {
  width: 100%;
  max-width: 560px;
  min-width: 0;
}

/* =========================================================
   EDITORIAL FLOURISHES — italian catalogue typography
   Drop caps, monumental Roman numerals, "FIG." captions,
   on-chain circular seal, printer's marks. The whole point.
   ========================================================= */

/* Roman numeral plate on each chapter (left margin, monumental). */
.chapter { padding-top: clamp(96px, 14vh, 200px); }
.chapter-inner { position: relative; }
.chapter-roman {
  position: absolute;
  top: -16px;
  left: -6px;
  display: block;
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 380;
  font-size: clamp(120px, 20vw, 320px);
  line-height: 0.82;
  letter-spacing: -0.03em;
  color: rgba(22, 17, 14, 0.07);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0;
}
.chapter-roman i {
  font-style: italic;
  color: rgba(122, 46, 31, 0.22);
}
@media (max-width: 900px) {
  .chapter-roman {
    position: relative;
    top: 0;
    font-size: clamp(96px, 28vw, 180px);
    margin-bottom: -30px;
    margin-top: -10px;
  }
}

/* Engraver's rule: double thin rule + ◊ center motif at section opener. */
.chapter-index {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 16px;
}
.chapter-index::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  height: 1px;
  background: var(--rule);
}
.chapter-index::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -4px;
  width: 8px; height: 8px;
  background: var(--paper);
  border: 1px solid var(--accent);
  transform: translateX(-50%) rotate(45deg);
}

/* Drop cap — applies to opening paragraphs in the catalogue style. */
.drop-cap::first-letter {
  font-family: var(--ff-display);
  font-weight: 420;
  font-style: italic;
  float: left;
  font-size: 4.4em;
  line-height: 0.86;
  padding: 6px 14px 0 0;
  margin: 4px 4px -4px 0;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  text-shadow: 0 1px 0 rgba(217, 166, 70, 0.18);
}

/* Marginal monocaption next to elements (FIG. NN, NOTA, etc.) */
.marginalia {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.marginalia::before {
  content: "";
  display: inline-block;
  width: 18px; height: 1px;
  background: var(--accent);
}

/* FIG. caption that lives under a Mac window. */
.fig-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.fig-caption strong {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.2em;
}
.fig-caption .fig-italic {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 380;
  font-size: 14px;
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--fg-2);
  font-variation-settings: "opsz" 30, "SOFT" 100, "WONK" 1;
}

/* Mac window wrap — holds the window + figcaption + optional stamp.
   <figure> default margin reset so the wrap aligns flush. */
.mac-window-wrap {
  position: relative;
  margin: 0;
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

/* Hero "issue number" — printer's index above the meta line. */
.hero-issue {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 30px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.hero-issue::after {
  content: "◊";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  color: var(--accent);
  font-size: 12px;
  background: var(--paper);
  padding: 0 8px;
  line-height: 1;
}
.hero-issue .hi-num {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 380;
  font-size: 16px;
  letter-spacing: -0.005em;
  color: var(--ink);
  font-variation-settings: "opsz" 60, "SOFT" 100, "WONK" 1;
}
.hero-issue .hi-num em {
  color: var(--accent);
}
.hero-issue .hi-meta {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  text-align: right;
}

/* Printer's registration marks (footer flourish). */
.printer-marks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 22px;
  border-top: 1px solid var(--rule);
  margin-top: 32px;
}
.printer-marks .reg-cross {
  width: 18px; height: 18px;
  position: relative;
  flex: 0 0 auto;
}
.printer-marks .reg-cross::before,
.printer-marks .reg-cross::after {
  content: "";
  position: absolute;
  background: var(--ink);
}
.printer-marks .reg-cross::before {
  left: 50%; top: 0; width: 1px; height: 100%;
  transform: translateX(-50%);
}
.printer-marks .reg-cross::after {
  top: 50%; left: 0; height: 1px; width: 100%;
  transform: translateY(-50%);
}
.printer-marks .reg-cross > i {
  position: absolute;
  inset: 4px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: block;
}
.printer-marks .color-bar {
  display: flex;
  flex: 1;
  gap: 2px;
  height: 10px;
}
.printer-marks .color-bar span {
  flex: 1;
  height: 100%;
  display: block;
}
.printer-marks .color-bar span:nth-child(1) { background: var(--ink); }
.printer-marks .color-bar span:nth-child(2) { background: var(--accent); }
.printer-marks .color-bar span:nth-child(3) { background: var(--gold); }
.printer-marks .color-bar span:nth-child(4) { background: var(--ok); }
.printer-marks .color-bar span:nth-child(5) { background: var(--paper-2); }
.printer-marks .fine-mark {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 380;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: 0.04em;
  font-variation-settings: "opsz" 60, "SOFT" 100, "WONK" 1;
}

/* Aggregator: position more deliberately in hero with small marginalia caption. */
.aggregator-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 6px 0 22px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-4);
  max-width: 320px;
}
.aggregator-caption .ac-rule {
  flex: 1;
  height: 1px;
  background: var(--rule-soft);
}
.aggregator-caption em {
  font-family: var(--ff-display);
  font-style: italic;
  text-transform: none;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--accent);
  font-variation-settings: "opsz" 30, "SOFT" 100, "WONK" 1;
}

/* Builders list claims: italic with WONK for true Fraunces character. */
.builder-row .br-claim em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
  font-variation-settings: "opsz" 60, "SOFT" 100, "WONK" 1;
}

/* problem-cell + case-stat numbers benefit from opsz 144. */
.problem-cell .pc-v {
  font-variation-settings: "opsz" 144, "SOFT" 20, "WONK" 0;
}
.problem-cell .pc-v em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.problem-cell.big .pc-v em { color: var(--gold); }
.case-stat .cs-v {
  font-variation-settings: "opsz" 144, "SOFT" 20, "WONK" 0;
}
.case-stat .cs-v em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "opsz" 60, "SOFT" 100, "WONK" 1;
}

/* Hero lede italic accent. */
.hero-lede .accent {
  font-style: italic;
  font-variation-settings: "opsz" 30, "SOFT" 100, "WONK" 1;
  color: var(--accent);
}
.hero-lede {
  font-size: clamp(17px, 1.4vw, 21px);
  font-variation-settings: "opsz" 24, "SOFT" 70, "WONK" 0;
}

/* The "live-dot" turns into a small printed bullet with halo. */
.live-dot { background: var(--accent); }
.live-dot::after { border-color: var(--accent); }

/* Footer mark refined */
.foot-mark {
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0;
  font-weight: 420;
}
.foot-cols a {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 17px;
  font-variation-settings: "opsz" 24, "SOFT" 80, "WONK" 1;
}

/* nav-cta — keep mono, switch to ink not pure black */
.nav-cta {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.nav-cta:hover { background: var(--paper); color: var(--ink); }

/* btn-primary same warm-ink */
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary::before { background: var(--paper); }
.btn-ghost::before { background: var(--ink); }
.btn-ghost:hover { color: var(--paper); border-color: var(--ink); }

/* Mac window — kept white to detach from parchment body. */
.mac-window {
  background: #ffffff;
  border-color: rgba(22, 17, 14, 0.14);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 30px 60px -20px rgba(22, 17, 14, 0.22),
    0 10px 20px -10px rgba(22, 17, 14, 0.10);
}
.mw-chrome {
  background: #f6f6f4;
  border-bottom-color: rgba(22, 17, 14, 0.08);
}
.mw-title {
  font-family: var(--ff-display);
  font-variation-settings: "opsz" 60, "SOFT" 25, "WONK" 0;
}

/* Score gauge wrap (DPP green status) — color-coded via inline style still. */
.mw-dpp-status {
  background: var(--ok-soft);
  border-color: rgba(46, 82, 56, 0.20);
}
.mw-dpp-status-num { color: var(--ok); }

/* Registry bar uses ink. */
.registry-bar {
  background: var(--ink);
  border-bottom-color: var(--rule);
  color: rgba(253, 251, 246, 0.74);
}

/* =========================================================
   MOBILE / TABLET — no horizontal scroll
   ========================================================= */
@media (max-width: 900px) {
  .hero,
  .hero-grid,
  .hero-copy,
  .hero-visual,
  .chapter,
  .chapter-inner,
  .mac-window-wrap,
  .fig-caption {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .chapter,
  .hero,
  main {
    overflow-x: hidden;
  }

  .hero-visual,
  [data-parallax] {
    transform: none !important;
  }

  .aggregator {
    max-width: min(320px, 100%);
    overflow: hidden;
  }

  .agg-galaxy {
    left: -12%;
    right: -12%;
  }

  .mac-window {
    max-width: 100%;
    min-width: 0;
  }

  .mw-chrome {
    gap: 8px;
    padding: 10px 12px;
  }

  .mw-bo-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .mw-score {
    flex-shrink: 0;
  }

  .mw-score-svg {
    width: 64px;
    height: 64px;
  }

  .mw-bo-meta .sep {
    display: none;
  }

  .mw-bo-meta span:not(.sep) {
    white-space: normal;
  }

  .chapter-roman {
    max-width: 100%;
    overflow: hidden;
  }

  body::before,
  body::after {
    inset: 0;
  }

  body::before {
    animation: none;
  }

  .chapter-index {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

}

/* =========================================================
   MOBILE REFINEMENTS — phones first (≤ 540 px / ≤ 420 px)
   ========================================================= */
@media (max-width: 720px) {
  /* Aggregator: keep it expressive but never overflow the viewport. */
  .aggregator { width: min(280px, 90vw); height: 158px; margin-left: auto; margin-right: auto; margin-bottom: 24px; }
  .agg-logo-wrap { width: 68px; height: 68px; }
  .agg-halo { width: 92px; height: 92px; }

  /* Tighten mac-window typography. */
  .mw-body { padding: 20px 18px 22px; }
  .mw-bo-meta { font-size: 9.5px; gap: 6px; }
  .mw-cert { grid-template-columns: 56px 1fr 22px; padding: 8px 6px; gap: 10px; }
  .mw-cert .cert-label { font-size: 12.5px; }
}

@media (max-width: 540px) {
  .nav { padding: 14px var(--pad-x); }
  .nav-shell.is-scrolled { padding-top: 0; padding-bottom: 0; }

  :root { --pad-x: clamp(16px, 4.5vw, 72px); }

  .hero { padding-top: clamp(40px, 6vh, 72px); }
  .hero-copy { overflow-x: clip; max-width: 100%; min-width: 0; }
  .hero-grid { gap: 40px; }

  .hero-issue {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
  }
  .hero-issue .hi-num { font-size: 14px; line-height: 1.25; }
  .hero-issue .hi-meta { text-align: left; font-size: 9.5px; letter-spacing: 0.16em; }

  .aggregator-caption {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    max-width: none;
  }
  .aggregator-caption .ac-rule { width: 100%; height: 1px; }

  .hero-title { font-size: clamp(24px, 7vw, 32px); line-height: 0.96; }
  .hero-lede { font-size: 15.5px; max-width: none; }
  .hero-lede .accent { white-space: normal; }

  .drop-cap::first-letter {
    font-size: 3.4em;
    padding: 4px 10px 0 0;
    margin: 2px 2px -2px 0;
  }

  .fig-caption {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .fig-caption .fig-italic { font-size: 13px; }

  .mw-title { word-break: break-word; }

  /* Hero CTAs stack and stretch to full width — better touch targets. */
  .hero-actions { gap: 10px; flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; padding: 16px 22px; }

  /* Hero visual: no enforced height — let mac-window dictate. */
  .hero-visual--mac { min-height: auto; }
  .hero-grid { min-height: auto; }

  /* Mac-window header: stack score under title. */
  .mw-bo-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .mw-score { align-self: flex-start; }
  .mw-title { font-size: 15px; }
  .mw-title .mw-pill { font-size: 8px; }

  /* DPP preview: stack the key-value grid + QR area. */
  .mw-dpp-grid { grid-template-columns: 1fr; gap: 12px; }
  .mw-dpp-qr { flex-direction: column; align-items: flex-start; gap: 12px; }
  .mw-dpp-qr-box { width: 96px; height: 96px; }
  .mw-dpp-status { padding: 10px 12px; gap: 10px; }
  .mw-dpp-status-meta { width: 100%; margin-left: 0; }

  /* Registry bar: only show the dot + first label. */
  .registry-bar { font-size: 9.5px; padding: 7px 14px; gap: 10px; letter-spacing: 0.18em; }

  /* Footer columns single col for phones. */
  .foot-cols { grid-template-columns: 1fr; gap: 24px; }

  /* Tighten chapter vertical rhythm a touch. */
  .chapter { padding-top: clamp(64px, 11vh, 100px); padding-bottom: clamp(64px, 11vh, 100px); }
}

@media (max-width: 420px) {
  .aggregator { width: min(240px, 86vw); height: 140px; }
  .agg-logo-wrap { width: 60px; height: 60px; }

  .mw-chrome .mw-actions {
    display: none;
  }

  .mw-dots span {
    width: 7px;
    height: 7px;
  }

  /* Mac-window chrome stays readable; URL ellipses already handle long paths. */
  .mw-url {
    font-size: 8.5px;
    letter-spacing: 0;
    text-align: left;
  }

  /* Mw-cert: drop id column on the narrowest screens — keep label + status. */
  .mw-cert { grid-template-columns: 1fr 22px; padding: 8px 4px; gap: 10px; }
  .mw-cert .cert-id { display: none; }

  /* Registry bar: hide ticker block on the narrowest devices. */
  .registry-bar > span:last-child { display: none; }
}
