/* ==========================================================================
   Matteo Arlotti — personal brand
   Palette ricavata dal ritratto: malva dello sfondo, blu notte della giacca,
   azzurro della camicia.
   ========================================================================== */

:root {
  --ink: #151b2e;
  --ink-2: #1b2340;
  --ink-soft: rgba(245, 242, 239, .66);
  --paper: #f5f2ef;
  --paper-2: #ece7e3;
  --white: #fffdfb;
  --mauve: #85717a;
  --mauve-hi: #937e85;
  --mauve-lo: #6a5961;
  --mauve-deep: #55464d;
  --mauve-text: #75606b;
  --sky: #b9c9ee;
  --sky-light: #d6e0f8;
  --blue: #3553b8;
  --muted: #595d6c;
  --line: rgba(21, 27, 46, .12);
  --line-dark: rgba(185, 201, 238, .16);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --header-h: 76px;
  --gutter: clamp(20px, 5vw, 48px);
  --max: 1240px;
  --radius: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) - 1px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
em { font-style: italic; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.section-dark :focus-visible, .hero :focus-visible, .contact :focus-visible, .site-footer :focus-visible { outline-color: var(--sky-light); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 8px;
  transition: top .2s;
}
.skip:focus { top: 16px; }

.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Tipografia condivisa ---------- */

.eyebrow,
.section-label {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.4;
}

.section-label {
  display: flex;
  align-items: center;
  gap: .9em;
  color: var(--muted);
  margin-bottom: 26px;
}
.section-label span { color: var(--blue); }
.section-label::after {
  content: "";
  width: 44px;
  height: 1px;
  background: currentColor;
  opacity: .45;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 5.4vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.section-title em { color: var(--mauve-text); }

.section-intro {
  margin-top: 24px;
  max-width: 34em;
  color: var(--muted);
  font-size: 1.125rem;
}

.section { padding-block: clamp(88px, 12vw, 160px); }
.section-head { max-width: 860px; }

/* ---------- Pulsanti ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: .95em 1.45em;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .98rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.btn span { transition: transform .25s var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn:hover span { transform: translateX(3px); }
.btn-small { padding: .62em 1.15em; font-size: .9rem; }

.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: var(--white); box-shadow: 0 10px 30px -12px rgba(21, 27, 46, .45); }

.btn-ghost-light { border-color: rgba(255, 253, 251, .42); color: var(--paper); }
.btn-ghost-light:hover { background: rgba(255, 253, 251, .1); border-color: rgba(255, 253, 251, .7); }

.pulse {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7fe0a8;
  flex: none;
}
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: ping 2.2s var(--ease) infinite;
}
.pulse-sky { background: var(--sky-light); }
@keyframes ping {
  0% { transform: scale(1); opacity: .7; }
  80%, 100% { transform: scale(3); opacity: 0; }
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  color: var(--paper);
  transition: background-color .35s, color .35s, box-shadow .35s;
}
.site-header.is-scrolled {
  background: rgba(92, 77, 85, .7);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(255, 253, 251, .12);
}
.site-header.is-solid {
  background: rgba(245, 242, 239, .94);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: -.005em;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: .02em;
  line-height: 1;
  padding-top: 2px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
  font-size: .95rem;
}
.nav-menu a:not(.btn) {
  position: relative;
  padding-block: 6px;
  opacity: .88;
  transition: opacity .2s;
}
.nav-menu a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s var(--ease);
}
.nav-menu a:not(.btn):hover,
.nav-menu a.is-active { opacity: 1; }
.nav-menu a:not(.btn):hover::after,
.nav-menu a.is-active::after { transform: scaleX(1); transform-origin: left; }

.nav-cta .btn { background: var(--paper); color: var(--ink); }
.site-header.is-solid .nav-cta .btn { background: var(--ink); color: var(--paper); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  place-items: center;
  position: relative;
  z-index: 2;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: max(100svh, 700px);
  display: flex;
  flex-direction: column;
  color: var(--paper);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse 58% 78% at 71% 44%, #917c83 0%, #89757c 32%, #7b6970 62%, #66565e 100%),
    #66565e;
}

.hero-visual {
  position: absolute;
  z-index: -1;
  top: calc(var(--header-h) * .7);
  right: max(-40px, calc((100vw - 1480px) / 2));
  height: calc((100svh - var(--header-h)) * 1.22);
  min-height: 780px;
  max-height: 1320px;
  aspect-ratio: 900 / 1278;
  animation: photo-in 1.6s var(--ease) both;
}
.hero-photo { position: relative; display: block; width: 100%; height: 100%; }

/* Orbite luminose attorno al ritratto */
.hero-orbit {
  position: absolute;
  left: 48%;
  top: 21%;
  width: 66%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1px solid rgba(214, 224, 248, .3);
  background: radial-gradient(circle, rgba(255, 253, 251, .14), transparent 62%);
  animation: orbit-in 1.8s var(--ease) .3s both;
}
.hero-orbit-outer {
  width: 102%;
  border-color: rgba(214, 224, 248, .14);
  background: none;
}
.hero-orbit i {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  animation: spin 22s linear infinite;
}
.hero-orbit-outer i { animation-duration: 38s; animation-direction: reverse; }
.hero-orbit i::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sky-light);
  box-shadow: 0 0 0 5px rgba(214, 224, 248, .16), 0 0 22px 4px rgba(214, 224, 248, .7);
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes orbit-in {
  from { opacity: 0; scale: .85; }
  to { opacity: 1; scale: 1; }
}
/* Grana fotografica leggera su tutta la hero */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Cognome gigante dietro al ritratto */
.hero-ghost {
  position: absolute;
  z-index: -2;
  right: max(-3vw, calc((100vw - 1700px) / 2));
  top: 38%;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(9rem, 21vw, 23rem);
  line-height: .8;
  letter-spacing: -.03em;
  color: rgba(255, 253, 251, .1);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  transform: translate3d(var(--gx, 0px), 0, 0);
  animation: ghost-in 2s var(--ease) .2s both;
}
@keyframes ghost-in {
  from { opacity: 0; letter-spacing: .04em; }
  to { opacity: 1; }
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
  filter: drop-shadow(0 30px 60px rgba(30, 20, 30, .35));
}
@keyframes photo-in {
  from { opacity: 0; transform: translateX(24px) scale(1.02); }
  to { opacity: 1; transform: none; }
}

.hero-inner {
  flex: 1;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-h) + 5vh);
  padding-bottom: 120px;
}

