@font-face {
  font-family: Knewave;
  src: url("font/Knewave/Knewave-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: Poppins;
  src: url("font/Poppins/Poppins-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Poppins;
  src: url("font/Poppins/Poppins-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "League Spartan";
  src: url("font/League_Spartan/LeagueSpartan-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #14161a;
  --accent: #3866b1;
  --use-letter: #3a66ae;
  --mist: #e6e9f9;
  --paper: #fff;
  --surface: #f4f6f9;
  --line: #dde1e8;
  --space: clamp(1rem, 4vw, 4rem);
  --site-legal-height: calc(2.1875rem + 1px + env(safe-area-inset-bottom, 0px));
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.65 Poppins, sans-serif;
}

* { box-sizing: border-box; }
body, h1, h2, form { margin: 0; }
h1, h2 { font-family: "League Spartan", sans-serif; line-height: 1; font-weight: 600; }
.use-letter { color: var(--use-letter); }

.home,
.web-product-hero,
:root:has(.section-page #finestra:is(:target, [data-in-panel])) {
  --use-letter: #b0c2e0;
}
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.skip-link {
  position: fixed;
  z-index: 100;
  inset: .5rem auto auto .5rem;
  max-width: calc(100% - 1rem);
  padding: .5rem .8rem;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--paper);
  transform: translateY(calc(-100% - 1rem));
}
.skip-link:focus { transform: none; outline-color: var(--paper); }
.section-page:has(#finestra:is(:target, [data-in-panel])) .skip-link { display: none; }
button { font: inherit; cursor: pointer; }

.home {
  background: var(--ink);
}

.home:not(:has(.home-viewport)),
.home-viewport {
  height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.home:has(.site-legal--fixed) .home-viewport {
  height: calc(100svh - var(--site-legal-height));
}

:is(.home, .home-viewport) > main {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-width: 0;
  container-type: size;
}

.home-overview {
  border-top: 1px solid color-mix(in srgb, var(--paper) 13%, transparent);
  color: var(--paper);
  background: color-mix(in srgb, var(--ink) 92%, var(--paper));
}

.home-overview-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .85rem 2rem;
  width: min(100%, 82rem);
  margin-inline: auto;
  padding: clamp(1.25rem, 3vw, 2rem) var(--space);
}

.home-overview h1 {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
}

.home-overview p {
  max-width: 58ch;
  margin: .3rem 0 0;
  color: color-mix(in srgb, var(--paper) 85%, var(--ink));
  font-size: .9rem;
}

.home-overview nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(1rem, 2.2vw, 2rem);
}

.home-overview a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: inherit;
  font-size: .9rem;
  font-weight: 600;
  text-decoration-color: color-mix(in srgb, var(--paper) 46%, transparent);
}

.home-overview a:hover { text-decoration-color: currentColor; }
.home-overview a:focus-visible { outline-color: currentColor; }

.home-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .25rem var(--space);
  color: var(--paper);
}

.home-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 clamp(.12rem, 1.15vw, 1rem);
}

.home-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding-inline: clamp(.36rem, .9vw, .75rem);
  border-radius: .35rem;
  color: var(--paper);
  font-size: clamp(.75rem, 1.15vw, .9rem);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.home-menu a:hover,
.home-menu a[aria-current] {
  background: color-mix(in srgb, var(--paper) 12%, transparent);
}

.home-menu a[aria-current] {
  box-shadow: inset 0 -2px var(--accent);
}

.home-menu .home-view-switch {
  align-self: center;
  justify-content: center;
  min-height: 2rem;
  margin: .25rem .26rem .33rem .24rem;
  padding-inline: .68rem;
  border: 2px solid var(--paper);
  border-radius: .16rem .55rem .18rem .45rem;
  background: var(--accent);
  color: var(--paper);
  box-shadow: .13rem .12rem 0 var(--ink), .22rem .21rem 0 var(--paper);
  font: 1.04rem/1 Knewave, fantasy;
  letter-spacing: .065em;
  transform: rotate(-4deg);
}

