/* Inter (variable, weights 100-900), served from this site (SIL Open Font License). Only the Latin sets are
   included: they cover Italian. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-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;
}

/* ==========================================================================
   Pampuri — Studio Tecnico
   ========================================================================== */

:root {
  --navy: #101322;
  --paper: #fbfbfb;
  --gray-bg: #f1f1f1;
  --card-bg: #f1f1f1;
  --green: #4cba58;
  --text-dark: #101322;
  --text-muted: #5e5e5e;
  --text-on-dark: #fbfbfb;
  --text-on-dark-muted: #a7a9b8;

  /* type scale: golden ratio on 14px (see _stile/foglio-stile.html) */
  --fs-label: 12px;
  --fs-text: 14px;
  --fs-intro: 22px;
  --fs-tile: clamp(24px, 2.6vw, 36px);
  --fs-section: clamp(30px, 4.8vw, 58px);
  --fs-page: clamp(40px, 9vw, 152px);
  --lh-title: 1.05;
  --lh-mid: 1.3;
  --lh-text: 1.5;
  --ls-title: -0.04em;
  --ls-mid: -0.02em;
  --ls-text: -0.01em;
  /* space scale: 12 x golden ratio, multiples of 4 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 20px;
  --sp-5: 32px;
  --sp-6: 52px;
  --sp-7: 84px;
  --radius-lg: 23px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --container-w: 1200px;
  --gutter: clamp(20px, 5vw, 64px);

  --ff: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Subtle film-grain texture, layered via background-blend-mode over dark
     panels (see .hero__frame::after / .statement--video::before). */
  --grain: 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='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--ff);
  background: var(--paper);
  color: var(--text-dark);
  font-weight: 500; /* small text a touch heavier than Regular (400); headings and buttons set their own weight */
  -webkit-font-smoothing: antialiased;
  /* overflow-x lives on <html> only: setting it here too would make body its
     own scroll container and silently break position:sticky descendants. */
}

img,
video,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section {
  position: relative;
}

/* ---------- Typography ---------- */

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* Every section heading (as opposed to the big dark statement headings)
   shares this exact size/weight — they read as one consistent family. */
.section-heading {
  font-size: clamp(30px, 4.8vw, 58px);
  font-weight: 600;
}

/* Titles inside the cards are one level (100% on every line). The hero
   statement keeps two levels: first line full, the rest at 40%. */
.hero__title .tr-line:not(:first-child) {
  opacity: 0.4;
}

.eyebrow {
  font-size: 14px;
  letter-spacing: -0.02em;
  color: var(--text-muted);
  font-weight: 500;
}

.eyebrow--light {
  color: var(--text-on-dark-muted);
}

p {
  margin: 0;
  line-height: var(--lh-text);
}

/* ---------- Buttons ---------- */

/* Buttons match the nav: solid #101322 with #F1F1F1 type on light sections,
   inverted on dark ones. On hover (site.js) a button lifts a hair and gets
   very slightly lighter. */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: none;
  font-size: var(--fs-text);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
}

.btn--dark {
  background: #101322;
  color: #f1f1f1;
}

.btn--light {
  background: #f1f1f1;
  color: #101322;
}

/* ---------- Fixed bottom nav ---------- */

/* Nav dock: the pill of links plus a small round "back to top" button. Both
   backgrounds are drawn on a separate layer and merged by a gooey filter, so
   the circle looks joined to the pill. Solid #101322 with #F1F1F1 type;
   over dark sections everything inverts (site.js toggles .is-over-dark). */
.nav-dock {
  --nav-bg: #101322;
  --nav-fg: #f1f1f1;
  --dock-h: 54px; /* pill height = the round button's diameter (the whole nav is 10% larger than it was: 49px) */
  --home-w: 92px; /* width of the "home" pill */
  position: fixed;
  /* Centred without left:50% + translateX(-50%): with that, Safari sizes the box to the space
     right of the 50% line (half the window) and the buttons spill out of the bar. */
  left: 0;
  right: 0;
  margin-inline: auto;
  bottom: 20px;
  z-index: 10000; /* stays above the page-transition overlay (9999), so the
     clicked pill's pulse (setupPageTransition) is still visible mid-transition */
  display: flex;
  align-items: stretch;
  gap: 5px;
  width: -webkit-max-content;
  width: max-content; /* exactly as wide as its buttons */
  max-width: calc(100vw - 24px);
}

.nav-dock a,
.nav-dock button {
  white-space: nowrap;
}

.nav-dock.is-over-dark {
  --nav-bg: #f1f1f1;
  --nav-fg: #101322;
}

.nav-dock__goo {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 5px;
  filter: url(#nav-goo);
  pointer-events: none;
  z-index: 0;
}

.nav-dock__goo i {
  background: var(--nav-bg);
  border-radius: var(--radius-pill);
  transition: background-color 0.3s ease;
}

.nav-dock__goo i:first-child {
  flex: 1;
}

/* "home" is its own pill, fused to the others like the round button. */
.nav-dock__goo i.nav-dock__goo-home {
  order: -1;
  flex: 0 0 var(--home-w);
}

.nav-dock__goo i:nth-child(2) {
  flex: 0 0 var(--dock-h);
}

/* The third shape is the phone menu's panel; unused on desktop. */
.nav-dock__goo i:nth-child(3) {
  display: none;
}

.nav-menu {
  display: none;
}

.nav-pill {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none; /* the pill is exactly as wide as its buttons */
  gap: 4px;
  padding: 6px;
  height: var(--dock-h);
}

.nav-home {
  position: relative;
  z-index: 1;
  flex: 0 0 var(--home-w);
  display: grid;
  place-items: center;
  height: var(--dock-h);
  color: var(--nav-fg);
  font-size: 15.4px;
  font-weight: 600;
  line-height: 19px;
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
}

/* The copy of "home" inside the list is only for phones. */
.nav-pill a.nav-home-list {
  display: none;
}

.nav-home.is-on,
.nav-top.is-on {
  color: var(--nav-bg);
}

.nav-top {
  position: relative;
  z-index: 1;
  flex: 0 0 var(--dock-h);
  display: grid;
  place-items: center;
  color: var(--nav-fg);
  font-size: 17.6px;
  font-weight: 600;
  line-height: 1;
  transition: color 0.3s ease;
}

/* Sliding indicator: one shape that glides through all the pills (home, the list, the
   round button), follows the hovered one and rests under the current page. */
.nav-pill__indicator {
  position: absolute;
  top: 6px;
  left: 0;
  height: calc(var(--dock-h) - 12px);
  width: 0;
  border-radius: var(--radius-pill);
  background: var(--nav-fg);
  pointer-events: none;
  z-index: 1;
  transition: background-color 0.3s ease;
}

.nav-pill a {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  color: var(--nav-fg);
  font-size: 15.4px;
  font-weight: 600;
  line-height: 19px;
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
}

/* The label sitting on the indicator (set by site.js) takes the pill's own color. */
.nav-pill a.is-on {
  color: var(--nav-bg);
}

/* Phones: the row of links becomes a "Menu" button that opens a vertical
   list. Menu, the round button and the list are all gooey shapes on the
   background layer, so opening the menu melts the panel out of the pill. */
@media (max-width: 719px) {
  /* Bottom-right corner, "Menu" on the outside (nearest the thumb) with the
     round button to its left; the list opens right-aligned. */
  .nav-dock {
    left: auto;
    right: 12px;
    margin-inline: 0;
    transform: none;
    flex-direction: row-reverse;
  }

  /* The goo layer spans the pile of pills plus the row (height set by site.js). It reaches 340px to the
     left of the dock, because the pills of the heap are wider than the Menu button. */
  .nav-dock {
    --goo-pad: 340px;
  }

  .nav-dock__goo {
    inset: auto 0 0 calc(var(--goo-pad) * -1);
    height: var(--goo-h, 340px);
    display: block;
  }

  .nav-dock__goo i {
    position: absolute;
    bottom: 0;
  }

  .nav-dock__goo i:first-child {
    right: 0;
    width: calc(100% - var(--goo-pad) - var(--dock-h) - 5px);
    height: var(--dock-h);
  }

  .nav-dock__goo i:nth-child(2) {
    left: var(--goo-pad);
    width: var(--dock-h);
    height: var(--dock-h);
  }

  /* The old rectangular panel is gone: each link has its own shape (added by site.js). */
  .nav-dock__goo i:nth-child(3) {
    display: none;
  }

  .nav-dock__goo i.nav-dock__goo-pill {
    display: none;
    top: 0;
    bottom: auto;
    right: auto;
    border-radius: var(--radius-pill);
  }

  .nav-menu {
    display: block;
    position: relative;
    z-index: 1;
    height: var(--dock-h);
    padding: 0 26px;
    border: none;
    background: none;
    color: var(--nav-fg);
    font: inherit;
    font-size: 15.4px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
  }

  /* The links are absolutely placed by site.js (a random chain of pills that always touch); the
     panel is just the box they are measured from, sitting right above the Menu button. */
  .nav-pill {
    position: absolute;
    right: 0;
    bottom: calc(var(--dock-h) + 5px);
    display: block;
    width: calc(100vw - 24px);
    height: 0;
    padding: 0;
    visibility: hidden;
    opacity: 0;
  }

  .nav-pill__indicator {
    display: none;
  }

  .nav-home,
  .nav-dock__goo i.nav-dock__goo-home {
    display: none;
  }

  .nav-pill a.nav-home-list {
    display: block;
  }

  .nav-pill a {
    position: absolute;
    right: 0;
    bottom: 0;
    width: max-content;
    padding: 13px 24px;
    font-size: 17.6px;
    line-height: 22px;
  }

  /* The current page (and the one under the finger) is lit by a smaller pill INSIDE its own pill,
     inset 5px on every side, instead of filling the whole pill. */
  .nav-pill a:hover,
  .nav-pill a[aria-current="page"] {
    color: var(--nav-bg);
  }

  .nav-pill a:hover::before,
  .nav-pill a[aria-current="page"]::before {
    content: "";
    position: absolute;
    inset: 5px;
    z-index: -1;
    border-radius: var(--radius-pill);
    background: var(--nav-fg);
  }
}



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

/* The gradient box is taller than the screen: its first screen holds the logo,
   the statement and the bolt; Vision / Mission sit inside it, further down. */
.hero-pin {
  position: relative;
  margin-bottom: 12px; /* the same gap as between the other cards */
}

.hero {
  position: relative;
  padding: 0;
  background: var(--paper);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}

.hero__frame {
  position: relative;
  width: 100%;
  min-height: 100svh;
  border-radius: 0;
  overflow: hidden;
  background: var(--navy);
  transform-origin: 50% 0%;
  will-change: transform;
  /* WebKit (Safari, every iPhone browser) does not round the corners of the canvases and layers inside a box that is
     being scaled, unless the box is also masked: without this its corners stay square while it narrows. */
  isolation: isolate;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
}

/* Reduced motion: a normal rounded card, matches the rest of the page */
@media (prefers-reduced-motion: reduce) {
  .hero {
    padding: 12px;
  }
  .hero__frame {
    border-radius: var(--radius-lg);
  }
}

.hero__frame video,
.hero__frame .gradient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../images/grain.jpg");
  background-size: 256px 256px;
  image-rendering: pixelated;
  mix-blend-mode: overlay;
  opacity: 0.03;
  pointer-events: none;
}