.hero-copy { max-width: 620px; }
.hero-copy > * { animation: rise-in 1s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; }
.hero-copy > :nth-child(3) { animation-delay: .18s; }
.hero-copy > :nth-child(4) { animation-delay: .28s; }
.hero-copy > :nth-child(5) { animation-delay: .38s; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px 9px 14px;
  border: 1px solid rgba(255, 253, 251, .28);
  border-radius: 999px;
  background: rgba(40, 30, 38, .16);
  color: rgba(255, 253, 251, .9);
  font-size: .72rem;
}

.hero-title {
  margin-top: 30px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.3rem, 7.4vw, 7.2rem);
  line-height: .94;
  letter-spacing: -.022em;
}
.hero-copy > .hero-title { animation: none; }
.hero-title .line {
  display: block;
  overflow: hidden;
  padding: .04em .12em .12em 0;
  margin: -.04em -.12em -.12em 0;
}
.hero-title .line > span {
  display: block;
  animation: line-up 1.15s var(--ease) both;
}
.hero-title .line:nth-child(2) > span { animation-delay: .12s; }
@keyframes line-up {
  from { transform: translateY(108%); }
  to { transform: none; }
}
.hero-title em {
  color: var(--sky-light);
  background: linear-gradient(100deg, #eef3ff 10%, #b9c9ee 45%, #eef3ff 80%) 0 0 / 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 7s ease-in-out 1.4s infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

.hero-lead {
  margin-top: 28px;
  max-width: 32em;
  font-size: clamp(1.06rem, 1.3vw, 1.2rem);
  line-height: 1.6;
  color: rgba(255, 253, 251, .86);
}
.hero-lead strong { color: var(--white); font-weight: 500; }

.hero-actions {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-meta {
  margin-top: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 253, 251, .2);
  max-width: 560px;
}
.hero-meta dt {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 253, 251, .62);
  margin-bottom: 4px;
}
.hero-meta dd { font-size: .95rem; color: rgba(255, 253, 251, .92); max-width: 20em; }

/* Ticker */
.ticker {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  overflow: hidden;
  padding-block: 17px;
  border-top: 1px solid rgba(255, 253, 251, .16);
  background: rgba(38, 28, 36, .26);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: marquee 48s linear infinite;
}
.ticker span {
  display: inline-flex;
  align-items: center;
  gap: 30px;
  padding-right: 30px;
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 253, 251, .82);
  white-space: nowrap;
}
.ticker span::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sky);
  opacity: .8;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ==========================================================================
   Numeri e clienti
   ========================================================================== */

