/* nerdbrain.it — motion site. Layout works without script; js/site.js adds the motion. */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url(../fonts/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #0a0a0a;
  --bg-2: #111110;
  --ink: #ecebe6;
  --dim: #8d8c86;      /* 6.1:1 on --bg */
  --line: #262624;
  --accent: #ff5533;   /* 5.9:1 on --bg */
  --gut: clamp(20px, 3.4vw, 56px);
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-stopped { overflow: hidden; }
body { font: 400 17px/1.55 var(--display); font-stretch: 100%; overflow-x: clip; }
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
em { font-style: normal; color: var(--accent); }
.accent { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip { position: fixed; left: var(--gut); top: 12px; z-index: 200; padding: 10px 14px; background: var(--accent); color: var(--bg); font: 500 14px var(--mono); transform: translateY(-200%); }
.skip:focus { transform: none; }

/* mono labels: the chapter system */
.lbl { font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }

/* ---------------------------------------------------------------- header */
.hdr { position: fixed; inset: 0 0 auto; z-index: 50; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 18px var(--gut); mix-blend-mode: difference; }
.hdr__logo { font: 800 22px/1 var(--display); font-stretch: 125%; text-decoration: none; letter-spacing: -.02em; }
.blink { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hdr__nav { display: flex; justify-content: center; gap: clamp(12px, 2vw, 32px); }
.hdr__nav a { font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; padding: 12px 0; color: #b4b3ae; transition: color .3s; }
.hdr__nav a:hover, .hdr__nav a.is-on { color: #f3f2ee; }
.hdr__nav i { font-style: normal; margin-right: 2px; color: var(--accent); }
.hdr__meta { display: flex; gap: 20px; font: 500 12px var(--mono); letter-spacing: .06em; color: #f3f2ee; }
.hdr__chapter { color: var(--accent); }
@media (max-width: 899px) { .hdr__nav, .hdr__clock { display: none; } .hdr { grid-template-columns: 1fr auto; } }

.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 60; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------------------------------------------------------------- boot */
.boot { display: none; }
.js .boot { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; justify-content: space-between; padding: 80px var(--gut) 32px; background: var(--bg); animation: boot-safety 0s 4.5s forwards; }
@keyframes boot-safety { to { visibility: hidden; opacity: 0; } }   /* never traps the page if the script fails */
.boot__log { margin: 0; font: 400 13px/1.7 var(--mono); color: var(--dim); white-space: pre-wrap; }
.boot__log b { color: var(--accent); font-weight: 400; }
.boot__count { align-self: flex-end; font: 800 clamp(80px, 18vw, 280px)/.8 var(--display); font-stretch: 62%; letter-spacing: -.03em; }
.boot__count span { font-variant-numeric: tabular-nums; }
html.boot-done .boot, html.no-boot .boot { display: none; }

/* ---------------------------------------------------------------- cursor */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .js .cursor { display: block; position: fixed; inset: 0; z-index: 90; pointer-events: none; mix-blend-mode: difference; opacity: 0; transition: opacity .3s; }
  .js .cursor.is-live { opacity: 1; }
  .cursor__dot, .cursor__ring { position: absolute; left: 0; top: 0; border-radius: 50%; }
  .cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; }
  .cursor__ring { width: 40px; height: 40px; margin: -20px 0 0 -20px; border: 1px solid #fff; display: grid; place-items: center; transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s; }
  .cursor.is-link .cursor__ring { width: 88px; height: 88px; margin: -44px 0 0 -44px; background: #fff; }
  .cursor__label { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #000; opacity: 0; transition: opacity .2s; }
  .cursor.is-link .cursor__label { opacity: 1; }
}

/* ---------------------------------------------------------------- hero */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; padding: 120px var(--gut) 40px; overflow: hidden; }
.hero__field { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__inner { position: relative; width: 100%; display: grid; gap: 28px; }
.hero__name { font: 800 clamp(68px, 15.5vw, 280px)/.8 var(--display); font-stretch: 72%; letter-spacing: -.035em; text-transform: uppercase; }
.hero__line { display: block; overflow: hidden; padding-bottom: .04em; }
.hero__line + .hero__line { padding-left: 8vw; }
.hero__role { font: 500 clamp(19px, 2vw, 30px)/1.25 var(--display); max-width: 40ch; }
.hero__sep { color: var(--dim); margin: 0 .2em; }
.scramble { font-family: var(--mono); font-size: .78em; font-weight: 400; color: var(--dim); white-space: nowrap; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 12px 48px; }
.hero__meta dt { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.hero__meta dd { font: 500 18px var(--display); margin-top: 4px; }
.hero__scroll { position: absolute; right: 0; bottom: 0; }
.hero__scroll span { display: inline-block; color: var(--accent); animation: nudge 1.6s var(--ease) infinite; }
@keyframes nudge { 50% { transform: translateY(5px); } }
@media (max-width: 639px) { .hero__name { font-size: 19.5vw; } .hero__line + .hero__line { padding-left: 0; } .hero__scroll { display: none; } }

/* ---------------------------------------------------------------- shared section frame */
main > section:not(.hero) { padding: 0 var(--gut); }
.manifesto, .persone, .stack, .contatti { padding-block: clamp(96px, 16vh, 180px) !important; }
h2 { font: 700 clamp(40px, 6.4vw, 108px)/.92 var(--display); font-stretch: 80%; letter-spacing: -.03em; text-transform: uppercase; }
section > .lbl, .flusso__text > .lbl, .ambiti__head > .lbl:first-child { margin-bottom: 28px; }

/* ---------------------------------------------------------------- manifesto */
.manifesto__pin { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
.manifesto__text { font: 500 clamp(30px, 4.6vw, 80px)/1.05 var(--display); font-stretch: 88%; letter-spacing: -.02em; max-width: 22ch; }

/* ---------------------------------------------------------------- ambiti: vertical by default, horizontal when the script pins it */
.ambiti { padding-block: 120px; }
.ambiti__head h2 { max-width: 12ch; }
.ambiti__count { display: none; }
.ambiti__track { display: grid; gap: 24px; margin-top: 56px; }
.panel { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; min-height: 560px; padding: clamp(24px, 2.6vw, 40px); background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.panel__viz { position: absolute; inset: 0 0 auto; width: 100%; height: 56%; }
.panel__idx { font: 500 13px var(--mono); color: var(--accent); }
.panel h3 { font: 700 clamp(30px, 3.4vw, 58px)/.95 var(--display); font-stretch: 78%; letter-spacing: -.02em; text-transform: uppercase; }
.panel p:not([class]) { color: #c9c8c2; max-width: 44ch; }
.panel__tags { font: 400 12px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--dim); padding-top: 14px; border-top: 1px solid var(--line); }
@media (min-width: 900px) {
  .ambiti__track { grid-template-columns: repeat(2, 1fr); }
  html.is-motion .ambiti { padding: 0 !important; }
  html.is-motion .ambiti__pin { height: 100svh; display: flex; align-items: center; overflow: hidden; }
  html.is-motion .ambiti__head { position: absolute; left: var(--gut); top: 112px; width: 32vw; }
  html.is-motion .ambiti__count { display: block; position: absolute; left: var(--gut); bottom: 40px; font-size: 14px; }
  html.is-motion .ambiti__count span { color: var(--accent); }
  html.is-motion .ambiti__track { display: flex; gap: 2.4vw; margin: 0; padding: 0 var(--gut) 0 38vw; will-change: transform; }
  html.is-motion .panel { flex: 0 0 min(46vw, 680px); height: min(72svh, 680px); min-height: 0; }
}

/* ---------------------------------------------------------------- flusso */
.flusso { padding-block: 120px; }
.flusso__pin { display: grid; gap: 48px; align-items: center; }
.flusso__text h2 { font-size: clamp(36px, 4.6vw, 76px); max-width: 14ch; }
.flusso__steps { margin-top: 40px; display: grid; gap: 0; counter-reset: s; }
.flusso__steps li { padding: 14px 0; border-top: 1px solid var(--line); color: var(--dim); transition: color .4s; max-width: 52ch; }
.flusso__steps li b { display: block; font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); margin-bottom: 2px; }
.flusso__steps li.is-on { color: var(--ink); }
.flusso__steps li.is-on b { color: var(--accent); }
.flusso__viz { position: relative; }
.flusso__svg { width: 100%; height: auto; overflow: visible; }
.flusso__track { fill: none; stroke: var(--line); stroke-width: 1.5; }
.flusso__line { fill: none; stroke: var(--accent); stroke-width: 2; }
.flusso__node circle { fill: var(--bg); stroke: var(--dim); stroke-width: 1.5; transition: fill .4s, stroke .4s; }
.flusso__node text { font: 500 13px var(--mono); letter-spacing: .08em; fill: var(--dim); text-anchor: middle; transition: fill .4s; }
.flusso__node.is-on circle { fill: var(--accent); stroke: var(--accent); }
.flusso__node.is-on text { fill: var(--ink); }
.flusso__log { margin: 16px 0 0; padding: 20px; border: 1px solid var(--line); background: var(--bg-2); font: 400 13px/1.8 var(--mono); color: var(--dim); white-space: pre-wrap; }
.flusso__log span { transition: color .4s; }
.flusso__log span.is-on { color: var(--ink); }
@media (min-width: 900px) { html.is-motion .manifesto { padding-block: 0 !important; } }
@media (min-width: 900px) {
  .flusso__pin { grid-template-columns: 5fr 6fr; min-height: 100svh; }
  html.is-motion .flusso { padding-block: 0; }
}

/* ---------------------------------------------------------------- persone */
.persone__title { max-width: 18ch; }
.marquee { margin: clamp(56px, 9vh, 96px) calc(-1 * var(--gut)); overflow: hidden; border-block: 1px solid var(--line); }
.marquee__row { display: flex; white-space: nowrap; padding: 10px 0; }
.marquee__row + .marquee__row { border-top: 1px solid var(--line); }
.marquee__inner { flex: none; padding-right: .4em; font: 800 clamp(48px, 9vw, 150px)/1 var(--display); font-stretch: 70%; text-transform: uppercase; letter-spacing: -.02em; }
.marquee__inner i { font-style: normal; color: var(--accent); font-size: .6em; vertical-align: .25em; }
.marquee__row--rev .marquee__inner { color: transparent; -webkit-text-stroke: 1px var(--ink); }
.persone__list { display: grid; gap: 32px; }
.persone__list li { color: #c9c8c2; max-width: 44ch; }
.persone__list b { display: block; font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
@media (min-width: 900px) { .persone__list { grid-template-columns: repeat(3, 1fr); } }

/* ---------------------------------------------------------------- stack */
.stack__groups { margin-top: 64px; display: grid; gap: 40px; }
.stack__group h3 { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.stack__group li { font: 500 clamp(20px, 1.8vw, 28px)/1 var(--mono); letter-spacing: -.02em; padding: 14px 0; border-bottom: 1px solid var(--line); transition: color .25s, padding-left .35s var(--ease); }
.stack__group li:hover { color: var(--accent); padding-left: 10px; }
@media (min-width: 640px) { .stack__groups { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .stack__groups { grid-template-columns: repeat(4, 1fr); } }

/* ---------------------------------------------------------------- contatti */
.contatti { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
.contatti__title { font-size: clamp(64px, 17vw, 320px); line-height: .8; font-stretch: 62%; }
.contatti__mail { text-decoration: none; display: inline-block; transition: font-stretch .7s var(--ease), color .4s; }
.contatti__mail:hover { font-stretch: 125%; }
.contatti__lead { margin-top: 40px; font-size: clamp(18px, 1.6vw, 24px); color: #c9c8c2; }
.contatti__links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px 40px; }
.contatti__links a { display: inline-block; padding: 10px 0; font: 500 15px var(--mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat; transition: background-size .45s var(--ease), color .3s; }
.contatti__links a:hover { background-size: 100% 1px; color: var(--accent); }

/* ---------------------------------------------------------------- footer */
.ftr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding: 28px var(--gut) 72px; border-top: 1px solid var(--line); font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.ftr a { text-decoration: none; display: inline-block; padding: 8px 0; }
.ftr a:hover { color: var(--accent); }
.ftr__mail { text-transform: none; letter-spacing: .02em; }

/* ---------------------------------------------------------------- reduced motion: tier 1 removed, fades kept */
@media (prefers-reduced-motion: reduce) {
  .blink, .hero__scroll span { animation: none; }
  .js .boot, .js .cursor { display: none; }
  .contatti__mail, .stack__group li { transition: color .2s; }
  .marquee__row { white-space: normal; }
}

/* ---------------------------------------------------------------- text pages (accessibilità, mappa del sito) */
.prose { max-width: 72ch; margin: 0 auto; padding: 96px var(--gut); }
.prose h1 { font: 700 clamp(40px, 6vw, 80px)/.95 var(--display); font-stretch: 80%; letter-spacing: -.03em; text-transform: uppercase; margin-bottom: 32px; }
.prose h2 { font-size: clamp(24px, 3vw, 36px); margin: 48px 0 16px; }
.prose p, .prose li { color: #c9c8c2; margin-bottom: 12px; }
.prose ul { list-style: square; padding-left: 1.2em; }
.prose ul ul { margin-top: 8px; }
.prose a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.prose a:hover { color: var(--accent); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }
.breadcrumb-list { display: flex; gap: 8px; margin-bottom: 40px; font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); list-style: none !important; padding: 0 !important; }
.breadcrumb-list li + li::before { content: "/"; margin-right: 8px; }