/* A very faint, soft shadow blob under the floating bolt. */
.hero__shade {
  display: none; /* removed: no shadow under the bolt */
  position: absolute;
  left: 50%;
  top: calc(100svh - 9vh);
  width: min(46vw, 640px);
  height: 9vh;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(2, 6, 10, 0.28), rgba(2, 6, 10, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* 3D bolt (three.js, see saetta.js) sits between the gradient and the hero text. */
.hero__saetta {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Flat fallback, shown only if WebGL is unavailable. */
.hero__saetta-flat {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  height: 60%;
  width: auto;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}

.hero__frame.no-webgl .hero__saetta {
  display: none;
}

.hero__frame.no-webgl .hero__saetta-flat {
  display: block;
}

.hero__content {
  position: absolute;
  inset: 0 0 auto 0;
  height: 100svh; /* the first screen of the box */
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(16px, 3vw, 40px) var(--card-pad, clamp(16px, 3vw, 40px)) 0;
  pointer-events: none; /* let mouse events reach the gradient canvas beneath */
}

.hero__wordmark {
  display: block;
  width: 100%;
  height: auto;
  fill: #fff;
  overflow: visible;
}

.hero__subtitle {
  fill: rgba(255, 255, 255, 0.75);
  font-family: var(--ff);
  font-weight: 500;
}

/* The intro statement, moved onto the gradient: same heading style as every
   other title, in white, at the bottom-left above the nav. */
.hero__title {
  position: absolute;
  left: var(--card-pad, clamp(16px, 3vw, 40px));
  bottom: 104px;
  margin: 0;
  color: #fff;
}

/* ==========================================================================
   Mission / Vision cards
   ========================================================================== */

/* Vision / Mission: just text, on the gradient — one on the left, one on the
   right — with the same two levels of opacity as the titles (white 100% / 40%). */
.pillars {
  position: relative;
  z-index: 2;
  margin-top: calc(100svh - 8px); /* just under the first screen */
  /* Same margin as the cards (2.5% of the box width, set by site.js), so the
     gap below the text matches the other cards' bottom padding. */
  padding: 0 var(--card-pad, clamp(16px, 2.5vw, 40px)) var(--card-pad, clamp(24px, 2.5vw, 40px));
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .pillars {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
  }

  /* Mission sits on the right edge, level with Vision. */
  .pillar:last-child {
    justify-self: end;
  }
}

.pillar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 30em;
}

.pillar__label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.7);
}

.pillar p {
  font-size: 14px; /* the site's small-text size */
  font-weight: 500;
  line-height: var(--lh-text);
  color: #fff;
  text-wrap: pretty;
}

.pillar__rest {
  opacity: 0.4;
}

/* ==========================================================================
   Dark statement section
   ========================================================================== */

.statement {
  margin: 24px 12px;
  border-radius: var(--radius-lg);
  background: var(--gray-bg);
  padding: clamp(48px, 8vw, 96px) clamp(24px, 5vw, 64px);
  text-align: left;
}

.statement__inner {
  max-width: 100%; /* wide enough that its heading's authored lines never re-wrap */
  margin-inline: auto;
}

.statement h2 {
  /* Same font-size/weight as .section-heading (applied via that class in
     the HTML) — every heading on the page is now one consistent size. */
  color: var(--navy);
  line-height: 0.98;
}

.statement p {
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 14px; /* same small-text size as the footer */
  line-height: var(--lh-text);
  max-width: 480px;
}

.statement__cta {
  margin-top: 32px;
}

/* video CTA variant: has a background video instead of flat navy */
.statement--video {
  position: relative;
  overflow: hidden;
}

.statement--video video,
.statement--video .gradient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.statement--video .statement__inner {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Projects section
   ========================================================================== */

.projects {
  background: var(--gray-bg);
  border-radius: var(--radius-lg);
  margin: 24px 12px;
  padding: clamp(48px, 6vw, 80px) clamp(20px, 4vw, 40px);
}

.projects__inner {
  max-width: var(--container-w);
  margin-inline: auto;
  container-type: inline-size; /* lets the blinds strip size itself from this width (cqw) */
}

.projects__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 40px;
}

.projects__head p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: var(--lh-text);
  max-width: 320px;
}

@media (min-width: 720px) {
  /* The whole sentence stays on one line. */
  .projects__head p {
    max-width: none;
    white-space: nowrap;
  }
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 980px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 447 / 571;
  background: var(--navy);
}

.project-card video,
.project-card .vposter {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover video,
.project-card:hover .vposter {
  transform: scale(1.04);
}

.project-card__label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  background: var(--paper);
  color: var(--navy);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
}

/* Blinds strip (>= 720px): a row of slats, one open at a time. The open slat
   keeps the card proportions (447 : 571) — the strip height is derived from
   the open slat's width, so the format never changes. Under 720px the plain
   grid above stays. */
@media (min-width: 720px) {
  .project-grid {
    --n: 7; /* slats */
    --r: 3.1; /* open slat width vs a closed one */
    --gap: 8px;
    --strip-w: 100cqw; /* set narrower by site.js on short screens (keeps the slat proportions) */
    --open-w: calc((var(--strip-w) - var(--gap) * (var(--n) - 1)) * var(--r) / (var(--r) + var(--n) - 1));
    width: var(--strip-w);
    margin-inline: auto;
    display: flex;
    gap: var(--gap);
    height: var(--strip-h, calc(var(--open-w) * 571 / 447)); /* --strip-h: set by site.js on short windows */
  }

  .project-card {
    flex: 1 1 0;
    min-width: 0;
    aspect-ratio: auto;
    border-radius: 10px;
    cursor: pointer;
  }

  /* Video keeps its open size and is only revealed by the slat, like a blind. */
  .project-card video,
  .project-card .vposter {
    left: 50%;
    right: auto;
    width: var(--open-w);
    max-width: none; /* the global img/video rule (max-width: 100%) shrank it to the slat, and the margin below then pushed the picture out of a closed slat (plain navy) */
    margin-left: calc(var(--open-w) / -2); /* centred with a margin: no transform on a video (iOS draws it on its own layer) */
    transform: none;
    transition: none;
  }

  .project-card:hover video,
  .project-card:hover .vposter {
    transform: none;
  }

  /* Own compositor layers: while a slat opens, only its clip changes, the big picture is not repainted every frame. */
  .project-card video,
  .project-card .vposter {
    will-change: transform;
  }

  /* Titles, not buttons: plain white type over a soft scrim, shown on the open slat only. */
  .project-card::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(16, 19, 34, 0.55) 0%, rgba(16, 19, 34, 0) 100%);
    pointer-events: none;
    z-index: 1;
  }

  .project-card__label {
    left: 16px;
    right: 16px;
    top: 14px;
    bottom: auto;
    background: none;
    padding: 0;
    border-radius: 0;
    color: #fff;
    font-size: clamp(15px, 1.5vw, 18px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
    transition: opacity 0.3s ease;
  }

  /* Safety net: a title never shows on a closed slat, whatever the tweens do. */
  .project-card:not(.is-active) .project-card__label {
    opacity: 0;
  }
}

/* Phone (< 720px): the strip becomes a stack of rows, one open at a time (see setupProjectBlinds). */
@media (max-width: 719.98px) {
  /* Fewer projects on a phone: the ones marked --desk are for larger screens only. */
  .project-card--desk {
    display: none;
  }

  .project-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* Wrapper added by site.js: as tall as the scroll spent on the projects, so the strip stays put. */
  .project-pin > .project-grid {
    position: sticky;
    top: 16px;
  }

  .project-card {
    flex: none;
    height: 64px;
    aspect-ratio: auto;
    border-radius: var(--radius-sm);
    cursor: pointer;
  }

  /* The video keeps its open size and the row only reveals it, so it never re-flows while the row grows. */
  .project-card video,
  .project-card .vposter,
  .project-card:hover video,
  .project-card:hover .vposter {
    inset: auto 0 auto 0;
    top: 50%;
    height: var(--open-h, 360px);
    margin-top: calc(var(--open-h, 360px) / -2);
    transform: none;
    transition: none;
  }

  .project-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(16, 19, 34, 0.55) 0%, rgba(16, 19, 34, 0.15) 100%);
    pointer-events: none;
    z-index: 1;
  }

  .project-card__label {
    left: 16px;
    right: 16px;
    top: 22px;
    bottom: auto;
    background: none;
    padding: 0;
    border-radius: 0;
    color: #fff;
    font-size: var(--fs-text);
    line-height: 1.2;
    letter-spacing: -0.01em;
  }
}

