@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --night: #0d1a16;
  --night-2: #16302a;
  --cream: #f6f1e7;
  --mist: #b9c4bd;
  --paper: #f5f0e6;
  --paper-2: #ebe4d5;
  --ink: #14231e;
  --ink-soft: #4a5751;
  --rule: #cfc7b5;
  --rule-dark: rgba(246, 241, 231, .16);
  --amber: #e8bb7a;
  --bronze: #85531a;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --step: 3.1rem;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; }
a { color: inherit; }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.wrap { width: 100%; max-width: 84rem; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 30; }
.skip:focus { left: 0; }

/* Testata */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13, 26, 22, .84);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule-dark);
  color: var(--cream);
}
.top__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-family: var(--serif); font-size: 1.3rem; font-weight: 500; white-space: nowrap; }
.nav { display: flex; gap: clamp(1rem, 2.5vw, 2.25rem); font-size: .95rem; }
.nav a { position: relative; text-decoration: none; padding-block: .4rem; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .15rem; height: 1px;
  background: var(--amber); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav a:hover::after { transform: scaleX(1); }

/* Apertura */
.hero {
  position: relative;
  overflow: hidden;
  display: flex; align-items: center;
  min-height: calc(100vh - 4.25rem);
  min-height: calc(100svh - 4.25rem);
  padding-block: clamp(3rem, 7vh, 6rem);
  background:
    radial-gradient(58% 72% at 80% 34%, #21463a 0%, rgba(33, 70, 58, 0) 72%),
    radial-gradient(44% 56% at 8% 96%, #1a352c 0%, rgba(26, 53, 44, 0) 70%),
    var(--night);
  color: var(--cream);
}
.hero__fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2.5rem, 5vw, 5rem); align-items: center; }
.eyebrow { font-size: .98rem; color: var(--mist); margin-bottom: 1.6rem; animation: fade-up .9s var(--ease) both .1s; }
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4rem, 7.1vw, 7.2rem);
  line-height: .96;
  letter-spacing: -.03em;
}
.h-line { display: block; overflow: hidden; padding: 0 .08em .15em 0; margin-bottom: -.15em; }
.h-line > span { display: block; animation: rise 1.2s var(--ease) both .15s; }
.h-line + .h-line > span { animation-delay: .3s; }
h1 em {
  font-style: italic;
  padding-right: .06em;
  background: linear-gradient(100deg, #f6dfb6 0%, #e2ab62 45%, #f6dfb6 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s ease-in-out infinite alternate;
}
.lead { font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.45; max-width: 36rem; margin-top: 1.9rem; color: #e4e6df; animation: fade-up 1s var(--ease) both .55s; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.6rem; margin-top: 2.4rem; animation: fade-up 1s var(--ease) both .7s; }
.btn {
  display: inline-block;
  background: var(--amber); color: var(--night);
  padding: .9rem 1.8rem; border-radius: 99px;
  text-decoration: none; font-weight: 600;
  transition: background-color .25s ease, transform .35s var(--ease);
}
.btn:hover { background: var(--cream); transform: translateY(-2px); }
.link { text-underline-offset: .28em; text-decoration-thickness: 1px; text-decoration-color: var(--amber); }
.link:hover { color: var(--amber); }

/* La cascata: i punti luminosi disegnano i gradini; senza animazione restano le linee */
.cascade li {
  position: relative;
  padding: 0 0 1.75rem 1.3rem;
  border-left: 1px solid var(--mist);
  animation: fade-up .9s var(--ease) both;
  animation-delay: .9s;
}
.cascade li:nth-child(2) { margin-left: var(--step); animation-delay: 1.2s; }
.cascade li:nth-child(3) { margin-left: calc(var(--step) * 2); animation-delay: 1.5s; }
.cascade li:nth-child(4) { margin-left: calc(var(--step) * 3); animation-delay: 1.8s; }
.cascade li:nth-child(5) { margin-left: calc(var(--step) * 4); animation-delay: 2.1s; padding-bottom: 0; border-left-color: var(--amber); }
.cascade li::before {
  content: "";
  position: absolute; top: .62rem; left: -5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--night); border: 1px solid var(--cream);
}
.cascade li:not(:last-child)::after {
  content: "";
  position: absolute; left: -1px; bottom: 0;
  width: calc(var(--step) + 1px); height: 1px;
  background: var(--mist);
}
.cascade li:last-child::before { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 18px 3px rgba(232, 187, 122, .6); }
.fx .cascade li { border-left-color: transparent; }
.fx .cascade li:not(:last-child)::after { background: transparent; }
.cascade strong { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 2.5vw, 2.15rem); line-height: 1.2; }
.cascade li:last-child strong { color: var(--amber); }
.cascade span { display: block; font-size: .92rem; color: var(--mist); line-height: 1.35; }

