/* ==========================================================================
   drsprojects.app
   Ogni sezione ha un solo effetto suo; tutte usano la stessa curva e le
   stesse durate (--ease, --t-*). Con "riduci movimento" tutto è statico.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #0b0e13;
  --surface: #12161d;
  --surface-2: #171c25;
  --border: #252c37;
  --text: #e6e9ee;
  --muted: #9aa5b4;
  --accent: #4f9dff;
  --ok: #3ddc97;
  --warm: #ff9f43;
  --accent-ink: #0b1a2e;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
  --radius: 14px;
  --header: 68px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.2, .75, .2, 1);
  --t-fast: .2s;
  --t: .7s;
  --t-slow: 1.1s;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --border: #dfe3e9;
    --text: #141920;
    --muted: #556070;
    --accent: #1f6fe0;
    --ok: #12985f;
    --warm: #d9731a;
    --accent-ink: #ffffff;
    --shadow: 0 30px 60px -34px rgba(20, 30, 50, .35);
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }
main { display: block; overflow-x: clip; }
code {
  font: .88em var(--mono); background: var(--surface-2); border: 1px solid var(--border);
  padding: .1em .35em; border-radius: 5px; overflow-wrap: anywhere;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }

/* accessibilità */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  padding: 10px 16px; border-radius: 10px; transition: top var(--t-fast) var(--ease);
}
.skip:focus { top: 12px; text-decoration: none; }

/* ==========================================================================
   Barra di avanzamento + header
   Effetto: la barra segue lo scroll; l'header diventa vetro.
   ========================================================================== */
.progress {
  position: fixed; inset: 0 0 auto; height: 2px; z-index: 60; pointer-events: none;
  background: var(--accent);
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}
.top {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
/* lo sfondo a vetro sta in un livello a parte: un backdrop-filter sull'header
   farebbe da contenitore al menu mobile (position: fixed) */
.top::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: opacity var(--t) var(--ease);
}
.top.glass, .project .top, body.menu-open .top { border-bottom-color: var(--border); }
.top.glass::before, .project .top::before, body.menu-open .top::before { opacity: 1; }
.bar { display: flex; align-items: center; justify-content: space-between; height: var(--header); gap: 16px; }

.brand { color: var(--text); font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; display: inline-flex; align-items: center; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.mark { color: var(--accent); }

/* menu */
.menu { display: flex; align-items: center; gap: 6px; }
.menu > a, .mega-btn {
  color: var(--muted); font: inherit; font-size: .95rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; background: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.menu > a:hover, .mega-btn:hover, .has-mega.open .mega-btn { color: var(--text); background: var(--surface-2); text-decoration: none; }
.ext { font-size: .8em; }
.chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; transition: transform var(--t-fast) var(--ease); }
.has-mega.open .chev { transform: rotate(180deg); }

.has-mega { position: relative; }
.mega {
  position: absolute; top: calc(100% + 10px); right: -160px; width: min(760px, calc(100vw - 48px));
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 14px; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.985); transform-origin: 70% 0;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility 0s linear var(--t-fast);
}
.mega::before { content: ""; position: absolute; inset: -12px 0 auto; height: 12px; } /* ponte per l'hover */
.has-mega.open .mega, html:not(.js) .has-mega:focus-within .mega, html:not(.js) .has-mega:hover .mega {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility 0s;
}
.mega-cat { margin: 4px 10px 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.mega-item {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: var(--text);
  transition: background var(--t-fast) var(--ease);
}
.mega-item:hover, .mega-item[aria-current] { background: var(--surface-2); text-decoration: none; }
.mega-item b { display: block; font-size: .95rem; font-weight: 600; line-height: 1.3; }
.mega-item small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.mega-item[aria-current] b::after { content: " ·"; color: var(--accent); }
.mi { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.mi.glyph svg { width: 20px; height: 20px; }

.burger { display: none; }

/* ==========================================================================
   Home · hero
   Effetto: il titolo sale parola per parola; il registro delle versioni
   si scrive una riga alla volta.
   ========================================================================== */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 88px 0 112px; }

/* campo di punti in prospettiva: un'onda lenta che sale dal piano all'apertura (disegnata da main.js) */
.field {
  position: absolute; inset: 14% 0 0; z-index: -1; pointer-events: none;
  transform: translateY(calc(var(--sy, 0px) * .3));
  /* sfuma in alto e resta tenue sotto il testo a sinistra */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 78%, transparent), linear-gradient(90deg, rgba(0,0,0,.35) 25%, #000 62%);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 78%, transparent), linear-gradient(90deg, rgba(0,0,0,.35) 25%, #000 62%);
          mask-composite: intersect;
}
.field::before { /* bagliore all'orizzonte */
  content: ""; position: absolute; left: 15%; right: -15%; top: 10%; height: 80%;
  background: radial-gradient(ellipse at 60% 50%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
  filter: blur(20px);
}
.field canvas { position: relative; width: 100%; height: 100%; display: block; }
.js .field { opacity: 0; }
.ready .field { opacity: 1; transition: opacity 1.6s var(--ease); }
/* parola che ruota dopo "for" */
.rot { display: inline-grid; vertical-align: top; }
.rot > span {
  grid-area: 1 / 1; white-space: nowrap;
  background: linear-gradient(90deg, var(--accent), var(--ok), var(--accent));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: flow 6s linear infinite;
}
html:not(.js) .rot > span:not(:first-child) { visibility: hidden; }
.js .rot { overflow: hidden; padding-bottom: .22em; margin-bottom: -.22em; }
.js .rot > span { transform: translateY(105%); opacity: 0; transition: transform .75s var(--ease), opacity .45s var(--ease); }
.js .rot > span.on { transform: none; opacity: 1; }
.js .rot > span.off { transform: translateY(-105%); opacity: 0; }
@keyframes flow { to { background-position: 200% 0; } }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 64px; align-items: end; }

h1 { font-size: clamp(2.2rem, 5.2vw, 3.9rem); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 26px; max-width: 19ch; text-wrap: balance; }

/* parole del titolo (create da main.js) */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .2em; margin-bottom: -.2em; }
.w > span { display: inline-block; }
.js h1[data-words] .w > span { transform: translateY(105%); }
.ready h1[data-words] .w > span {
  transform: none; transition: transform var(--t-slow) var(--ease);
  transition-delay: calc(var(--i) * 60ms + 150ms);
}

