/* ==========================================================================
   Antecnica — full-bleed dark technical design system
   Zero framework. Self-hosted type. GDPR-safe (no CDN fonts).
   ========================================================================== */

/* ---- Fonts -------------------------------------------------------------
   Self-hosted Inter is dropped in via /assets/fonts (see fonts.css when
   the woff2 files are added). Until then a native technical stack is used
   so the site never blocks on a webfont. --------------------------------- */
@import "/assets/css/fonts.css";

/* ---- Design tokens ---------------------------------------------------- */
:root {
  /* Palette — near-black base with a signal-cyan technical accent */
  --bg:            #0B0F14;
  --bg-elevated:   #10161D;
  --bg-band:       #0E141B;
  --bg-light:      #F4F6F8;
  --surface:       #141C24;
  --line:          #1E2A36;
  --line-strong:   #2C3D4D;

  --fg:            #E6EDF3;
  --fg-muted:      #9BABBA;
  --fg-faint:      #61717F;
  --fg-on-light:   #0B0F14;
  --fg-on-light-muted: #45535F;

  --accent:        #66CCFF;   /* brand cyan — sampled from the logo mark */
  --accent-strong: #8AD8FF;
  --accent-dim:    #2E8FC0;
  --accent-glow:   rgba(102, 204, 255, 0.16);

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Mono",
    "Consolas", monospace;

  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3rem);
  --step-4:  clamp(2.6rem, 1.9rem + 3.4vw, 4.5rem);

  /* Space & measure */
  --measure: 68ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --band-y: clamp(4rem, 8vw, 7rem);
  --radius: 4px;
  --radius-lg: 8px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.12; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p { margin: 0 0 1em; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong { font-weight: 650; color: var(--fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* Utility overline / kicker */
.kicker {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.kicker::before {
  content: "";
  width: 1.6rem; height: 1px;
  background: var(--accent-dim);
}

/* ---- Skip link -------------------------------------------------------- */
.skip-link {
  position: absolute; left: 0; top: 0;
  transform: translateY(-120%);
  background: var(--accent); color: var(--fg-on-light);
  padding: 0.6rem 1rem; z-index: 200; font-weight: 600;
}
.skip-link:focus { transform: translateY(0); }

/* ---- Layout primitives ------------------------------------------------ */
.band { padding: var(--band-y) 0; position: relative; }
.band--dark  { background: var(--bg); }
.band--elevated { background: var(--bg-band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band--light { background: var(--bg-light); color: var(--fg-on-light); }
.band--light h1, .band--light h2, .band--light h3, .band--light h4 { color: var(--fg-on-light); }
.band--light .kicker { color: var(--accent-dim); }
.band--light .kicker::before { background: var(--accent-dim); }
.band--light p { color: var(--fg-on-light-muted); }
.band--light strong { color: var(--fg-on-light); }
.band--light a { color: var(--accent-dim); }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 820px; }
.prose { max-width: var(--measure); }
.prose p, .prose li { color: var(--fg-muted); }
.band--light .prose p, .band--light .prose li { color: var(--fg-on-light-muted); }
.prose h2, .prose h3 { margin-top: 2em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.lead { font-size: var(--step-1); color: var(--fg); line-height: 1.5; }
.band--light .lead { color: var(--fg-on-light); }

/* ---- Header ----------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 15, 20, 0.72);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--fg); font-weight: 650; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand svg, .brand img { height: 26px; width: auto; }
.brand__logo { height: 30px; width: auto; }
.brand__word { font-size: 1.2rem; }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav a {
  color: var(--fg-muted); font-size: var(--step--1); font-weight: 500;
  padding: 0.5rem 0.7rem; border-radius: var(--radius); letter-spacing: 0.01em;
}
.nav a:hover { color: var(--fg); background: var(--surface); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent-strong); }

.nav-toggle { display: none; }

/* Mobile nav */
@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: transparent; border: 1px solid var(--line-strong); color: var(--fg);
    padding: 0.45rem 0.75rem; border-radius: var(--radius); font: inherit; font-size: var(--step--1); cursor: pointer;
  }
  .nav {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-elevated); border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1rem;
    transform: translateY(-120%); transition: transform 0.3s var(--ease);
    box-shadow: 0 24px 40px -20px rgba(0,0,0,0.8);
  }
  .nav[data-open="true"] { transform: translateY(0); }
  .nav a { padding: 0.85rem 0.5rem; border-bottom: 1px solid var(--line); font-size: var(--step-0); }
}

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.04em;
  padding: 0.8em 1.4em; border-radius: var(--radius); cursor: pointer;
  border: 1px solid transparent; transition: all 0.2s var(--ease); text-transform: uppercase;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: var(--fg-on-light); font-weight: 600; }
.btn--primary:hover { background: var(--accent-strong); box-shadow: 0 0 0 4px var(--accent-glow); }
.btn--ghost { border-color: var(--line-strong); color: var(--fg); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn__arrow { transition: transform 0.2s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ---- Hero ------------------------------------------------------------- */
.hero {
  position: relative; min-height: min(92vh, 900px);
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg svg { width: 100%; height: 100%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  /* Both gradients used to reach fully-opaque --bg, which painted over the array at
     the bottom of the artwork. They are capped now: still enough contrast for the
     hero text (which sits in the upper band), while the array stays visible. */
  background:
    radial-gradient(120% 90% at 75% 30%, transparent 32%, rgba(11,15,20,0.45) 78%, rgba(11,15,20,0.5) 100%),
    linear-gradient(180deg, transparent 70%, rgba(11,15,20,0.12) 100%);
  pointer-events: none;
}
/* Content sits in the upper band so the array animation stays clear of the CTAs */
.hero__inner { position: relative; z-index: 2; padding-top: clamp(3rem, 8vh, 6rem); padding-bottom: clamp(6rem, 15vh, 10rem); }
.hero h1 { max-width: 16ch; margin-bottom: 0.5em; }
.hero__lead { font-size: var(--step-1); color: var(--fg-muted); max-width: 52ch; margin-bottom: 2rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; }

/* ---- Card grids ------------------------------------------------------- */
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.6rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.card--link:hover { border-color: var(--accent-dim); transform: translateY(-3px); text-decoration: none; }
.card__index { font-family: var(--font-mono); font-size: var(--step--1); color: var(--accent); letter-spacing: 0.1em; }
.card h3 { font-size: var(--step-1); margin: 0; }
.card p { color: var(--fg-muted); margin: 0; font-size: var(--step-0); }
.card__meta { font-family: var(--font-mono); font-size: var(--step--1); color: var(--fg-faint); margin-top: auto; }
a.card { color: inherit; }

/* Tag / badge */
.tag {
  display: inline-block; font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase; padding: 0.25em 0.6em;
  border: 1px solid var(--line-strong); border-radius: 999px; color: var(--fg-muted);
}
.tag--accent { border-color: var(--accent-dim); color: var(--accent-strong); }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---- Section header --------------------------------------------------- */
.section-head { max-width: var(--measure); margin-bottom: 2.5rem; }
.section-head p { color: var(--fg-muted); }
.band--light .section-head p { color: var(--fg-on-light-muted); }

/* ---- Reference / logo strip ------------------------------------------- */
.refs { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: center; }
.ref-chip {
  display: inline-flex; align-items: baseline; gap: 0.6rem;
  font-family: var(--font-mono); font-size: var(--step--1); color: var(--fg-muted);
}
.ref-chip strong { color: var(--fg); }
.ref-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* ---- Spec table ------------------------------------------------------- */
.spec-table { width: 100%; border-collapse: collapse; font-size: var(--step-0); }
.spec-table th, .spec-table td { text-align: left; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table th { font-family: var(--font-mono); font-weight: 500; color: var(--fg-muted); font-size: var(--step--1); width: 40%; letter-spacing: 0.02em; }
.spec-table td { color: var(--fg); }
.band--light .spec-table th { color: var(--fg-on-light-muted); }
.band--light .spec-table td { color: var(--fg-on-light); }
.band--light .spec-table th, .band--light .spec-table td { border-bottom-color: rgba(11,15,20,0.12); }
.table-scroll { overflow-x: auto; }

/* Capability visuals (animated SVG or CMS image) */
.cap-visual { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-elevated); aspect-ratio: 1000 / 360; }
.cap-visual svg, .cap-visual img { width: 100%; height: 100%; display: block; }
.cap-visual img { object-fit: cover; }

/* Document/records table (used on the light Trasparenza band) */
.doc-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.doc-table th, .doc-table td { text-align: left; padding: 0.7rem 0.85rem; border-bottom: 1px solid rgba(11,15,20,0.12); vertical-align: top; }
.doc-table thead th { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.72rem; color: var(--fg-on-light-muted); font-weight: 600; white-space: nowrap; }
.doc-table td { color: var(--fg-on-light); }
.doc-table td:first-child { font-family: var(--font-mono); white-space: nowrap; }
.doc-note { font-size: var(--step--1); color: var(--fg-on-light-muted); }

/* ---- Definition / meta list ------------------------------------------- */
.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; margin: 0; }
.meta-list dt { font-family: var(--font-mono); font-size: var(--step--1); color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.meta-list dd { margin: 0; color: var(--fg); }
.band--light .meta-list dt { color: var(--fg-on-light-muted); }
.band--light .meta-list dd { color: var(--fg-on-light); }

/* ---- Team grid -------------------------------------------------------- */
.team-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.team-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.4rem; }
.team-card__photo { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); margin-bottom: 1rem; background: var(--bg-elevated); }
.team-card__name { font-weight: 650; margin: 0; }
.team-card__role { color: var(--accent); font-family: var(--font-mono); font-size: var(--step--1); margin: 0.2rem 0 0; }
.team-card a { font-size: var(--step--1); }

/* ---- Prose article (news / project body) ------------------------------ */
.article { max-width: var(--measure); }
.article img { border-radius: var(--radius-lg); border: 1px solid var(--line); margin: 1.5rem 0; }
/* No colour rule for .article headings on purpose: it would tie on specificity with
   `.band--light h2` and, coming later, win — painting light-on-light. Headings
   inherit the light body colour on dark bands, and band--light darkens them. */

/* ---- Footer ----------------------------------------------------------- */
.site-footer { background: var(--bg-elevated); border-top: 1px solid var(--line); padding: clamp(3rem, 6vw, 5rem) 0 2rem; }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1.4fr 1fr 1fr; }
.footer-grid h4 { font-size: var(--step--1); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-faint); font-weight: 500; margin-bottom: 1rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.footer-grid a { color: var(--fg-muted); font-size: var(--step--1); }
.footer-grid a:hover { color: var(--fg); }
.footer-about p { color: var(--fg-muted); font-size: var(--step--1); max-width: 42ch; }
.footer-legal { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; color: var(--fg-faint); font-size: var(--step--1); font-family: var(--font-mono); }
.footer-legal a { color: var(--fg-faint); }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* ---- CTA strip -------------------------------------------------------- */
.cta { text-align: center; }
.cta h2 { max-width: 20ch; margin-inline: auto; }
.cta p { color: var(--fg-muted); max-width: 50ch; margin-inline: auto 2rem; margin-inline: auto; margin-bottom: 2rem; }

/* ---- Utility ---------------------------------------------------------- */
.flow > * + * { margin-top: 1.25rem; }
.stack-lg > * + * { margin-top: 2.5rem; }
.center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