.home-menu .home-view-switch:hover {
  background: var(--paper);
  color: var(--ink);
}

@media (pointer: coarse) {
  .home-menu .home-view-switch { min-height: 2.75rem; }
}

.site-legal {
  padding: .9rem var(--space);
  border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent);
  background: var(--ink);
  color: var(--line);
  font-size: .875rem;
  text-align: center;
}

:is(.home:has(.site-legal--fixed), .vertical-demo[data-design="contrasto"]) {
  padding-block-end: var(--site-legal-height);
}

:root:has(.home .site-legal--fixed, .vertical-demo[data-design="contrasto"] .site-legal--fixed) {
  scroll-padding-block-end: var(--site-legal-height);
}

.site-legal--fixed {
  position: fixed;
  z-index: 5;
  inset: auto 0 0;
  padding-block: .5rem calc(.5rem + env(safe-area-inset-bottom, 0px));
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.language-switch {
  display: inline-grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding-inline: .55rem;
  border: 1px solid color-mix(in srgb, currentColor 38%, transparent);
  border-radius: .45rem;
  color: inherit;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}

.language-switch:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
  color: inherit;
}

.home-toolbar a:focus-visible {
  outline-color: var(--paper);
  outline-offset: 2px;
}

.scene {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  overflow: hidden;
  width: min(100%, calc(100cqh * 3344 / 1882));
  margin-inline: auto;
}

.scene-photo {
  display: block;
  width: 100%;
  height: auto;
}

.scene[data-color-mode] .scene-photo,
.scene[data-color-mode="team"] .hotspot:not([data-team]) .hotspot-effect {
  filter: grayscale(1);
}

.scene[data-color-mode="team"] .scene-book {
  --book-color: grayscale(1);
}

.scene-color {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.scene--lighting::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgb(11 13 19 / .24);
  mask-image: var(--scene-light-mask);
  mask-composite: intersect;
}

.hotspot {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--w);
  height: var(--h);
  pointer-events: none;
}

.hotspot-hit {
  position: absolute;
  inset: 0;
  display: block;
  clip-path: var(--shape);
  pointer-events: auto;
  -webkit-tap-highlight-color: rgb(255 220 157 / .25);
}

