/* ==========================================================================
   SmartChair — foglio di stile principale
   Palette: blu elettrico (neurale) · bianco · grigio metallo (hardware) · verde acido (open source)
   ========================================================================== */

/* ---------- Font (ospitati localmente, licenza OFL) ---------- */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  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: "Space Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("../fonts/space-grotesk-latin-ext-wght-normal.woff2") format("woff2-variations");
  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;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  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: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  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;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
}

/* ---------- Design token ---------- */
:root {
  /* Blu elettrico */
  --blue: #1846ff;
  --blue-600: #1238d6;
  --blue-400: #3d6bff;
  --blue-glow: #4f8bff;
  --blue-50: #eef2ff;

  /* Notte neurale (sfondi scuri) */
  --navy: #050b24;
  --navy-800: #0a1438;
  --navy-700: #101d4d;

  /* Grigio metallo */
  --metal-50: #f5f7fa;
  --metal-100: #eceff4;
  --metal-200: #dde2ea;
  --metal-300: #c3cad6;
  --metal-400: #9aa3b2;
  --metal-500: #6d7789;
  --metal-600: #4c5566;
  --metal-700: #333a47;

  /* Verde acido */
  --acid: #c6ff1a;
  --acid-600: #a8e000;
  --acid-ink: #3f6600; /* verde leggibile su bianco */

  --white: #ffffff;
  --ink: #0b1020;
  --text: #1d2433;
  --muted: var(--metal-500);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgb(11 16 32 / .06), 0 1px 1px rgb(11 16 32 / .04);
  --shadow: 0 10px 30px -12px rgb(11 16 32 / .18), 0 2px 6px rgb(11 16 32 / .05);
  --shadow-blue: 0 18px 40px -16px rgb(24 70 255 / .45);

  --container: 1180px;
  --narrow: 760px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-600); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--acid); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--acid); color: var(--navy); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
main { display: block; outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 1000;
  background: var(--acid); color: var(--navy); padding: .6rem 1rem; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container.narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }

.dot {
  display: inline-block; width: .55em; height: .55em; border-radius: 50%;
  background: var(--acid); box-shadow: 0 0 0 4px rgb(198 255 26 / .18), 0 0 14px rgb(198 255 26 / .7);
  margin-right: .6em; vertical-align: .08em;
}

.eyebrow {
  font-family: var(--font-mono); font-size: .78rem; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--metal-300); margin-bottom: 1.25rem;
}
.eyebrow--dark { color: var(--metal-500); }
.eyebrow--dark .dot { box-shadow: 0 0 0 4px rgb(198 255 26 / .35); }

/* ---------- Pulsanti ---------- */
.btn {
  --btn-bg: var(--blue); --btn-fg: var(--white); --btn-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .7rem 1.35rem; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1.5px solid var(--btn-bd);
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: -.005em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; color: var(--btn-fg); }
.btn--sm { min-height: 40px; padding: .45rem 1rem; font-size: .92rem; }
.btn--acid { --btn-bg: var(--acid); --btn-fg: var(--navy); }
.btn--acid:hover { box-shadow: 0 10px 30px -8px rgb(198 255 26 / .55); }
.btn--ghost { --btn-bg: rgb(255 255 255 / .04); --btn-fg: var(--white); --btn-bd: rgb(255 255 255 / .35); backdrop-filter: blur(6px); }
.btn--ghost:hover { --btn-bd: var(--white); --btn-bg: rgb(255 255 255 / .1); }
.btn--blue:hover { --btn-bg: var(--blue-600); box-shadow: var(--shadow-blue); }
.btn--outline { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--metal-300); }
.btn--outline:hover { --btn-bd: var(--blue); --btn-fg: var(--blue); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  background: rgb(5 11 36 / .55);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgb(255 255 255 / .06);
  transition: background-color .3s, border-color .3s;
}
.site-header.is-scrolled { background: rgb(5 11 36 / .88); border-bottom-color: rgb(255 255 255 / .1); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--white); text-decoration: none; }
.brand:hover { color: var(--white); text-decoration: none; }
.brand .logo-mark { width: 36px; height: 36px; color: var(--blue-glow); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.03em; }
.brand-name span { color: var(--blue-glow); }

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.site-nav ul a {
  position: relative; display: block; padding: .5rem .85rem; border-radius: 999px;
  color: var(--metal-200); text-decoration: none; font-size: .95rem; font-weight: 500;
  transition: color .2s, background-color .2s;
}
.site-nav ul a:hover { color: var(--white); background: rgb(255 255 255 / .07); }
.site-nav ul a[aria-current="page"] { color: var(--white); }
.site-nav ul a[aria-current="page"]::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 50%; background: var(--acid); box-shadow: 0 0 10px var(--acid);
}
.lang-switch {
  display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; min-height: 36px;
  border: 1px solid rgb(255 255 255 / .22); border-radius: 999px;
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .06em;
  color: var(--metal-300); text-decoration: none; transition: border-color .2s, color .2s;
}
.lang-switch:hover { border-color: var(--acid); color: var(--white); text-decoration: none; }
.lang-current { color: var(--acid); font-weight: 500; }
.lang-sep { opacity: .4; }