.stats { padding-block: clamp(64px, 8vw, 104px) clamp(56px, 7vw, 88px); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: 8px clamp(16px, 2.4vw, 32px) 8px;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-num {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
  font-size: clamp(3rem, 5.2vw, 4.5rem);
  line-height: 1;
  letter-spacing: -.02em;
}
.stat-num small {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-label {
  display: block;
  margin-top: 14px;
  max-width: 17em;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.5;
}

.clients {
  margin-top: clamp(56px, 7vw, 88px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px 40px;
}
.clients-label {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.clients-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.4rem, 2.3vw, 1.95rem);
  line-height: 1.2;
}
.clients-list li { display: inline-flex; align-items: center; }
.clients-list li:not(:last-child)::after {
  content: "/";
  font-style: normal;
  margin-inline: .6em;
  color: var(--mauve);
  opacity: .6;
}

/* ==========================================================================
   Manifesto (testo che si accende allo scroll)
   ========================================================================== */

.manifesto {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(110px, 16vw, 220px);
}
.manifesto::before {
  content: "";
  position: absolute;
  width: 70vw;
  height: 70vw;
  left: -20vw;
  top: -25vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(133, 113, 122, .45), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}
.manifesto::after {
  content: "";
  position: absolute;
  width: 55vw;
  height: 55vw;
  right: -18vw;
  bottom: -30vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 201, 238, .16), transparent 65%);
  pointer-events: none;
}
.manifesto .container { position: relative; z-index: 1; }
.manifesto-label {
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sky);
  margin-bottom: 34px;
}
.manifesto-text { margin: 0; max-width: 1120px; }
.manifesto-text p {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4.7vw, 4.4rem);
  line-height: 1.1;
  letter-spacing: -.015em;
}
.manifesto-text em { color: var(--sky); }
.js .manifesto-text .w {
  opacity: .16;
  transition: opacity .5s ease;
}
.js .manifesto-text .w.is-lit { opacity: 1; }
.manifesto-sign {
  margin-top: 48px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: .98rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   Chi sono
   ========================================================================== */

.about { background: var(--paper-2); }

.about-grid {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(40px, 7vw, 120px);
  align-items: start;
}
.about-head { position: sticky; top: calc(var(--header-h) + 40px); }

.about-body p + p { margin-top: 20px; }
.about-body p { color: var(--muted); }
.about-body .about-lead {
  color: var(--ink);
  font-size: clamp(1.3rem, 1.9vw, 1.55rem);
  line-height: 1.45;
  letter-spacing: -.01em;
  margin-bottom: 32px;
}

.now-card {
  margin-top: 40px;
  padding: 24px 26px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
  display: grid;
  gap: 6px;
}
.now-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.now-badge .pulse { background: #2f9e62; }
.about-body .now-role {
  font-family: var(--serif);
  font-size: 1.7rem;
  line-height: 1.15;
  color: var(--ink);
  margin: 0;
}
.about-body .now-org { margin: 0; font-size: .95rem; }

.strengths { margin-top: clamp(80px, 10vw, 136px); }
.strengths-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.05;
  letter-spacing: -.01em;
  margin-bottom: clamp(32px, 4vw, 48px);
}
.strengths-title em { color: var(--mauve-text); }
.strength-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.strength {
  position: relative;
  padding: 30px 26px 32px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s;
}
.strength::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--mauve), var(--blue));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease);
}
.strength:hover {
  transform: translateY(-6px);
  border-color: transparent;
  box-shadow: 0 30px 60px -30px rgba(21, 27, 46, .35);
}
.strength:hover::after { transform: scaleX(1); }
.strength-icon {
  width: 44px;
  height: 44px;
  padding: 9px;
  border-radius: 12px;
  background: var(--ink);
  fill: none;
  stroke: var(--sky-light);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.strength h4 {
  margin: 26px 0 10px;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.005em;
}
.strength p { color: var(--muted); font-size: .96rem; line-height: 1.55; margin: 0; }

/* ==========================================================================
   Cosa faccio (sezione scura)
   ========================================================================== */

.section-dark {
  background: var(--ink);
  color: var(--paper);
}
.section-dark .section-label { color: rgba(245, 242, 239, .6); }
.section-dark .section-label span { color: var(--sky); }
.section-dark .section-title em { color: var(--sky); }
.section-dark .section-intro { color: var(--ink-soft); }

/* Schema del flusso dati */
.flow {
  margin-block: clamp(48px, 7vw, 80px) clamp(40px, 6vw, 64px);
  padding: clamp(20px, 4vw, 44px);
  border: 1px solid var(--line-dark);
  border-radius: 28px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(185, 201, 238, .10), transparent 70%),
    linear-gradient(rgba(185, 201, 238, .045) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(185, 201, 238, .045) 1px, transparent 1px) 0 0 / 32px 32px;
}