@keyframes rise { from { transform: translateY(112%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes slide { to { transform: translateX(-50%); } }

/* Nastro delle competenze */
.marquee { overflow: hidden; background: var(--night); color: var(--amber); border-block: 1px solid var(--rule-dark); padding-block: 1.05rem; }
.marquee__track { display: flex; width: max-content; animation: slide 46s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track span { font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 2.2vw, 1.8rem); line-height: 1.2; white-space: nowrap; padding-inline: 1.5rem; }
.marquee__track span::after { content: "·"; font-style: normal; margin-left: 3rem; color: var(--mist); }

/* Comparsa allo scorrimento: senza script il contenuto resta visibile */
.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* Sezioni */
.section { padding-block: clamp(5rem, 10vw, 9rem); }
.section__title { font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 7vw, 6.2rem); line-height: 1; letter-spacing: -.025em; }

.services { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.services .section__title { position: sticky; top: 7rem; }
.service {
  display: grid;
  grid-template-columns: clamp(5rem, 9vw, 8.5rem) minmax(0, 1fr);
  gap: 0 clamp(1rem, 3vw, 2.5rem);
  padding-block: clamp(2.25rem, 4vw, 3.5rem);
  border-top: 1px solid var(--rule);
}
.service:first-child { border-top: 0; padding-top: 0; }
.service__num {
  grid-row: span 2;
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(5rem, 10vw, 9rem); line-height: .85;
  color: transparent;
  -webkit-text-stroke: 1px var(--bronze);
  transition: color .6s ease;
}
.service:hover .service__num { color: var(--bronze); }
.service h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.1; letter-spacing: -.01em; margin-bottom: .8rem; }
.service__head p { color: var(--ink-soft); font-size: 1.1rem; max-width: 42rem; }
.service__list { margin-top: 1.5rem; }
.service__list li { position: relative; padding: .6rem 0 .6rem 1.4rem; border-top: 1px solid var(--paper-2); }
.service__list li::before { content: ""; position: absolute; left: 0; top: 1.25rem; width: .55rem; height: 1px; background: var(--bronze); }

.section--dark {
  background: radial-gradient(70% 90% at 15% 0%, var(--night-2) 0%, rgba(22, 48, 42, 0) 70%), var(--night);
  color: var(--cream);
}
.section--dark .section__title { margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem); counter-reset: passo; }
.steps li { position: relative; counter-increment: passo; border-top: 1px solid var(--rule-dark); padding-top: 1.4rem; }
.steps li::after {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  background: var(--amber); transform-origin: left;
  transition: transform 1.4s var(--ease) .25s;
}
.js .steps li:not(.in)::after { transform: scaleX(0); }
.steps li:nth-child(2), .steps li:nth-child(2)::after { transition-delay: .15s; }
.steps li:nth-child(3), .steps li:nth-child(3)::after { transition-delay: .3s; }
.steps li:nth-child(4), .steps li:nth-child(4)::after { transition-delay: .45s; }
.steps li::before { content: counter(passo); display: block; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(3rem, 5vw, 4.5rem); line-height: 1; color: var(--amber); margin-bottom: 1.2rem; }
.steps h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 2.2vw, 1.85rem); line-height: 1.15; margin-bottom: .7rem; }
.steps p { color: #cdd3cd; font-size: 1.02rem; }

.profile { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2.5rem, 5vw, 4.5rem) clamp(2.5rem, 6vw, 6rem); }
.profile .section__title { grid-column: 1 / -1; }
.profile__text p + p { margin-top: 1.1rem; }
.profile__text .profile__lead { font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1.16; letter-spacing: -.01em; margin-bottom: 1.8rem; }
.profile__edu h3 { font-size: .95rem; font-weight: 600; margin-bottom: .75rem; }
.profile__edu li { padding-block: 1rem; border-top: 1px solid var(--rule); }
.profile__edu strong { display: block; font-weight: 500; line-height: 1.35; }
.profile__edu span { display: block; font-size: .93rem; color: var(--ink-soft); margin-top: .2rem; line-height: 1.4; }