.nav-toggle { display: none; }

@media (max-width: 880px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: 12px; border: 1px solid rgb(255 255 255 / .18);
    background: transparent; color: var(--white); cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px;
    transition: transform .3s var(--ease), opacity .2s;
  }
  .nav-toggle-bars { position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 1rem;
    padding: 1rem var(--gutter) 1.5rem; background: rgb(5 11 36 / .97);
    border-bottom: 1px solid rgb(255 255 255 / .08);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: transform .3s var(--ease), opacity .25s, visibility 0s .3s;
  }
  .site-nav.is-open { transform: none; opacity: 1; visibility: visible; transition: transform .3s var(--ease), opacity .25s; }
  .site-nav ul { flex-direction: column; }
  .site-nav ul a { padding: .85rem .5rem; font-size: 1.1rem; border-radius: 10px; }
  .site-nav ul a[aria-current="page"]::after { left: auto; right: .75rem; top: 50%; bottom: auto; margin: -2.5px 0 0; }
  .lang-switch { align-self: flex-start; }
  .no-js .site-nav { position: static; transform: none; opacity: 1; visibility: visible; }
}

/* ---------- Hero homepage ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 72vh; min-height: 72svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 3.5rem) 0 4.5rem;
  background:
    radial-gradient(1200px 700px at 75% 40%, rgb(24 70 255 / .35), transparent 60%),
    radial-gradient(800px 500px at 10% 90%, rgb(24 70 255 / .18), transparent 60%),
    var(--navy);
  color: var(--white);
}
.scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0; transition: opacity 1.4s var(--ease); }
.scene.is-ready { opacity: 1; }
.hero-vignette {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgb(5 11 36 / .85) 0%, rgb(5 11 36 / .35) 45%, transparent 70%),
              linear-gradient(0deg, var(--navy) 0%, transparent 25%);
}
.hero-inner { position: relative; }
.hero-title {
  color: var(--white); font-weight: 700;
  font-size: clamp(2.4rem, 5.6vw, 4.6rem); line-height: 1.02; letter-spacing: -.04em;
  max-width: 15ch; margin-bottom: 1.4rem;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--blue-glow) 0%, #8fb2ff 45%, var(--acid) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-intro { max-width: 52ch; font-size: clamp(1.08rem, 1.6vw, 1.25rem); line-height: 1.6; color: var(--metal-100); margin-bottom: 1.25rem; }
.hero-motto { max-width: 52ch; padding-left: 1rem; border-left: 2px solid var(--acid); font-size: .98rem; font-style: italic; line-height: 1.55; color: var(--metal-300); margin-bottom: 2.25rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; }
/* ---------- Intestazione pagine interne ---------- */
.page-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: calc(var(--header-h) + clamp(3rem, 8vw, 6rem)) 0 clamp(3rem, 7vw, 5.5rem);
  background:
    radial-gradient(900px 400px at 85% 0%, rgb(24 70 255 / .4), transparent 65%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-800) 100%);
  color: var(--white);
}
.page-hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgb(198 255 26 / .55), transparent);
}
.page-hero-inner { position: relative; }
.page-title { color: var(--white); font-size: clamp(2.2rem, 5.5vw, 4rem); line-height: 1.04; letter-spacing: -.04em; max-width: 20ch; }
.page-lead { max-width: 60ch; font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--metal-200); margin: 0; }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: 1.75rem; font-size: .92rem; color: var(--metal-300); }
.page-hero--post .page-title { font-size: clamp(2rem, 4.6vw, 3.4rem); max-width: 24ch; }
.page-hero--post .page-hero-inner, .page-hero--post .page-meta { max-width: var(--narrow); }
.page-hero--404 { min-height: 80vh; display: flex; align-items: center; }
.back-link {
  display: inline-flex; gap: .4rem; margin-bottom: 1.5rem; color: var(--metal-300);
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
}
.back-link:hover { color: var(--acid); text-decoration: none; }

