/* Studio Legale Avv. Riccardo Piga — foglio di stile */

@font-face {
  font-family: "Marcellus";
  src: url("fonts/marcellus.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #0f2a47;         /* blu notte */
  --navy-2: #163a61;
  --blue: #1d5a96;         /* blu istituzionale */
  --azure: #3a8dd0;        /* azzurro accento */
  --sky: #9cc9ee;          /* azzurro chiaro su fondo scuro */
  --ice: #e9f2fa;          /* sfondo azzurrato */
  --mist: #f5f9fc;         /* sfondo pagina */
  --text: #233142;
  --muted: #5b6b7e;
  --line: #d6e3ef;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 42, 71, .06), 0 14px 34px -14px rgba(15, 42, 71, .25);
  --head: "Marcellus", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--text);
  font: 400 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--azure); }
:focus-visible { outline: 2px solid var(--azure); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--head); color: var(--navy); font-weight: 400; line-height: 1.12; letter-spacing: 0; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.06; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.eyebrow {
  font: 600 .76rem/1 var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--azure);
  margin: 0 0 14px;
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }
.eyebrow--light { color: var(--sky); }

/* ---------- Barra superiore ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.topbar.is-scrolled { border-color: var(--line); box-shadow: 0 6px 20px -16px rgba(15,42,71,.45); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1; }
.brand__kicker { font: 600 .64rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--azure); margin-bottom: 6px; display: block; }
.brand__name { font: 400 1.3rem/1 var(--head); color: var(--navy); display: block; }

.nav { display: flex; align-items: center; gap: 30px; }
.nav a { font-size: .92rem; font-weight: 500; color: var(--navy); text-decoration: none; position: relative; padding: 6px 0; }
.nav a:not(.nav__cta)::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px; background: var(--azure); transition: right .25s; }
.nav a:not(.nav__cta):hover::after { right: 0; }
.nav__cta { background: var(--navy); color: #fff !important; border-radius: 999px; padding: 9px 20px !important; transition: background .2s; }
.nav__cta:hover { background: var(--blue); }

.navtoggle { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 10px; cursor: pointer; }
.navtoggle span { display: block; height: 2px; background: var(--navy); margin: 5px 0; border-radius: 2px; transition: transform .25s, opacity .2s; }
.navtoggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navtoggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.navtoggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 .95rem/1 var(--sans); text-decoration: none;
  padding: 15px 24px; border-radius: 999px; transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn--primary { background: var(--azure); color: #fff; }
.btn--primary:hover { background: #2f7cbc; color: #fff; transform: translateY(-1px); }
.btn--ghost { border: 1px solid rgba(255,255,255,.45); color: #fff; }
.btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,.1); color: #fff; }

/* ---------- Hero ---------- */
.hero { background: var(--mist); }
.hero__banner { position: relative; min-height: clamp(460px, 42vw, 580px); display: flex; align-items: center; overflow: hidden; background: var(--navy); }
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 45%; }
.hero__banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(15,42,71,.96) 0%, rgba(15,42,71,.9) 32%, rgba(22,58,97,.55) 62%, rgba(29,90,150,.12) 100%);
}
.hero__text { position: relative; z-index: 1; padding: 72px 0 104px; }
.hero__text > * { max-width: 560px; }
.hero h1 { color: #fff; }
.hero h1 span { color: var(--sky); }
.hero__rule { display: block; width: 72px; height: 2px; background: var(--azure); margin: 30px 0 34px; }
.lead { font-size: 1.12rem; color: #cfdeec; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.certbar {
  position: relative; z-index: 2; margin-top: -52px;
  display: flex; align-items: center; gap: 22px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 26px; text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  transition: border-color .2s, transform .2s;
}
.certbar:hover { border-color: var(--sky); transform: translateY(-2px); color: var(--text); }
.certbar img { width: 64px; flex: none; }
.certbar__text { display: flex; flex-direction: column; gap: 2px; }
.certbar__text strong { font: 400 1.35rem/1.2 var(--head); color: var(--navy); }
.certbar__text span { color: var(--muted); font-size: .95rem; }
.certbar__arrow { margin-left: auto; font-size: 1.4rem; color: var(--azure); }

/* ---------- Sezioni ---------- */
.section { padding: clamp(64px, 9vw, 108px) 0; }
.section--tint { background: var(--ice); }
.section__head { margin-bottom: 44px; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split--reverse { grid-template-columns: .9fr 1.1fr; }

.framed, .portrait { margin: 0; position: relative; }
.framed img, .portrait img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.framed::before { content: ""; position: absolute; inset: 18px -18px -18px 18px; background: var(--ice); border-radius: var(--radius); z-index: -1; }
.portrait::before { content: ""; position: absolute; inset: -18px 18px 18px -18px; background: #fff; border-radius: var(--radius); z-index: -1; }

.offices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.office { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--azure); border-radius: 10px; padding: 14px 18px; display: flex; flex-direction: column; }
.office__tag { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.office strong { font: 400 1.2rem/1.4 var(--head); color: var(--navy); }
.office span:last-child { font-size: .93rem; }


/* ---------- Competenze ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--sky); }
.card__icon {
  width: 56px; height: 56px; padding: 12px; border-radius: 14px; background: var(--ice);
  fill: none; stroke: var(--blue); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 20px;
}
.card p { font-size: .97rem; color: var(--muted); margin: 0; }

.areas { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.area { background: linear-gradient(180deg, var(--ice), rgba(233,242,250,0)); border-top: 3px solid var(--blue); border-radius: 4px 4px var(--radius) var(--radius); padding: 26px 24px 8px; }
.area h3 { font-size: 1.2rem; color: var(--blue); }
.area p { font-size: .97rem; }

/* ---------- Certificazioni ---------- */
.section--dark { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 60%, #1d4f86 100%); color: #cfdeec; }
.section--dark h2 { color: #fff; }
.section--dark strong { color: #fff; }
.section--dark .eyebrow { color: var(--sky); }
.certhead { display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 5vw, 56px); align-items: center; max-width: 900px; margin-bottom: 52px; }
.certhead__badge { background: #fff; border-radius: 18px; padding: 22px 28px; box-shadow: 0 20px 40px -20px rgba(0,0,0,.6); }
.certhead__badge img { width: 101px; }
.docs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.doc {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: rgba(255,255,255,.06); border: 1px solid rgba(156,201,238,.25); border-radius: var(--radius);
  overflow: hidden; transition: transform .25s, border-color .25s, background .25s;
}
.doc:hover { transform: translateY(-4px); border-color: var(--sky); background: rgba(255,255,255,.1); color: inherit; }
.doc img { aspect-ratio: 4 / 3; object-fit: cover; object-position: top; background: #fff; width: 100%; }
.doc__body { padding: 18px 22px; display: flex; flex-direction: column; gap: 2px; }
.doc__body strong { font: 400 1.18rem/1.3 var(--head); }
.doc__body span { font-size: .85rem; color: var(--sky); }

/* ---------- Video ---------- */
.video { max-width: 980px; position: relative; }
.video video { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--radius); background: var(--navy); display: block; box-shadow: var(--shadow); }
.video__play {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0;
  border-radius: var(--radius); overflow: hidden; cursor: pointer; background: var(--navy); box-shadow: var(--shadow);
}
.video__play img { width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: opacity .3s, transform .6s; }
.video__play:hover img { opacity: .78; transform: scale(1.02); }
.video__btn {
  position: absolute; left: 50%; top: 66%; translate: -50% -50%;
  width: 84px; height: 84px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .25s;
}
.video__play:hover .video__btn { transform: scale(1.08); }
.video__btn svg { width: 34px; fill: var(--blue); margin-left: 4px; }
.video__label { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; color: #fff; font: 400 1.25rem/1 var(--head); }

/* ---------- Contatti ---------- */
.contacts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.contact { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column; gap: 8px; }
.contact h3 { font-size: 1.2rem; margin-bottom: 14px; }
.contact a { color: var(--navy); text-decoration: none; font-weight: 500; }
.contact a:hover { color: var(--azure); }
.contact__icon {
  width: 46px; height: 46px; padding: 11px; border-radius: 12px; background: var(--ice);
  stroke: var(--blue); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 8px;
}
.contact__pec { color: var(--muted); }
.contact__muted { font-size: .92rem; color: var(--muted); }
.contact__link { display: inline-flex; align-items: center; gap: 12px; }
.contact__link svg { width: 32px; height: 32px; flex: none; stroke: var(--blue); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Footer ---------- */
.footer { background: var(--navy); color: #a9bdd2; padding: 56px 0 28px; font-size: .92rem; }
.footer .brand__kicker { color: var(--sky); }
.footer .brand__name { color: #fff; margin-bottom: 14px; }
.footer__grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer__small { margin: 0; line-height: 1.6; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: flex-start; }
.footer__nav a { color: #dbe7f3; text-decoration: none; }
.footer__nav a:hover { color: var(--sky); }
.footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding-top: 22px; font-size: .82rem; }

/* ---------- Comparsa allo scorrimento ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .cards, .contacts { grid-template-columns: repeat(2, 1fr); }
  .docs { gap: 14px; }
  .areas { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .navtoggle { display: block; }
  .nav {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px 16px 20px; box-shadow: 0 20px 30px -20px rgba(15,42,71,.35);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav a::after { display: none; }
  .nav__cta { margin-top: 14px; text-align: center; border-bottom: 0 !important; }
  .hero__banner { min-height: 0; align-items: flex-end; }
  .hero__bg { object-position: 62% 30%; }
  .hero__banner::after {
    background: linear-gradient(180deg, rgba(15,42,71,.35) 0%, rgba(15,42,71,.72) 34%, rgba(15,42,71,.94) 58%, rgba(15,42,71,.97) 100%);
  }
  .hero__text { padding: 190px 0 88px; }
  .split, .split--reverse { grid-template-columns: 1fr; }
  .portrait { margin-left: 18px; }
  .certhead { grid-template-columns: 1fr; }
  .certhead__badge { justify-self: start; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .cards, .contacts, .docs, .offices { grid-template-columns: 1fr; }
    .certbar { padding: 16px 18px; gap: 16px; }
  .certbar img { width: 48px; }
  .certbar__text strong { font-size: 1.08rem; }
  .certbar__arrow { display: none; }
  .btn { width: 100%; justify-content: center; }
  .video__btn { width: 64px; height: 64px; }
  .video__label { font-size: 1rem; bottom: 14px; }
  .doc img { aspect-ratio: 16 / 10; }
}

/* Numeri nei titoli: il font lapidario disegna lo 0 come una O */
.certbar__text strong .num, .doc__body strong .num { font-family: var(--sans); font-size: .82em; font-weight: 500; color: inherit; letter-spacing: .01em; }
