/* bebroggi.it — stile pulito, colori delle bandiere nautiche.
   Un solo carattere: Google Sans, per testo, titoli, etichette e numeri.
   Palette del codice internazionale dei segnali: blu notte per il testo, rosso, giallo e blu
   per gli accenti. Ogni sezione ha la sua bandiera (la lettera iniziale).
   Le animazioni: filetti che si tracciano, righe evidenziate in giallo, numeri che girano
   come un contamiglia, bandiere che sventolano. */

:root {
  --ink: #0e1a2b;
  --paper: #fff;
  --grey: #5d6470;
  --grey2: #98a0ab;
  --hair: #dde0e5;
  --wash: #eef1f5;
  --red: #d7262e;
  --yellow: #f6c519;
  --blue: #1446a0;
  --sky: #c9d6ee;
  --font: "Google Sans", "Product Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 1240px;
  --gutter: 24px;
  --label: 11rem;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --top: 64px;
  interpolate-size: allow-keywords;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 12px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--yellow); color: var(--ink); }
img, video { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; text-decoration-color: var(--red); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.on-dark :focus-visible, .machine :focus-visible { outline-color: var(--yellow); }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 6px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Etichette in mono */
.mono, .group, .sec__title, .nav, .clock, .lang, .btn, .tag, .meta-mono, .foot .wrap {
  font-family: var(--font); font-size: .74rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase;
}

/* Pulsanti: rettangoli neri che si invertono */
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 18px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .25s ease, color .25s ease;
}
.btn:hover { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.btn .arr { display: inline-block; transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translate(3px, -3px); }
.btn:hover .arr--down { transform: translateY(3px); }
.btn:hover .arr--right { transform: translateX(4px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--light { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.btn--light:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.btn--small { min-height: 34px; padding: 0 12px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tag { padding: 4px 8px; border: 1px solid currentColor; font-size: .64rem; line-height: 1.3; }

.live { display: inline-flex; align-items: center; gap: 8px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: blink 1.6s steps(2, start) infinite; }
.live--off i { background: transparent; border: 1px solid currentColor; animation: none; }
@keyframes blink { to { visibility: hidden; } }

/* ─── Testata ─── */
.masthead { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--hair); }
.masthead::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--red);
  transform: scaleX(var(--p, 0)); transform-origin: left;
}
.masthead .wrap { display: flex; align-items: center; gap: 8px 26px; min-height: var(--top); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 500; text-decoration: none; white-space: nowrap; margin-right: auto; }
.brand .flag { width: 21px; height: 14px; }
.brand .flag + .flag { margin-left: -7px; }
.nav { display: flex; gap: 22px; }
.nav a { text-decoration: none; position: relative; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.nav a:hover::after, .nav a.is-here::after { transform: scaleX(1); transform-origin: left; }
.clock { color: var(--grey); white-space: nowrap; }
.lang { margin: 0; white-space: nowrap; }
.lang a { text-decoration: none; color: var(--grey2); }
.lang a[aria-current] { color: var(--ink); }
@media (max-width: 1080px) { .clock { display: none; } }
@media (max-width: 860px) {
  .masthead .wrap { flex-wrap: wrap; padding-top: 10px; }
  .nav { order: 5; width: 100%; gap: 18px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  :root { --top: 92px; }
}
@media (max-width: 560px) { .masthead .btn { display: none; } :root { --top: 84px; } }

/* ─── Bandiere del codice internazionale dei segnali ─── */
.flag { display: inline-block; vertical-align: middle; flex: none; }
.hoist { position: absolute; z-index: 3; top: -18px; left: -46px; width: 30px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 18px; }
.hoist::before { content: ""; position: absolute; left: 0; top: 0; bottom: -10px; width: 1px; background: var(--ink); }
.hoist .flag { width: 30px; height: 20px; transform-origin: 0 50%; animation: flutter 3.6s ease-in-out infinite; animation-delay: calc(var(--k, 0) * -.45s); }
@keyframes flutter { 0%, 100% { transform: skewY(0) scaleX(1); } 35% { transform: skewY(-5deg) scaleX(.94); } 70% { transform: skewY(3deg) scaleX(.98); } }
.hoist__say { position: absolute; left: 40px; top: 18px; white-space: nowrap; padding: 4px 7px; background: var(--ink); color: var(--paper); font-family: var(--font); font-size: .6rem; letter-spacing: .05em; text-transform: uppercase; opacity: 0; transform: translateX(-6px); transition: opacity .3s, transform .3s var(--ease); pointer-events: none; }
.hoist:hover .hoist__say, .hoist:focus .hoist__say { opacity: 1; transform: none; }
@media (max-width: 899px) { .hoist { left: auto; right: -38px; } .hoist__say { left: auto; right: 40px; } }

/* ─── Apertura ─── */
.hero { padding: clamp(36px, 6vw, 72px) 0 0; }
.hero__grid { display: grid; gap: 40px; align-items: end; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: minmax(0, 1fr) clamp(15rem, 26vw, 21rem); gap: 56px; } }
.hero__title em { font-style: normal; background: linear-gradient(var(--yellow), var(--yellow)) no-repeat 0 90% / 0% 32%; transition: background-size 1.2s var(--ease) .9s; }
.hero__title.in em, html:not(.js) .hero__title em { background-size: 100% 32%; }
.hero__title { margin: 0 0 22px; font-size: clamp(2.2rem, 5vw, 4.4rem); font-weight: 500; line-height: 1.06; letter-spacing: -.035em; max-width: 17ch; }
.hero__sub { margin: 0 0 30px; max-width: 46ch; font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--grey); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.hero__stack { margin: 0; color: var(--grey); }

/* Parole che salgono da sotto una riga */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.w > span { display: inline-block; }

/* Ritratto: stampa con i segni di taglio */
.print { position: relative; margin: 0; padding: 14px; }
.print::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 10px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 0 / 1px 10px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 0 / 10px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 0 / 1px 10px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 100% / 10px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 100% / 1px 10px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 100% / 10px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 100% / 1px 10px no-repeat;
}
.print__frame { position: relative; overflow: hidden; aspect-ratio: 820 / 1000; background: var(--wash); }
.print__frame img, .print__frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.print figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--grey); font-family: var(--font); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; }
@media (max-width: 899px) { .hero .print { max-width: 19rem; } }