/* ---------- Sezioni ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section--tight { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section--metal { background: var(--metal-50); border-top: 1px solid var(--metal-100); border-bottom: 1px solid var(--metal-100); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2.5rem; }
.section-title { font-size: clamp(1.9rem, 3.6vw, 2.75rem); margin-bottom: .4em; }
.section-lead { max-width: 52ch; color: var(--metal-600); margin: 0; }

/* Pilastri */
.pillars-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--metal-200); border: 1px solid var(--metal-200); border-radius: var(--radius-lg); overflow: hidden; }
.pillars-grid { margin-top: 3rem; }
.pillar { background: var(--white); padding: clamp(1.5rem, 3vw, 2.25rem); transition: background-color .3s; }
.pillar:hover { background: var(--blue-50); }
.pillar-num {
  display: inline-block; font-family: var(--font-mono); font-size: .85rem; color: var(--blue);
  padding-bottom: .35rem; margin-bottom: 1.1rem; border-bottom: 2px solid var(--acid);
}
.pillar-title { font-size: 1.45rem; }
.pillar p { color: var(--metal-600); margin: 0; }

/* ---------- Card ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(1rem, 2vw, 1.5rem); }
.card {
  position: relative; display: flex; flex-direction: column;
  padding: clamp(1.4rem, 2.5vw, 1.85rem); border-radius: var(--radius-lg);
  background: var(--white); border: 1px solid var(--metal-200); box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgb(24 70 255 / .45); }
.card-title { font-size: 1.35rem; margin-bottom: .5rem; }
.card-link { color: var(--ink); text-decoration: none; }
.card-link:hover { color: var(--blue); text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* tutta la card cliccabile */
.card-text { color: var(--metal-600); font-size: .98rem; }
.card-cta {
  margin-top: auto; padding-top: .75rem; font-family: var(--font-display); font-weight: 600; font-size: .95rem;
  color: var(--blue); transition: transform .3s var(--ease);
}
.card:hover .card-cta { transform: translateX(4px); }

.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1rem; }
.tag {
  font-family: var(--font-mono); font-size: .74rem; padding: .2rem .55rem; border-radius: 999px;
  background: var(--metal-100); color: var(--metal-600);
}
.tag-list--post { margin-top: 2.5rem; }

