/* Davide Dorigatti · sito 2026
   Un solo carattere (JetBrains Mono), carta, inchiostro, bianco e un acquamarina.
   Desktop da 900px in su, telefono sotto. Le animazioni stanno in js/main.js e girano a 10fps. */

/* JetBrains Mono (licenza OFL), caricato dalla cartella del sito: nessuna richiesta a Google */
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url('../font/jetbrains-mono-latin.woff2') format('woff2-variations'), url('../font/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url('../font/jetbrains-mono-latin-ext.woff2') format('woff2-variations'), url('../font/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #F2EEE4;
  --ink: #1D1B18;
  --text: #33302B;
  --muted: #5F5A51;
  --white: #FFFFFF;
  --acc: #3AB5A0;
  --gut: 64px;
  --font: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-weight: 300;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* grana della carta: una texture generata una volta dal js, in moltiplica sopra tutto.
   Sta sulla pagina, non sullo schermo, così scorre insieme ai contenuti. */
body { position: relative; }
body::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 50;
  background-image: var(--grain, none); mix-blend-mode: multiply; opacity: 0.25;
}
a { color: var(--ink); }
img, svg { display: block; max-width: 100%; }
main { overflow-x: clip; }
h1, h2, h3, p, ul { margin: 0; }
strong { font-weight: 800; color: var(--ink); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut); }
.mob { display: none !important; }

/* ------------------------------------------------------------ testi */
.label { font-size: 11px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; font-weight: 300; }
.txt { color: var(--text); font-weight: 300; line-height: 1.65; max-width: 560px; }
.b15 { font-size: 15px; max-width: 320px; }
.b16 { font-size: 16px; max-width: 580px; }
.b17 { font-size: 17px; max-width: 540px; }
.b18 { font-size: 18px; }
.wide { max-width: 800px; }

