/* ==========================================================================
   Fifth — lo sprint di cinque giorni di Nordlys Design
   Foglio di stile unico, senza dipendenze.

   Indice
   01 Token (colori, tipografia, spazi)   07 I cinque giorni e il prototipo Forma
   02 Base                                08 Sprint, scenari, percorso
   03 Elementi comuni                     09 Patti chiari, dopo, domande, studio
   04 Intestazione                        10 Chiusura e brief
   05 Apertura                            11 Piè di pagina
   06 In breve e sezioni                  12 Movimento ridotto e alto contrasto
   ========================================================================== */

/* ---------- 01 Token ---------------------------------------------------- */

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

:root {
  color-scheme: light;

  /* Neutri */
  --white: #ffffff;
  --paper: #f5f5f3;
  --ink: #0b0b0c;
  --ink-soft: #2b2c30;
  --muted: #5c5f66;
  --hair: #dcdcd8;
  --night: #0b0b0c;
  --night-muted: #b4b7bf;
  --night-hair: #34353a;
  --error: #b3261e;

  /* Aurora Nordlys: gli stessi colori del mosaico a pixel del marchio */
  --pink: #fe91f3;
  --peri: #b7b3f7;
  --sky: #69d7fb;
  --cyan: #11ffff;
  --tint-pink: #ffe5fc;
  --tint-peri: #eceafd;
  --tint-sky: #e1f5fe;
  --tint-cyan: #d8ffff;
  --aurora: linear-gradient(90deg, var(--pink), var(--peri) 38%, var(--sky) 70%, var(--cyan));

  /* Tipografia */
  --font: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --t-xs: .8125rem;
  --t-s: .9375rem;
  --t-m: 1.0625rem;
  --t-l: clamp(1.15rem, 1.05rem + .5vw, 1.375rem);
  --t-h3: clamp(1.3rem, 1.15rem + .6vw, 1.6rem);
  --t-h2: clamp(2rem, 1.2rem + 3.4vw, 3.75rem);
  --t-h1: clamp(2.75rem, 1rem + 8vw, 6.75rem);

  /* Spazi e misure */
  --gutter: clamp(20px, 5vw, 72px);
  --max: 1280px;
  --section: clamp(72px, 10vw, 150px);
  --header-h: 68px;
  --rule: 1px solid var(--ink);
}