.projects__cta {
  display: flex;
  justify-content: flex-end;
  margin-top: 32px;
}

/* ==========================================================================
   Trust / clients section
   ========================================================================== */

.trust {
  position: relative;
  padding: clamp(64px, 10vw, 120px) var(--gutter);
  text-align: center;
  overflow: hidden;
}

.trust__inner {
  position: relative;
  z-index: 1;
  max-width: 100%; /* wide enough that its heading's authored lines never re-wrap */
  margin-inline: auto;
}


.trust__cloud {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 32px 24px;
  margin: 48px auto;
  max-width: 900px;
}

@media (min-width: 720px) {
  /* Twelve logos on two rows of six. */
  .trust__cloud {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px 24px;
  }
}

.trust__cloud img {
  /* The logo files sit on square artboards with generous margins, so the
     visible mark only gets bigger when the box does. */
  width: 100%;
  height: clamp(72px, 9vw, 112px);
  object-fit: contain;
  object-position: center;
  opacity: 0.65;
  filter: grayscale(1);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.trust__cloud img:hover {
  opacity: 1;
  filter: grayscale(0);
}

.trust__closing {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 16px;
}

.trust__cta {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.trust__closing p {
  font-size: 18px;
  font-weight: 500;
  max-width: 380px;
  text-align: left;
}

/* ==========================================================================
   Contact section
   ========================================================================== */

.contact {
  padding: clamp(64px, 10vw, 120px) var(--gutter) 160px;
}

.contact__heading {
  max-width: var(--container-w);
  margin-inline: auto;
  margin-bottom: 48px;
}

.contact__inner {
  max-width: var(--container-w);
  margin-inline: auto;
  display: grid;
  gap: 48px;
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .contact__inner {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.contact__intro p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: var(--lh-text);
  max-width: 420px;
}

.contact__note {
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form input[type="email"],
.form textarea {
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: #fff;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: -0.01em;
  resize: vertical;
}

.form input::placeholder,
.form textarea::placeholder {
  color: #9a9a9a;
}

.form__checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  padding: 4px 2px;
}

.form__checkbox input {
  margin-top: 3px;
}

.form button[type="submit"] {
  align-self: flex-start;
  margin-top: 8px;
}

/* ==========================================================================
   Reveal animation base state
   ========================================================================== */

/* Initial hidden state is applied by JS (gsap.set) right before animating,
   so content stays visible by default if the animation script fails to load. */

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

.site-footer {
  position: relative;
  background: var(--navy);
  margin: 24px 12px 148px;
  border-radius: var(--radius-lg);
  padding: 0; /* the top block and the wordmark set their own gaps (2.5%) */
  overflow: hidden;
}

.site-footer__top {
  /* Same margin as the logo (2.5% of the footer's width) on top and sides, so
     the text lines up with the logo's left and right edges. */
  margin: var(--sp-5) 0 0;
  padding-inline: var(--sp-5);
  position: relative;
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 720px) {
  .site-footer__top {
    grid-template-columns: repeat(3, auto) 1fr;
    align-items: start;
  }
}

.site-footer__col p {
  color: var(--text-on-dark-muted);
  font-size: 14px;
  line-height: var(--lh-text);
}

.site-footer__col p + p {
  margin-top: 16px;
}

.site-footer__col a {
  color: var(--text-on-dark-muted);
  transition: color 0.3s ease;
}

.site-footer__col a:hover {
  color: var(--text-on-dark);
}

.site-footer__nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.site-footer__nav a {
  font-size: 14px;
  line-height: var(--lh-text); /* same as the paragraphs, so the first line sits level with "Pampuri srl" */
  color: var(--text-on-dark-muted);
}

.site-footer__nav a:hover {
  color: var(--text-on-dark);
}

.site-footer__year {
  grid-column: 2 / 3;
  justify-self: end;
  color: #fff;
  font-size: var(--fs-label);
}

@media (min-width: 720px) {
  .site-footer__year {
    grid-column: 4 / 5;
  }
}

.site-footer__wordmark {
  margin-top: clamp(32px, 6vw, 56px);
  margin-bottom: var(--sp-5); /* the same gap as on the logo's sides */
  line-height: 0;
}

.site-footer__logo {
  display: block;
  width: calc(100% - 2 * var(--sp-5)); /* leaves 32px on each side */
  height: auto;
  margin-inline: auto;
  fill: #fff;
  opacity: 0.18;
  overflow: visible;
}

/* Phones: 2.5% is only ~8px, too tight — use a fixed 20px on the text and the
   logo so their left and right edges still line up. */
@media (max-width: 719px) {
  .site-footer__top {
    margin-top: 24px;
    padding-inline: 20px;
    column-gap: 24px;
  }

  .site-footer__year {
    /* top-right corner of the text block, level with the first lines */
    position: absolute;
    top: 0;
    right: 0; /* the grid column already stops at the 20px side padding */
    line-height: var(--lh-text);
  }

  .site-footer__logo {
    width: calc(100% - 40px);
  }

  .site-footer__wordmark {
    margin-bottom: 20px;
  }
}

/* ==========================================================================
   Text reveal — see setupTextReveals() in site.js
   ========================================================================== */

.tr-line {
  display: block; /* preserves the manual line breaks authored in the HTML */
  white-space: nowrap; /* never re-wraps mid-line — containers are sized to fit instead */
}

@media (max-width: 640px) {
  .tr-line {
    /* The original site itself re-laid-out text for phone portrait rather
       than just shrinking it — on the smallest screens we do the same,
       letting these lines wrap naturally instead of overflowing. */
    white-space: normal;
  }
}

.split-word {
  display: inline-block;
  vertical-align: top;
  will-change: transform, opacity, filter;
}

/* The original site bolded a few words per heading, but at this larger
   size it just reads as "this title is heavier than the others" — every
   heading now stays at one consistent weight, no per-word emphasis. */
.split-word--bold {
  font-weight: inherit;
}

/* "Untitled blend" FLOW gradient: blur 13px + scale(1 + 13/200), as in the export */
.gradient-flow {
  filter: blur(13px) brightness(0.85); /* a slightly darker take on the exported palette */
  transform: scale(1.065);
}

/* ==========================================================================
   Stacked boxes (>= 720px)
   From "L'energia è ovunque" to the contact box, every box is one card in a pile: each sticks near the top while the next
   slides up over it, leaving a rounded edge of the previous ones visible.
   Each card keeps the height of its content; a covered card is trimmed to the
   height of the one covering it (site.js). Under 720px the page keeps its plain flow.
   ========================================================================== */

.stack-shade {
  position: absolute;
  inset: 0;
  z-index: 50;
  border-radius: inherit;
  background: #0b0d18;
  opacity: 0;
  pointer-events: none;
}

@media (min-width: 720px) {
  /* The footer is not part of the pile: after the last card it simply
     scrolls in normally, as a plain block. */
  .page {
    position: relative;
    z-index: 1;
    background: var(--paper);
  }

  /* The footer sits inside .stack, so the pile stays stuck (compact) until the
     footer has scrolled all the way in; flow-root keeps its bottom margin inside. */
  .stack {
    display: flow-root;
  }

  /* A fully covered card shows just its plain background in the pile's edge. */
  .stack-card > *:not(.stack-shade):not(.gradient-canvas) {
    transition: opacity 0.3s ease;
  }

  .stack-card.is-covered > *:not(.stack-shade):not(.gradient-canvas) {
    opacity: 0;
  }

  .stack-card {
    --peek: 12px;
    position: sticky;
    top: calc(var(--stack-top, 12px) + var(--i, 0) * var(--peek));
    margin: 0 12px 12px;
    min-height: clamp(380px, 50svh, 520px); /* small cards stay comfortably big */
    border-radius: var(--radius-lg);
    transform-origin: 50% 0;
    overflow: hidden;
  }

  /* All cards are the same light grey; a very faint shadow along each card's top
     edge falls on the card it covers, so a pile still reads as layers. */
  .stack-card {
    box-shadow: 0 -8px 26px -10px rgba(16, 19, 34, 0.1), 0 -1px 6px rgba(16, 19, 34, 0.04);
  }

  /* One rhythm for every card: same padding, same left edge, text top-aligned. */
  .stack-card {
    /* 2.5% of the card's width (set by site.js as --card-pad): the same margin
       as the footer's logo and text, on top and on both sides. */
    --pad-x: var(--card-pad, clamp(24px, 2.5vw, 48px));
    --pad-y: var(--card-pad, clamp(24px, 2.5vw, 48px));
    padding: var(--pad-y) var(--pad-x);
  }

  /* Small text keeps its box width but never leaves a lone word on a line. */
  .stack-card p {
    text-wrap: pretty;
  }

  /* Same anatomy in every card:
     - title: top-left, at the card padding, same size and line-height;
     - small text: right under the title;
     - navigation button: top-right, centered on the title's first line. */
  .stack-card h2 {
    margin: 0;
    text-align: left;
  }

  /* Content spans the card's inner width, so every card shares the same left edge. */
  .stack-card .projects__inner,
  .stack-card .contact__heading,
  .stack-card .contact__inner {
    max-width: none;
    margin-inline: 0;
  }

  .stack-card .statement__cta,
  .stack-card .projects__cta,
  .trust.stack-card .trust__cta {
    position: absolute;
    top: calc(var(--pad-y) + (clamp(30px, 4.8vw, 58px) - 33px) / 2);
    right: var(--pad-x);
    margin: 0;
  }

  /* These wrappers were positioned; the button must anchor to the card. */
  .statement--video .statement__inner,
  .trust.stack-card .trust__closing {
    position: static;
  }

  .statement--video .statement__inner > * {
    position: relative;
    z-index: 1;
  }

  .statement--video .statement__cta {
    position: absolute;
    z-index: 2;
  }

  .trust.stack-card {
    background: var(--gray-bg);
    text-align: left;
  }

  /* Trust: the small "Studio tecnico" line sits under the title like the
     other cards' small text; logos and closing line align to the left edge. */
  .trust.stack-card .trust__inner {
    display: flex;
    flex-direction: column;
    margin-inline: 0;
  }

  .trust.stack-card .eyebrow {
    order: 2;
    margin-top: 16px;
    font-size: 14px;
    line-height: var(--lh-text);
    white-space: nowrap; /* the whole sentence on one line */
  }

  .trust.stack-card .trust__cloud {
    margin: 48px 0 0;
    max-width: none;
  }

  .trust.stack-card .trust__closing {
    justify-content: flex-start;
    margin-top: 0;
  }

  .projects.stack-card .projects__head {
    margin-bottom: var(--head-gap, 24px);
  }

  .contact.stack-card {
    background: var(--gray-bg);
  }

  .contact.stack-card h2 {
    margin-bottom: 48px;
  }
}

/* The first card and the last one (contact) stay dark; the ones between are light grey. */
.statement:not(.statement--video) {
  background: var(--navy);
}

.statement:not(.statement--video) h2 {
  color: var(--text-on-dark);
}

.statement:not(.statement--video) p {
  color: var(--text-on-dark-muted);
}

@media (min-width: 720px) {
  .contact.stack-card {
    background: var(--navy);
  }

  .contact.stack-card h2 {
    color: var(--text-on-dark);
  }

  .contact.stack-card .contact__intro p,
  .contact.stack-card .contact__note,
  .contact.stack-card .form__checkbox {
    color: var(--text-on-dark-muted);
  }
}

/* ==========================================================================
   Tying the hero and the cards together: a recurring green (the logo's), the
   same fine grain everywhere, and a softer hand-over from the hero to the pile.
   ========================================================================== */

:root {
  --accent: var(--green); /* the one brand green, #4cba58 (defined in :root above) */
  --accent-deep: #4e8754;
}

::selection {
  background: var(--accent);
  color: var(--navy);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Links: a green underline, and green on hover in the footer. */
p a {
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.site-footer__col a:hover,
.site-footer__nav a:hover {
  color: var(--accent);
}

/* Small green dot before the Vision / Mission labels. */
/* The same fine grain as the hero, very faint, on every card and the footer.
   (A blend mode on a big card that scales and is clipped while you scroll made Chrome stutter: see the
   override below for the stacked cards.) */
.stack-card::after,
.site-footer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background-image: url("../images/grain.jpg");
  background-size: 256px 256px;
  image-rendering: pixelated;
  mix-blend-mode: overlay;
  opacity: 0.05;
  pointer-events: none;
}

/* Hero: the gradient darkens towards navy at the bottom of its box, so
   Vision / Mission also read well against it. */
.hero__frame::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  z-index: 1;
  background: linear-gradient(180deg, rgba(16, 19, 34, 0) 0%, rgba(16, 19, 34, 0.78) 100%);
  pointer-events: none;
}

.statement:not(.statement--video) .statement__inner {
  position: relative;
  z-index: 2;
}

@media (min-width: 720px) {
  .statement:not(.statement--video).stack-card,
  .contact.stack-card {
    box-shadow: 0 -8px 26px -10px rgba(16, 19, 34, 0.1), 0 -1px 6px rgba(16, 19, 34, 0.04);
  }
}

/* Referenze: the box has no shadow. */
@media (min-width: 720px) {
  .page-referenze .stack-card,
  .page-referenze .statement:not(.statement--video).stack-card {
    box-shadow: none;
  }
}

/* The footer sits the same 12px from the last card as the cards do from each other. */
.stack .site-footer {
  margin-top: 12px;
}

/* Short windows: no pile, the cards simply scroll one after another. */
.stack.no-pile .stack-card {
  position: relative;
  top: auto;
  transform: none;
  clip-path: none;
}

.stack.no-pile .stack-card > * {
  opacity: 1;
}

/* The dimming layer belongs to the pile only. */
.stack.no-pile .stack-shade {
  display: none;
}

/* ==========================================================================
   Projects page
   Same anatomy as the Home cards: title top-left, small text (14px) below, nav
   button top-right. The project rows follow: 14px text, one title size, 10px tiles.
   ========================================================================== */

/* No card treatment here: .hero and .hero__frame are left exactly as the home
   page defines them (full-bleed, 100svh, plain navy) — the logo ends up the
   exact same size, and plays the exact same entrance animation, on every page. */
/* A compact banner, not the home page's full screen: just enough room for the
   name and a little breathing space, so the actual page content sits close by. */
/* No boxed hero at all any more: the page name sits directly on the page's
   own (white) background, like a heading, top-left, with the same gutter
   every other section uses. */
.page-title {
  padding: clamp(6px, 1.4vw, 14px) var(--gutter) clamp(4px, 1vw, 8px);
}

/* Referenze: the small animated icon that sat next to the title on the
   original site, scaled off the title's own font-size so it stays in
   proportion whatever the viewport. */
.page-title--with-icon {
  display: flex;
  align-items: center; /* the icon is centred on the title's own height */
  gap: clamp(6px, 1.4vw, 18px);
}

/* .hero__wordmark-text normally claims width:100% (needed elsewhere, so the
   transition wheel's words size correctly) — here that would shove the icon
   off to the far right instead of right next to the word, so it only takes
   the space its own text needs. */
.page-title--with-icon .hero__wordmark-text {
  width: auto;
}

.page-title__icon {
  flex: none;
  /* Noticeably bigger than the title's own clamp(40px, 9vw, 140px) — an "em"
     here would size off the wrong element (the header, not the h1's own
     larger font-size), so it's spelled out the same way instead, at 1.5x. */
  width: clamp(60px, 13.5vw, 210px);
  height: clamp(60px, 13.5vw, 210px);
}

/* Per-page nudges: same idea (size relative to the title, distance pulled in
   with a negative margin instead of touching the shared gap), tuned by eye
   per icon since they're not all drawn with the same amount of empty margin
   inside their own frame. */
.page-title__icon--progetti {
  width: clamp(69px, 15.5vw, 242px);
  height: clamp(69px, 15.5vw, 242px);
  margin-left: clamp(-14px, -3.2vw, -42px);
}

.page-title__icon--contatti,
.page-title__icon--team {
  width: clamp(69px, 15.5vw, 242px);
  height: clamp(69px, 15.5vw, 242px);
  margin-left: clamp(-16px, -3.6vw, -48px);
}

.page-title__icon--servizi {
  width: clamp(48px, 10.8vw, 168px);
  height: clamp(48px, 10.8vw, 168px);
  margin-left: clamp(-6px, -1.4vw, -18px);
}

/* Every page but the home one opens straight on its own name, big and bold
   (not the drawn logo — real text, so the transition wheel can spin through
   every page's name in the same type). Arriving fresh, it rises into place
   once (setupPageHeroWord); arriving via the wheel (setupPageTransition) it's
   already sitting there, done. */
.hero__wordmark-text {
  display: block;
  width: 100%;
  margin: 0;
  color: var(--navy);
  font-family: var(--ff);
  font-weight: 750; /* Inter is loaded as a variable font (wght 100-900) so in-between weights work */
  font-size: var(--fs-page);
  line-height: 0.92;
  letter-spacing: var(--ls-title);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Page transition: a vertical wheel of every page's name on the same paper
   background as the rest of the site, the one you're headed to sharp and
   centred, the rest blurred — see setupPageTransition(). */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--paper);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-transition__wheel {
  position: absolute;
  left: clamp(20px, 5vw, 64px); /* matches .page-title's own left gutter */
  top: 0;
  display: flex;
  flex-direction: column;
}

.page-transition__word {
  width: auto;
  margin: 0.06em 0;
}

.projects-list {
  margin: 12px;
  border-radius: var(--radius-lg);
  background: var(--gray-bg);
}

/* From 720px the pile gives the card its padding (2.5% of its width, like the others). */
@media (max-width: 719px) {
  .projects-list {
    padding: 24px 16px;
  }
}

/* The projects: rows of slats, one open per row (site.js). No card around them, so no
   inner padding: the rows line up with the hero and the cards (12px from the edges). */
.projects-list {
  display: block;
  padding: 0;
  margin: 12px;
  background: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.projects-list::after,
.projects-list .stack-shade {
  display: none;
}

.pstrip {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prow {
  display: flex;
  gap: 10px;
  height: clamp(320px, 48svh, 480px);
}

.proj {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--navy);
  cursor: pointer;
  outline-offset: 3px;
}

.proj__media,
.proj__media video,
.proj__media .vposter {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Soft veil at the bottom, so the name reads on any picture. */
.proj__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(to top, rgba(16, 19, 34, 0.55), rgba(16, 19, 34, 0));
  pointer-events: none;
}

.proj__dim {
  position: absolute;
  inset: 0;
  background: var(--navy);
  opacity: 0.3;
  pointer-events: none;
}

.proj__label .proj__client,
.proj__label .proj__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proj__label .proj__client {
  margin-bottom: 3px;
  font-size: var(--fs-label);
  font-weight: 500;
  opacity: 0.8;
}

.proj__label {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  margin: 0;
  color: #fff;
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
}

/* ---- lightbox: full screen, white, a fine "spec sheet" ---- */
.has-lightbox {
  overflow: hidden;
}

/* full screen: the floating menu would sit on top of the media, so it steps aside */
.has-lightbox .nav-dock {
  opacity: 0;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: block;
  padding: 0;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__scrim {
  position: absolute;
  inset: 0;
  background: #fff;
}

.lightbox__panel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(240px, 42svh) 1fr;
  width: 100%;
  height: 100svh;
  overflow-y: auto;
  background: #fff;
}

@media (min-width: 860px) {
  .lightbox__panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 100%;
    overflow: hidden;
  }
}

/* the media sits inset in the white, with soft corners */
.lightbox__media {
  position: relative;
  margin: var(--sp-3);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #f1f1f1;
}

@media (min-width: 860px) {
  .lightbox__media {
    min-height: 0;
    margin: var(--sp-4) 0 var(--sp-4) var(--sp-4);
  }
}

.lightbox__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox__body {
  overflow-y: auto;
  padding: clamp(28px, 5vw, 72px) clamp(24px, 5vw, 80px) clamp(40px, 6vw, 80px);
}

@media (min-width: 860px) {
  .lightbox__body {
    padding-top: clamp(72px, 9vh, 112px); /* room for the close button */
  }
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #101322; /* same dark as the site's buttons and the menu */
  color: #f1f1f1;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.lightbox__close:hover {
  transform: scale(1.06);
}

.lightbox__client {
  margin: 0 0 var(--sp-3);
  color: var(--navy);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: var(--lh-text);
}

.lightbox__title {
  margin: 0 0 var(--sp-5);
  max-width: 14ch;
  color: var(--navy);
  font-size: var(--fs-tile); /* same as a tile title (.svc-tile h3) */
  font-weight: 600;
  line-height: var(--lh-title);
  letter-spacing: -0.04em;
}

/* a label above each value */
.lightbox__data {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 640px;
  margin: 0;
}

.ld {
  padding: var(--sp-3) 0;
}

.ld--facts {
  display: grid;
  grid-template-columns: 1fr 1fr; /* year | type, each label above its value */
  grid-template-rows: auto auto;
  grid-auto-flow: column;
  gap: 0 var(--sp-4);
}

/* label and value are the same text style (14px, Medium): only the colour tells them apart */
.ld dt {
  margin: 0;
  color: var(--navy);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: var(--lh-text);
}

.ld dd {
  margin: 0 0 var(--sp-3);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: var(--lh-text);
  text-wrap: pretty;
}

.ld dd:last-child {
  margin-bottom: 0;
}

/* Phone: each group is a vertical accordion (rows of 64px, one open) that site.js keeps in
   place while you scroll; the wrapper .proj-pin gives it the scroll room. */
@media (max-width: 719.98px) {
  .prow {
    flex-direction: column;
    gap: 8px;
    height: auto;
  }

  .proj-pin > .prow {
    position: sticky;
    top: 16px;
  }

  .pstrip {
    gap: 12px;
  }

  .proj {
    flex: none;
    height: 64px;
    border-radius: var(--radius-sm);
  }

  .proj__media video,
  .proj__media .vposter {
    inset: auto 0 auto 0;
    top: 50%;
    height: var(--open-h, 360px);
    margin-top: calc(var(--open-h, 360px) / -2);
    transform: none;
  }

  .proj__label {
    left: 16px;
    right: 16px;
    bottom: 12px;
    font-size: var(--fs-text);
  }

  .proj__label .proj__client {
    margin-bottom: 2px;
  }
}

/* Words wrapped by site.js for the cursor interaction. */
.cw {
  display: inline-block;
}

/* ==========================================================================
   Contact page: a text-message conversation on a white ground: the sender's name above each bubble, the
   bubble with one shorter corner (no avatars, no typing dots; site.js brings each message in as you
   scroll). "Tu" on the left (light grey bubbles), "Pampuri" on the right (green bubbles).
   ========================================================================== */

.chat-card,
.chat-card.stack-card {
  background: transparent; /* the messages sit straight on the white page */
  border-radius: var(--radius-lg);
  box-shadow: none;
}

/* no grain, no shade layer: they would tint the white ground grey */
.chat-card::after,
.chat-card .stack-shade {
  display: none;
}

/* From 720px the pile gives the card its margin and padding (2.5% of its width). */
@media (max-width: 719px) {
  .chat-card {
    margin: 12px;
    padding: 24px 16px;
  }
}

/* The floating nav dock always sits over the bottom ~90px of the screen — extra
   room here so the last message never ends up hidden behind it (after the
   padding above, from either breakpoint). */
.chat-card {
  padding-bottom: calc(24px + 90px);
}

@media (min-width: 720px) {
  .chat-card {
    padding-bottom: calc(var(--pad-y, clamp(24px, 2.5vw, 48px)) + 90px);
  }

  /* On a large screen the chat sits on a light grey card like the other light cards; the "Tu" bubbles turn white so they stand out. */
  .chat-card,
  .chat-card.stack-card {
    background: var(--gray-bg);
  }

  .chat__msg--in .chat__bubble {
    --bub: var(--paper);
  }
}

.chat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  width: min(100%, 760px);
  margin-inline: auto;
}

.chat__msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.chat__msg--out {
  align-items: flex-end;
}

.chat__name {
  padding: 0 var(--sp-4);
  color: var(--text-muted);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
}

.chat__bubble {
  --bub: var(--gray-bg);
  position: relative;
  max-width: min(440px, 84%);
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  background: var(--bub);
  color: var(--navy);
}

.chat__msg--out .chat__bubble {
  --bub: var(--green);
}

.chat__msg--in .chat__bubble {
  border-bottom-left-radius: 6px;
}

.chat__msg--out .chat__bubble {
  border-bottom-right-radius: 6px;
}

.chat__bubble p {
  margin: 0;
  font-size: 14px;
  line-height: var(--lh-text);
  text-wrap: pretty;
}

.chat__bubble--link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.chat__bubble--link:hover {
  filter: brightness(0.96);
  transform: translateY(-2px);
}

.chat__link {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Team page
   ========================================================================== */

/* Light version of the statement card (the dark one is the default). */
.statement.statement--light {
  background: var(--gray-bg);
}

.statement.statement--light h2 {
  color: var(--navy);
}

.statement.statement--light p {
  color: var(--text-muted);
}

/* Story: two columns of small text under the title. */
.prose-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 48px;
}

@media (min-width: 720px) {
  .prose-cols {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-top: 64px;
  }
}

.statement .prose p {
  margin: 0 0 16px;
  max-width: 54ch;
}

.statement .prose p:last-child {
  margin-bottom: 0;
}

.statement .prose p.prose__label {
  color: var(--text-on-dark);
  font-weight: 600;
}

/* Team note: two white cards with the story text, in the first row next to the founders. */
.team-note {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
  min-width: 0;
}

@media (min-width: 560px) {
  .team-note {
    grid-template-columns: 1fr 1fr;
  }
}

.note-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 0 0 var(--sp-4); /* side/top spacing is on the children: padding on the card itself
                        would widen it beyond a portrait slot (flex-basis 0) */
  border-radius: var(--radius-lg);
  background: var(--gray-bg);
}

.note-card h3 {
  margin: var(--sp-4) var(--sp-4) var(--sp-2);
  color: var(--navy);
  font-size: var(--fs-intro);
  font-weight: 600;
  letter-spacing: var(--ls-mid);
  line-height: var(--lh-mid);
}

.note-card p {
  margin: 0 var(--sp-4);
  color: var(--text-muted);
  font-size: 14px;
  line-height: var(--lh-text);
  text-wrap: pretty;
}

@media (min-width: 1000px) {
  /* in the first row each card takes one portrait slot, as tall as a portrait */
  .team-row > .note-card {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    height: clamp(340px, 50svh, 470px);
  }
}

/* People: portrait videos in rows (2, 3, 5, 4), plays on hover. */
.team-rows {
  display: grid;
  gap: var(--sp-3);
  margin-top: 48px;
}

.team-row {
  display: flex;
  gap: 12px;
}

.person {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: clamp(340px, 50svh, 470px);
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--navy);
}