/* ---------- Testi markdown ---------- */
.prose { color: var(--text); }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-top: 2.2em; }
.prose h3 { font-size: 1.35rem; margin-top: 1.8em; }
.prose h4 { font-size: 1.1rem; margin-top: 1.6em; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: .4em 0; padding-left: .2em; }
.prose ul li::marker { color: var(--blue); }
.prose ol li::marker { color: var(--blue); font-family: var(--font-mono); font-weight: 500; }
.prose blockquote {
  margin: 2em 0; padding: 1.25rem 1.5rem; border-left: 4px solid var(--acid);
  background: linear-gradient(90deg, var(--metal-50), transparent); border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-display); font-size: 1.2rem; line-height: 1.5; color: var(--ink);
}
.prose blockquote p:last-child { margin: 0; }
.prose code {
  font-family: var(--font-mono); font-size: .88em; padding: .12em .4em; border-radius: 6px;
  background: var(--metal-100); color: var(--navy-700);
}
.prose pre {
  margin: 1.6em 0; padding: 1.2rem 1.4rem; overflow-x: auto; border-radius: var(--radius);
  background: var(--navy); color: var(--metal-100); font-size: .9rem; line-height: 1.6;
  border: 1px solid var(--navy-700);
}
.prose pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
.prose img { border-radius: var(--radius); margin: 2em auto; }
.prose hr { border: 0; height: 1px; margin: 3em 0; background: linear-gradient(90deg, transparent, var(--metal-300), transparent); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.8em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose thead th { text-align: left; font-family: var(--font-mono); font-size: .76rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--metal-500); }
.prose th, .prose td { padding: .8rem 1rem; border-bottom: 1px solid var(--metal-200); vertical-align: top; }
.prose tbody tr:hover { background: var(--metal-50); }
.prose--intro { max-width: var(--narrow); margin-bottom: 2.5rem; font-size: 1.1rem; color: var(--metal-600); }
.prose--intro p:last-child { margin: 0; }

/* Post */
.translation-note { margin: 0 0 2rem; }
.translation-note a {
  display: inline-flex; padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--metal-300);
  font-family: var(--font-mono); font-size: .8rem; text-decoration: none; color: var(--metal-600);
}
.translation-note a:hover { border-color: var(--blue); color: var(--blue); }
.post-cover { margin: 0 0 2.5rem; }
.post-cover img { width: 100%; border-radius: var(--radius-lg); }
.post .prose { font-size: 1.1rem; }

/* Pagina ricerca */
.research-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.spec-card {
  position: sticky; top: calc(var(--header-h) + 24px);
  padding: 1.75rem; border-radius: var(--radius-lg); border: 1px solid var(--metal-200);
  background: linear-gradient(180deg, var(--metal-50), var(--white));
}
.spec-title { font-size: 1.15rem; }
.spec-list { margin: 0; }
.spec-list > div { display: grid; grid-template-columns: 1fr; gap: .15rem; padding: .8rem 0; border-top: 1px solid var(--metal-200); }
.spec-list dt { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--metal-500); }
.spec-list dd { margin: 0; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 880px) {
  .research-grid { grid-template-columns: 1fr; }
  .spec-card { position: static; order: -1; }
}