.hotspot-effect,
.hotspot-rays {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hotspot-effect {
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease, visibility .12s ease;
}

.hotspot:has(.hotspot-hit:is(:hover, :focus-visible, :active)) {
  z-index: 1;
}

.hotspot-hit:is(:hover, :focus-visible, :active) + .hotspot-effect {
  opacity: 1;
  visibility: visible;
}

.hotspot-hit:focus-visible {
  background: rgb(255 220 157 / .16);
}

.hotspot-rays {
  filter: drop-shadow(0 0 1px #ffd58e);
}

.hotspot-rays i {
  position: absolute;
  top: var(--ray-y);
  left: var(--ray-x);
  width: max(5px, var(--ray-length));
  height: max(1.5px, var(--ray-thick));
  background: #211715;
  clip-path: polygon(0 43%, 49% 16%, 91% 0, 100% 27%, 93% 88%, 72% 100%, 36% 68%);
  transform: translateY(-50%) rotate(var(--ray-angle));
  transform-origin: 0 50%;
}

.hotspot-rays i:nth-child(3n) {
  clip-path: polygon(0 57%, 29% 31%, 96% 0, 100% 69%, 83% 83%, 66% 79%, 42% 100%);
}

.hotspot-name {
  position: absolute;
  top: var(--label-y);
  left: var(--label-x);
  transform: translate(-50%, -72%) rotate(-7deg);
  width: max-content;
  color: #ffe1a4;
  font: 400 clamp(.85rem, 3.2cqw, 4.4rem)/1 Knewave, "Marker Felt", cursive;
  letter-spacing: -.025em;
  -webkit-text-stroke: .09em #221510;
  paint-order: stroke fill;
  text-shadow: .065em .075em #221510;
}

.hotspot--margherita-losavio .hotspot-name {
  font-size: clamp(.76rem, 2.65cqw, 3.65rem);
}

.hotspot--use .hotspot-rays i,
.hotspot--halia .hotspot-rays i {
  background: #321e15;
}

.scene-book {
  position: absolute;
  inset: 0;
  filter: var(--book-color, none);
}

.scene-book::before {
  content: "";
  position: absolute;
  inset: auto -8% -4% -4%;
  height: 15%;
  transform: skewY(-1.5deg);
  background:
    radial-gradient(ellipse at 48% 53%, rgb(31 18 13 / .79), transparent 70%),
    radial-gradient(ellipse at 78% 41%, rgb(31 18 13 / .52), transparent 68%);
}

.scene-book-pages,
.scene-book-cover {
  position: absolute;
  inset: 0;
}

.scene-book-pages {
  clip-path: polygon(84% 4%, 98% 0, 96% 94%, 84% 98%);
  background:
    repeating-linear-gradient(-8deg, transparent 0 .045cqw, rgb(38 26 22 / .26) .045cqw .07cqw),
    linear-gradient(92deg, #51453b 85%, #ad9a81 89%, #d4c3a6 94%, #8d7b64 98%);
}

.scene-book-pages::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(97% 0, 98% 0, 96% 94%, 94.8% 94.4%);
  background: #284595;
}

.scene-book-cover {
  display: grid;
  place-items: center;
  padding-inline: 12% 15%;
  clip-path: polygon(6.5% 4%, 89% 1%, 87% 97%, 1% 100%);
  background:
    repeating-linear-gradient(129deg, transparent 0 .032cqw, rgb(20 22 26 / .13) .032cqw .06cqw),
    repeating-linear-gradient(40deg, transparent 0 .046cqw, rgb(255 255 255 / .085) .046cqw .07cqw),
    linear-gradient(175deg, transparent 18%, rgb(214 229 249 / .59) 18% 19.5%, transparent 19.5% 81%, rgb(214 229 249 / .36) 81% 82.5%, transparent 82.5%) left / 13% 100% no-repeat,
    linear-gradient(94deg, #284595 4%, #528cca 7%, #2c509d 12%, transparent 15%),
    radial-gradient(ellipse at 23% 10%, rgb(255 230 190 / .19), transparent 64%),
    linear-gradient(153deg, #528cca 9%, #325ca6 46%, #284595 88%);
}

.scene-book-cover::before,
.scene-book-cover::after {
  content: "";
  position: absolute;
  border: solid color-mix(in srgb, #528cca 47%, var(--paper));
  transform: skew(-3deg, -1.5deg);
}

.scene-book-cover::before {
  inset: 12% 15% 12% 12%;
  border-width: max(.5px, .052cqw);
  opacity: .76;
}

.scene-book-cover::after {
  inset: 16% 17% 16% 14%;
  border-width: max(.5px, .028cqw);
  opacity: .50;
}

.scene-book-title {
  color: var(--paper);
  font: 600 1.16cqw/1 Poppins, sans-serif;
  letter-spacing: -.045em;
  text-shadow: .038em .066em rgb(19 34 66 / .72);
  transform: skewY(-1.5deg);
}

.hotspot--isaac4 .hotspot-hit {
  inset: 50% auto auto 50%;
  width: max(100%, 24px);
  height: max(100%, 24px);
  transform: translate(-50%, -50%);
}

@media (max-width: 42rem) {
  :where(.hotspot--awards, .hotspot--isaac4, .hotspot--halia, .hotspot--use, .hotspot--newspaper) .hotspot-hit {
    inset: 0 auto auto 50%;
    width: max(100%, 24px);
    height: max(100%, 24px);
    clip-path: none;
    transform: translateX(-50%);
  }

  .hotspot--awards .hotspot-hit {
    top: clamp(calc(-3.7cqw * 1882 / 3344), calc(8.85cqw * 1882 / 3344 - 24px), 0px);
  }

  .hotspot--isaac4 { z-index: 1; }

  .hotspot--isaac4 .hotspot-hit {
    top: max(0px, calc(24px - 12.55cqw * 1882 / 3344));
    transform: translateX(-50%);
  }

  :is(.hotspot--halia, .hotspot--use) .hotspot-hit {
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .hotspot--use .hotspot-hit { top: calc(50% + 3px); }

  .hotspot--newspaper .hotspot-hit {
    top: auto;
    bottom: 0;
  }

  .hotspot--margherita-losavio .hotspot-name {
    top: 8%;
    left: 28%;
  }
}

dialog {
  --panel-gray: color-mix(in srgb, var(--ink) 84%, var(--paper));
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: auto;
  width: 90vw;
  height: 90dvh;
  max-width: none;
  max-height: calc(100% - .75rem);
  padding: 0;
  overflow: hidden;
  border: 1px solid #000;
  border-radius: .9rem;
  color-scheme: dark;
  color: var(--paper);
  background: color-mix(in srgb, var(--panel-gray) 90%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 1.25rem 4rem color-mix(in srgb, var(--ink) 65%, transparent);
}

:is(.home, .home-viewport) > main:has(dialog[open])::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--ink) 38%, transparent);
}

html:has(dialog[open]) { overflow: hidden; }

.dialog-body {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.dialog-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: .15rem clamp(.35rem, 1.2vw, .85rem);
  border-bottom: 1px solid color-mix(in srgb, var(--paper) 17%, transparent);
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--paper);
}

.dialog-close:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: -2px;
}

.dialog-close-icon {
  position: relative;
  width: 1.85rem;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--paper) 58%, transparent);
  border-radius: 50%;
}