.person__media {
  position: absolute;
  inset: 0;
}

/* Every face lands on the same point of the card (50% across, --face-y down), whatever the
   framing of the source video, and the card is ALWAYS completely filled: the video is
   drawn at least as big as the card in both directions and its position is clamped so no
   edge can ever come inside the card.
   --fx / --fy: the face's centre in the frame (0-1); --s: how much taller than the card
   the video is drawn (bigger = tighter on the face); --rat: the frame's width / height.
   Values are set per portrait in team.html. Sizes come from the card itself (container
   query units on .person__media). */
.person__media {
  container-type: size;
}

.person__media video,
.person__media .vposter {
  --face-y: 0.34;
  --r: var(--rat, 0.771);
  /* height of the drawn video: the wanted zoom, but never less than what fills the width */
  --k: max(calc(var(--s, 1.5) * 100cqh), calc(100cqw / var(--r)));
  position: absolute;
  max-width: none;
  width: calc(var(--k) * var(--r));
  height: var(--k);
  left: clamp(calc(100cqw - var(--k) * var(--r)), calc(50cqw - var(--fx, 0.5) * var(--k) * var(--r)), 0px);
  top: clamp(calc(100cqh - var(--k)), calc(var(--face-y) * 100cqh - var(--fy, 0.3) * var(--k)), 0px);
  object-fit: cover;
}