/* ---------- Contatti ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
.contact-side { display: grid; gap: 1.5rem; align-content: start; }
.contact-card:hover { transform: none; }
.contact-card .card-title { margin-top: 0; font-size: 1.3rem; }
.contact-email { font-family: var(--font-display); font-size: clamp(1.1rem, 2.4vw, 1.4rem); font-weight: 600; overflow-wrap: anywhere; }
.contact-card--dark { background: linear-gradient(150deg, var(--navy-700), var(--navy)); border-color: var(--navy-700); color: var(--metal-200); }
.contact-card--dark .card-title { color: var(--white); }
.contact-card--dark .card-text { color: var(--metal-300); }
.contact-card--dark .btn { align-self: flex-start; }
.mailto-form { display: grid; gap: 1.1rem; margin-top: .5rem; }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 600; font-size: .92rem; color: var(--ink); }
.field input, .field textarea {
  width: 100%; padding: .8rem 1rem; border-radius: 12px; border: 1.5px solid var(--metal-200);
  background: var(--metal-50); color: var(--ink); font: inherit; font-size: 1rem;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); background: var(--white); box-shadow: 0 0 0 4px rgb(24 70 255 / .15); }
.mailto-form .btn { justify-self: start; }
.form-fallback { font-size: .88rem; color: var(--metal-500); margin: 0; }
.prose .not-prose ul { padding: 0; }
.prose .not-prose li { padding: 0; margin: 0; }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }

.social-links { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; }
.social-links a {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; padding: .45rem .9rem; border-radius: 999px;
  border: 1px solid var(--metal-200); color: var(--text); text-decoration: none; font-size: .92rem; font-weight: 500;
  transition: border-color .2s, color .2s;
}
.social-links a:hover { border-color: var(--blue); color: var(--blue); }
.social-links svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Layout di supporto ---------- */
.container.narrow-wide { max-width: calc(900px + 2 * var(--gutter)); }
.section-head--compact { margin-bottom: 1.75rem; }
.section-head--compact .section-title { font-size: clamp(1.6rem, 2.8vw, 2.1rem); }
.text-link { display: inline-block; margin-top: 1.25rem; font-family: var(--font-display); font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* Home: cronologia + ricerche affiancate */
.dashboard { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.dashboard-main > .btn { margin-top: .5rem; }
.research-stack { display: grid; gap: 1rem; }
@media (max-width: 960px) { .dashboard { grid-template-columns: 1fr; } }

/* ---------- Cronologia del diario ---------- */
.timeline { list-style: none; margin: 0 0 2rem; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; top: 8px; bottom: 8px; left: calc(76px + 1rem + 11px); width: 2px;
  background: linear-gradient(180deg, var(--blue) 0%, var(--metal-200) 100%); border-radius: 2px;
}
.entry { position: relative; display: grid; grid-template-columns: 76px 24px minmax(0, 1fr); gap: 0 1rem; padding: .25rem 0 1.25rem; }
.entry[hidden] { display: none; }
.entry-date { display: flex; flex-direction: column; align-items: flex-end; padding-top: .9rem; line-height: 1.1; text-align: right; }
.entry-day { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; color: var(--ink); }
.entry-month { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--metal-500); margin-top: .2rem; }
.entry-node {
  position: relative; z-index: 1; justify-self: center; margin-top: 1.25rem;
  width: 14px; height: 14px; border-radius: 50%; background: var(--white);
  border: 3px solid var(--blue); box-shadow: 0 0 0 4px var(--white);
}
.section--metal .entry-node { box-shadow: 0 0 0 4px var(--metal-50); }
.kind-node--experiment { border-color: #7a3cff; }
.kind-node--result { border-color: var(--acid-600); background: var(--acid); }
.kind-node--note { border-color: var(--metal-400); }
.kind-node--explainer { border-color: #0e9fb8; }
.entry-body {
  position: relative; padding: 1rem 1.25rem 1.1rem; border-radius: var(--radius);
  background: var(--white); border: 1px solid var(--metal-200); box-shadow: var(--shadow-sm);
  transition: border-color .25s, box-shadow .25s, transform .3s var(--ease);
}
.entry-body:hover { border-color: rgb(24 70 255 / .45); box-shadow: var(--shadow); transform: translateX(3px); }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: 0 0 .5rem; }
.entry-project { font-family: var(--font-mono); font-size: .74rem; color: var(--metal-600); }
.entry-project::before { content: "↳ "; color: var(--metal-400); }
.entry-title { font-size: 1.15rem; margin: 0 0 .3rem; line-height: 1.3; }
.entry-text { margin: 0; color: var(--metal-600); font-size: .95rem; line-height: 1.55; }
@media (max-width: 560px) {
  .timeline::before { left: 11px; }
  .entry { grid-template-columns: 24px minmax(0, 1fr); gap: 0 .75rem; }
  .entry-date { grid-column: 2; flex-direction: row; gap: .4rem; align-items: baseline; padding: 0 0 .4rem; }
  .entry-day { font-size: 1rem; }
  .entry-node { grid-column: 1; grid-row: 1 / span 2; margin-top: .2rem; }
  .entry-body { grid-column: 2; }
}

.journal-month { margin-bottom: 1rem; }
.journal-month[hidden] { display: none; }
.journal-month-title {
  font-family: var(--font-mono); font-size: .8rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue); margin: 0 0 1rem; padding-left: calc(76px + 24px + 1rem);
}
@media (max-width: 560px) { .journal-month-title { padding-left: 0; } }

/* Tipo di voce */
.kind {
  display: inline-flex; align-items: center; padding: .18rem .6rem; border-radius: 999px;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  background: var(--blue-50); color: var(--blue); border: 1px solid rgb(24 70 255 / .18);
}
.kind--experiment { background: #f3edff; color: #5b23d6; border-color: rgb(122 60 255 / .22); }
.kind--result { background: rgb(198 255 26 / .3); color: var(--acid-ink); border-color: rgb(120 170 0 / .35); }
.kind--note { background: var(--metal-100); color: var(--metal-600); border-color: var(--metal-200); }
.kind--explainer { background: #e6f8fb; color: #0b6f80; border-color: rgb(14 159 184 / .25); }
.kind--on-dark { background: rgb(255 255 255 / .08); color: var(--acid); border-color: rgb(198 255 26 / .35); }
.hero-chip {
  display: inline-flex; padding: .18rem .7rem; border-radius: 999px; border: 1px solid rgb(255 255 255 / .25);
  font-family: var(--font-mono); font-size: .74rem; color: var(--white); text-decoration: none;
}
.hero-chip:hover { border-color: var(--acid); color: var(--acid); }

/* Filtri del diario */
.filters { display: grid; gap: .75rem; margin-bottom: 2.5rem; padding: 1.1rem 1.25rem; border-radius: var(--radius); background: var(--metal-50); border: 1px solid var(--metal-200); }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.filter-label { min-width: 5.5rem; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--metal-500); }
.chip {
  min-height: 36px; padding: .35rem .9rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--metal-300); background: var(--white); color: var(--metal-600);
  font: 500 .82rem var(--font-mono); transition: all .2s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--acid); }