.dialog-close-icon::before,
.dialog-close-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: .72rem;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.dialog-close-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.dialog-close:hover .dialog-close-icon {
  border-color: var(--paper);
  background: color-mix(in srgb, var(--paper) 10%, transparent);
}

.dialog-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: transparent;
}

[data-video-trigger][hidden],
[data-video-poster][hidden] {
  display: none;
}

.video-player {
  width: min(100%, 46rem);
  margin-inline: auto;
  text-align: center;
}

.video-player iframe {
  display: block;
  width: 100%;
  min-height: 200px;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: .9rem;
  background: var(--ink);
}

.video-close {
  margin-top: .55rem;
  padding: .35rem .15rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: .875rem;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.section-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .4rem var(--space);
  background: var(--surface);
}
.article { max-width: 52rem; margin-inline: auto; padding: clamp(1.5rem, 6vw, 4rem) var(--space); }
.article h1 { font-size: clamp(2.25rem, 8vw, 4.5rem); }
.article p { max-width: 67ch; }
.category { margin: 0 0 .7rem; color: var(--accent); font-weight: 600; }
.lead { font-size: clamp(1.1rem, 3vw, 1.4rem); }
.product-logo { display: block; width: min(13rem, 65%); max-height: 7rem; object-fit: contain; object-position: left center; margin-bottom: 1.2rem; }

/* Embedded sections use the panel backdrop. Keep legacy fragment links styled. */
:root:has(.section-page #finestra:is(:target, [data-in-panel])) {
  color-scheme: dark;
  color: var(--paper);
  background: transparent;
}

.section-page:has(#finestra:is(:target, [data-in-panel])) .section-nav { display: none; }

.section-page #finestra:is(:target, [data-in-panel]) {
  max-width: none;
  padding: clamp(1rem, 2.5vw, 2rem) clamp(1rem, 3vw, 2.75rem);
}

.section-page #finestra.product-page:is(:target, [data-in-panel]) {
  max-width: 53rem;
}

.section-page #finestra:is(:target, [data-in-panel]) h1 {
  font-size: clamp(2.1rem, 7.5vw, 3.5rem);
}

.section-page #finestra:is(:target, [data-in-panel]) :is(.category, a) { color: var(--paper); }
.section-page #finestra:is(:target, [data-in-panel]) :focus-visible { outline-color: var(--paper); }
.section-page #finestra:is(:target, [data-in-panel]) .product-logo { filter: brightness(0) invert(1); }

@media (prefers-reduced-motion: reduce) {
  .hotspot-effect { transition: none; }
}