.person figcaption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 56px 18px 16px;
  font-size: 14px;
  line-height: var(--lh-text);
  background: linear-gradient(to top, rgba(6, 12, 28, 0.85), rgba(6, 12, 28, 0));
  pointer-events: none;
}

.person figcaption strong {
  color: #fff;
  font-weight: 600;
}

.person figcaption span {
  color: rgba(255, 255, 255, 0.65);
}

.person:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

@media (max-width: 719px) {
  .person {
    height: 260px;
  }
}

/* Join: open positions and how to apply (dark card). */
.join__label {
  margin: var(--sp-6) 0 var(--sp-3);
}

.statement.join-card p.join__label {
  margin: var(--sp-6) 0 var(--sp-3);
  max-width: none;
  color: var(--text-on-dark);
  font-weight: 600;
}

.positions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 720px) {
  .positions {
    grid-template-columns: 1fr 1fr;
  }
}

.position {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(251, 251, 251, 0.06);
}

.join-card .position p,
.join-card .steps p {
  margin: 0;
  max-width: none;
}

.join-card .position p.position__role {
  color: var(--text-on-dark);
  font-weight: 600;
}

.join-card .position p.position__area {
  margin-bottom: var(--sp-3);
}

.position dl {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
}

.position dt {
  color: var(--text-on-dark);
  font-size: 14px;
  font-weight: 600;
  line-height: var(--lh-text);
}