.lead { font-size: clamp(1.05rem, 1.5vw, 1.15rem); color: var(--muted); max-width: 60ch; margin: 0 0 32px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 0; }
.js .hero .lead, .js .hero .cta { opacity: 0; transform: translateY(12px); }
.ready .hero .lead, .ready .hero .cta {
  opacity: 1; transform: none; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.ready .hero .lead { transition-delay: .75s; }
.ready .hero .cta { transition-delay: .9s; }

/* registro delle ultime versioni */
.log { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 20px 22px 16px; }
.log-h { margin: 0 0 12px; font-size: .95rem; font-weight: 600; }
.log-list { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.log-list li { display: grid; grid-template-columns: 5.2em minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--border); }
.log-list time, .log-list .v { font-family: var(--mono); font-size: .82rem; color: var(--muted); white-space: nowrap; }
.log-list .v.new { color: var(--ok); }
.log-list a { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-foot { margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); }
.js .log-list li, .js .log-foot { opacity: 0; transform: translateX(-6px); }
.ready .log-list li, .ready .log-foot {
  opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .5s var(--ease);
  transition-delay: calc(var(--i, 0) * 110ms + 1s);
}

/* ==========================================================================
   Elementi comuni
   ========================================================================== */
section { padding-bottom: 104px; }

/* titoli di sezione · effetto: la linea si allunga */
.sh {
  display: flex; align-items: baseline; gap: 20px;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem); line-height: 1.2; letter-spacing: -.02em; font-weight: 700;
  margin: 0 0 32px;
}
.sh::after { content: ""; flex: 1; height: 1px; background: var(--border); transform-origin: 0 50%; }
.js .sh::after { transform: scaleX(0); }
.js .sh.in::after { transform: none; transition: transform var(--t-slow) var(--ease) .15s; }

h3 { margin: 0; font-size: 1.15rem; letter-spacing: -.01em; line-height: 1.3; }
.meta { margin: 2px 0 0; font-size: .82rem; color: var(--muted); font-family: var(--mono); }
.head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.head img, .pi { border-radius: 12px; flex: none; }