.flow-ai {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 18px 22px;
  border: 1px solid rgba(185, 201, 238, .34);
  border-radius: 16px;
  background: rgba(21, 27, 46, .82);
  box-shadow: 0 0 0 6px rgba(185, 201, 238, .04), 0 20px 60px -30px rgba(185, 201, 238, .35);
}
.flow-ai-head {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sky);
}
.flow-ai-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 0 4px rgba(185, 201, 238, .18), 0 0 18px rgba(185, 201, 238, .9);
}
.flow-ai-query {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 1.6em;
  font-size: 1.02rem;
  color: var(--paper);
}
.flow-prompt { font-family: var(--mono); color: var(--sky); }
.caret {
  width: 2px;
  height: 1.1em;
  background: var(--sky);
  margin-left: -6px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.flow-row {
  --drop: 56px;
  display: flex;
  align-items: stretch;
  margin-top: var(--drop);
}
.flow-node {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 22px 24px;
  border: 1px solid rgba(185, 201, 238, .22);
  border-radius: 16px;
  background: var(--ink-2);
}
/* collegamento verticale verso il livello AI */
.flow-node::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  height: var(--drop);
  border-left: 1px dashed rgba(185, 201, 238, .42);
}
.flow-node::after {
  content: "";
  position: absolute;
  left: calc(50% - 3px);
  bottom: 100%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 10px var(--sky);
  animation: rise-dot 2.6s var(--ease) infinite;
}
.flow-node:nth-child(3)::after { animation-delay: .8s; }
.flow-node:nth-child(5)::after { animation-delay: 1.6s; }
@keyframes rise-dot {
  0% { transform: translateY(0); opacity: 0; }
  15%, 80% { opacity: 1; }
  100% { transform: translateY(calc(var(--drop) * -1 + 6px)); opacity: 0; }
}

.flow-kicker {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sky);
}
.flow-node strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  line-height: 1.1;
  margin-top: 6px;
}
.flow-sub { font-size: .92rem; color: var(--ink-soft); }