.position dd {
  margin: 0;
  color: var(--text-on-dark-muted);
  font-size: 14px;
  line-height: var(--lh-text);
}

.position ul {
  margin: 0;
  padding-left: 18px;
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.steps li {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.steps li > span {
  color: var(--text-on-dark-muted);
  font-size: 14px;
  font-weight: 600;
}

.steps strong {
  color: var(--text-on-dark);
  font-weight: 600;
}

.steps a,
.join__note a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.statement.join-card p.join__note {
  margin-top: var(--sp-5);
  max-width: none;
}

/* Team: no box, no title — the portraits (and the two note cards) sit straight on the page. */
.team-plain {
  margin: 0 var(--sp-3) var(--sp-4);
  padding: 0 var(--card-pad, clamp(16px, 2.5vw, 40px));
}

.team-plain .team-rows {
  margin-top: 0;
}

/* Join: no box — the content sits straight on the page (dark text on the paper). */
.statement.join-plain:not(.statement--video) {
  background: transparent;
  margin: var(--sp-4) var(--sp-3) var(--sp-6);
  padding: 32px var(--card-pad, clamp(16px, 2.5vw, 40px)) 0;
}

.statement.join-plain h2 {
  color: var(--navy);
}

.statement.join-plain p,
.join-plain .position dd,
.join-plain .steps li > span {
  color: var(--text-muted);
}

.statement.join-plain p.join__label,
.statement.join-plain .position p.position__role,
.join-plain .position dt,
.join-plain .steps strong {
  color: var(--navy);
}

/* the "light" button becomes the dark one on the paper */
.join-plain .btn--light {
  background: #101322;
  color: #f1f1f1;
}

/* open positions: no filled cards, just a hairline above each */
.join-plain .position {
  padding: var(--sp-4) 0 var(--sp-2);
  border-radius: 0;
  background: transparent;
  border-top: 1px solid rgba(16, 19, 34, 0.16);
}

/* Join intro: the title on one line, the text right under it. */
.join-intro__text {
  margin-top: var(--sp-4);
}

.statement.join-plain .join-intro__text p {
  margin: 0 0 var(--sp-3);
  max-width: 62ch;
  line-height: var(--lh-text);
}

.statement.join-plain .join-intro__text p:last-child {
  margin-bottom: 0;
}

.statement.join-plain .join-intro__text p.join-intro__lead {
  color: var(--navy);
}

.join-plain .join__label {
  margin-top: var(--sp-6);
}

/* Join: two separate offers and how to apply — same tile language as Services
   (grey tiles, big rounded corners, small "boxes" for the technical details). */
.join-plain .join__count {
  display: inline-block;
  margin-left: var(--sp-2);
  padding: 2px var(--sp-2);
  border-radius: 100px;
  background: #f1f1f1;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  vertical-align: 1px;
}

.jobs {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

@media (min-width: 860px) {
  .jobs {
    grid-template-columns: 1fr 1fr;
  }
}

.job {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  background: #f1f1f1;
}

.job__head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}

.job__no {
  flex: none;
  padding: var(--sp-1) var(--sp-2);
  border-radius: 100px;
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.job h3 {
  margin: 0;
  color: var(--navy);
  font-size: var(--fs-tile);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: var(--lh-title);
}

.statement.join-plain .job p.job__area {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: var(--lh-text);
}

.statement.join-plain .job p.job__desc {
  margin: 0;
  max-width: 52ch;
  color: var(--text-muted);
  font-size: 14px;
  line-height: var(--lh-text);
}

.job__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}

.spec {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--radius-md);
  background: #fff;
}

.spec span,
.job__req-title {
  color: var(--text-muted);
  font-size: var(--fs-text);
  font-weight: 500;
  letter-spacing: var(--ls-text);
  line-height: var(--lh-text);
}

.spec b {
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
  line-height: var(--lh-text);
}

.job__req {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.job__req ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.job__req li {
  position: relative;
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--navy);
  font-size: 14px;
  line-height: var(--lh-text);
}

.job__cta {
  align-self: flex-start;
  margin-top: auto;
}

.statement.join-plain .jobs + p.join__label {
  margin-top: var(--sp-5);
}

/* How to apply: four numbered rows, one under the other (number | title | detail). */
.apply {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.apply__step {
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: var(--sp-3);
  row-gap: 2px;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  background: #f1f1f1;
}

@media (min-width: 720px) {
  .apply__step {
    grid-template-columns: 28px minmax(180px, 260px) 1fr;
    align-items: center;
    padding: var(--sp-3) var(--sp-4);
  }
}

@media (max-width: 719px) {
  .apply__n {
    grid-row: 1 / span 2; /* on a phone the number sits beside title + detail */
    align-self: start;
  }
}

.apply__n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font-size: var(--fs-label);
  font-weight: 600;
}

.apply__step h4 {
  margin: 0;
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: var(--ls-text);
  line-height: var(--lh-text);
}

.statement.join-plain .apply__step p {
  margin: 0;
  max-width: none;
  color: var(--text-muted);
  font-size: 14px;
  line-height: var(--lh-text);
}

.statement.join-plain .apply__step p a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Services page: no big grey box — the intro (small) and the tiles sit straight on the page,
   aligned with the other cards' inner margin. */
.page-servizi .statement.statement--light {
  margin: 0 var(--sp-3) var(--sp-4);
  padding: 0 var(--card-pad, clamp(16px, 2.5vw, 40px));
  border-radius: 0;
  background: transparent;
}

/* Referenze page: no big grey box — the small intro and the logos sit straight on the page. */
.page-referenze .statement.statement--light {
  margin: 0 var(--sp-3) var(--sp-4);
  padding: 0 var(--card-pad, clamp(16px, 2.5vw, 40px));
  border-radius: 0;
  background: transparent;
}

/* the grain layer that every card carries would still tint the area as a faint grey box */
.page-referenze .stack-card::after {
  display: none;
}

/* the logo wall spans the same width as the text (it was centred in a 1100px column) */
.page-referenze .trust__cloud--page {
  max-width: none;
  margin: var(--sp-5) 0 0;
  gap: var(--sp-5) var(--sp-4);
}

@media (min-width: 720px) {
  .page-referenze .trust__cloud--page {
    gap: var(--sp-6) var(--sp-5);
  }
}

@media (min-width: 1000px) {
  .page-referenze .trust__cloud--page {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--sp-7) var(--sp-6);
  }
}

/* a bit smaller, so there is more air around each logo */
.page-referenze .trust__cloud--page img {
  height: clamp(48px, 6vw, 72px);
}

.page-referenze .statement .svc-intro,
.page-referenze .statement.statement--light p.svc-intro {
  max-width: 62ch;
  margin: 0 0 var(--sp-4);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: var(--lh-text);
}

/* the intro text now lives in the green tile, at the bottom like the other tiles' descriptions */
.svc-tile.svc-tile--green p.svc-tile__lead {
  max-width: 46ch;
  margin-top: auto;
  color: var(--navy);
  font-size: 14px;
  line-height: var(--lh-text);
}

/* ==========================================================================
   Services page
   ========================================================================== */
:root {
  /* every animated bar on this page (audit's horizontal bars, industria 5.0's
     vertical bars, the site-supervision slider) shares this thickness and corner
     radius, so they read as one consistent bar/progress language. */
  --bar-thick: 8px;
  --bar-radius: 4px;
}

.statement .svc-intro,
.statement.statement--light p.svc-intro {
  max-width: 34ch;
  margin: 0 0 56px;
  color: var(--navy);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 500;
  letter-spacing: -0.033em;
  line-height: 1.14;
}

.svc-grid,
.svc-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.svc-grid + .svc-tile,
.svc-tile + .svc-steps,
.svc-steps + .svc-grid {
  margin-top: 12px;
}