.contact {
  background:
    radial-gradient(60% 90% at 88% 100%, #21463a 0%, rgba(33, 70, 58, 0) 72%),
    var(--night);
  color: var(--cream);
  padding-block: clamp(5.5rem, 12vw, 10rem);
}
.contact h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.1rem, 4.6vw, 4rem); line-height: 1.08; letter-spacing: -.015em; max-width: 54rem; }
.contact__mail {
  display: inline-block;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.55rem, 6.6vw, 5.6rem);
  line-height: 1.15; letter-spacing: -.015em;
  margin-top: clamp(2rem, 4vw, 3.25rem);
  color: var(--amber);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  transition: background-size .6s var(--ease), color .3s ease;
  overflow-wrap: anywhere;
}
.contact__mail:hover { background-size: 0 1px; background-position: right bottom; color: var(--cream); }
.contact__list { display: flex; flex-wrap: wrap; gap: 1.25rem clamp(2rem, 6vw, 5rem); margin-top: clamp(2.5rem, 5vw, 4rem); }
.contact__list dt { font-size: .9rem; color: var(--mist); }
.contact__list dd { font-size: 1.2rem; }
.contact__list a { text-underline-offset: .22em; text-decoration-thickness: 1px; text-decoration-color: var(--amber); overflow-wrap: anywhere; }
.contact__list a:hover { color: var(--amber); }

.foot { padding-block: 1.5rem; font-size: .92rem; background: var(--night); color: var(--mist); border-top: 1px solid var(--rule-dark); }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.foot a { text-underline-offset: .2em; }

/* Pagine di servizio */
.legal { max-width: 46rem; padding-block: clamp(3rem, 7vw, 5rem); }
.legal h1 { font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1; }
.legal__date { color: var(--ink-soft); margin-top: .75rem; }
.legal h2 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; line-height: 1.2; margin: 2.25rem 0 .6rem; }
.legal p + p { margin-top: .8rem; }
.legal a:not(.btn) { color: var(--bronze); text-underline-offset: .2em; overflow-wrap: anywhere; }
.legal__list { margin-top: .8rem; padding-left: 1.2rem; list-style: disc; }
.legal__list + p { margin-top: .8rem; }
.legal--center { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1rem; }
.legal--center p + p { margin-top: .5rem; }

@media (max-width: 62rem) {
  .hero { min-height: 0; }
  h1 { font-size: clamp(2.9rem, 14vw, 7.2rem); }
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .services { grid-template-columns: minmax(0, 1fr); }
  .services .section__title { position: static; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  :root { --step: 1.3rem; }
  .top__row { flex-direction: column; align-items: flex-start; gap: 0; padding-block: .6rem; }
  .top { position: static; }
  html { scroll-padding-top: 1rem; }
  .nav { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .service { grid-template-columns: minmax(0, 1fr); }
  .service__num { grid-row: auto; font-size: 4.5rem; margin-bottom: .75rem; }
  .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .steps li:not(.in)::after { transform: none; }
}