.flow-link {
  position: relative;
  flex: 0 0 clamp(36px, 6vw, 88px);
  align-self: center;
  height: 22px;
}
.flow-link i {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: rgba(185, 201, 238, .38);
}
.flow-link i:first-child { top: 4px; }
.flow-link i:last-child { bottom: 4px; }
.flow-link i::after {
  content: "";
  position: absolute;
  top: -2.5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 8px var(--sky);
  animation: slide-right 1.9s linear infinite;
}
.flow-link i:last-child::after { animation-name: slide-left; animation-delay: .6s; }
@keyframes slide-right { from { left: 0; } to { left: calc(100% - 6px); } }
@keyframes slide-left { from { left: calc(100% - 6px); } to { left: 0; } }

.flow-caption {
  margin-top: 28px;
  text-align: center;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(245, 242, 239, .55);
}

/* Card servizi */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.card {
  position: relative;
  padding: clamp(26px, 3vw, 36px);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .025);
  transition: border-color .3s, background-color .3s, transform .4s var(--ease);
}
/* luce che segue il puntatore */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(185, 201, 238, .13), transparent 45%);
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; }
.card:hover {
  border-color: rgba(185, 201, 238, .4);
  background: rgba(255, 255, 255, .045);
  transform: translateY(-3px);
}
.card-num {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(185, 201, 238, .4);
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--sky);
}
.card h3 {
  margin: 24px 0 12px;
  font-size: 1.32rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.card p { color: var(--ink-soft); font-size: 1rem; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.tags li {
  padding: 5px 11px;
  border: 1px solid rgba(185, 201, 238, .26);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--sky);
}

.card-wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 48px;
  align-items: end;
  background: linear-gradient(120deg, rgba(185, 201, 238, .13), rgba(185, 201, 238, .02) 70%);
}
.card-kicker {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sky);
}
.card-wide h3 {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -.01em;
}
.card-wide p { font-size: 1.06rem; }

/* ==========================================================================
   Metodo
   ========================================================================== */

.steps {
  margin-top: clamp(48px, 6vw, 80px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
  counter-reset: step;
}
.step {
  position: relative;
  padding-top: 30px;
  border-top: 1px solid rgba(21, 27, 46, .28);
}
.step::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 5px var(--paper);
}
.step:last-child::before { background: var(--mauve); }
.step-num {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 2.8rem;
  line-height: 1;
  color: var(--mauve);
}
.step h3 {
  margin: 18px 0 8px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -.005em;
}
.step p { color: var(--muted); font-size: .96rem; line-height: 1.55; }

/* ==========================================================================
   Esperienza
   ========================================================================== */

.experience { padding-top: 0; }
.experience > .container {
  border-top: 1px solid var(--line);
  padding-top: clamp(88px, 12vw, 160px);
}

.exp-grid {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.exp-head { position: sticky; top: calc(var(--header-h) + 40px); }

.tl-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px 32px;
  padding-block: 36px;
  border-top: 1px solid var(--line);
}
.tl-item:first-child { border-top: 0; padding-top: 6px; }
.tl-when {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 12px;
}
.is-current .tl-when { color: var(--ink); }
.is-current .tl-when::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f9e62;
  margin-right: 8px;
  vertical-align: 1px;
}
.tl-body h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -.01em;
}
.tl-org {
  margin-top: 6px;
  font-size: .95rem;
  font-weight: 500;
  color: var(--mauve-text);
}
.tl-body ul { margin-top: 18px; display: grid; gap: 10px; }
.tl-body li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}
.tl-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .8em;
  width: 10px;
  height: 1px;
  background: var(--blue);
}

/* ==========================================================================
   Competenze
   ========================================================================== */

.skills { background: var(--paper-2); }