@media (min-width: 720px) {
  .svc-grid {
    grid-template-columns: 1fr 1fr;
  }
  .svc-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.svc-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  padding: var(--sp-5);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #f1f1f1;
}

.svc-tile h3 {
  max-width: 14ch;
  margin: 0;
  color: var(--navy);
  font-size: var(--fs-tile);
  font-weight: 600; /* matches .section-heading, used everywhere else on the site */
  letter-spacing: -0.04em;
  line-height: var(--lh-title);
}

.svc-tile p {
  margin: 0;
  max-width: 34ch;
  color: var(--text-muted);
  font-size: var(--fs-text);
  line-height: var(--lh-text);
}

.svc-tile p a {
  color: var(--navy);
  text-decoration: underline;
}

.svc-vis {
  display: flex;
  flex: 1;
  align-items: center;
  margin: 16px 0;
  color: var(--navy);
}

.svc-tile--green {
  background: var(--green);
}

.svc-tile--green p {
  color: var(--navy);
}

.svc-tile--wide {
  min-height: 242px;
}

.svc-tile--wide h3 {
  max-width: 16ch;
}

.svc-sun {
  position: absolute;
  top: 24px;
  right: 32px;
  flex: none;
  margin: 0;
}

/* Electrical: six icons slide in and line up */
.svc-icons {
  gap: 10px;
}

.svc-icons span {
  display: block;
  width: 30px;
  height: 30px;
  /* the icon itself is used as a mask (set inline, so its url() resolves against the
     page rather than this stylesheet), so every one renders in the exact same green
     regardless of the colour baked into its source PNG */
  background: var(--green);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* Lighting: five bulbs switching on one after the other */
.svc-lights {
  gap: 24px;
}

.svc-light {
  position: relative;
  flex: 0 1 41px; /* narrower screens shrink the bulbs, but they stay round: the height follows the width */
  min-width: 0;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--green);
}

.svc-light i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--paper);
}

/* Home automation: a voice command and its answer */
.svc-chat {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

.svc-chat span {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: var(--lh-text);
}

.svc-chat__in {
  max-width: 260px;
  background: var(--navy);
  color: var(--paper);
}

.svc-chat .svc-chat__in {
  border-bottom-left-radius: 3px; /* WhatsApp-style tail corner (extra specificity beats ".svc-chat span") */
}

.svc-chat__out {
  align-self: flex-end;
  background: var(--green);
  color: var(--navy);
  font-weight: 600;
}

.svc-chat .svc-chat__out {
  border-bottom-right-radius: 3px; /* WhatsApp-style tail corner (extra specificity beats ".svc-chat span") */
}

/* Security: two cameras, each with a blinking "rec" dot */
.svc-cams {
  gap: 12px;
}

.svc-cams span {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  height: 66px;
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.svc-cams i {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

/* Site supervision: a tick that travels along the track, filling it as it goes. */
.svc-slider {
  position: relative;
  padding: 16px 0;
}

.svc-slider__track {
  position: relative;
  display: block;
  width: 100%;
  max-width: 363px;
  height: var(--bar-thick);
  border-radius: var(--bar-radius);
  background: var(--paper);
}

.svc-slider__fill {
  position: absolute;
  inset: 0;
  width: 0;
  border-radius: var(--bar-radius);
  background: #8be89c;
}

.svc-slider__handle {
  position: absolute;
  top: 50%;
  left: 0;
  width: var(--bar-thick);
  height: 26px;
  margin-top: -13px;
  border-radius: var(--bar-radius);
  background: #00cd50;
}

/* Photovoltaic steps */
.svc-step {
  min-height: 305px;
}

.svc-step h3 {
  max-width: 13ch;
  font-size: clamp(20px, 2vw, 24px);
}

.svc-step h3 span {
  display: block;
  color: var(--text-muted);
}

.svc-step__dot {
  display: block;
  width: 56px;
  height: 56px;
  margin-top: auto;
  border-radius: 50%;
  background: var(--paper);
}

.svc-steps {
  position: relative;
}

.svc-steps__go {
  display: block;
  position: absolute;
  bottom: 26px;
  left: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green);
  pointer-events: none;
}


/* Audit / industry 5.0: bars that fill up */
.svc-bars {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
}

.svc-bars span {
  display: block;
  width: calc(var(--w) * 100%);
  max-width: 100%;
  height: var(--bar-thick);
  border-radius: var(--bar-radius);
  background: var(--paper);
  overflow: hidden;
}

.svc-bars i {
  display: block;
  width: 86%;
  height: 100%;
  border-radius: var(--bar-radius);
  background: #00cd50;
  transform-origin: 0 50%;
}

/* Electromagnetic fields: pulsing rings */
.svc-rings {
  position: relative;
  justify-content: center;
}

.svc-rings i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 51px;
  height: 51px;
  margin: -25px 0 0 -25px;
  border-radius: 50%;
}

.svc-rings i:nth-child(1) {
  background: #a8fdb1;
  transform: scale(2);
}

.svc-rings i:nth-child(2) {
  background: #5ddf6b;
  transform: scale(1.5);
}

.svc-rings i:nth-child(3) {
  background: var(--green);
}

.svc-chip {
  justify-content: center;
}

.svc-cap {
  justify-content: flex-start;
}

.svc-hello span {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border-bottom-left-radius: 3px; /* WhatsApp-style tail corner: a shorter radius than
     the other three corners so it reads clearly on a small, almost-pill-shaped bubble */
  background: #2d345a;
  color: var(--paper);
  font-size: 15px;
  font-weight: 500;
}

.statement.statement--light .svc-tile--green p {
  color: var(--navy);
}

/* Real media (icons, Lottie animations) used in place of the hand-drawn placeholders. */
.svc-icons {
  position: relative;
}

.svc-chat__out {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.svc-chat__check {
  flex: none;
}

.svc-slider {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 14px;
}

.svc-slider__shots {
  display: flex;
  gap: 10px;
}

.svc-slider__shots img {
  width: 50%;
  aspect-ratio: 112 / 66;
  border-radius: 10px;
  object-fit: cover;
}

.svc-sun,
.svc-chip,
.svc-cap {
  justify-content: center;
}

.svc-sun dotlottie-player {
  width: 120px;
  height: 120px;
}

.svc-chip dotlottie-player {
  width: 96px;
  height: 96px;
}

.svc-cap dotlottie-player {
  width: 96px;
  height: 96px;
}

/* Security: two eyes (real Readymag asset) with a pupil that looks side to side. */
.svc-eyes {
  gap: 24px;
}

.svc-eye {
  position: relative;
  width: 112px;
  color: var(--navy);
  /* clips the pupil to the eye's own outline (traced from the artwork), so it can
     never visibly leave the white shape, however it's positioned by JS. */
  clip-path: polygon(
    0% 50%, 5% 40%, 10% 31%, 20% 18%, 30% 8%, 40% 2%, 50% 0%, 60% 2%, 70% 8%, 80% 18%, 90% 32%, 95% 40%,
    100% 50%,
    95% 59%, 90% 68%, 80% 82%, 70% 92%, 60% 98%, 50% 100%, 40% 98%, 30% 92%, 20% 82%, 10% 68%, 5% 60%
  );
}

.svc-eye img {
  display: block;
  width: 100%;
  height: auto;
}

.svc-eye__pupil {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  background: var(--green);
}

/* Industria 5.0: a donut chart that completes + a small vertical bar chart. */
.svc-i50 {
  gap: 20px;
}

.svc-pie {
  width: 88px;
  height: 88px;
  flex: none;
  transform: rotate(-90deg);
}

.svc-pie__track,
.svc-pie__fill {
  fill: none;
  stroke-width: 14;
}

.svc-pie__track {
  stroke: var(--paper);
}

.svc-pie__fill {
  stroke: #00cd50;
  stroke-linecap: round;
  stroke-dasharray: 311; /* 2 * PI * 49.5 */
  stroke-dashoffset: 311;
}

.svc-vbars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 88px;
}

.svc-vbars span {
  position: relative;
  display: block;
  align-self: flex-end;
  width: var(--bar-thick);
  height: calc(var(--h) * 100%);
  border-radius: var(--bar-radius) var(--bar-radius) 0 0;
  background: var(--paper);
  overflow: hidden;
}

/* Fills from the bottom to 86% of the bar's own height, leaving the same light
   "not quite there yet" cap visible at the top as the horizontal bars leave at
   their end — the two read as the same bar, just turned 90°. */
.svc-vbars i {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 86%;
  border-radius: var(--bar-radius);
  background: #00cd50;
  transform-origin: 50% 100%;
  /* the starting scaleY(0) is set by GSAP at runtime, not here — setting it in
     CSS too would make gsap.from() capture 0 as both its start AND end state,
     leaving the bar stuck invisible even once the tween "finishes" */
}

.svc-chip,
.svc-cap {
  position: relative;
}

.svc-chip__blob {
  position: absolute;
  width: 117px;
  height: 110px;
  border-radius: var(--radius-lg);
  background: #a8fdb1;
}

.svc-chip dotlottie-player {
  position: relative;
}

.svc-cap__blob {
  position: absolute;
  width: 94px;
  height: 138px;
  border-radius: var(--radius-lg);
  background: #5ddf6b;
}

.svc-cap__blob::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 12px;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  background: #a8fdb1;
  z-index: -1;
}

.svc-cap dotlottie-player {
  position: relative;
}

/* Referenze page: the full client-logo wall (53 logos), denser than the home
   page's short teaser strip since it's the page's whole point. */
.trust__cloud--page {
  max-width: 1100px;
  margin-top: 56px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 720px) {
  .trust__cloud--page {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 32px 24px;
  }
}

