/**
 * Crescita Studio: Portfolio (scroll-craft redesign 2026-10-24; was Laboratorio digitale).
 * Gallery grammar. Pass 3, 2026-10-26 (founder: video first, styles below, the tools spread
 * out and revealed progressively): white hero with the video; the five website styles on
 * Midnight as a stacked deck that portfolio.js deals into their grid; then the tools in four
 * chapters on alternating grounds, each with its own even layout and its own reveal, under a
 * sticky chapter index; the close on white. laboratorio.css and lab-pro.css style the widgets,
 * style-demos.css the style cards and their dialog.
 */
body.crescita-page-pf {
  --sc-canvas: #fff;
  --sc-surface: #fff;
  --sc-ink: var(--crescita-midnight);
  --sc-ink-soft: var(--color-text-secondary);
  --sc-accent: var(--crescita-ocean-bright);
  --sc-accent-ink: #fff;
  --sc-font-display: var(--font-primary);
  --sc-font-text: var(--font-primary);
  --sc-font-mono: var(--font-secondary);
  font-family: var(--font-primary);
}
.pf {
  --pf-head: 72px;          /* the sticky header, measured by portfolio.js */
  --pf-gutter: clamp(1.25rem, 5vw, 4rem);
  --pf-line: rgba(15, 23, 34, 0.1);
  --pf-line-dark: rgba(247, 245, 240, 0.14);
  --pf-ease: cubic-bezier(0.23, 1, 0.32, 1);
  color: var(--crescita-midnight);
  background: #fff;
}
.pf :where(h1, h2, h3, p, figure) { margin: 0; }
.pf-wrap { width: 100%; max-width: 78rem; margin-inline: auto; padding-inline: var(--pf-gutter); }

/* ── Hero: title, then the video ───────────────────────────────── */
.pf-hero { padding: clamp(3.5rem, 7vw, 5.5rem) 0 clamp(4rem, 8vw, 6rem); text-align: center; background: #fff; overflow: clip; }
.pf-hero__copy { display: grid; justify-items: center; gap: 1.125rem; }
.pf-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.375rem 0.875rem 0.375rem 0.625rem;
  font-family: var(--font-secondary); font-size: 0.8125rem; font-weight: 500; color: var(--crescita-ocean);
  border: 1px solid rgba(30, 58, 95, 0.18); border-radius: 999px;
}
.pf-eyebrow::before { content: ""; width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: var(--crescita-ocean-bright); box-shadow: 0 0 0 3px rgba(46, 90, 143, 0.16); }
/* Wide enough to set in two lines on desktop (founder, 2026-10-26). */
.pf .pf-title { max-width: 24ch; margin: 0; font-size: clamp(2.375rem, 1.6rem + 3vw, 4.25rem); font-weight: 700; line-height: 1.04; letter-spacing: -0.035em; text-wrap: balance; }
.pf-lede { max-width: 46ch; font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem); color: var(--color-text-secondary); }

.pf-video { display: grid; gap: 1.25rem; max-width: 68rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.pf-video__frame {
  position: relative; display: grid; place-items: center; gap: 0.75rem;
  aspect-ratio: 16 / 9; width: 100%;
  border-radius: 24px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(46, 90, 143, 0.55), transparent 60%),
    radial-gradient(90% 80% at 100% 100%, rgba(159, 193, 232, 0.25), transparent 60%),
    var(--crescita-midnight);
  box-shadow: 0 2px 4px rgba(15, 23, 34, 0.06), 0 50px 90px -40px rgba(15, 23, 34, 0.55);
}
/* The frame grows from slightly inset to full as the hero scrolls away (--sc-p from the engine). */
@media (prefers-reduced-motion: no-preference) and (min-width: 861px) {
  /* Never past 1: at 1.06 the frame covered its own caption (founder, 2026-10-26). */
  .pf-hero[data-sc-act] .pf-video__frame { transform: scale(calc(0.94 + 0.06 * min(1, var(--sc-p, 0.5) * 1.6))); transform-origin: 50% 0; }
}
.pf-video__frame video, .pf-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.pf-video__play { width: 76px; height: 76px; border-radius: 50%; background: rgba(247, 245, 240, 0.12); box-shadow: inset 0 0 0 1px rgba(247, 245, 240, 0.4); position: relative; }
.pf-video__play::after { content: ""; position: absolute; left: 31px; top: 24px; border-left: 22px solid var(--crescita-sand); border-top: 14px solid transparent; border-bottom: 14px solid transparent; } /* impeccable-disable-line side-tab border-accent-on-rounded */
.pf-video__soon { font-family: var(--font-secondary); font-size: 0.875rem; color: rgba(247, 245, 240, 0.72); }
.pf-video figcaption { position: relative; z-index: 1; font-family: var(--font-secondary); font-size: 0.875rem; color: var(--color-text-secondary); }