.skill-grid {
  margin-top: clamp(48px, 6vw, 72px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.skill-group {
  padding: 26px 24px 28px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
}
.skill-group h3 {
  font-family: var(--mono);
  font-weight: 400;
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: .9rem;
  line-height: 1.3;
}

.creds {
  margin-top: clamp(56px, 7vw, 88px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.cred { padding-top: 26px; border-top: 1px solid rgba(21, 27, 46, .28); }
.cred-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1.1;
  margin-bottom: 22px;
}
.cred-list { display: grid; gap: 16px; }
.cred-list strong { display: block; font-weight: 500; line-height: 1.4; }
.cred-list span { display: block; margin-top: 2px; color: var(--muted); font-size: .92rem; }

.lang-list { display: grid; gap: 18px; }
.lang-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: baseline;
}
.lang-name { font-weight: 500; }
.lang-level { color: var(--muted); font-size: .9rem; }
.lang-bar {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 3px;
  background: rgba(21, 27, 46, .1);
  overflow: hidden;
}
.lang-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: calc(var(--level) * 100%);
  background: var(--mauve-deep);
  border-radius: inherit;
  transform-origin: left;
  transition: transform 1.2s var(--ease) .3s;
}
.js .cred:not(.is-visible) .lang-bar::after { transform: scaleX(0); }

/* ==========================================================================
   Contatti
   ========================================================================== */

.contact {
  color: var(--paper);
  overflow: hidden;
  padding-top: 0;
  background:
    radial-gradient(ellipse 50% 70% at 82% 60%, #8a767d 0%, #7a6870 45%, #5f4f57 100%),
    #5f4f57;
}

.contact-marquee {
  overflow: hidden;
  padding-block: clamp(40px, 6vw, 72px) clamp(56px, 8vw, 104px);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  padding-right: .45em;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(3.6rem, 10vw, 9.5rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  white-space: nowrap;
  color: var(--paper);
}
.marquee-track span::after {
  content: "";
  width: .22em;
  height: .22em;
  border-radius: 50%;
  background: var(--sky-light);
  flex: none;
}
.marquee-track .outline {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 253, 251, .6);
}
.contact-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(40px, 7vw, 110px);
  align-items: center;
}
.section-label-light { color: rgba(255, 253, 251, .7); }
.section-label-light span { color: var(--sky-light); }
.contact .section-title em { color: var(--sky-light); }
.contact-lead { margin-top: 22px; font-size: 1.15rem; color: rgba(255, 253, 251, .84); }

.contact-email {
  display: inline-flex;
  align-items: baseline;
  gap: .3em;
  margin-top: 36px;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.6vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 6px;
  transition: background-size .45s var(--ease), color .25s;
  overflow-wrap: anywhere;
}
.contact-email span { font-size: .6em; transition: transform .3s var(--ease); }
.contact-email:hover { color: var(--white); background-size: 0 1px; background-position: 100% 100%; }
.contact-email:hover span { transform: translate(3px, -3px); }

.contact-links {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-portrait {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(20, 14, 20, .6);
}
.contact-portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.contact-portrait figcaption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: grid;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(21, 27, 46, .55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-weight: 500;
  font-size: .95rem;
  line-height: 1.35;
}
.contact-portrait figcaption span {
  font-family: var(--mono);
  font-weight: 400;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 253, 251, .7);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--ink);
  color: rgba(245, 242, 239, .7);
  padding-block: 36px;
  font-size: .9rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 32px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  font-weight: 500;
}
.footer-brand .brand-mark { width: 32px; height: 32px; font-size: .9rem; }
.footer-top { color: var(--paper); }
.footer-top:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ==========================================================================
   Animazioni allo scroll
   ========================================================================== */

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
  .skill-grid, .strength-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); row-gap: 48px; }
}

