/* ============================================================
   Smart Nexus — design tokens (da brief Monte 17/07/2026)
   Indigo #2B2C64 dominante · Orange #C25334 accento
   ============================================================ */
@font-face {
  font-family: "Archivo Black";
  src: url("fonts/archivo-black.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --indigo: #2B2C64;
  --indigo-deep: #1F2050;
  --indigo-surface: #383A7C;
  --orange: #C25334;
  --orange-hover: #A84228;
  --orange-ink: #A84228;   /* arancio per TESTO su fondi chiari: 5.3:1 su paper (AA) */
  --salmon: #E89B7F;          /* accento display su fondi scuri (contrasto AA large) */
  --paper: #F2EFE7;
  --paper-card: #FBFAF6;
  --ink: #23244D;
  --ink-soft: #4A4B72;
  --light: #F5F3EE;
  --light-soft: #C9CADF;

  --font-display: "Archivo Black", "Arial Black", Arial, sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --wrap: 1160px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(31, 32, 80, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- accessibilità ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--orange); color: #fff; padding: 10px 18px;
  z-index: 100; border-radius: 0 0 8px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.section-indigo :focus-visible, .hero :focus-visible, .site-header :focus-visible { outline-color: var(--salmon); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--indigo-deep);
  background: color-mix(in srgb, var(--indigo-deep) 92%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(245, 243, 238, .08);
}
.header-row { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { text-decoration: none; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .02em; }
.brand-sm { color: var(--orange); }
.brand-art { color: var(--light); font-family: var(--font-body); font-weight: 500; }
.brand-nexus { color: var(--light); }
.site-footer .brand-art, .site-footer .brand-nexus { color: var(--ink); }
.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a {
  color: var(--light-soft); text-decoration: none; font-size: .92rem; font-weight: 500;
  padding: 6px 2px; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: #fff; border-bottom-color: var(--orange); }

/* ---------- bottoni ---------- */
.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  border-radius: 10px; padding: 14px 26px; font-size: 1rem;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
  border: 2px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn-solid { background: var(--orange); color: #fff; }
.btn-solid:hover { background: var(--orange-hover); }
.btn-ghost { border-color: rgba(245, 243, 238, .45); color: var(--light); }
.btn-ghost:hover { border-color: var(--salmon); color: #fff; }
.btn-small { padding: 9px 18px; font-size: .9rem; }

/* ---------- tipografia comune ---------- */
h1, h2 { font-family: var(--font-display); font-weight: 400; line-height: 1.08; letter-spacing: .005em; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); margin-bottom: 18px; }
h3 { font-size: 1.15rem; margin-bottom: 10px; line-height: 1.3; }
.lead { font-size: 1.13rem; max-width: 46em; color: var(--ink-soft); margin-bottom: 40px; }
.lead-light { color: var(--light-soft); }
.lead strong { color: inherit; }

.eyebrow {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--orange-ink); margin-bottom: 14px;
}
.eyebrow::before { content: "// "; opacity: .7; }
.eyebrow-light { color: var(--salmon); }

.mono-label {
  font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--orange-ink); display: block; margin-bottom: 2px;
}
.section-indigo .mono-label { color: var(--salmon); }

/* ---------- sezioni ---------- */
.section { padding: 96px 0; scroll-margin-top: 72px; }
.section-paper { background: var(--paper); color: var(--ink); }
.section-indigo { background: var(--indigo); color: var(--light); }
.section-indigo h2 { color: #fff; }
.section-team { background: var(--indigo-deep); }

/* ---------- hero ---------- */
.hero {
  position: relative; background: var(--indigo-deep); color: var(--light);
  min-height: 88vh; display: flex; align-items: center; overflow: hidden;
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 2; padding-top: 80px; padding-bottom: 80px; }
.hero h1 { font-size: clamp(2.4rem, 6.4vw, 4.6rem); color: #fff; margin-bottom: 22px; max-width: 11em; }
.accent-dot { color: var(--orange); }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--light-soft); max-width: 36em; margin-bottom: 34px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.hero-proof { font-family: var(--font-mono); font-size: .84rem; color: var(--light-soft); }
.hero-proof a { color: var(--salmon); }

/* ---------- griglie e card ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  background: var(--paper-card); border: 1px solid rgba(35, 36, 77, .08);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.card-dark {
  background: var(--indigo-surface); border-color: rgba(245, 243, 238, .12);
  color: var(--light); box-shadow: none;
}
.card-dark h3 { color: #fff; }
.tick { display: inline-block; width: 12px; height: 12px; background: var(--orange); border-radius: 3px; margin-right: 10px; }

/* ---------- badge di stato ---------- */
.badge {
  display: inline-block; font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: .12em; text-transform: uppercase; padding: 4px 10px;
  border-radius: 999px; margin-bottom: 12px;
}
.badge-live { background: var(--orange); color: #fff; }
.badge-build { background: transparent; border: 1.5px dashed var(--orange-ink); color: var(--orange-ink); }
.section-indigo .badge-build { border-color: var(--salmon); color: var(--salmon); }
.badge-core { background: transparent; border: 1.5px solid var(--salmon); color: var(--salmon); }
.badge-test { background: var(--ink); color: var(--paper); }

/* ---------- nexus map ---------- */
.nexus-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: center; }
.nexus-map-wrap { overflow-x: auto; }
#nexus-map { width: 100%; height: auto; min-width: 540px; }
.link { stroke-width: 2; fill: none; }
.link-solid { stroke: var(--salmon); opacity: .9; }
.link-dashed { stroke: var(--salmon); stroke-dasharray: 6 7; opacity: .45; }
.node { cursor: pointer; }
.node circle { transition: transform .2s ease, filter .2s ease; transform-origin: center; transform-box: fill-box; }
.node:hover circle, .node:focus-visible circle, .node.is-active circle { transform: scale(1.09); filter: brightness(1.15); }
.node text {
  text-anchor: middle; font-family: var(--font-mono); font-size: 13.5px;
  fill: #fff; pointer-events: none;
}
.node-core circle { fill: var(--orange); }
.node-core text { font-size: 15px; }
.node-solid circle { fill: var(--indigo-surface); stroke: var(--salmon); stroke-width: 2.5; }
.node-dashed circle { fill: transparent; stroke: var(--light-soft); stroke-width: 2; stroke-dasharray: 6 6; }
.nexus-info { min-height: 240px; }
.nexus-story h3 { color: #fff; font-size: 1.35rem; }
.nexus-story p { color: var(--light-soft); }
.nexus-story a { color: var(--salmon); }
.nexus-hint { font-family: var(--font-mono); font-size: .8rem; color: var(--light-soft); opacity: .8; margin-top: 16px; }
.dashed-label { border-bottom: 2px dashed var(--salmon); }

/* ---------- progetti ---------- */
.projects .project h3 { font-size: 1.3rem; }
.project p { margin-bottom: 12px; }
.project-future { border: 1.5px dashed rgba(35, 36, 77, .35); background: transparent; box-shadow: none; }
.text-link { color: var(--orange-ink); font-weight: 600; text-decoration: none; }
.text-link::after {
  content: ""; display: inline-block; width: .5em; height: .5em;
  border-top: 2px solid currentColor; border-right: 2px solid currentColor;
  transform: rotate(45deg); margin-left: .4em; vertical-align: baseline;
}
.text-link:hover { text-decoration: underline; }

/* ---------- metodo ---------- */
.method { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; counter-reset: fase; }
.method li {
  background: var(--indigo-surface); border-radius: var(--radius); padding: 22px 18px;
  border-top: 3px solid var(--orange);
}
.method-num { font-family: var(--font-mono); color: var(--salmon); font-size: .8rem; letter-spacing: .1em; }
.method h3 { color: #fff; margin: 6px 0 8px; }
.method p { font-size: .92rem; color: var(--light-soft); }

/* ---------- evidence ---------- */
.evidence-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.evidence-list li {
  background: var(--paper-card); border-left: 4px solid var(--orange);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 20px 24px;
  box-shadow: var(--shadow);
}

/* ---------- behind ---------- */
.behind { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: center; }
.behind .lead { margin-bottom: 0; }
.behind-links { display: flex; flex-direction: column; gap: 14px; }

/* ---------- team ---------- */
.person-role { margin-bottom: 10px; }
.person .text-link { display: inline-block; margin-top: 14px; }
.text-link-light { color: var(--salmon); }

/* ---------- final ---------- */
.section-final h2 { text-align: center; margin-bottom: 40px; }
.door { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.door .btn { margin-top: auto; }
.door p { color: var(--light-soft); }

/* ---------- footer ---------- */
.site-footer { background: var(--paper); border-top: 1px solid rgba(35, 36, 77, .12); padding: 28px 0; }
.footer-row { display: flex; flex-wrap: wrap; gap: 10px 30px; justify-content: space-between; font-size: .88rem; color: var(--ink-soft); }
.footer-row a { color: var(--orange-ink); }
.site-footer .brand-sm { color: var(--orange-ink); }
.footer-honest { font-family: var(--font-mono); font-size: .78rem; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .node circle, .btn { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .grid-3, .method { grid-template-columns: 1fr 1fr; }
  .method li:last-child { grid-column: 1 / -1; }
  .nexus-layout, .behind { grid-template-columns: 1fr; }
  .method { gap: 14px; }
}
/* ---------- nav mobile ---------- */
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 10px; margin-left: 4px;
}
.nav-toggle-bar {
  display: block; width: 22px; height: 2.5px; background: var(--light);
  border-radius: 2px; margin: 4.5px 0; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .grid-3, .grid-2, .method, .evidence-list { grid-template-columns: 1fr; }
  .method li:last-child { grid-column: auto; }
  .hero { min-height: 76vh; }
  .hero-ctas .btn { width: 100%; text-align: center; }

  /* Senza JS: la nav resta visibile come riga che va a capo (niente bottoni morti). */
  .header-row { justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; height: auto; min-height: 64px; padding: 10px 0; }
  .site-nav { order: 4; width: 100%; margin-left: 0; display: flex; flex-wrap: wrap; gap: 2px 18px; }
  .site-nav a { padding: 6px 0; }

  /* Con JS: hamburger + pannello a tendina. */
  html.js .header-row { flex-wrap: nowrap; height: 64px; padding: 0; }
  html.js .nav-toggle { display: block; }
  html.js .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--indigo-deep); flex-direction: column; gap: 0;
    border-bottom: 1px solid rgba(245, 243, 238, .12); padding: 8px 0;
    width: auto; margin-left: auto; order: 0;
  }
  html.js .site-nav.open { display: flex; }
  html.js .site-nav a { padding: 14px 24px; border-bottom: 0; font-size: 1.05rem; }
}