.trust__cloud--page img {
  height: clamp(56px, 8vw, 96px);
}



/* Cursor (see setupCursor in site.js): a small green dot, real mouse only. */
html.has-cursor,
html.has-cursor * {
  cursor: none !important;
}
html.has-cursor input,
html.has-cursor textarea,
html.has-cursor select,
html.has-cursor [contenteditable] {
  cursor: text !important;
}
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2147483000;
  width: 12px;
  height: 12px;
  pointer-events: none;
}
.cursor__dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--green);
}
.cursor__label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--navy);
  font-size: var(--fs-label, 12px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}


/* Photovoltaic: the three steps belong to the wide tile, so they sit inside it as white boxes. */
.svc-tile--wide {
  min-height: 0;
}

.svc-tile--wide .svc-steps {
  --step-pad: var(--sp-4);
  margin-top: var(--sp-5);
  gap: var(--sp-2);
}

.svc-tile--wide .svc-step {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: var(--step-pad);
  border-radius: var(--radius-md);
  background: #fff;
}

.svc-tile--wide .svc-step h3 {
  max-width: none;
  color: var(--navy);
  font-size: var(--fs-intro);
  letter-spacing: var(--ls-mid);
  line-height: var(--lh-mid);
}

.svc-tile--wide .svc-step h3 span {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-text);
  font-weight: 500;
  letter-spacing: var(--ls-text);
  line-height: var(--lh-text);
}

.svc-tile--wide .svc-step__dot {
  margin-top: var(--sp-5);
  background: var(--gray-bg);
}

.svc-tile--wide .svc-steps__go {
  left: var(--step-pad);
  bottom: var(--step-pad);
}

/* The sun icon must sit above the step boxes, not behind them. */
.svc-tile--wide .svc-sun { top: var(--sp-4); }
.svc-tile--wide .svc-sun dotlottie-player { width: 88px; height: 88px; }

/* 12px between the wide tile and the grid below, like every other gap. */
.svc-tile--wide { margin-bottom: 12px; }

/* The picture that stands in for a video until it plays (site.js, setupPosters): laid out exactly like the video,
   so nothing moves or flashes when the video takes over. */
.vposter {
  display: block;
  pointer-events: none;
}

/* A video stays invisible until its first real frame has been drawn (site.js adds .is-live),
   then fades in over the picture that stood in for it: no hard swap, whatever the browser does. */
.project-card video,
.proj__media video,
.person__media video {
  opacity: 0;
}

.project-card video.is-live,
.proj__media video.is-live,
.person__media video.is-live {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Phone: the clients block is a card like the others (grey, 23px corners, 12px from the edges,
   32px inside, text on the left, the button at the bottom right like Projects). Before, it was a
   bare full-width block with centred text. The other cards get the same 32px inside. */
@media (max-width: 719.98px) {
  .statement,
  .projects,
  .trust {
    padding: var(--sp-5);
  }

  .trust {
    margin: 24px 12px;
    border-radius: var(--radius-lg);
    background: var(--gray-bg);
    text-align: left;
  }

  .trust__inner {
    display: flex;
    flex-direction: column;
    margin-inline: 0;
  }

  .trust .eyebrow {
    order: 2;
    margin-top: 16px;
    font-size: 14px;
    line-height: var(--lh-text);
  }

  .trust__cloud {
    margin: var(--sp-5) 0 0;
    max-width: none;
    gap: 24px 16px;
  }

  .trust__cta {
    justify-content: flex-end;
    margin-top: var(--sp-5);
  }
}

/* Phone: the gradient box is exactly one screen tall (Vision / Mission are a card of their own under it, see
   setupHeroPillars) and behaves as on a computer: full screen with square corners, then it narrows to the width
   of the other cards while its corners appear (setupHeroScale). */


/* Entering a page: until the wheel of page names has played, the screen is covered with paper (the class is put on
   <html> by a script in the head, and released by site.js, setupPageTransition). */
html.is-entering::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--paper);
}

html.is-entering {
  overflow: hidden; /* the page does not scroll under the wheel */
}

/* Phone: Vision / Mission as a card under the gradient box (moved there by setupHeroPillars). */
@media (max-width: 719px) {
  .pillars.pillars--card {
    margin: 0 12px 24px;
    padding: var(--sp-5);
    gap: var(--sp-5);
    grid-template-columns: 1fr;
    background: var(--navy);
    border-radius: var(--radius-lg);
  }
}

/* Every card button sits on the right: on a phone the buttons of the statement cards (Servizi, Team) join
   Projects and Clients, and the form's Invia goes right too (on larger screens the card buttons are already
   pinned to the top right of their card). */
@media (max-width: 719px) {
  .statement__cta {
    display: flex;
    justify-content: flex-end;
  }
}

.form button[type="submit"] {
  justify-self: end;
  align-self: flex-end;
}

/* Servizi: smaller step circles, the green one moves between them (site.js), lights that stay round, and
   the sun icon kept clear of the title. */
.svc-tile--wide .svc-step__dot {
  width: 40px;
  height: 40px;
}

.svc-tile--wide .svc-steps__go {
  left: 0;
  top: 0;
  bottom: auto;
  width: 40px;
  height: 40px;
}

@media (max-width: 719px) {
  .svc-lights {
    gap: 12px;
  }

  .svc-tile--wide h3 {
    max-width: calc(100% - 104px);
  }
}

/* Last tile: "Ciao!" and the studio's answer, a two-bubble chat (the answer on the right, like in Domotica). */
.svc-hello {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

.svc-hello .svc-hello__reply {
  align-self: flex-end;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: 3px; /* the tail is on the other side */
  background: var(--paper);
  color: var(--navy);
  font-weight: 600;
}

/* Phone: the contact card of the Home is a dark card like the desktop one (the last card stays dark),
   with the same 12px margin, 23px corners and 32px inside as the others. Before, it was a bare light block. */
@media (max-width: 719px) {
  .contact.stack-card {
    margin: 24px 12px;
    padding: var(--sp-5);
    border-radius: var(--radius-lg);
    background: var(--navy);
  }

  .contact.stack-card .contact__heading {
    margin-bottom: var(--sp-5);
    color: var(--text-on-dark);
  }

  .contact.stack-card .contact__inner {
    gap: var(--sp-5);
  }

  .contact.stack-card .contact__intro p,
  .contact.stack-card .contact__note,
  .contact.stack-card .form__checkbox {
    color: var(--text-on-dark-muted);
  }

  .contact.stack-card .form__checkbox a {
    color: var(--text-on-dark);
  }
}

/* Safari on iPhone, Home: the bars take the colour of what is fixed at the edge of the screen, else the page's own
   background. The page background is the dark of the box (dark bar on top, which Daniela likes); to keep the bar at
   the bottom white, a thin white strip is fixed at the bottom edge while the page is at rest at the very top
   (site.js, setupSafariBottomTint). */
.safari-bottom-tint {
  display: none;
}

@media (max-width: 719px) {
  html.page-home,
  html.page-home body {
    background: #101322;
  }

  /* the visible page stays paper-coloured (the gaps between the cards), only what lies outside it is dark */
  html.page-home .page {
    background: var(--paper);
  }

  .safari-bottom-tint {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 12px;
    z-index: 9000;
    background: #fbfbfb;
    pointer-events: none;
  }

  .safari-bottom-tint.is-off {
    display: none;
  }
}

/* Cookie banner (site.js, setupCookieBanner): a green card, bottom left on a large screen, across the bottom on a phone,
   above the nav. */
.cookie {
  position: fixed;
  left: var(--sp-4);
  bottom: 92px;
  z-index: 9990;
  width: min(420px, calc(100vw - 2 * var(--sp-4)));
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  background: var(--green);
  color: var(--navy);
}

.cookie[hidden] {
  display: none;
}

.cookie__title {
  margin: 0 0 var(--sp-2);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: var(--ls-text);
  line-height: var(--lh-text);
}

.cookie__text {
  margin: 0 0 var(--sp-4);
  color: var(--navy);
  font-size: 14px;
  line-height: var(--lh-text);
}

.cookie__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

@media (max-width: 719px) {
  .cookie {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 96px;
    padding: var(--sp-4);
  }
}

/* Stacked cards (>= 720px): the grain has no blend mode, so a card that is scaled and clipped while you scroll
   is not blended against what is behind it on every frame (Chrome stuttered on the projects card). */
@media (min-width: 720px) {
  .stack-card::after {
    mix-blend-mode: normal;
    opacity: 0.025;
  }

  .stack-card {
    will-change: transform;
  }
}

/* Projects card on the Home: it follows the gradient box and is NOT part of the pile (no sticky, no scaling, no
   trimming): it scrolls away like a normal block. It keeps the look of the other cards (class stack-card). */
@media (min-width: 720px) {
  .stack-card.stack-card--free {
    position: relative;
    top: auto;
    min-height: 0;
    box-shadow: none;
    will-change: auto;
    margin: 0 12px 12px;
  }
}

/* Touch targets (phone / touch screens): buttons are at least 44px tall; the footer links and the small inline links get
   a larger tappable area (padding), cancelled out with a negative margin where there is room, so the layout hardly moves. */
@media (max-width: 719.98px), (pointer: coarse) {
  .btn {
    min-height: 44px;
  }

  .form__checkbox {
    min-height: 44px;
    align-items: center;
  }

  .site-footer__nav a {
    display: block;
    padding-block: 11.5px;
  }

  .site-footer__col a:not(.site-footer__nav a),
  .form__checkbox a {
    display: inline-block;
    padding-block: 14px;
    margin-block: -14px;
  }
}