/* ---------- 02 Base ----------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 20px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 var(--t-m)/1.6 var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { min-width: 0; border: 0; }
[hidden] { display: none !important; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3 { text-wrap: balance; }
h1 { font-size: var(--t-h1); font-weight: 600; line-height: .98; letter-spacing: -.045em; }
h2 { font-size: var(--t-h2); font-weight: 600; line-height: 1.04; letter-spacing: -.038em; }
h3 { font-size: var(--t-h3); font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }

::selection { background: var(--cyan); color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---------- 03 Elementi comuni ------------------------------------------ */

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.vh {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Etichette lunghe e corte dei giorni: su schermi stretti si vede «Lun», ma si legge sempre «Lunedì» */
.u-short { display: none; }
@media (max-width: 640px) {
  .u-full {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .u-short { display: inline; }
}

.skip-link {
  position: absolute; left: var(--gutter); top: -120px; z-index: 100;
  padding: .8em 1.1em; background: var(--ink); color: var(--white); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 10px; }

.icon { flex: none; width: .72em; height: .78em; fill: currentColor; }

/* Pulsanti */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .75em;
  max-width: 100%; min-height: 52px; padding: .7em 1.4em;
  border: var(--rule); border-radius: 0; background: var(--white); color: var(--ink);
  font-size: 1rem; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn .icon { transition: transform .18s ease; }
.btn:hover { background: var(--ink); color: var(--white); }
.btn:hover .icon { transform: translateX(3px); }
.btn--primary { background: var(--ink); color: var(--white); }
.btn--primary:hover { background: var(--aurora); color: var(--ink); }
.btn--small { min-height: 44px; padding: .5em 1em; font-size: var(--t-s); }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Occhielli numerati delle sezioni: il colore scorre lungo l'aurora, dal rosa al ciano */
.kicker, .eyebrow {
  display: flex; align-items: center; gap: .8em;
  font-size: var(--t-xs); font-weight: 600; line-height: 1.3; letter-spacing: .09em; text-transform: uppercase;
}
.kicker__n {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2.3em; padding: .3em .45em;
  background: var(--k, var(--pink)); color: var(--ink); letter-spacing: .04em; font-variant-numeric: tabular-nums;
}
.px { flex: none; width: .85em; height: .85em; background: var(--aurora); }
#perche { --k: #fe91f3; }
#giorni { --k: #e79cf4; }
#sprint { --k: #cfa7f6; }
#scenari { --k: #b8b3f7; }
#percorso { --k: #9ac1f9; }
#patti { --k: #7bcffa; }
#dopo { --k: #5adefc; }
#domande { --k: #36eefd; }
#studio { --k: #11ffff; }

.link-arrow { display: inline-flex; align-items: center; gap: .6em; font-weight: 600; }
.link-arrow .icon { transition: transform .18s ease; }
.link-arrow:hover .icon { transform: translateX(3px); }

.footnote { margin-top: 24px; max-width: 46em; font-size: var(--t-s); color: var(--muted); }

/* ---------- 04 Intestazione --------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-stuck, .site-header.is-open { border-bottom-color: var(--ink); }
.site-header__bar { display: flex; align-items: center; gap: 14px; min-height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.brand__logo { display: inline-flex; padding-block: 12px; }
.brand__logo img { width: 104px; }
.brand__sep { color: var(--muted); }
.brand__service { display: inline-flex; align-items: center; min-height: 44px; margin-inline: -6px; padding-inline: 6px; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.02em; text-decoration: none; }
.brand__service:hover { text-decoration: underline; }

.site-nav ul { display: flex; gap: 2px; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: 11px;
  font-size: var(--t-s); font-weight: 500; text-decoration: none; white-space: nowrap;
}
.site-nav a:hover { text-decoration: underline; }
.site-nav a[aria-current] { box-shadow: inset 0 -3px 0 var(--ink); }
.site-nav__cta { display: none; }

.menu-toggle {
  display: none; align-items: center; gap: 10px; min-width: 44px; min-height: 44px; padding: 0 12px;
  border: var(--rule); background: var(--white); font-size: var(--t-s); font-weight: 600; cursor: pointer;
}
.menu-toggle__icon { display: grid; gap: 4px; }
.menu-toggle__icon i { display: block; width: 18px; height: 2px; background: currentColor; transition: transform .18s ease, opacity .18s ease; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon i:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1099px) {
  .site-header__bar { flex-wrap: wrap; }

  /* Senza JavaScript il menu resta visibile, su una seconda riga */
  .no-js .site-nav { order: 5; width: 100%; padding-bottom: 8px; }
  .no-js .site-nav ul { flex-wrap: wrap; }

  .js .menu-toggle { display: inline-flex; }
  .js .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    max-height: calc(100vh - var(--header-h)); max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
    padding: 4px var(--gutter) 24px; background: var(--white); border-bottom: var(--rule);
  }
  .js .site-header.is-open .site-nav { display: block; }
  .js .site-nav ul { flex-direction: column; gap: 0; }
  .js .site-nav a {
    width: 100%; min-height: 56px; padding-inline: 0; border-bottom: 1px solid var(--hair);
    font-size: 1.3125rem; font-weight: 600; letter-spacing: -.02em; white-space: normal;
  }
  .js .site-nav a[aria-current] { box-shadow: inset 4px 0 0 var(--ink); padding-left: 14px; }
  .js .site-nav__cta { display: block; margin-top: 18px; }
  .js .site-nav__cta a { justify-content: center; border: var(--rule); background: var(--ink); color: var(--white); font-size: 1.0625rem; }
}
@media (max-width: 480px) {
  .brand__logo img { width: 86px; }
  .menu-toggle { padding: 0; justify-content: center; }
  .menu-toggle__label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 379px) {
  .js .site-header__cta { display: none; }
}

/* ---------- 05 Apertura -------------------------------------------------- */

.hero { padding-top: clamp(32px, 6vw, 80px); }
.hero .eyebrow { margin-bottom: clamp(20px, 3vw, 36px); }
.hero__row { display: grid; gap: 28px; margin-top: clamp(24px, 4vw, 52px); }
.lead { max-width: 34em; font-size: var(--t-l); line-height: 1.45; color: var(--ink-soft); }
@media (min-width: 960px) {
  .hero__row { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 64px; align-items: end; }
  .hero__row .btn-row { justify-content: flex-end; }
}