@media (max-width: 960px) {
  :root { --header-h: 68px; }

  .nav-toggle { display: grid; }
  .nav-menu {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    padding: calc(var(--header-h) + 24px) var(--gutter) 40px;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--serif);
    font-size: clamp(2.2rem, 9vw, 3rem);
    line-height: 1.15;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s var(--ease), visibility .35s;
  }
  .nav-menu.is-open { opacity: 1; visibility: visible; }
  .nav-menu a:not(.btn)::after { display: none; }
  .nav-cta { margin-top: 24px; font-family: var(--sans); }
  .nav-cta .btn,
  .site-header.is-solid .nav-cta .btn { background: var(--paper); color: var(--ink); font-size: 1rem; padding: .9em 1.4em; }
  .site-header.menu-open { color: var(--paper); background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .brand { position: relative; z-index: 2; }

  /* Hero impilato */
  .hero {
    min-height: 0;
    background:
      radial-gradient(ellipse 90% 55% at 50% 24%, #917c83 0%, #86737a 40%, #736269 72%, #62525a 100%),
      #62525a;
  }
  .hero-visual {
    position: relative;
    z-index: 0;
    top: auto; right: auto;
    width: min(100%, 520px);
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 4.4;
    margin: calc(var(--header-h) + 16px) auto 0;
  }
  .hero-photo { overflow: hidden; }
  .hero-photo img {
    object-position: 50% 0;
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 98%);
    mask-image: linear-gradient(to bottom, #000 60%, transparent 98%);
  }
  .hero-orbit { top: 30%; width: 84%; }
  .hero-orbit-outer { width: 120%; }
  .hero-inner {
    position: relative;
    z-index: 1;
    margin-top: -8vw;
    padding-top: 0;
    padding-bottom: 56px;
  }
  .hero-copy { max-width: 640px; }
  .ticker { position: relative; }
  .hero-ghost {
    left: 0; right: 0; bottom: auto;
    top: calc(var(--header-h) + 18vw);
    text-align: center;
    font-size: 33vw;
    color: rgba(255, 253, 251, .09);
  }

  .stats-grid { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }

  .about-grid, .exp-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-head, .exp-head { position: static; }

  .contact-portrait { max-width: 440px; }
}

@media (max-width: 760px) {
  .flow-ai { flex-direction: column; align-items: flex-start; }
  .flow-row { --drop: 40px; flex-direction: column; }
  .flow-node { flex: none; }
  .flow-node:not(:first-child)::before,
  .flow-node:not(:first-child)::after { display: none; }
  .flow-link {
    flex: 0 0 40px;
    width: 22px;
    height: auto;
  }
  .flow-link i { top: 0; bottom: 0; left: auto; right: auto; width: 1px; height: auto; }
  .flow-link i:first-child { top: 0; left: 4px; }
  .flow-link i:last-child { bottom: 0; right: 4px; }
  .flow-link i::after { top: 0; left: -2.5px; animation-name: slide-down; }
  .flow-link i:last-child::after { animation-name: slide-up; }
  @keyframes slide-down { from { top: 0; } to { top: calc(100% - 6px); } }
  @keyframes slide-up { from { top: calc(100% - 6px); } to { top: 0; } }

  .cards { grid-template-columns: 1fr; }
  .card-wide { grid-template-columns: 1fr; }

  .steps { grid-template-columns: 1fr; gap: 0; }
  .step {
    display: grid;
    grid-template-columns: 64px 1fr;
    column-gap: 16px;
    padding: 0 0 32px 28px;
    border-top: 0;
    border-left: 1px solid rgba(21, 27, 46, .28);
  }
  .step:last-child { padding-bottom: 0; }
  .step::before { top: 4px; left: -5px; }
  .step-num { grid-row: span 2; font-size: 2.4rem; }
  .step h3 { margin-top: 2px; }

  .tl-item { grid-template-columns: 1fr; }
  .tl-when { padding-top: 0; }

  .skill-grid, .strength-grid { grid-template-columns: 1fr; }
  .creds { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 520px) {
  body { font-size: 1rem; }
  .hero-eyebrow { font-size: .64rem; letter-spacing: .1em; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { border-left: 0; padding-left: 0; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; padding-bottom: 0; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .contact-links li { flex: 1 1 100%; }
  .contact-links .btn { width: 100%; justify-content: center; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .ticker-track { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
}