/* Laser eyes: si accendono solo mentre sorrido nel video (finestra in data-from/data-to, vedi site.js).
   Le posizioni delle pupille sono misurate sul video e date in % del riquadro. */
.laser { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s ease; }
.laser.on { opacity: 1; }
.laser i { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; }
.laser i::before {
  content: ""; position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 14%, #ff3b3b 30%, rgba(255, 20, 20, .55) 50%, rgba(255, 0, 0, 0) 72%);
  animation: laser-pulse .16s steps(2, end) infinite alternate;
}
.laser i::after, .laser b {
  content: ""; position: absolute; left: -110px; top: -2px; width: 220px; height: 4px; border-radius: 50%;
  background: radial-gradient(ellipse at center, #fff 0 6%, rgba(255, 50, 50, .95) 20%, rgba(255, 0, 0, 0) 70%);
}
.laser b { transform: rotate(-24deg) scaleX(.7); }
.laser em {
  position: absolute; right: 10px; bottom: 10px; padding: 4px 8px; background: #f7931a; color: #fff;
  font-style: normal; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  transform: translateY(6px); transition: transform .3s var(--ease);
}
.laser.on em { transform: none; }
@keyframes laser-pulse { to { transform: scale(1.18); filter: brightness(1.25); } }

/* ─── La macchina: un dato disordinato diventa una riga pulita ─── */
.machine { margin-top: clamp(40px, 6vw, 72px); background: var(--ink); color: var(--paper); }
.machine .wrap { padding-block: 22px 28px; }
.machine__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; padding-bottom: 14px; border-bottom: 1px solid #2a3850; color: var(--grey2); }
.machine__tabs { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.machine__tabs button { padding: 0 0 3px; border: 0; border-bottom: 1px solid transparent; background: none; color: var(--grey2); cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.machine__tabs button[aria-selected="true"] { color: var(--paper); border-bottom-color: var(--yellow); }
.machine__body { display: grid; gap: 22px; padding-top: 22px; min-height: 17rem; }
@media (min-width: 900px) { .machine__body { grid-template-columns: minmax(0, 1fr) 4rem minmax(0, 1.15fr); gap: 32px; } }
.machine__label { margin: 0 0 10px; color: var(--grey2); font-family: var(--font); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; }
.machine__raw { position: relative; margin: 0; font-family: var(--font); font-size: clamp(.92rem, 1.4vw, 1.05rem); line-height: 1.6; color: #e6ebf3; min-height: 5em; word-break: break-word; }
.machine__raw::after { content: "▌"; margin-left: 2px; animation: blink 1s steps(2, start) infinite; }
.machine__raw.done::after { content: ""; }
.machine__arrow { position: relative; display: grid; place-items: center; font-size: 2rem; color: var(--grey2); }
.machine__arrow::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #2a3850; }
.machine__arrow span { position: relative; padding: 0 6px; background: var(--ink); transition: color .3s; }
.machine.is-working .machine__arrow span { color: var(--red); animation: nudge .6s ease-in-out infinite alternate; }
@keyframes nudge { to { transform: translateX(6px); } }
@media (max-width: 899px) { .machine__arrow { transform: rotate(90deg); height: 2rem; width: 2rem; } }
.machine__out { margin: 0; }
.machine__out > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid #24324a; opacity: .18; transition: opacity .35s; }
.machine__out > div.on { opacity: 1; }
.machine__out dt { color: var(--yellow); font-family: var(--font); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; padding-top: .25em; }
.machine__out dd { margin: 0; min-height: 1.5em; }
.machine__foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; color: var(--grey2); font-family: var(--font); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; }
.machine__bar { flex: 1; max-width: 14rem; align-self: center; height: 2px; background: #2a3850; position: relative; overflow: hidden; }
.machine__bar i { position: absolute; inset: 0; background: var(--yellow); transform: scaleX(0); transform-origin: left; }

/* ─── Sezioni: etichetta a sinistra, contenuto a destra ─── */
.sec { position: relative; padding-block: 28px 80px; }
.sec::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--ink); transform-origin: left; transition: transform 1.3s var(--ease); }
.sec > .wrap { display: grid; gap: 18px; }
.sec__title { margin: 0; font-weight: 400; }
.sec__title .flag { display: block; width: 33px; height: 22px; margin-bottom: 12px; }
.sec__title b { display: block; margin-top: 6px; font-family: var(--font); font-size: 1.4rem; font-weight: 500; line-height: 1.2; letter-spacing: -.02em; text-transform: none; }
.sec__body { min-width: 0; }
.sec__lead { margin: 0 0 30px; max-width: 54ch; font-size: clamp(1.2rem, 1.8vw, 1.5rem); line-height: 1.35; letter-spacing: -.015em; }
@media (min-width: 1000px) {
  .sec > .wrap { grid-template-columns: var(--label) minmax(0, 1fr); gap: 0 40px; }
  .sec__title { position: sticky; top: calc(var(--top) + 22px); align-self: start; }
}

.group { margin: 40px 0 0; padding-bottom: 8px; color: var(--grey); border-bottom: 1px solid var(--ink); display: flex; justify-content: space-between; gap: 12px; }
.group:first-child { margin-top: 0; }

/* Righe con filetto che si traccia */
.rows { margin: 0; padding: 0; list-style: none; }
.rows > * { position: relative; }
.rows > *::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--hair); transform-origin: left; transition: transform .9s var(--ease) var(--d, 0s); }