.title {
  position: relative; font-weight: 750; line-height: 1.15; letter-spacing: -1px; color: var(--ink);
  filter: url(#soft);
}
.t-hero { font-size: 54px; letter-spacing: -1.5px; }
.t-h2 { font-size: 40px; max-width: 820px; }
.t-h2s { font-size: 34px; max-width: 560px; }
.t-h2c { font-size: 48px; }
/* il js duplica il titolo: sotto lo strato dell'evidenziatore, sopra il testo */
.title .under { position: absolute; inset: 0; color: transparent; filter: url(#hl); pointer-events: none; }
.title .over { position: relative; }
.hlw { background: linear-gradient(var(--white), var(--white)) no-repeat 0 0 / var(--p, 100%) 100%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hl-first { padding-left: 10px; margin-left: -10px; }
.hl-last { padding-right: 10px; margin-right: -10px; }

.intro { display: flex; flex-direction: column; gap: 20px; }

/* ------------------------------------------------------------ testata */
/* la barra ha sempre la stessa altezza nel flusso della pagina: quando diventa nera scivola in su
   con una trasformazione, che non sposta i contenuti (niente salti durante lo scorrimento) */
.top { position: sticky; top: 0; z-index: 20; --lift: 26px; transition: transform 0.3s steps(3); }
.top.stuck { transform: translateY(calc(var(--lift) * -1)); }
.top-in { position: relative; display: flex; justify-content: space-between; align-items: center; padding-top: 40px; padding-bottom: 12px; }
/* quando si scorre la barra diventa una striscia di carta con il bordo irregolare */
.top::before { content: ''; position: absolute; inset: -12px 0 -5px; background: var(--ink); filter: url(#bar);
  opacity: 0; transition: opacity 0.2s steps(2); }
.top.stuck::before { opacity: 1; }
/* sulla striscia nera: testo carta, logo in negativo, l'acquamarina resta */
.top .name, .top .nav a, .top .menu-btn, .top .logo .k, .top .mi i:not(.a) { transition: color 0.2s steps(2), background-color 0.2s steps(2); }
.top.stuck .name, .top.stuck .nav a, .top.stuck .menu-btn { color: var(--paper); }
.top.stuck .logo .k, .top.stuck .mi i:not(.a) { background: var(--paper); }
.top.stuck .nav a.on { color: var(--ink); }
section[id] { scroll-margin-top: 64px; }
#top { scroll-margin-top: 999px; } /* il logo riporta proprio in cima */
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.logo { display: grid; grid-template-columns: repeat(3, 8px); grid-auto-rows: 8px; }
.logo i { display: block; }
.logo .k { background: var(--ink); }
.logo .a { background: var(--acc); }
.name { font-size: 17px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.nav { display: flex; gap: 28px; }
.nav a, .menu-btn { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; text-decoration: none; }
.nav a, .menu a { position: relative; }
.nav-t { position: relative; }
.nav a:hover .nav-t { text-decoration: underline; text-decoration-color: var(--acc); text-decoration-thickness: 2px; text-underline-offset: 5px; }
/* sezione in cui ti trovi: l'evidenziatore bianco, passato dal js */
.nav-hl { position: absolute; left: -6px; right: -6px; top: -3px; bottom: -3px; background: var(--white); filter: url(#hl); clip-path: inset(0 100% 0 0); }

/* ------------------------------------------------------------ pulsanti e link */
.btn { position: relative; display: inline-flex; align-self: flex-start; text-decoration: none; }
.btn-bg { position: absolute; top: 4px; left: -6px; right: -6px; bottom: 2px; background: var(--acc); filter: url(#hl);
  transform-origin: left; }
.btn-t { position: relative; display: inline-flex; align-items: center; gap: 12px; height: 48px; padding: 0 8px;
  font-size: 16px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink); }
.btn-t b { font-weight: 300; color: var(--white); transition: transform 0.2s steps(2); }
.btn:hover .btn-t b { transform: translateX(6px); }
.mail .btn-t { height: 52px; font-size: 18px; }
.ulink { position: relative; align-self: flex-start; display: inline-block; padding-bottom: 8px; font-size: 15px; font-weight: 700; text-decoration: none; }
.ulink .ul { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--acc); filter: url(#line); transform-origin: left; }

/* ------------------------------------------------------------ sezioni */
.sec { position: relative; padding-top: 80px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 56px; }
.sec.last { padding-bottom: 64px; overflow: hidden; }

.hero { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; padding-top: 112px; padding-bottom: 40px; }
.hero-text { grid-column: span 7; display: flex; flex-direction: column; gap: 28px; }
.hero-illo { grid-column: 8 / span 5; margin-left: 50px; margin-right: -24px; align-self: stretch; position: relative; min-height: 240px; }
/* affiancata al testo: va dall'eyebrow al pulsante e, se il testo è corto, resta appoggiata in basso */
.hero-illo svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }

.probs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 80px; row-gap: 56px; }
.prob { display: flex; gap: 32px; align-items: flex-start; }
.glyph { width: 120px; height: 120px; flex: none; }
.prob-t { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.prob .txt { max-width: 360px; }
.code { font-size: 11px; letter-spacing: 1px; color: var(--muted); }

.phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 64px; }
.phase { display: grid; grid-template-areas: "meta" "glyph" "name" "what" "get"; row-gap: 20px; align-content: start; }
.ph-meta { grid-area: meta; display: flex; align-items: center; gap: 14px; }
.marks { display: flex; gap: 4px; }
.marks i { width: 12px; height: 12px; box-shadow: inset 0 0 0 1.5px var(--ink); }
.marks i.on { background: var(--ink); }
.ph-glyph { grid-area: glyph; }
.ph-name { grid-area: name; font-size: 26px; font-weight: 750; letter-spacing: -0.5px; }
.ph-d { display: flex; flex-direction: column; gap: 8px; }
.ph-d:nth-of-type(1) { grid-area: what; margin-top: 4px; }
.ph-d:nth-of-type(2) { grid-area: get; }

.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.split .intro { grid-column: span 7; }
.split-illo { grid-column: 8 / span 5; }
.lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 80px; }
.lists > div { display: flex; flex-direction: column; gap: 12px; }
.list { padding: 0; list-style: none; }
.list li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px dashed var(--muted); }
/* resta solo la linea sotto l'etichetta dell'elenco */
.list li + li { border-top: 0; padding-top: 4px; }
.list .txt { font-size: 16px; line-height: 1.55; }
.mk { flex: none; width: 12px; height: 12px; margin-top: 6px; box-shadow: inset 0 0 0 1.5px var(--ink); }
.mk.on { background: var(--acc); box-shadow: none; }

.lab { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.lab-l { grid-column: span 5; display: flex; flex-direction: column; gap: 28px; }
.lab-r { grid-column: 7 / span 6; display: flex; flex-direction: column; gap: 28px; }
.lab-name { display: flex; flex-direction: column; gap: 8px; }
.lab-name h3 { font-size: 26px; font-weight: 750; letter-spacing: -0.5px; }
.lab-body { display: flex; flex-direction: column; gap: 28px; }
.render { width: 124%; max-width: none; height: auto; margin: -24px 0 -16px -12%; }
.tiles-wrap { display: flex; flex-direction: column; gap: 28px; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.tile { position: relative; aspect-ratio: 1 / 1; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile::after { content: ''; position: absolute; inset: -2px; border: 5px solid var(--paper); filter: url(#tile); pointer-events: none; }
.tile.solid { filter: url(#rough); }
.tile.solid::after { display: none; }
.tile.k { background: var(--ink); }
.tile.w { background: var(--white); }
.tile.a { background: var(--acc); }

.chi { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.chi-l { grid-column: span 5; display: flex; flex-direction: column; }
.portrait { width: 210px; height: auto; margin: 20px 0 14px -8px; }
.chi-r { grid-column: 7 / span 6; align-self: stretch; position: relative; }
.chi-r svg { position: absolute; top: 34px; left: 0; height: calc(100% - 44px); width: auto; max-width: 100%; }
.chi-t { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.chi-t .txt:nth-child(1) { grid-column: span 5; }
.chi-t .txt:nth-child(2) { grid-column: 7 / span 5; }

.contact { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.contact-l { grid-column: span 5; padding-right: 24px; }
.contact-r { grid-column: 7 / span 6; display: flex; flex-direction: column; gap: 28px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.foot { display: flex; justify-content: space-between; align-items: center; margin-top: 40px;
  font-size: 11px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.f-id { display: flex; align-items: center; gap: 14px; }
.flogo { width: 15px; height: 20px; flex: none; }

/* menu del telefono */
.menu-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 8px 0; color: var(--ink); font-family: var(--font); font-size: 12px; letter-spacing: 1px; cursor: pointer; }
.mi { display: grid; grid-template-columns: repeat(2, 6px); grid-auto-rows: 6px; gap: 2px; }
.mi i { background: var(--ink); }
.mi i.a { background: var(--acc); }
.menu-btn[aria-expanded="true"] .mi i:nth-child(2), .menu-btn[aria-expanded="true"] .mi i:nth-child(3) { background: transparent !important; }
.menu { position: fixed; inset: 0; z-index: 15; background: var(--paper); padding: 110px 20px 40px;
  display: flex; flex-direction: column; gap: 8px; }
.menu[hidden] { display: none; }
.menu a { font-size: 31px; font-weight: 750; letter-spacing: -1px; text-decoration: none; padding: 6px 0; }
.menu .menu-mail { margin-top: auto; font-size: 15px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }

/* ------------------------------------------------------------ desktop stretto (tablet orizzontale, portatili piccoli) */
@media (min-width: 900px) and (max-width: 1119px) {
  :root { --gut: 40px; }
  .t-hero { font-size: 46px; letter-spacing: -1.3px; }
  .t-h2 { font-size: 34px; }
  .t-h2s { font-size: 30px; }
  .t-h2c { font-size: 42px; }
  .hero { padding-top: 96px; }
  .hero-text { grid-column: span 7; }
  .hero-illo { margin-left: 24px; margin-right: 0; }
  .probs { column-gap: 48px; }
  .prob { gap: 24px; }
  .prob .glyph { width: 96px; height: 96px; }
  .phases { column-gap: 40px; }
  .lists { column-gap: 48px; }
  .chi-l, .contact-l, .lab-l { grid-column: span 6; }
  .lab-r { grid-column: 7 / span 6; }
  .contact-r { grid-column: 7 / span 6; }
  .contact-l { padding-right: 0; }
  .render { width: 112%; margin: -20px 0 -12px -6%; }
}

/* ------------------------------------------------------------ telefono */
@media (max-width: 899px) {
  :root { --gut: 20px; }
  .desk { display: none !important; }
  .mob { display: flex !important; }
  .top-in { padding-top: 20px; padding-bottom: 10px; }
  .top { --lift: 8px; }
  section[id] { scroll-margin-top: 52px; }
  .logo { grid-template-columns: repeat(3, 6px); grid-auto-rows: 6px; }
  .brand { gap: 10px; }
  .name { font-size: 13px; }

  .sec { padding-top: 48px; padding-bottom: 48px; gap: 36px; }
  .txt, .b15, .b16, .b17, .b18 { font-size: 15px; max-width: none; }
  .t-hero, .t-h2c { font-size: 31px; letter-spacing: -1px; line-height: 1.18; }
  .t-h2, .t-h2s { font-size: 25px; }

  .hero { display: flex; flex-direction: column; gap: 40px; padding-top: 72px; padding-bottom: 48px; }
  .hero-text { gap: 24px; }
  .btn-t { font-size: 15px; }
  .hero-illo { margin: 0; padding: 0; min-height: 0; }
  /* in colonna: altezza limitata, così dai pezzi sparsi al blocco si vede tutta nella prima schermata */
  .hero-illo svg { position: static; width: auto; height: min(300px, 36svh); max-width: 100%; }

  .probs { display: flex; flex-direction: column; gap: 32px; }
  .prob { gap: 18px; }
  .prob .glyph { width: 84px; height: 84px; }
  .prob-t { gap: 8px; padding-top: 4px; }

  .phases { display: flex; flex-direction: column; gap: 44px; }
  .phase { grid-template-columns: 1fr; grid-template-areas: "glyph" "meta" "name" "what" "get"; row-gap: 12px; }
  .ph-glyph { justify-self: start; margin: 0 0 4px -4px; }
  .ph-glyph .glyph { width: 88px; height: 88px; }
  .ph-name { font-size: 22px; }
  .ph-d { gap: 6px; margin-top: 6px; }

  .split { display: flex; flex-direction: column; gap: 36px; align-items: stretch; }
  .lists { display: flex; flex-direction: column; gap: 36px; }
  .list .txt { font-size: 15px; }

  /* laboratorio: le due colonne si sciolgono e i pezzi si rimettono in fila */
  .lab { display: flex; flex-direction: column; gap: 36px; align-items: stretch; }
  .lab-l, .lab-r { display: contents; }
  .o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; } .o6 { order: 6; }
  .lab-body { gap: 16px; }
  .lab-name h3 { font-size: 22px; }
  .render { width: 406px; margin: -50px 0 -4px -54px; align-self: center; }
  .tiles { gap: 8px; }
  .tiles-wrap { gap: 12px; }
  .tiles-wrap .label { font-size: 10px; }

  .chi { display: flex; flex-direction: column; }
  .portrait { width: 180px; margin: 16px 0 16px -6px; }
  .chi-t { display: flex; flex-direction: column; gap: 16px; }

  .contact { display: flex; flex-direction: column; align-items: stretch; }
  .contact-r { gap: 36px; }
  .mail .btn-t { height: 48px; font-size: 15px; letter-spacing: 0.3px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 0; margin-top: 28px; line-height: 1.7; }
  .f-id { flex-direction: column; align-items: flex-start; gap: 16px; }
  .flogo { width: 24px; height: 32px; }
  .f-addr { display: flex; flex-direction: column; }
  .f-addr .sep { display: none; }
  .foot > a { margin-top: 10px; }
  .corner { position: absolute; right: 0; bottom: 0; pointer-events: none; transform-origin: 100% 100%; }
  .corner.off { display: none !important; }
  .corner svg { width: 190px; height: 300px; overflow: visible; }
}

/* ------------------------------------------------------------ tablet
   Parte dal layout del telefono e rimette due colonne dove lo spazio c'è. */
@media (min-width: 600px) and (max-width: 899px) {
  :root { --gut: 40px; }
  .top-in { padding-top: 28px; }
  .top { --lift: 14px; }
  .sec { padding-top: 64px; padding-bottom: 64px; gap: 44px; }
  .txt, .b15, .b16, .b17, .b18 { font-size: 16px; max-width: 560px; }
  .t-hero { font-size: 42px; letter-spacing: -1.2px; }
  .t-h2c { font-size: 40px; }
  .t-h2, .t-h2s { font-size: 32px; }

  .hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 32px; align-items: center; padding-top: 88px; padding-bottom: 56px; }
  .hero-text, .hero-illo { grid-column: auto; }
  .hero-illo { padding: 0; margin: 0; }
  .hero-illo svg { position: absolute; width: 100%; height: 100%; }

  .probs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; row-gap: 40px; }
  .prob { flex-direction: column; gap: 16px; }

  .phases { gap: 48px; }
  .phase { grid-template-columns: 120px minmax(0, 1fr); column-gap: 32px; grid-template-areas: "glyph meta" "glyph name" "glyph what" "glyph get"; }
  .ph-glyph { align-self: start; margin: 0; }
  .ph-glyph .glyph { width: 120px; height: 120px; }
  .ph-name { font-size: 24px; }

  .split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 32px; align-items: center; }
  .lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .list .txt { font-size: 15px; }

  .render { width: min(620px, 110%); margin: -60px 0 -20px -5%; align-self: flex-start; }
  .lab-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .lab-body .txt { font-size: 15px; }
  .tiles { gap: 12px; }

  .chi { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 32px; }
  .chi-l { display: contents; }
  .chi-l .label { grid-column: 1 / -1; }
  .portrait { grid-column: 1; grid-row: 2; width: 200px; margin: 20px 0 0 -8px; }
  .chi-l .title { grid-column: 2; grid-row: 2; align-self: end; margin-bottom: 8px; }
  .chi-t { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .chi-t .txt, .chi-t .txt:nth-child(1), .chi-t .txt:nth-child(2) { grid-column: auto; font-size: 15px; }

  .contact-r { max-width: 520px; }
  .corner svg { width: 240px; height: 380px; }
}

/* tablet piccolo: la hero torna in colonna */
@media (min-width: 600px) and (max-width: 719px) {
  .hero { display: flex; flex-direction: column; gap: 48px; }
  .hero-illo svg { position: static; width: auto; height: min(340px, 34svh); }
  .split { display: flex; flex-direction: column; align-items: stretch; }
  .split-illo { max-width: 440px; }
}

/* ------------------------------------------------------------ animazioni
   Lo stato iniziale vale solo con il js attivo e senza "riduci movimento". */
@media (prefers-reduced-motion: no-preference) {
  .anim .label, .anim .txt, .anim .code, .anim .ph-name, .anim .lab-name h3, .anim .render, .anim .portrait,
  .anim .list li, .anim .foot > span, .anim .foot > a, .anim .btn-t, .anim .ulink,
  .anim .name, .anim .nav a, .anim .menu-btn { opacity: 0; }
  .anim .title .w, .anim .illo rect, .anim .illo path, .anim .tile, .anim .marks i, .anim .mk,
  .anim .flogo rect, .anim .logo i { visibility: hidden; }
  .anim .title .hlw { --p: 0%; }
  .anim .list li .txt { opacity: 1; }
  .anim .btn-bg, .anim .ulink .ul { clip-path: inset(0 100% 0 0); }
  /* blocchi attraversati di corsa: compaiono già finiti */
  .anim .done, .anim .done * { opacity: 1 !important; visibility: visible !important; }
  .anim .done .hlw { --p: 100% !important; }
  .anim .done .btn-bg, .anim .done .ul, .anim .done .portrait, .anim .done.portrait { clip-path: none !important; }
}
.title .w { display: inline-block; }
.title .w.j { transform: translateY(0.08em); }