.glyph {
  width: 56px; height: 56px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 1px solid var(--border);
}
.glyph svg { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.js .rv .glyph svg * { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .rv.in .glyph svg * { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--ease) calc(var(--d, 0ms) + 250ms); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: .95rem;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 86%, var(--text)); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--muted); background: var(--surface-2); }
.btn .bi { width: 16px; height: 16px; margin-right: 8px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.btn.coffee { background: transparent; color: var(--text); border-color: color-mix(in srgb, var(--warm) 45%, var(--border)); }
.btn.coffee .bi { stroke: var(--warm); }
.btn.coffee:hover { background: color-mix(in srgb, var(--warm) 12%, transparent); border-color: var(--warm); }
.btn.sm { padding: 7px 14px; font-size: .86rem; }
.f-coffee { margin-top: 18px !important; }
.btn .n { font: 500 .82rem var(--mono); color: var(--muted); border-left: 1px solid var(--border); margin-left: 10px; padding-left: 10px; }

.chip { display: inline-block; font: 500 .75rem/1 var(--mono); padding: 5px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.chip.ver { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.chip.ver.soon { color: var(--muted); border-color: var(--border); }
.card-foot { gap: 12px; }

/* comparsa allo scroll */
.js .rv { opacity: 0; transform: translateY(26px); }
.js .rv.from-left { transform: translateX(-34px); }
.js .rv.from-right { transform: translateX(34px); }
.js .rv.in { opacity: 1; transform: none; transition: opacity var(--t) var(--ease), transform var(--t-slow) var(--ease); transition-delay: var(--d, 0ms); }

/* ==========================================================================
   Finestra con inclinazione 3D (in evidenza + pagina hddfancontrol)
   Effetto: si inclina verso il cursore con un riflesso.
   ========================================================================== */
/* ==========================================================================
   Home · in evidenza
   Effetto: la sezione resta ferma mentre scorri; gli screenshot si
   sfogliano in 3D e la voce corrispondente si accende.
   ========================================================================== */
.featured { position: relative; }
@media (min-width: 981px) and (prefers-reduced-motion: no-preference) {
  .js .featured { height: 340vh; padding-bottom: 0; margin-bottom: 104px; }
  .js .deck-pin { position: sticky; top: var(--header); min-height: calc(100vh - var(--header)); display: flex; align-items: center; }
  .js .deck-pin .feature { width: 100%; }
}
.deck { position: relative; aspect-ratio: 1200 / 891; perspective: 1600px; perspective-origin: 50% 0; }
.deck-card {
  position: absolute; inset: 0; margin: 0; overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow);
  transform-origin: 50% 0;
  /* d: 0 davanti, 1..3 nel mazzo dietro, < 0 già sfogliata */
  --back: clamp(0, var(--d), 3); --gone: clamp(-1, var(--d), 0);
  transform:
    translate3d(0, calc(var(--back) * -26px + var(--gone) * 34%), calc(var(--back) * -110px))
    rotateX(calc(var(--gone) * -32deg));
  opacity: calc(1 + var(--gone) * 1.15 - var(--back) * .12);
  will-change: transform, opacity;
}
.deck-card:nth-child(1) { --d: 0; z-index: 4; }
.deck-card:nth-child(2) { --d: 1; z-index: 3; }
.deck-card:nth-child(3) { --d: 2; z-index: 2; }
.deck-card:nth-child(4) { --d: 3; z-index: 1; }
.deck-card img { display: block; width: 100%; flex: 1; min-height: 0; object-fit: cover; object-position: top; }
.deck-steps { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 4px; }
.deck-step { padding: 8px 0 8px 16px; border-left: 2px solid var(--border); color: var(--muted); font-size: .95rem; transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.deck-step b { color: var(--text); font-weight: 600; margin-right: 4px; }
.deck-step.on { border-color: var(--accent); color: var(--text); }
@media (max-width: 980px), (prefers-reduced-motion: reduce) {
  .deck { aspect-ratio: auto; perspective: none; }
  .deck-card { position: relative; transform: none; opacity: 1; }
  .deck-card:not(:first-child) { display: none; }
}
html:not(.js) .deck { aspect-ratio: auto; }
html:not(.js) .deck-card { position: relative; transform: none; opacity: 1; }
html:not(.js) .deck-card:not(:first-child) { display: none; }

.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 48px; align-items: center; }
.feature-text > p:not(.links) { color: var(--muted); }
.links { margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }

.window { margin: 0; perspective: 1100px; position: relative; }
.win {
  position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--ease);
}
.window.tilting .win { transition: transform .08s linear; }
.titlebar {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 85%, var(--bg));
}
.titlebar i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.titlebar i:nth-child(1) { background: #ff5f57; }
.titlebar i:nth-child(2) { background: #febc2e; }
.titlebar i:nth-child(3) { background: #28c840; }
.titlebar span { margin: 0 auto; font: .75rem var(--mono); color: var(--muted); padding: 2px 12px; border-radius: 6px; background: var(--bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win img { width: 100%; height: auto; display: block; }
figcaption { color: var(--muted); font-size: .88rem; margin-top: 12px; text-align: center; }

/* ==========================================================================
   Home · catalogo per categoria
   Effetto: le schede entrano in sequenza; alone e bordo seguono il cursore.
   ========================================================================== */
.catalog { display: grid; gap: 56px; }
.cat-row { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.cat-label { position: sticky; top: calc(var(--header) + 24px); }
.cat-label h3 { font-size: 1.3rem; margin: 0 0 8px; letter-spacing: -.02em; }
.cat-label p { margin: 0; color: var(--muted); }
.cat-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.card {
  position: relative; isolation: isolate; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column;
}
.card:hover { text-decoration: none; }
.card, .res { transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.card:hover, .res:hover, .card:focus-visible, .res:focus-visible { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.card:hover { transform: translateY(-2px); }
.card > p { color: var(--muted); margin: 0 0 18px; flex: 1; }
.card > .card-foot { display: flex; align-items: center; justify-content: space-between; flex: none; margin: 0; }
.stats { display: inline-flex; gap: 14px; font: .8rem var(--mono); color: var(--muted); }
.stat { display: inline-flex; align-items: center; gap: 5px; }
.stat svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.js .card.rv .head img { transform: scale(.6); opacity: 0; }
.js .card.rv.in .head img { transform: none; opacity: 1; transition: transform var(--t) cubic-bezier(.3, 1.6, .5, 1), opacity var(--t) var(--ease); transition-delay: calc(var(--d, 0ms) + 250ms); }

/* ==========================================================================
   Home · about — Effetto: la frase si accende parola per parola.
   ========================================================================== */
.statement { font-size: clamp(1.45rem, 3.2vw, 2.2rem); line-height: 1.32; letter-spacing: -.02em; font-weight: 600; max-width: 28ch; margin: 0 0 24px; }
.statement .sw { transition: opacity .35s var(--ease); }
.js .statement .sw { opacity: .16; }
.js .statement .sw.on { opacity: 1; }
.about-more { color: var(--muted); max-width: 60ch; margin: 0 0 28px; }

/* ==========================================================================
   Pagine progetto
   ========================================================================== */
.p-hero { position: relative; isolation: isolate; overflow: hidden; padding: 56px 0 72px; margin-bottom: 72px; border-bottom: 1px solid var(--border); }
.p-hero .field { inset: 0; opacity: .75; }
.crumbs { font-size: .88rem; color: var(--muted); margin: 0 0 22px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs span { opacity: .6; }
.p-title { display: flex; align-items: center; gap: 22px; margin-bottom: 30px; }
.pi.big { width: 88px; height: 88px; border-radius: 20px; }
.pi.big.glyph svg { width: 44px; height: 44px; }
.p-title h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); margin: 0 0 6px; max-width: none; }
.p-tag { font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: var(--muted); margin: 0; max-width: 56ch; }

.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, auto)); justify-content: start; gap: 16px 48px;
  margin: 0 0 30px; padding: 18px 22px; border: 1px solid var(--border); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 70%, transparent); width: fit-content; max-width: 100%;
}
.facts dt { font-size: .82rem; color: var(--muted); margin-bottom: 2px; }
.facts dd { margin: 0; font-weight: 600; font-size: .95rem; }
.tech { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tech li { font: 500 .78rem var(--mono); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }

.p-sec { padding-bottom: 96px; }
.showcase { padding-bottom: 96px; }
.showcase .window, .showcase .terminal { max-width: 960px; margin: 0 auto; }
.intro { font-size: 1.12rem; color: var(--muted); max-width: 70ch; margin: -8px 0 36px; }

/* funzionalità · effetto: comparsa scaglionata, la barretta si allunga al passaggio */
.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 36px; }
.feat { padding: 4px 0 0 18px; border-left: 2px solid var(--border); transition: border-color var(--t) var(--ease); }
.feat:hover { border-color: var(--accent); }
.feat h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feat p { margin: 0; color: var(--muted); font-size: .95rem; }

/* galleria */
.gallery { display: grid; grid-template-columns: 1fr 1fr 220px; grid-template-areas: "a b p" "w w p"; gap: 18px; align-items: start; }
.gallery .shot:nth-child(1) { grid-area: a; }
.gallery .shot:nth-child(2) { grid-area: b; }
.gallery .wide { grid-area: w; }
.gallery .phone { grid-area: p; }
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform var(--t) var(--ease); }
.shot:hover img { transform: translateY(-4px); }
.shot.phone img { border-radius: 22px; }

/* come iniziare */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.split h3 { margin: 0 0 12px; }
.split > div > * + h3 { margin-top: 28px; }
.split p { color: var(--muted); margin-top: 0; }
.code {
  position: relative; margin: 0 0 16px; padding: 16px 18px; padding-right: 72px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow-x: auto; font: .85rem/1.65 var(--mono); color: var(--text);
}
.code code { background: none; border: 0; padding: 0; font: inherit; overflow-wrap: normal; white-space: pre; }
.code-box { position: relative; }
.copy {
  position: absolute; top: 8px; right: 8px; font: 600 .75rem var(--font); color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 6px 10px; cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.copy:hover { color: var(--text); border-color: var(--accent); }
.copy.done { color: var(--ok); border-color: var(--ok); }

.checks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 28px; color: var(--muted); }
.checks li b { color: var(--text); font-weight: 600; }
.checks li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 14px; height: 8px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; color: var(--muted); }
.steps li b { color: var(--text); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 .85rem var(--mono); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); }
.note { font-size: .92rem; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.tbl th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tbl td:first-child { color: var(--muted); }

/* terminale (Parbit) */
.terminal { margin: 0; border: 1px solid var(--border); border-radius: 12px; background: #0d1117; box-shadow: var(--shadow); overflow: hidden; }
.terminal .titlebar { background: #161b22; border-color: #252c37; }
.terminal .titlebar span { background: #0d1117; color: #9aa5b4; }
.terminal pre { margin: 0; padding: 22px 24px; overflow-x: auto; font: .9rem/1.7 var(--mono); color: #c9d1d9; }
.terminal pre b { color: #6cb0ff; }
.terminal pre em { color: #febc2e; font-style: normal; }
.terminal figcaption { padding: 0 16px 14px; color: #9aa5b4; }

/* risorse · effetto: alone e bordo che seguono il cursore */
.res-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.res {
  position: relative; isolation: isolate; display: block; padding: 16px 44px 16px 18px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.res:hover { text-decoration: none; }
.res b { display: block; font-weight: 600; }
.res small { display: block; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.res .arr { position: absolute; right: 16px; top: 16px; color: var(--muted); transition: transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.res:hover .arr { transform: translate(2px, -2px); color: var(--accent); }

/* progetto precedente / successivo */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding-bottom: 96px; }
.pg {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "s s" "i n"; align-items: center; gap: 8px 14px;
  padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color var(--t-fast) var(--ease);
}
.pg:hover { text-decoration: none; border-color: var(--accent); }
.pg small { grid-area: s; color: var(--muted); font-size: .82rem; }
.pg .mi { grid-area: i; }
.pg b { grid-area: n; font-size: 1.05rem; }
.pg.next { text-align: right; grid-template-columns: 1fr auto; grid-template-areas: "s s" "n i"; }

/* ==========================================================================
   Documentazione (docs.drsprojects.app)
   Effetto: l'indice a destra segue la lettura.
   ========================================================================== */
.wrap.doc { max-width: 1380px; }
.doc { display: grid; grid-template-columns: 230px minmax(0, 1fr) 220px; gap: 56px; padding-top: 40px; padding-bottom: 96px; align-items: start; }
.doc-side, .doc-toc { position: sticky; top: calc(var(--header) + 28px); max-height: calc(100vh - var(--header) - 56px); overflow-y: auto; font-size: .9rem; }
.doc-nav summary { list-style: none; cursor: default; margin-bottom: 10px; }
.doc-nav summary::-webkit-details-marker { display: none; }
.doc-proj { display: flex; align-items: center; gap: 10px; }
.doc-proj .mi { width: 28px; height: 28px; border-radius: 7px; }
.doc-proj .mi.glyph svg { width: 16px; height: 16px; }
.doc-side ul, .doc-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.doc-side li a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--muted); }
.doc-side li a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.doc-side li a[aria-current] { color: var(--text); background: var(--surface-2); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
.doc-more { margin: 16px 10px 0; font-size: .85rem; color: var(--muted); }
.doc-toc p { margin: 0 0 10px; font-weight: 600; font-size: .85rem; }
.doc-toc li a { display: block; padding: 4px 0 4px 12px; border-left: 1px solid var(--border); color: var(--muted); line-height: 1.4; transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.doc-toc li.l3 a { padding-left: 24px; font-size: .85rem; }
.doc-toc li a:hover { color: var(--text); text-decoration: none; }
.doc-toc li a.on { color: var(--accent); border-color: var(--accent); }

.doc-body { min-width: 0; max-width: 780px; }
.doc-head { padding-bottom: 28px; margin-bottom: 36px; border-bottom: 1px solid var(--border); }
.doc-head .crumbs { margin-bottom: 18px; }
.doc-kicker { margin: 0 0 6px; color: var(--accent); font-weight: 600; font-size: .9rem; }
.doc-head h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); max-width: none; margin: 0 0 12px; }
.doc-desc { margin: 0; font-size: 1.12rem; color: var(--muted); max-width: 60ch; }

/* testo lungo: righe corte, interlinea ampia, titoli ben separati */
.prose { font-size: 1.0625rem; line-height: 1.75; max-width: 74ch; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.6rem; letter-spacing: -.02em; line-height: 1.25; margin: 2.4em 0 .7em; padding-top: .9em; border-top: 1px solid var(--border); }
.prose h3 { font-size: 1.22rem; margin: 2em 0 .5em; }
.prose h4 { font-size: 1.02rem; margin: 1.6em 0 .4em; }
.prose h2, .prose h3, .prose h4 { position: relative; scroll-margin-top: calc(var(--header) + 20px); }
.prose .anchor { position: absolute; left: -1.1em; color: var(--muted); opacity: 0; font-weight: 400; transition: opacity var(--t-fast) var(--ease); }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor, .prose .anchor:focus { opacity: 1; text-decoration: none; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--muted); }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { color: var(--text); }
.prose img { height: auto; border-radius: 10px; border: 1px solid var(--border); }
.prose p[align="center"] { text-align: center; }
.prose p[align="center"] img + img { margin-left: 12px; }
.prose blockquote { margin: 0 0 1.2em; padding: 2px 18px; border-left: 3px solid var(--border); color: var(--muted); }
.prose .code { font-size: .86rem; line-height: 1.65; margin-bottom: 1.3em; }
.prose .tbl-wrap { margin: 0 0 1.4em; border: 1px solid var(--border); border-radius: 10px; }
.prose .tbl { font-size: .93rem; line-height: 1.5; }
.prose .tbl th { background: var(--surface); }
.prose .tbl tr:last-child td { border-bottom: 0; }
.prose .tbl td:first-child { color: inherit; }
.prose .ta-center { text-align: center; }
.prose .ta-right { text-align: right; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.4em 0; }
.prose details { margin: 0 0 1.2em; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.prose summary { cursor: pointer; font-weight: 600; }
.diagram-src { margin: 0 0 1.3em; }
.diagram-src figcaption { text-align: left; margin-top: -6px; }

.callout { --c: var(--accent); margin: 0 0 1.3em; padding: 14px 18px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--c) 35%, var(--border)); background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.callout > :last-child { margin-bottom: 0; }
.callout-t { margin: 0 0 4px !important; font-weight: 700; font-size: .9rem; color: var(--c); }
.callout.tip { --c: var(--ok); }
.callout.warning, .callout.important { --c: var(--warm); }
.callout.caution { --c: #f25f5c; }

.doc-edit { margin: 48px 0 24px; font-size: .9rem; }
.doc-pager { padding-bottom: 0; }

/* indice delle docs */
.dh { padding-top: 48px; padding-bottom: 96px; }
.dh-proj { padding: 32px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; }
.dh-proj h2 { font-size: 1.3rem; margin: 0; }
.dh-proj h2 a { color: var(--text); }
.dh-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dh-list a { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); height: 100%; transition: border-color var(--t-fast) var(--ease); }
.dh-list a:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.dh-list b { display: block; }
.dh-list small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.45; }

@media (max-width: 1180px) {
  .doc { grid-template-columns: 210px minmax(0, 1fr); gap: 44px; }
  .doc-toc { display: none; }
}
@media (max-width: 860px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; }
  .doc-side { position: static; max-height: none; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 12px 10px; }
  .doc-nav summary { cursor: pointer; margin: 0; padding: 0 4px; display: flex; justify-content: space-between; align-items: center; }
  .doc-nav summary::after { content: "Pages"; font-size: .82rem; color: var(--muted); }
  .doc-nav[open] summary { margin-bottom: 10px; }
  .dh-proj { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .prose .anchor { display: none; }
}
@media (max-width: 640px) {
  .dh-list { grid-template-columns: minmax(0, 1fr); }
  .prose { font-size: 1rem; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .92rem; }
.foot { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding-top: 48px; padding-bottom: 32px; }
.f-brand p { margin: 12px 0 0; max-width: 34ch; }
.f-cat { margin: 0 0 10px; font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--text); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot ul a { color: var(--muted); }
.foot ul a:hover { color: var(--text); }
.f-bottom { border-top: 1px solid var(--border); padding-top: 18px; padding-bottom: 36px; font-size: .85rem; }
.f-bottom p { margin: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .feature, .hero-in { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .log { max-width: 520px; }
  .cat-row { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .cat-label { position: static; }
  .feats, .res-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot { grid-template-columns: 1fr 1fr 1fr; }
  .f-brand { grid-column: 1 / -1; }
  .gallery { grid-template-columns: 1fr 1fr; grid-template-areas: "a b" "w w" "p p"; }
  .gallery .phone { max-width: 240px; justify-self: center; }
}

/* menu mobile */
@media (max-width: 860px) {
  .burger {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; padding: 0;
  }
  .burger i { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--t-fast) var(--ease); }
  .burger[aria-expanded="true"] i:first-of-type { transform: translateY(3.5px) rotate(45deg); }
  .burger[aria-expanded="true"] i:last-of-type { transform: translateY(-3.5px) rotate(-45deg); }

  .menu {
    position: fixed; inset: var(--header) 0 0; z-index: 49; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 16px 20px 40px; overflow-y: auto; overscroll-behavior: contain;
    background: var(--bg); border-top: 1px solid var(--border);
  }
  .js .menu { visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility 0s linear var(--t-fast); }
  .js .menu.open { visibility: visible; opacity: 1; transform: none; transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility 0s; }
  html:not(.js) .menu { position: static; background: none; border: 0; padding: 0; width: 100%; }
  html:not(.js) .burger { display: none; }
  html:not(.js) .bar { height: auto; flex-wrap: wrap; padding-block: 14px; }
  .menu > a, .mega-btn { font-size: 1.05rem; padding: 12px 10px; }
  .mega-btn { pointer-events: none; color: var(--text); }
  .mega-btn .chev { display: none; }
  .mega, .has-mega.open .mega {
    position: static; width: auto; opacity: 1; visibility: inherit; transform: none;
    grid-template-columns: 1fr; box-shadow: none; padding: 4px 0 12px; border: 0; background: none;
    backdrop-filter: none; -webkit-backdrop-filter: none; transition: none;
  }
  body.menu-open { overflow: hidden; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  section, .p-sec, .showcase { padding-bottom: 72px; }
  .hero { padding: 48px 0 72px; }
  .cat-cards, .feats, .res-grid, .split, .pager { grid-template-columns: minmax(0, 1fr); }
  .split { gap: 28px; }
  .facts { grid-template-columns: 1fr 1fr; gap: 14px 24px; width: 100%; }
  .p-title { gap: 16px; align-items: flex-start; }
  .pi.big { width: 64px; height: 64px; border-radius: 16px; }
  .pi.big.glyph svg { width: 32px; height: 32px; }
  .gallery { grid-template-columns: minmax(0, 1fr); grid-template-areas: "a" "b" "w" "p"; }
  .cta .btn, .links .btn { flex: 1 1 auto; }
  .foot { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   Movimento ridotto: tutto visibile, nessuna animazione
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv, .js .hero .lead, .js .hero .cta, .js .log-list li, .js .log-foot,
  .js .card.rv .head img, .js h1[data-words] .w > span { opacity: 1 !important; transform: none !important; }
  .js .rot > span:not(:first-child) { display: none; }
  .js .rot > span:first-child { opacity: 1; transform: none; }
  .js .glyph svg * { stroke-dashoffset: 0 !important; }
  .js .sh::after { transform: none; }
  .js .statement .sw { opacity: 1; }
}
}