/* ── Shared type ───────────────────────────────────────────────── */
.pf-h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); font-weight: 600; line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance; }
.pf-line { font-size: 1.0625rem; color: var(--color-text-secondary); }
.pf-note { font-family: var(--font-secondary); font-size: 0.875rem; color: var(--color-text-secondary); }
.pf-dark .pf-h2 { color: #fff; }
.pf-dark .pf-line, .pf-dark .pf-note { color: var(--color-text-on-dark-secondary); }

/* ── Styles: the deck, on Midnight ─────────────────────────────── */
.pf-styles { padding: clamp(4.5rem, 9vw, 7rem) 0 clamp(5rem, 10vw, 7.5rem); background: var(--crescita-midnight); }
.pf-deck__head { display: grid; justify-items: center; gap: 0.5rem; margin-bottom: clamp(2rem, 4vw, 3rem); text-align: center; }
/* --deal runs 0 (stacked) to 1 (in the grid); each card carries its own offset to the stack
   (--dx, --dy), tilt (--r) and depth (--s), set by portfolio.js. */
.pf-deck { --deal: 1; text-align: left; }
.pf-deck.is-dealing .sd-card {
  transform: translate(calc(var(--dx, 0px) * (1 - var(--deal))), calc(var(--dy, 0px) * (1 - var(--deal)))) rotate(calc(var(--r, 0deg) * (1 - var(--deal)))) scale(calc(var(--s, 1) + (1 - var(--s, 1)) * var(--deal)));
  transform-origin: 50% 0;
  will-change: transform;
}
.pf-deck.is-dealing .sd-card__thumb { box-shadow: 0 calc(30px * (1 - var(--deal)) + 18px) calc(60px * (1 - var(--deal)) + 36px) -24px rgba(0, 0, 0, 0.7); }
.pf-deck.is-dealing .sd-card__open { opacity: clamp(0, var(--deal) * 2.5 - 1.5, 1); }
/* The card labels sit on Midnight here. */
.pf-styles .sd-card__name { color: #fff; }
.pf-styles .sd-card__line { color: var(--color-text-on-dark-secondary); }
.pf-styles .sd-card__go { color: #fff; border-color: var(--pf-line-dark); }
.pf-styles .sd-card__open:hover .sd-card__go, .pf-styles .sd-card__open:focus-visible .sd-card__go { background: #fff; color: var(--crescita-midnight); }

/* ── Tools: chapter index ──────────────────────────────────────── */
.pf-tools { position: relative; }
.pf-index {
  position: sticky; top: calc(var(--pf-head) + 0.75rem); z-index: 6;
  display: flex; gap: 0.25rem; width: max-content; max-width: calc(100% - 2rem);
  margin: 0 auto -3.25rem; transform: translateY(1.25rem);
  padding: 0.3125rem; border-radius: 999px; overflow-x: auto; scrollbar-width: none;
  background: rgba(255, 255, 255, 0.94); border: 1px solid var(--pf-line);
  box-shadow: 0 16px 36px -20px rgba(15, 23, 34, 0.55);
}
.pf-index a { flex: none; padding: 0.5rem 1rem; border-radius: 999px; font-size: 0.875rem; font-weight: 500; color: var(--color-text-secondary); text-decoration: none; transition: background-color 250ms ease, color 250ms ease; }
.pf-index a:hover { color: var(--crescita-midnight); background: rgba(15, 23, 34, 0.05); }
.pf-index a.is-current { color: #fff; background: var(--crescita-midnight); }
.pf-index a:focus-visible { outline: 2px solid var(--crescita-ocean-bright); outline-offset: 2px; }

/* ── Chapters ──────────────────────────────────────────────────── */
.pf-ch { padding: clamp(6rem, 11vw, 8.5rem) 0 clamp(4.5rem, 9vw, 7rem); scroll-margin-top: var(--pf-head); }
.pf-ch.pf-dark { background: var(--crescita-midnight); }
.pf-ch__n { font-family: var(--font-secondary); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; color: var(--crescita-ocean-bright); }
.pf-dark .pf-ch__n { color: #9fc1e8; }
.pf-ch__head { display: grid; justify-items: center; gap: 0.625rem; margin-bottom: clamp(2.25rem, 4.5vw, 3.25rem); text-align: center; }
.pf-ch__head .pf-line { max-width: 44ch; }

/* 01 Sito: a sticky title beside two tools that wipe in */
.pf-ch__split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr); gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
.pf-ch__side { position: sticky; top: calc(var(--pf-head) + 5rem); display: grid; gap: 0.75rem; }
.pf-ch__stack { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); }
.pf.is-js [data-pf-wipe] { clip-path: inset(0 0 100% 0 round 24px); transform: translateY(2.5rem); transition: clip-path 1100ms var(--pf-ease), transform 1100ms var(--pf-ease); }
.pf.is-js [data-pf-wipe].is-in { clip-path: inset(0 0 0 0 round 24px); transform: none; }

/* 02 Richieste: an even two-by-two */
.pf-ch__grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: stretch; }

/* 03 Assistenti: one stage, three tabs */
.pf-tabs { display: flex; justify-content: center; gap: 0.375rem; width: max-content; max-width: 100%; margin: 0 auto 1.5rem; padding: 0.3125rem; border-radius: 999px; border: 1px solid var(--pf-line); background: #fff; overflow-x: auto; scrollbar-width: none; }
.pf-tabs[hidden] { display: none; }
.pf-tabs button { flex: none; padding: 0.625rem 1.125rem; border: 0; border-radius: 999px; font: inherit; font-size: 0.9375rem; font-weight: 500; color: var(--color-text-secondary); background: transparent; cursor: pointer; transition: background-color 250ms ease, color 250ms ease; }
.pf-tabs button:hover { color: var(--crescita-midnight); background: rgba(15, 23, 34, 0.05); }
.pf-tabs button[aria-selected="true"] { color: #fff; background: var(--crescita-midnight); }
.pf-tabs button:focus-visible { outline: 2px solid var(--crescita-ocean-bright); outline-offset: 2px; }
.pf-stage { max-width: 62rem; margin-inline: auto; display: grid; gap: 1.5rem; }
.pf-stage .pf-tile[hidden] { display: none; }
.pf-stage .pf-tile.is-shown { animation: pf-panel 600ms var(--pf-ease) both; }
@keyframes pf-panel { from { opacity: 0; transform: translateY(1rem); } to { opacity: 1; transform: none; } }

/* 04 Google: three columns at three depths */
.pf-ch__grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.pf-ch__grid3 .pf-tile:nth-child(2) { margin-top: clamp(0rem, 4vw, 3rem); }

/* ── Tiles: the widget, then a museum label (same schema everywhere) ── */
.pf-tile {
  display: grid; grid-template-rows: 1fr auto; gap: 0;
  border-radius: 24px; background: var(--crescita-sand); border: 1px solid var(--pf-line);
  overflow: hidden; scroll-margin-top: 8rem;
}
.pf-dark .pf-tile { background: rgba(247, 245, 240, 0.06); border-color: var(--pf-line-dark); }
.pf-tile .lab-widget { margin: 0.625rem 0.625rem 0; border-radius: 18px; background: #fff; border: 1px solid var(--pf-line); box-shadow: 0 18px 36px -28px rgba(15, 23, 34, 0.35); color: var(--crescita-midnight); }
.pf-label { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; align-items: baseline; padding: 1.125rem 1.375rem 1.25rem; }
.pf-label h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.pf-label p { grid-column: 1; font-size: 0.9375rem; color: var(--color-text-secondary); }
.pf-dark .pf-label h3 { color: #fff; }
.pf-dark .pf-label p { color: var(--color-text-on-dark-secondary); }
.pf-label a {
  grid-column: 2; grid-row: 1 / span 2; align-self: center;
  padding: 0.375rem 0.75rem; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 500; white-space: nowrap;
  color: var(--crescita-ocean); text-decoration: none; border: 1px solid rgba(30, 58, 95, 0.2);
}
.pf-label a:hover, .pf-label a:focus-visible { background: var(--crescita-midnight); border-color: var(--crescita-midnight); color: #fff; }
.pf-dark .pf-label a { color: #9fc1e8; border-color: rgba(159, 193, 232, 0.35); }
.pf-dark .pf-label a:hover, .pf-dark .pf-label a:focus-visible { background: #fff; border-color: #fff; color: var(--crescita-midnight); }

/* ── Close ─────────────────────────────────────────────────────── */
.pf-close { padding: clamp(5rem, 11vw, 8.5rem) 0; text-align: center; background: #fff; }
.pf-close .pf-wrap { display: grid; justify-items: center; gap: 1rem; }
.pf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 0.75rem; }
.pf-fine { margin-top: 1rem !important; max-width: 52ch; font-family: var(--font-secondary); font-size: 0.8125rem; color: var(--color-text-secondary); }

@media (max-width: 1023.98px) {
  .pf-ch__split { grid-template-columns: 1fr; }
  .pf-ch__side { position: static; text-align: center; justify-items: center; }
  .pf-ch__grid3 { grid-template-columns: 1fr; max-width: 40rem; margin-inline: auto; }
  .pf-ch__grid3 .pf-tile:nth-child(2) { margin-top: 0; }
}
@media (max-width: 760px) {
  .pf-ch__grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 599.98px) {
  .pf-label { grid-template-columns: 1fr; }
  .pf-label a { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 0.5rem; }
  .pf-actions a { flex: 1 1 100%; text-align: center; }
  .pf-video__frame { border-radius: 16px; }
  .pf-index a { padding: 0.4375rem 0.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pf.is-js [data-pf-wipe] { clip-path: none; transform: none; transition: none; }
  .pf-stage .pf-tile.is-shown { animation: none; }
  .pf-index a, .pf-tabs button { transition: none; }
}
@media print {
  .pf-index, .pf-tabs, .pf-video { display: none !important; }
  .pf-stage .pf-tile[hidden] { display: grid !important; }
  .pf.is-js [data-pf-wipe] { clip-path: none; transform: none; }
  .pf-styles, .pf-ch.pf-dark { background: #fff; }
}

/* 02 Richieste as a pinned pan (founder, 2026-10-26): the chapter holds while vertical scroll slides
   the tools sideways, the heading riding in as the first item. Each card is as tall as the space under
   the header and the chapter index, and its demo scrolls inside it. The engine sets the act height and
   the travel (data-sc-span, data-sc-pan); under reduced motion it becomes a native swipe row. */
.pf-ch.pf-ch--richieste { padding: 0; }
.pf-pan__stage { display: grid; align-items: center; padding-top: calc(var(--pf-head) + 4.75rem); padding-bottom: 1.25rem; }
.pf-pan { display: flex; gap: 1.25rem; width: max-content; padding-inline: var(--pf-gutter); align-items: stretch; }
.pf-pan > * { flex: none; }
.pf-pan__lead { display: grid; align-content: center; gap: 0.75rem; width: min(26rem, 78vw); padding-right: 1.5rem; }
.pf-pan > .pf-tile { width: min(32rem, 84vw); height: calc(100svh - var(--pf-head) - 6.5rem); grid-template-rows: minmax(0, 1fr) auto; }
.pf-pan > .pf-tile .lab-widget { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
@media print { .pf-pan { flex-wrap: wrap; width: auto; } .pf-pan > .pf-tile { height: auto; } }

/* The chapter index as a band under the header (founder, 2026-10-26: "keep the bar but give the
   chapters enough top spacing that it never covers their content"). Full width and opaque, so the
   page passes under it like under the header; every chapter starts below it. */
.pf-index {
  top: var(--pf-head); width: 100%; max-width: none; margin: 0 0 -3.75rem; transform: none;
  justify-content: center; padding: 0.5rem var(--pf-gutter); border-radius: 0; border: 0;
  border-bottom: 1px solid var(--pf-line); background: rgba(255, 255, 255, 0.97); box-shadow: 0 10px 24px -20px rgba(15, 23, 34, 0.6);
}
.pf-ch { scroll-margin-top: calc(var(--pf-head) + 3.75rem); }
.pf-ch:not(.pf-ch--richieste) { padding-top: clamp(7rem, 12vw, 9rem); }
.pf-pan__stage { padding-top: calc(var(--pf-head) + 5rem); }
.pf-pan > .pf-tile { height: calc(100svh - var(--pf-head) - 7rem); }
.pf-ch__side { top: calc(var(--pf-head) + 6rem); }
.pf-tile { scroll-margin-top: calc(var(--pf-head) + 4.5rem); }