/* ---------- Fasi della ricerca ---------- */
.phase-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin: 0 0 .75rem; }
.phase-key { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--metal-500); }
.phase-current { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.stepper { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; }
.step { display: flex; flex-direction: column; gap: .55rem; }
.step-bar { height: 6px; border-radius: 3px; background: var(--metal-200); }
.step--done .step-bar { background: var(--blue); }
.step--current .step-bar { background: linear-gradient(90deg, var(--blue), var(--acid)); box-shadow: 0 0 12px rgb(198 255 26 / .6); }
.step-name { font-size: .78rem; line-height: 1.3; color: var(--metal-500); }
.step--done .step-name { color: var(--metal-600); }
.step--current .step-name { color: var(--ink); font-weight: 600; }
.phase--compact .step-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.phase--compact .step-bar { height: 5px; }
.phase--compact .phase-label { margin-bottom: .5rem; }
.phase--compact .phase-current { font-size: .92rem; }
@media (max-width: 640px) {
  .phase:not(.phase--compact) .step-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Card ricerca */
.research-card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.research-icon {
  display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px;
  color: var(--white); background: linear-gradient(145deg, var(--blue-400), var(--blue-600));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), 0 8px 18px -8px rgb(24 70 255 / .7);
}
.research-icon--lg { width: 60px; height: 60px; margin-bottom: 1.1rem; }
.codename { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--metal-500); }
.research-card .card-title { font-size: 1.2rem; }
.research-card .phase { margin-top: auto; padding-top: 1rem; }
.research-card-foot { margin: .9rem 0 0; font-size: .8rem; color: var(--metal-500); }
.research-stack .research-card { padding: 1.25rem 1.35rem; }