/* ─── Lavoro ─── */
.job > summary {
  list-style: none; cursor: pointer; position: relative;
  display: grid; align-items: center; gap: 2px 14px; padding: 12px 0;
  grid-template-columns: 2.5rem minmax(0, 1fr) 1.25rem;
  grid-template-areas: "logo when tog" "logo who tog" "logo what tog" "logo num tog";
  background: linear-gradient(var(--yellow), var(--yellow)) no-repeat 0 0 / 0% 100%;
  transition: background-size .5s var(--ease), padding .3s var(--ease);
}
.job > summary::-webkit-details-marker { display: none; }
.job > summary:hover, .job[open] > summary { background-size: 100% 100%; padding-inline: 10px; }
.job .when { grid-area: when; font-variant-numeric: tabular-nums; font-family: var(--font); font-size: .76rem; color: var(--grey); transition: color .25s; }
.job .logo { grid-area: logo; align-self: start; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; }
.job .logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.job .who { grid-area: who; font-weight: 500; }
.job .what { grid-area: what; }
.job .num { grid-area: num; font-family: var(--font); font-size: .76rem; color: var(--grey); transition: color .25s; }
.job .tog { grid-area: tog; justify-self: end; font-family: var(--font); }
.job .tog::before { content: "+"; }
.job[open] .tog::before { content: "−"; }
.job > summary:hover .when, .job > summary:hover .num, .job[open] > summary .when, .job[open] > summary .num { color: var(--ink); }
@media (min-width: 760px) {
  .job > summary {
    grid-template-columns: 6.5rem 2.5rem 13rem minmax(0, 1fr) 14rem 1.25rem;
    grid-template-areas: "when logo who what num tog";
    padding: 10px 0;
  }
  .job .logo { align-self: center; height: 2rem; }
  .job .num { text-align: right; }
}
.job::details-content { block-size: 0; overflow: hidden; transition: block-size .55s var(--ease), content-visibility .55s allow-discrete; }
.job[open]::details-content { block-size: auto; }

.job__body { padding: 20px 0 36px; max-width: 66ch; }
@media (min-width: 760px) { .job__body { margin-left: calc(6.5rem + 2.5rem + 28px); } }
.job__body > p:first-child { margin-top: 0; }
.job__body h3 { margin: 24px 0 8px; font-family: var(--font); font-size: .7rem; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); }
.job__body ul { margin: 0; padding: 0; list-style: none; }
.job__body ul li { position: relative; padding-left: 1.1em; margin: 0 0 5px; }
.job__body ul li::before { content: "–"; position: absolute; left: 0; }
.job__body ul.skills { display: flex; flex-wrap: wrap; gap: 6px; }
.job__body ul.skills li { padding: 3px 8px; margin: 0; border: 1px solid var(--ink); font-family: var(--font); font-size: .66rem; letter-spacing: .04em; text-transform: uppercase; }
.job__body ul.skills li::before { content: none; }
.job__body .ext { display: inline-block; margin-top: 22px; font-family: var(--font); font-size: .76rem; }
.job__body .ext::after { content: " ↗"; }