/* Fascia della settimana: il mosaico si riempie da lunedì a venerdì */
.week { margin-top: clamp(36px, 5vw, 64px); }
.dither { width: 100%; }
.dither--week { height: clamp(112px, 18vw, 240px); background: var(--aurora); }
.js .dither--week { background: none; }
.week__days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: var(--rule); }
.week__days li + li { border-left: 1px solid var(--hair); }
.week__days a {
  display: flex; flex-direction: column; gap: 1px; height: 100%; min-height: 64px;
  padding: 14px 12px 18px; text-decoration: none; transition: background-color .18s ease;
}
.week__days li:first-child a { padding-left: 0; }
.week__days a:hover { background: var(--paper); }
.week__days li:first-child a:hover { box-shadow: -12px 0 0 var(--paper); }
.week__dow { font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.week__step { font-size: clamp(1.05rem, .8rem + 1.2vw, 1.75rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.week__out { font-size: var(--t-s); color: var(--muted); }
.week figcaption { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--hair); font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) {
  .week__days a { padding: 10px 6px 12px; min-height: 56px; }
  .week__step { font-size: .9375rem; letter-spacing: -.02em; }
  .week__out { display: none; }
}

/* ---------- 06 In breve e sezioni ---------------------------------------- */

.brief-strip { margin-top: clamp(48px, 7vw, 96px); border-block: var(--rule); }
.summary { display: grid; }
.summary__item { display: grid; gap: 10px; align-content: start; padding-block: 26px; }
.summary__item + .summary__item { border-top: 1px solid var(--hair); }
.summary dt { font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.summary dd { font-size: var(--t-l); font-weight: 500; line-height: 1.35; letter-spacing: -.012em; }
@media (min-width: 860px) {
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary__item { padding: 36px 36px 40px 0; }
  .summary__item + .summary__item { padding-left: 36px; border-top: 0; border-left: 1px solid var(--hair); }
}

.section { padding-block: var(--section); }
.section--paper { background: var(--paper); }
.section .kicker { margin-bottom: clamp(20px, 3vw, 32px); }
.section__head { display: grid; gap: 20px; margin-bottom: clamp(36px, 5vw, 64px); }
.section__head p { max-width: 32em; font-size: var(--t-l); line-height: 1.45; color: var(--ink-soft); }
.split { display: grid; gap: 24px; }
.split__body { display: grid; gap: 16px; align-content: start; font-size: var(--t-l); line-height: 1.45; color: var(--ink-soft); }
@media (min-width: 960px) {
  .section__head, .split { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 64px; }
  .section__head { align-items: end; }
}

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(40px, 6vw, 84px); border-top: var(--rule); }
.metric { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; min-width: 0; padding: 18px 12px 0 0; }
.metric + .metric { padding-left: clamp(12px, 2vw, 28px); border-left: 1px solid var(--hair); }
.metric dd { font-size: clamp(2.5rem, 1.4rem + 6vw, 7rem); font-weight: 600; line-height: .95; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.metric dt { font-size: var(--t-s); color: var(--muted); }

/* ---------- 07 I cinque giorni e il prototipo Forma ---------------------- */

.days__tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: var(--rule); background: var(--white); }
.days__tabs li + li { border-left: var(--rule); }
.days__tab {
  display: flex; flex-direction: column; gap: 1px; height: 100%; min-height: 72px; padding: 12px 16px 14px;
  text-decoration: none; cursor: pointer; transition: background-color .18s ease, color .18s ease;
}
.days__n { font-size: var(--t-xs); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.days__dow { font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.days__step { font-size: var(--t-s); color: var(--muted); }
.days__tab:hover { background: var(--tint-cyan); }
.days__tab[aria-selected="true"] { background: var(--ink); color: var(--white); }
.days__tab[aria-selected="true"] .days__n, .days__tab[aria-selected="true"] .days__step { color: var(--night-muted); }
.days__tab:focus-visible { outline-offset: -6px; }
.days__tab[aria-selected="true"]:focus-visible { outline-color: var(--cyan); }
@media (max-width: 640px) {
  .days__tab { align-items: center; min-height: 64px; padding: 10px 2px; text-align: center; }
  .days__dow { font-size: 1rem; }
  .days__step { font-size: .6875rem; }
}

.day { display: grid; gap: 28px; padding-block: clamp(28px, 4vw, 48px) 0; }
.day__next { justify-self: start; }
.no-js .day + .day { margin-top: clamp(28px, 4vw, 48px); border-top: 1px solid var(--hair); }
.js .day[hidden] { display: none; }
@media (min-width: 980px) {
  .day {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr;
    grid-template-areas: "story stage" "next stage"; gap: 20px 56px; align-items: start;
  }
  .day__story { grid-area: story; }
  .day__stage { grid-area: stage; }
  .day__next { grid-area: next; }
}
.day:focus-visible { outline-offset: 8px; }

.day__story { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; min-width: 0; }
.day__story > * { max-width: 100%; }
.day__tag { display: flex; align-items: center; gap: .8em; font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.day__tag::before { content: ""; flex: none; width: .85em; height: .85em; background: var(--aurora); }
.day__title { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); line-height: 1.04; letter-spacing: -.038em; }
.day__story > p:not(.day__tag) { color: var(--ink-soft); }
.day__meta { display: grid; width: 100%; border-top: var(--rule); }
.day__meta div { display: grid; gap: 3px; padding-block: 14px; border-bottom: 1px solid var(--hair); }
.day__meta dt { font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.day__meta dd { font-weight: 500; }

.day__stage {
  min-width: 0; padding: clamp(14px, 3vw, 36px); border: var(--rule);
  background-color: var(--white);
  /* griglia di pixel: quadratini 2×2 ogni 16 px */
  background-image: linear-gradient(90deg, var(--white) 14px, transparent 14px), linear-gradient(var(--white) 14px, var(--hair) 14px);
  background-size: 16px 16px;
}
.day__artifact { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 18px; font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.day__artifact span { font-size: var(--t-s); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.day__artifact, .stage-fallback { background: var(--white); width: fit-content; padding: 2px 8px 2px 0; }
.stage-fallback { color: var(--muted); }
.days__note { margin-top: 20px; font-size: var(--t-s); color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .js .day:not([hidden]) .day__stage > :first-child { animation: arrive .32s ease-out both; }
}
@keyframes arrive {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Lunedì: il brief */
.board { display: grid; justify-items: start; }
.sheet { display: grid; gap: 14px; width: 100%; max-width: 440px; padding: clamp(18px, 3vw, 28px); border: var(--rule); background: var(--white); }
.sheet__meta { display: flex; justify-content: space-between; gap: 12px; font: 600 .6875rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sheet__title { font-size: clamp(1.25rem, 1rem + 1.2vw, 1.7rem); font-weight: 600; line-height: 1.1; letter-spacing: -.03em; }
.sheet__quote { font-size: 1rem; line-height: 1.5; color: var(--ink-soft); }
.sheet__quote mark { padding: .05em .15em; background: var(--cyan); color: var(--ink); }
.sheet__scribble { position: relative; padding-left: 1.5em; font-style: italic; font-weight: 500; }
.sheet__scribble::before { content: ""; position: absolute; left: .2em; top: .15em; width: .7em; height: .7em; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.sticky {
  position: relative; z-index: 1; justify-self: end; max-width: 250px; margin: -22px 6px 6px 0; padding: 14px 16px;
  background: var(--pink); box-shadow: 4px 4px 0 var(--ink); transform: rotate(2deg);
  font-size: var(--t-s); font-weight: 500; line-height: 1.35;
}
.sticky strong { display: block; margin-bottom: 6px; font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; }

/* Cornice da browser, comune a wireframe e prototipo */
.frame { border: var(--rule); background: var(--white); }
.frame__bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: var(--rule); font: 500 .6875rem/1.3 var(--mono); color: var(--muted); }
.frame__dots { display: inline-flex; gap: 4px; }
.frame__dots i { width: 7px; height: 7px; background: var(--pink); }
.frame__dots i:nth-child(2) { background: var(--peri); }
.frame__dots i:nth-child(3) { background: var(--cyan); }

/* Martedì: il wireframe */
.wire { --w: #a9aaa6; color: #63656b; }
.wire__head, .wire__ctl, .wire__controls b, .wire__room span, .wire__caption { font: 600 .6875rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.wire__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 12px 16px; border-bottom: 1px dashed var(--w); }
.wire__main { display: grid; gap: 14px; padding: 16px; }
@media (min-width: 560px) {
  .wire__main { grid-template-columns: 1.25fr 1fr; }
}
.wire__room {
  display: grid; place-items: center; min-height: 150px; border: 1px dashed var(--w);
  background:
    linear-gradient(to top right, transparent calc(50% - .5px), var(--w) calc(50% - .5px), var(--w) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(to bottom right, transparent calc(50% - .5px), var(--w) calc(50% - .5px), var(--w) calc(50% + .5px), transparent calc(50% + .5px));
}
.wire__room span { padding: 3px 8px; background: var(--white); }
.wire__controls { display: grid; gap: 10px; align-content: start; }
.wire__controls i { display: block; height: 10px; background: #d9d9d5; }
.wire__controls i.short { width: 60%; }
.wire__ctl { padding: 10px 12px; border: 1px dashed var(--w); }
.wire__controls b { padding: 11px 12px; background: #63656b; color: var(--white); text-align: center; }
.wire__flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px dashed var(--w); color: var(--ink); font-size: var(--t-s); font-weight: 600; }
.wire__flow span { padding: 4px 10px; border: var(--rule); }
.wire__caption { padding: 0 16px 14px; }

/* Mercoledì, giovedì, venerdì: lo stesso prototipo che cresce */
.forma { container-type: inline-size; }
.forma__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--hair); }
.forma__logo { font-size: 1.25rem; font-weight: 700; letter-spacing: -.04em; }
.forma__logo span { color: #85926b; }
.forma__claim { font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.forma__body { display: grid; }
@container (min-width: 29em) {
  .forma__body { grid-template-columns: 1.15fr 1fr; }
}
.forma__scene { display: grid; place-items: center; min-height: 190px; padding: 12px; background: #f1efe9; }
.forma__svg { width: 100%; max-width: 420px; height: auto; }
.scene-rug { fill: #e3dfd4; }
.scene-table { fill: var(--finish, #ad8059); stroke: var(--finish-dark, #755337); stroke-width: 3; }
.scene-chair { fill: var(--white); stroke: var(--ink-soft); stroke-width: 2; }
.scene-chair-back { fill: var(--ink-soft); }
.scene-plant rect:first-child { fill: #cfd8c0; }
.scene-plant rect:last-child { fill: #85926b; }

.forma__controls { display: grid; gap: 16px; align-content: start; min-width: 0; padding: 18px 16px 16px; }
.forma__title { font-size: 1.5rem; font-weight: 600; line-height: 1.1; letter-spacing: -.035em; }
.forma__text { font-size: var(--t-s); line-height: 1.45; color: var(--ink-soft); }
.forma__ctl { position: relative; }
.forma__finish legend, .forma__label { display: block; margin-bottom: 8px; font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.forma__value { margin-left: .5em; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 5px; font-size: var(--t-xs); cursor: pointer; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.swatch__chip { position: relative; width: 48px; height: 48px; border: var(--rule); background: var(--c); }
.swatch input:checked + .swatch__chip { outline: 3px solid var(--ink); outline-offset: 2px; }
.swatch input:checked + .swatch__chip::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 10px; height: 10px; background: var(--white); border: 1px solid var(--ink); }
.swatch input:checked ~ .swatch__name { font-weight: 700; }
.swatch input:focus-visible + .swatch__chip { outline: 3px solid var(--ink); outline-offset: 5px; }
.forma__select { width: 100%; min-height: 48px; padding: 0 12px; border: var(--rule); border-radius: 0; background: var(--white); font-size: 1rem; }
.forma__save {
  width: 100%; min-height: 48px; padding: .5em 1em; border: var(--rule); border-radius: 0;
  background: var(--ink); color: var(--white); font-weight: 600; cursor: pointer; transition: background-color .18s ease, color .18s ease;
}
.forma__save:hover { background: var(--aurora); color: var(--ink); }
.forma__status { min-height: 2.9em; font-size: var(--t-xs); line-height: 1.45; color: var(--ink-soft); }

/* Mercoledì il prototipo funziona ma è grezzo: controlli nativi, niente rifiniture */
.forma[data-mode="build"] { font-family: var(--mono); }
.forma[data-mode="build"] .forma__head { border-bottom-style: dashed; border-bottom-color: #a9aaa6; }
.forma[data-mode="build"] .forma__logo { font-size: 1rem; letter-spacing: 0; }
.forma[data-mode="build"] .forma__logo span { color: inherit; }
.forma[data-mode="build"] .forma__claim, .forma[data-mode="build"] .forma__text { display: none; }
.forma[data-mode="build"] .forma__scene { background: var(--white); border-bottom: 1px dashed #a9aaa6; }
.forma[data-mode="build"] .scene-rug, .forma[data-mode="build"] .scene-plant { display: none; }
.forma[data-mode="build"] .scene-chair { fill: none; stroke: #63656b; stroke-dasharray: 4 3; }
.forma[data-mode="build"] .scene-chair-back { fill: #a9aaa6; }
.forma[data-mode="build"] .forma__title { font-size: 1rem; letter-spacing: 0; }
.forma[data-mode="build"] .forma__finish legend, .forma[data-mode="build"] .forma__label { font-size: var(--t-xs); letter-spacing: 0; text-transform: none; }
.forma[data-mode="build"] .swatches { gap: 4px 18px; }
.forma[data-mode="build"] .swatch { flex-direction: row; gap: 8px; min-height: 44px; font-size: var(--t-s); }
.forma[data-mode="build"] .swatch input { position: static; width: 20px; height: 20px; opacity: 1; accent-color: var(--ink); }
.forma[data-mode="build"] .swatch__chip { display: none; }
.forma[data-mode="build"] .forma__save { border-style: dashed; background: #ebebe8; color: var(--ink); }
.forma[data-mode="build"] .forma__save:hover { background: #dededa; }
@container (min-width: 29em) {
  .forma[data-mode="build"] .forma__scene { border-bottom: 0; border-right: 1px dashed #a9aaa6; }
}

/* Venerdì: i commenti della sessione di test */
.pin {
  position: absolute; top: -12px; right: -4px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: var(--rule); border-radius: 0; background: var(--pink); box-shadow: 3px 3px 0 var(--ink);
  font-weight: 700; cursor: pointer;
}
.pin:hover { background: var(--cyan); }
.pin[aria-expanded="true"] { background: var(--ink); color: var(--white); box-shadow: 3px 3px 0 var(--pink); }
.forma__ctl--status .pin { top: -4px; }
.forma[data-mode="test"] .forma__status { min-height: 48px; padding-right: 56px; }
.research { border-top: var(--rule); }
.research__steps { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 16px; border-bottom: 1px solid var(--hair); font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.research__steps span { color: var(--muted); }
.research__note { display: grid; gap: 8px; padding: 14px 16px 16px; background: var(--tint-pink); }
.research__who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--t-xs); font-weight: 600; }
.research__avatar { display: grid; place-items: center; width: 28px; height: 28px; background: var(--ink); color: var(--white); font-size: .6875rem; }
.research__label { font-weight: 500; color: var(--ink-soft); }
.research__text { font-size: var(--t-s); line-height: 1.45; }

/* ---------- 08 Sprint, scenari, percorso --------------------------------- */

/* Le linee tra le schede sono il fondo nero della griglia che traspare dai varchi */
.offers, .pacts, .afters { display: grid; gap: 1px; border: var(--rule); background: var(--ink); }
@media (min-width: 680px) {
  .offers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1180px) {
  .offers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.offer {
  --pad: clamp(20px, 2.2vw, 30px);
  display: grid; grid-template-rows: auto auto auto 1fr auto auto; row-gap: 16px; min-width: 0;
  padding: 0 var(--pad) var(--pad); background: var(--white);
}
@supports (grid-template-rows: subgrid) {
  .offer { grid-row: span 6; grid-template-rows: subgrid; }
}
.offer--1 { --tint: var(--tint-pink); }
.offer--2 { --tint: var(--tint-peri); }
.offer--3 { --tint: var(--tint-sky); }
.offer--4 { --tint: var(--tint-cyan); }
.offer__label { margin-inline: calc(var(--pad) * -1); padding: 12px var(--pad); background: var(--tint); font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.offer h3 { margin-top: 8px; font-size: clamp(2.3rem, 1.6rem + 2vw, 3.1rem); line-height: 1; letter-spacing: -.045em; }
.offer__desc { font-size: var(--t-l); font-weight: 500; line-height: 1.35; letter-spacing: -.012em; }
.offer__out { align-self: start; padding-top: 14px; border-top: var(--rule); }
.offer__out-title, .offer__for { font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.offer__out-title { margin-bottom: 10px; }
.offer__out ul { display: grid; gap: 8px; }
.offer__out li { position: relative; padding-left: 1.35em; line-height: 1.4; }
.offer__out li::before { content: ""; position: absolute; left: 0; top: .5em; width: .5em; height: .5em; background: var(--ink); }
.offer__for { color: var(--muted); }

.cases { border-top: var(--rule); }
.cases a {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px 24px;
  padding: clamp(16px, 2.4vw, 28px) 0; border-bottom: var(--rule); text-decoration: none;
  transition: background-color .18s ease, box-shadow .18s ease;
}
.cases a:hover { background: var(--white); box-shadow: -16px 0 0 var(--white), 16px 0 0 var(--white); }
.cases__n { font-size: var(--t-xs); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.cases__q { font-size: clamp(1.25rem, .9rem + 1.9vw, 2.25rem); font-weight: 600; line-height: 1.15; letter-spacing: -.03em; }
.cases__tag {
  display: inline-flex; align-items: center; min-height: 36px; padding: .3em .85em; border: var(--rule); background: var(--white);
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  transition: background-color .18s ease, color .18s ease;
}
.cases a:hover .cases__tag { background: var(--ink); color: var(--white); }
@media (max-width: 640px) {
  .cases a { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .cases__n { padding-top: .45em; }
  .cases__tag { grid-column: 2; justify-self: start; }
}

.path { display: grid; }
.path__step { position: relative; padding: 0 0 30px 58px; }
.path__step:last-child { padding-bottom: 0; }
.path__step::before { content: ""; position: absolute; left: 18px; top: 38px; bottom: 0; width: 2px; background: var(--ink); }
.path__step:last-child::before { display: none; }
.path__n { position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 38px; height: 38px; background: var(--ink); color: var(--white); font-weight: 600; font-variant-numeric: tabular-nums; }
.path__step--sprint .path__n { background: var(--aurora); color: var(--ink); }
.path__step h3 { margin-bottom: 6px; padding-top: 4px; font-size: clamp(1.2rem, 1.1rem + .4vw, 1.4rem); }
.path__step p { color: var(--ink-soft); }
@media (min-width: 1020px) {
  .path { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .path__step, .path__step:last-child { padding: 62px 28px 0 0; }
  .path__step::before { left: 38px; right: 0; top: 18px; bottom: auto; width: auto; height: 2px; }
}

/* ---------- 09 Patti chiari, dopo, domande, studio ----------------------- */

@media (min-width: 900px) {
  .pacts, .afters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.pact, .after { display: grid; gap: 14px; align-content: start; min-width: 0; padding: clamp(20px, 2.6vw, 36px); background: var(--white); }
.pact--in { background: var(--tint-cyan); }
.pact > p, .after p { color: var(--ink-soft); }
.list { margin-top: 6px; border-top: var(--rule); }
.list li { position: relative; padding: 12px 0 12px 32px; border-bottom: 1px solid rgba(11, 11, 12, .18); font-weight: 500; line-height: 1.4; }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list li::before { content: ""; position: absolute; left: 0; top: .95em; width: 16px; height: 16px; }
.list--check li::before { background: var(--ink); }
.list--check li::after {
  content: ""; position: absolute; left: 5.5px; top: calc(.95em + 2px); width: 5px; height: 9px;
  border: solid var(--white); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.pact--in .list--check li::after { border-color: var(--tint-cyan); }
.list--cross li::before {
  border: 1px solid var(--ink);
  background:
    linear-gradient(to top right, transparent calc(50% - .75px), var(--ink) calc(50% - .75px), var(--ink) calc(50% + .75px), transparent calc(50% + .75px)),
    linear-gradient(to bottom right, transparent calc(50% - .75px), var(--ink) calc(50% - .75px), var(--ink) calc(50% + .75px), transparent calc(50% + .75px));
}

.faq { display: grid; gap: 32px; }
.faq__head { display: grid; gap: 20px; align-content: start; }
.faq__head .kicker { margin-bottom: 0; }
.faq__head p:last-child { color: var(--ink-soft); }
.faq__list { border-top: var(--rule); }
.faq__item { border-bottom: var(--rule); }
.faq__item summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; padding-block: 18px; cursor: pointer; list-style: none; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item h3 { font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); }
.faq__icon { position: relative; flex: none; width: 18px; height: 18px; }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; left: 0; top: 7.5px; width: 18px; height: 3px; background: var(--ink); transition: transform .2s ease; }
.faq__icon::after { transform: rotate(90deg); }
.faq__item[open] .faq__icon::after { transform: rotate(0); }
.faq__item > p { max-width: 44em; padding-bottom: 24px; color: var(--ink-soft); }
@media (min-width: 980px) {
  .faq { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
  .faq__head { position: sticky; top: calc(var(--header-h) + 32px); }
}

.works { display: grid; gap: 28px 20px; margin-top: clamp(40px, 6vw, 72px); }
@media (min-width: 720px) {
  .works { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.work img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: var(--rule); background: var(--paper); }
.work__name { margin-top: 12px; font-weight: 600; }
.work__tags { font-size: var(--t-s); color: var(--muted); }

/* ---------- 10 Chiusura e brief ------------------------------------------ */

.closing { background: var(--night); color: var(--white); padding-bottom: var(--section); }
.dither--aurora { height: clamp(120px, 20vw, 280px); }
.closing__grid { display: grid; gap: 40px; padding-top: clamp(32px, 5vw, 64px); }
.closing__copy { display: grid; gap: 24px; align-content: start; min-width: 0; }
.closing__copy > p:not(.kicker) { max-width: 30em; font-size: var(--t-l); line-height: 1.45; color: #e8e9ed; }
.closing__copy .closing__mail { font-size: var(--t-m); color: var(--night-muted); }
.closing__mail a { color: var(--white); font-weight: 600; }
.closing__copy :focus-visible, .site-footer :focus-visible { outline-color: var(--cyan); }
@media (min-width: 1020px) {
  .closing__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: start; }
  .closing__copy { position: sticky; top: calc(var(--header-h) + 32px); }
}

.brief { display: grid; gap: 22px; min-width: 0; padding: clamp(20px, 3.2vw, 40px); background: var(--white); color: var(--ink); }
.brief__kicker { font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.brief__title { margin-top: -14px; font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); line-height: 1.05; letter-spacing: -.038em; }
.brief__intro { color: var(--ink-soft); }
.field { display: grid; gap: 8px; }
.field label, .field legend { font-weight: 600; }
.field legend { margin-bottom: 8px; }
.field__hint { margin-left: .5em; font-size: var(--t-xs); font-weight: 500; color: var(--muted); }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border: var(--rule); border-radius: 0; background: var(--white);
  font-size: 1rem; line-height: 1.45;
}
.field textarea { min-height: 104px; resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.field__error { font-size: var(--t-s); font-weight: 600; color: var(--error); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; display: inline-flex; max-width: 100%; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; gap: .6em; min-height: 44px; padding: .4em .95em .4em .8em; border: var(--rule); font-size: var(--t-s); font-weight: 600; line-height: 1.2; }
.choice span::before { content: ""; flex: none; width: .65em; height: .65em; border: var(--rule); }
.choice:hover span { background: var(--paper); }
.choice input:checked + span { background: var(--ink); color: var(--white); }
.choice input:checked + span::before { border-color: var(--cyan); background: var(--cyan); }
.choice input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }
.brief__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.brief__status { font-weight: 600; }
.brief__status:empty { display: none; }
.brief__manual { width: 100%; min-height: 180px; padding: 12px; border: var(--rule); border-radius: 0; font: 500 var(--t-xs)/1.5 var(--mono); }
.brief__privacy, .brief__noscript { font-size: var(--t-xs); color: var(--muted); }

/* ---------- 11 Piè di pagina --------------------------------------------- */

.site-footer { padding-block: 36px 48px; border-top: 1px solid var(--night-hair); background: var(--night); color: var(--white); }
.site-footer__grid { display: grid; gap: 24px; }
.site-footer__brand a { display: inline-flex; padding-block: 6px; }
.site-footer__brand img { width: 132px; }
.site-footer__tag { margin-top: 12px; font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0 26px; }
.site-footer__links a, .site-footer__links .consent-open { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer__legal { font-size: var(--t-xs); line-height: 1.6; color: var(--night-muted); }
@media (min-width: 900px) {
  .site-footer__grid { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .site-footer__links { justify-content: flex-end; }
  .site-footer__legal { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--night-hair); }
}

/* ---------- 12 Movimento ridotto e alto contrasto ------------------------ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (forced-colors: active) {
  .dither { display: none; }
  .kicker__n, .path__n, .pin, .sticky, .offer__label { border: 1px solid CanvasText; }
  .days__tab[aria-selected="true"], .choice input:checked + span, .swatch input:checked + .swatch__chip { outline: 3px solid Highlight; outline-offset: -3px; }
  .swatch__chip, .frame__dots i, .px, .day__tag::before { forced-color-adjust: none; }
}