/* Pagina ricerca */
.research-status { background: var(--metal-50); border-bottom: 1px solid var(--metal-100); }
.research-status .phase { max-width: 900px; }
.question {
  max-width: 900px; margin-top: 2rem; padding: 1.25rem 1.5rem; border-radius: var(--radius);
  background: var(--white); border: 1px solid var(--metal-200); border-left: 4px solid var(--acid);
}
.question-label { margin: 0 0 .35rem; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.question-text { margin: 0; font-family: var(--font-display); font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.45; color: var(--ink); }
.spec-subtitle { margin: 1.25rem 0 .5rem; font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--metal-500); }
.material-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.material-links a { font-weight: 500; text-decoration: none; }
.material-links a:hover { text-decoration: underline; }

/* Prossimi passi */
.checklist-progress { font-family: var(--font-mono); font-size: .8rem; color: var(--metal-500); margin-top: -.5em; }
.prose ul.checklist { list-style: none; padding: 0; }
.prose .checklist li { display: flex; gap: .75rem; align-items: flex-start; padding: .55rem 0; margin: 0; border-bottom: 1px solid var(--metal-100); }
.check { flex: none; width: 20px; height: 20px; margin-top: .2rem; border-radius: 6px; border: 2px solid var(--metal-300); background: var(--white); }
.checklist .is-done { color: var(--metal-500); }
.checklist .is-done .check {
  border-color: var(--blue); background: var(--blue)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c6ff1a' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* Riquadro ricerca in fondo alla voce */
.research-box { margin-top: 3rem; padding: 1.4rem 1.5rem; border-radius: var(--radius-lg); background: var(--metal-50); border: 1px solid var(--metal-200); }
.research-box-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.research-box-label { margin: 0; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--metal-500); }
.research-box-title { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.research-box-title:hover { color: var(--blue); }

/* ---------- Banda "segui la ricerca" ---------- */
.follow-band {
  position: relative; overflow: hidden; padding: clamp(3rem, 7vw, 5rem) 0;
  background: radial-gradient(700px 300px at 90% 100%, rgb(198 255 26 / .16), transparent 60%),
              linear-gradient(120deg, var(--navy-700), var(--navy));
  color: var(--white);
}
.follow-inner { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2rem; }
.follow-title { color: var(--white); font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin-bottom: .4em; }
.follow-band p { color: var(--metal-200); max-width: 54ch; margin: 0; }
.follow-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--metal-300); padding-top: clamp(3rem, 6vw, 4.5rem); font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 2.5rem; padding-bottom: 3rem; }
.footer-about p { max-width: 42ch; margin-top: 1rem; }
.footer-motto { font-family: var(--font-display); font-size: 1.05rem; color: var(--metal-200); border-left: 2px solid var(--acid); padding-left: 1rem; }
.footer-title { color: var(--white); font-family: var(--font-mono); font-size: .78rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1.1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .5rem; }
.site-footer a { color: var(--metal-200); text-decoration: none; }
.site-footer a:hover { color: var(--acid); }
.site-footer .social-links a { border-color: rgb(255 255 255 / .15); color: var(--metal-200); }
.site-footer .social-links a:hover { border-color: var(--acid); color: var(--acid); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem;
  padding-block: 1.5rem; border-top: 1px solid rgb(255 255 255 / .08); font-size: .85rem; color: var(--metal-400);
}
.footer-bottom p { margin: 0; }
.footer-open .dot { width: .5em; height: .5em; }
.footer-bottom a { text-decoration: underline; text-decoration-color: rgb(255 255 255 / .25); }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Animazioni di comparsa ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .scene, .follow-band, .filters { display: none !important; }
  .page-hero, .hero { background: none; color: #000; padding: 0 0 1rem; min-height: 0; }
  .page-title, .hero-title { color: #000; }
}