.site-list li { padding-left: 0 !important; border-bottom: 1px solid var(--hair); margin: 0 !important; }
.site-list li::before { content: none !important; }
.site-list a { display: grid; grid-template-columns: 11rem minmax(0, 1fr) auto; gap: 12px; padding: 8px 6px; text-decoration: none; background: linear-gradient(var(--yellow), var(--yellow)) no-repeat 0 0 / 0% 100%; transition: background-size .4s var(--ease); }
.site-list a:hover { background-size: 100% 100%; }
.site-list a:hover span { color: var(--ink); }
.site-list span { color: var(--grey); }
.site-list em { font-style: italic; font-weight: 400; color: var(--grey); }
@media (max-width: 560px) { .site-list a { grid-template-columns: minmax(0, 1fr) auto; } .site-list span { grid-column: 1; } .site-list b { grid-row: 1; grid-column: 2; } }

.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 4px; }
.shots a { display: block; border: 1px solid var(--hair); overflow: hidden; }
.shots a:first-child { grid-column: 1 / -1; }
.shots p { grid-column: 1 / -1; margin: 0; font-size: .8rem; color: var(--grey); }

/* ─── Progetti in vetrina ─── */
.show { display: grid; border: 1px solid var(--ink); margin-bottom: 28px; background: var(--paper); }
@media (min-width: 900px) {
  .show { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .show--flip .show__visual { order: 2; border-left: 1px solid var(--ink); }
  .show:not(.show--flip) .show__visual { border-right: 1px solid var(--ink); }
}
.show__visual {
  position: relative; display: block; min-height: clamp(300px, 36vw, 470px); overflow: hidden; text-decoration: none;
  background: var(--wash) radial-gradient(rgba(20,70,160,.25) 1px, transparent 1.3px) 0 0 / 16px 16px;
}
@media (max-width: 899px) { .show__visual { border-bottom: 1px solid var(--ink); } }
.show__badge { position: absolute; z-index: 4; top: 16px; left: 16px; padding: 6px 10px; background: var(--ink); color: var(--paper); }
.show__badge .live i { background: var(--yellow); }
.show__hint { position: absolute; z-index: 4; right: 16px; bottom: 14px; color: var(--grey); }
.browser { position: absolute; z-index: 1; left: 6%; top: 15%; width: 76%; border: 1px solid var(--ink); background: var(--paper); box-shadow: 10px 10px 0 var(--blue); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.browser__bar { display: flex; align-items: center; gap: 12px; height: 28px; padding: 0 10px; border-bottom: 1px solid var(--ink); }
.browser__dots { display: flex; gap: 5px; }
.browser__dots i { width: 8px; height: 8px; border: 1px solid var(--ink); border-radius: 50%; }
.browser__url { overflow: hidden; color: var(--grey); font-family: var(--font); font-size: .62rem; white-space: nowrap; text-overflow: ellipsis; }
.browser img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.phone { position: absolute; z-index: 2; right: 6%; bottom: 7%; width: 23%; aspect-ratio: 540 / 1169; border: 5px solid var(--ink); border-radius: 22px; overflow: hidden; background: var(--ink); box-shadow: 8px 8px 0 var(--red); transition: transform .5s var(--ease); }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.show__visual:hover .browser { transform: translate(-4px, -4px); box-shadow: 14px 14px 0 var(--blue); }
.show__visual:hover .phone { transform: translateY(-8px) rotate(-2deg); }
.show__copy { padding: clamp(24px, 3.4vw, 46px); display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.show__copy h3 { margin: 0; font-size: clamp(2rem, 3.5vw, 3.3rem); font-weight: 500; line-height: 1.02; letter-spacing: -.035em; }
.show__copy p { margin: 0; max-width: 46ch; }
.show__links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.show__links .alt { font-family: var(--font); font-size: .72rem; }

.places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 16px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .places { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.place { display: block; text-decoration: none; }
.place__img { overflow: hidden; border: 1px solid var(--ink); aspect-ratio: 4 / 5; background: var(--wash); }
.place__img img { width: 100%; height: 100%; object-fit: cover; }
.place:hover .place__img img { transform: scale(1.04); }
.place small { display: block; margin-top: 10px; color: var(--grey); font-family: var(--font); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; }
.place strong { display: block; margin-top: 2px; font-size: 1.2rem; font-weight: 500; letter-spacing: -.02em; }
.place:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.place span { display: block; color: var(--grey); font-size: .95rem; line-height: 1.4; }

/* ─── Strumenti: griglia a filetti, demo vive ─── */
.tools { display: grid; border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
@media (min-width: 900px) { .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tool { display: flex; flex-direction: column; gap: 16px; padding: clamp(20px, 2.6vw, 30px); border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--paper); }
.tool__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--grey); }
.tool h3 { margin: -6px 0 0; font-size: clamp(1.5rem, 2.2vw, 1.95rem); font-weight: 500; line-height: 1.1; letter-spacing: -.025em; }
.tool h3 small { display: block; margin-top: 6px; color: var(--grey); font-family: var(--font); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; }
.tool__viz { padding: 14px; border: 1px solid var(--hair); background: var(--paper); min-height: 15rem; display: flex; flex-direction: column; justify-content: center; }
.tool__media { position: relative; overflow: hidden; border: 1px solid var(--ink); aspect-ratio: 16 / 9; background: var(--ink); }
.tool__media img, .tool__media video { width: 100%; height: 100%; object-fit: cover; }
.tool .pitch { margin: 0; color: #2a2a2a; }
.tool .pitch strong { color: var(--ink); }
.tool__foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding-top: 4px; }
.tool__foot .tags { color: var(--grey); }

/* Barre: i colori delle bandiere */
.c-red { background: var(--red); }
.c-blue { background: var(--blue); }
.c-yellow { background: var(--yellow); }
.c-sky { background: var(--sky); }
.c-grey { background: #b7bec8; }
.hbars { display: grid; gap: 4px; }
.hbar { display: grid; grid-template-columns: minmax(5rem, 7.5rem) minmax(2rem, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--hair); transition: background .3s, color .3s, border-color .3s; }
.hbar span { overflow: hidden; font-family: var(--font); font-size: .66rem; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; }
.hbar .bar { display: block; height: 12px; width: 2%; transition: width .7s var(--ease); }
.hbar b { font-family: var(--font); font-size: .76rem; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.hbar.win { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.hbar.win b { color: var(--yellow); }
.viz-foot { margin: 10px 0 0; color: var(--grey); font-family: var(--font); font-size: .64rem; line-height: 1.5; }
.seg { display: inline-flex; margin-bottom: 10px; border: 1px solid var(--ink); align-self: flex-start; }
.seg button { min-height: 30px; padding: 0 12px; border: 0; background: transparent; cursor: pointer; font-family: var(--font); font-size: .66rem; letter-spacing: .05em; text-transform: uppercase; }
.seg button + button { border-left: 1px solid var(--ink); }
.seg button.on { background: var(--ink); color: var(--paper); }

.verdict { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.verdict small { display: block; color: var(--grey); font-family: var(--font); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; }
.verdict strong { font-size: 1.3rem; font-weight: 500; letter-spacing: -.02em; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--ink); }
.tiles > div { padding: 10px; }
.tiles > div + div { border-left: 1px solid var(--ink); }
.tiles > div:last-child { background: var(--yellow); }
.tiles small { display: block; font-family: var(--font); font-size: .6rem; letter-spacing: .04em; text-transform: uppercase; opacity: .7; }
.tiles b { display: block; margin-top: 4px; font-size: clamp(1rem, 1.6vw, 1.3rem); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.chips i { padding: 4px 8px; border: 1px solid var(--hair); font-family: var(--font); font-size: .62rem; font-style: normal; color: var(--grey); }
.chips i.on { border-color: var(--ink); background: var(--ink); color: var(--paper); }

.radar__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.radar__head b { color: var(--grey); font-family: var(--font); font-size: .64rem; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; }
.radar__head em { font-family: var(--font); font-size: 1.1rem; font-style: normal; font-weight: 500; color: var(--blue); }
.radar__bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; align-items: end; height: 64px; border-bottom: 1px solid var(--ink); }
.radar__bars i { display: block; min-height: 3px; background: var(--sky); cursor: pointer; transform-origin: bottom; transition: background .15s, transform .5s var(--ease); }
.radar__bars i.on { background: var(--blue); }
.radar__rows { display: grid; gap: 6px; margin-top: 12px; }
.radar__row { display: grid; grid-template-columns: minmax(70px, 96px) minmax(40px, 1fr); align-items: center; gap: 8px; }
.radar__row > span:first-child { font-family: var(--font); font-size: .62rem; text-transform: uppercase; letter-spacing: .03em; }
.radar__track { position: relative; height: 12px; background: var(--wash); }
.radar__track i { position: absolute; top: 0; bottom: 0; }
.radar__track i.pub { width: 3px; background: var(--red); }

.slider { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.slider span { color: var(--grey); font-family: var(--font); font-size: .64rem; text-transform: uppercase; letter-spacing: .05em; }
.slider b { font-family: var(--font); font-size: .8rem; font-weight: 500; }
.tool input[type="range"] { width: 100%; margin: 8px 0 12px; accent-color: var(--red); }

/* Vento: raffiche bianche sul video */
.wind { position: absolute; inset: 0; pointer-events: none; }
.wind i { position: absolute; left: -30%; height: 1px; width: 26%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent); animation: gust 3.2s linear infinite; }
.wind i:nth-child(1) { top: 28%; }
.wind i:nth-child(2) { top: 52%; animation-delay: 1.1s; width: 34%; }
.wind i:nth-child(3) { top: 74%; animation-delay: 2.1s; }
@keyframes gust { to { left: 110%; } }

/* App e dashboard */
.devs { display: grid; gap: 28px; margin-top: 28px; }
@media (min-width: 900px) { .devs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.devcard { border: 1px solid var(--ink); display: flex; flex-direction: column; }
.devcard__visual { position: relative; display: grid; place-items: center; min-height: 26rem; padding: 34px 28px; overflow: hidden; border-bottom: 1px solid var(--ink); text-decoration: none; background: var(--wash) radial-gradient(rgba(20,70,160,.25) 1px, transparent 1.3px) 0 0 / 16px 16px; }
.devcard__body { padding: clamp(20px, 2.6vw, 30px); display: flex; flex-direction: column; align-items: flex-start; gap: 14px; flex: 1; }
.devcard__body h3 { margin: 0; font-size: clamp(1.5rem, 2.2vw, 1.95rem); font-weight: 500; line-height: 1.1; letter-spacing: -.025em; }
.devcard__body p { margin: 0; color: #2a2a2a; }
.devcard__body .btn { margin-top: auto; }
.note-tag { position: absolute; padding: 6px 10px; background: var(--ink); color: var(--paper); }
.note-tag--a { right: 22px; top: 70px; transform: rotate(4deg); background: var(--red); }
.note-tag--b { left: 22px; bottom: 44px; transform: rotate(-4deg); background: var(--blue); }
.note-tag--c { left: 20px; top: 18px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); }

.app { position: relative; width: 218px; height: 430px; border: 6px solid var(--ink); border-radius: 30px; overflow: hidden; background: var(--paper); box-shadow: 10px 10px 0 var(--yellow); transition: transform .5s var(--ease); }
.devcard__visual:hover .app { transform: translateY(-8px) rotate(-1.5deg); }
.app__ui { position: absolute; inset: 0; display: flex; flex-direction: column; font-size: .5rem; }
.app__top { display: flex; align-items: flex-end; justify-content: space-between; min-height: 56px; padding: 22px 12px 10px; border-bottom: 1px solid var(--hair); }
.app__top strong { font-size: .8rem; }
.app__top em, .app__nav strong { padding: 4px 7px; background: var(--ink); color: var(--paper); font-family: var(--font); font-size: .42rem; font-style: normal; }
.app__body { flex: 1; display: flex; flex-direction: column; padding: 22px 13px 12px; text-align: center; }
.app__body > small { color: var(--grey); font-family: var(--font); font-size: .42rem; text-transform: uppercase; letter-spacing: .08em; }
.app__body > strong { margin-top: 6px; font-size: 1.05rem; font-weight: 500; }
.app__progress { height: 4px; margin: 14px 18px 5px; background: var(--hair); }
.app__progress i { display: block; width: 18%; height: 100%; background: var(--red); }
.app__count { color: var(--grey); font-family: var(--font); font-size: .44rem; }
.app__wish { margin-top: 18px; padding: 12px; display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; border: 1px solid var(--ink); text-align: left; }
.app__wish b { font-size: .8rem; font-weight: 500; }
.app__wish > span { overflow: hidden; color: var(--grey); font-size: .46rem; white-space: nowrap; text-overflow: ellipsis; align-self: center; }
.app__wish small { color: var(--grey); font-size: .42rem; }
.app__wish em { justify-self: end; padding: 4px 8px; background: var(--ink); color: var(--paper); font-size: .42rem; font-style: normal; }
.app__search { margin-top: 10px; padding: 7px 10px; border: 1px solid var(--hair); color: var(--grey); font-size: .44rem; text-align: left; }
.app__empty { margin: auto 0; color: var(--grey); font-size: .6rem; font-style: italic; }
.app__nav { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 8px 10px 13px; border-top: 1px solid var(--hair); color: var(--grey); font-family: var(--font); font-size: .4rem; text-transform: uppercase; }

.devcard__visual .browser { position: relative; left: auto; top: auto; width: 100%; }
.flow { display: flex; align-items: center; gap: 6px; width: 100%; }
.flow span { flex: 1; padding: 8px 4px; border: 1px solid var(--ink); text-align: center; font-family: var(--font); font-size: .6rem; letter-spacing: .04em; text-transform: uppercase; transition: background .3s, color .3s; }
.flow span.on { background: var(--yellow); }
.flow b { font-weight: 400; }

/* ─── Diario: colonne di giornale ─── */
.posts { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
@media (min-width: 760px) { .posts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.post { position: relative; }
.post a { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 18px 0 26px; border-bottom: 1px solid var(--hair); text-decoration: none; }
@media (min-width: 760px) {
  .post a { padding: 20px 22px 28px; border-left: 1px solid var(--hair); }
  .post:nth-child(3n + 1) a { padding-left: 0; border-left: 0; }
}
.post time { color: var(--grey); font-family: var(--font); font-size: .66rem; letter-spacing: .05em; text-transform: uppercase; }
.post strong { font-size: 1.25rem; font-weight: 500; line-height: 1.25; letter-spacing: -.02em; }
.post span { color: var(--grey); font-size: 1rem; line-height: 1.45; }
.post em { margin-top: auto; padding-top: 6px; font-family: var(--font); font-size: .68rem; font-style: normal; letter-spacing: .05em; text-transform: uppercase; }
.post em::after { content: "→"; display: inline-block; margin-left: .4em; transition: transform .3s var(--ease); }
.post a:hover strong { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--red); text-underline-offset: .18em; }
.post a:hover em { color: var(--red); }
.post a:hover em::after { transform: translateX(5px); }
.more { margin: 26px 0 0; }

/* ─── Vela ─── */
.sea { display: grid; gap: 32px; align-items: center; margin-bottom: 30px; }
@media (min-width: 900px) { .sea { grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; } }
.odo-big { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.odo-big__n { font-size: clamp(3.4rem, 9.5vw, 7rem); font-weight: 500; line-height: .95; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.odo-big__n small { font-size: .4em; vertical-align: .9em; margin-right: .08em; }
.sea__meta { margin: 14px 0 22px; color: var(--grey); max-width: 54ch; }
.sea__intro { margin: 0; max-width: 60ch; }
.ring { width: 100%; max-width: 300px; justify-self: center; }
.ring svg { display: block; width: 100%; height: auto; overflow: visible; }
.ring .track { fill: none; stroke: var(--hair); stroke-width: 1; }
.ring .lat { fill: none; stroke: var(--blue); stroke-opacity: .35; stroke-width: 1; stroke-dasharray: 2 4; }
.ring .arc { fill: none; stroke: var(--red); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 2.4s var(--ease); }
.ring .boat { transition: transform 2.4s var(--ease); transform-origin: 150px 150px; }
.ring text { font-family: var(--font); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; fill: var(--grey); }
.ring .pct { font-family: var(--font); font-size: 44px; font-weight: 500; letter-spacing: -.03em; text-transform: none; fill: var(--ink); }

.item { display: grid; gap: 2px 16px; padding: 11px 0; grid-template-columns: minmax(0, 1fr); }
.item b { font-weight: 500; }
.item .meta { color: var(--grey); }
@media (min-width: 760px) {
  .item--race { grid-template-columns: 14rem 11rem minmax(0, 1fr); align-items: baseline; }
  .item--cruise { grid-template-columns: 14rem minmax(0, 1fr) 11rem; align-items: baseline; }
  .item--cruise > :last-child { text-align: right; }
}
.item [data-nm] { white-space: nowrap; }
.fold { margin-top: 34px; border-top: 1px solid var(--ink); }
.fold > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; font-family: var(--font); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "+"; }
.fold[open] > summary::after { content: "−"; }
.fold::details-content { block-size: 0; overflow: hidden; transition: block-size .55s var(--ease), content-visibility .55s allow-discrete; }
.fold[open]::details-content { block-size: auto; }

/* Contamiglia */
/* ogni cifra è una finestra alta 1.2em su un rullo 0–9 0–9 */
.odo { display: inline-flex; align-items: flex-start; vertical-align: bottom; }
.odo > span { display: inline-block; height: 1.2em; line-height: 1.2em; }
.odo__d { overflow: hidden; }
.odo__col { display: block; transition: transform 1.8s var(--ease); }
.odo__col > span { display: block; height: 1.2em; line-height: 1.2em; }

/* ─── Fuori ufficio ─── */
.life { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 170px; grid-auto-flow: dense; gap: 10px; }
@media (min-width: 760px) { .life { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 210px; gap: 12px; } }
.card { position: relative; overflow: hidden; margin: 0; background: var(--ink); cursor: zoom-in; }
.card img, .card video { transition: transform 1.2s var(--ease); }
.card img, .card video { width: 100%; height: 100%; object-fit: cover; }
.card:hover img, .card:hover video { transform: scale(1.03); }
.card--hero { grid-column: span 2; grid-row: span 2; }
.card--tall { grid-row: span 2; }
.card--wide { grid-column: span 2; }
.card__cap { position: absolute; z-index: 2; left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 6px 9px 7px; background: var(--paper); color: var(--ink); font-size: .9rem; line-height: 1.25; }
.card__cap strong { display: block; font-weight: 500; }
.card__cap span { display: block; color: var(--grey); font-size: .78rem; }
.card__cap a { position: relative; z-index: 3; }
.card__badge { position: absolute; z-index: 2; top: 10px; left: 10px; padding: 5px 8px; background: var(--red); color: var(--paper); font-family: var(--font); font-size: .6rem; letter-spacing: .05em; text-transform: uppercase; }
.card__play { position: absolute; z-index: 2; top: 10px; right: 10px; padding: 4px 7px; background: var(--yellow); color: var(--ink); font-family: var(--font); font-size: .6rem; letter-spacing: .05em; text-transform: uppercase; }
.card--post { grid-column: span 2; grid-row: span 2; display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; background: var(--paper); cursor: default; }
.card--post figure { position: relative; margin: 0; overflow: hidden; background: var(--ink); cursor: zoom-in; }
.card--post figure:first-child { grid-row: span 2; }
.card--links { display: flex; align-items: flex-end; padding: 18px; background: var(--blue); color: var(--paper); text-decoration: none; cursor: pointer; }
.card--links small { display: block; color: var(--sky); font-family: var(--font); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; }
.card--links strong { display: block; font-size: 1.9rem; font-weight: 500; line-height: 1.05; letter-spacing: -.03em; }
.card--links em { display: block; margin-top: 4px; color: var(--sky); font-style: normal; font-size: .95rem; }
.card--links:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
@media (max-width: 759px) { .card--post { grid-template-columns: 1fr 1fr; grid-template-rows: 2fr 1fr; } .card--post figure:first-child { grid-row: auto; grid-column: span 2; } }

.viewer { max-width: min(1200px, 94vw); max-height: 94vh; padding: 0; border: 0; background: transparent; color: var(--paper); overflow: visible; }
.viewer::backdrop { background: rgba(14, 26, 43, .95); }
.viewer img, .viewer video { max-height: 80vh; width: auto; max-width: 100%; margin: 0 auto; background: var(--ink); }
.viewer__cap { margin: 10px 0 0; font-size: .95rem; }
.viewer__cap span { display: block; color: var(--grey2); font-size: .85rem; }
.viewer__cap a { color: var(--paper); }
.viewer__bar { display: flex; align-items: baseline; gap: 20px; padding: 10px 0 0; font-family: var(--font); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.viewer__bar button { padding: 0; border: 0; background: none; color: var(--paper); cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; text-decoration: underline; text-underline-offset: .18em; }
.viewer__bar [data-close] { margin-left: auto; }

/* ─── Contatti: la sezione in negativo ─── */
.contact { position: relative; overflow: hidden; background: var(--blue); color: var(--paper); padding-block: clamp(72px, 11vw, 140px); }
.contact__bg { position: absolute; inset: 0; }
.contact__bg video { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15); mix-blend-mode: multiply; opacity: .55; }
.contact .wrap { position: relative; }
.contact__label { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; color: var(--sky); }
.contact__label .flag { width: 33px; height: 22px; }
.contact h2 { margin: 0 0 30px; font-size: clamp(3.2rem, 10vw, 8.4rem); font-weight: 500; line-height: .95; letter-spacing: -.05em; }
.contact .mail { display: inline-block; margin-bottom: 30px; font-size: clamp(1.4rem, 3.8vw, 2.6rem); letter-spacing: -.03em; text-decoration-color: var(--yellow); }
.contact a:hover { text-decoration-color: var(--yellow); }
.contact__links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.contact__links a:not(.btn) { font-family: var(--font); font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; }

/* ─── Piede ─── */
.foot { border-top: 1px solid var(--ink); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding-block: 16px 28px; color: var(--grey); }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ─── Pagine semplici (link che amo) ─── */
.page { padding-block: 40px 72px; }
.page h1 { margin: 0 0 6px; font-size: clamp(2.3rem, 5.6vw, 3.8rem); font-weight: 500; line-height: 1.05; letter-spacing: -.035em; }
.page h1 + p { margin: 0 0 34px; color: var(--grey); max-width: 60ch; }
.page h2 { margin: 34px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-family: var(--font); font-size: .72rem; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); }
.page ul { margin: 0; padding: 0; list-style: none; }
.page h2, .page ul { max-width: 46rem; }
.page li { padding: 10px 0; border-bottom: 1px solid var(--hair); }
.page .note { margin-top: 34px; color: var(--grey); }

/* ─── Animazioni d'entrata (solo con JS e se il sistema non chiede meno movimento) ─── */
@media (prefers-reduced-motion: no-preference) {
  .js .sec::before { transform: scaleX(0); }
  .js .sec.in::before { transform: scaleX(1); }
  .js .rows > *::after { transform: scaleX(0); }
  .js .rows.in > *::after { transform: scaleX(1); }
  .js .w > span { transform: translateY(108%); transition: transform .9s var(--ease) var(--d, 0s); }
  .js .in .w > span, .js .w.in > span { transform: none; }
  /* tendina: un pannello color carta che scorre via (clip-path sul target confonderebbe l'IntersectionObserver) */
  .js [data-wipe] { position: relative; }
  .js [data-wipe]::after { content: ""; position: absolute; inset: -1px; z-index: 6; background: var(--paper); pointer-events: none; transform-origin: 50% 100%; transition: transform 1.1s var(--ease) var(--d, 0s); }
  .js [data-wipe].in::after { transform: scaleY(0); }
  .js [data-rise] { opacity: 0; transform: translateY(18px); transition: opacity .8s ease var(--d, 0s), transform .9s var(--ease) var(--d, 0s); }
  .js [data-rise].in { opacity: 1; transform: none; }
  .js .radar__bars i { transform: scaleY(0); }
  .js .radar__bars.in i { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .masthead, .machine, .viewer, .contact__bg { display: none !important; }
  .contact { background: none; color: var(--ink); }
}
