/* ============================================================
   AXELERA — Design Tokens
   Bilingual non-profit · Exponential technologies · Italy
   ============================================================ */

:root {
  /* — Brand palette — derived from logo (navy + steel blue gradient) */
  --ax-navy-950: #060d18;
  --ax-navy-900: #0a1628;
  --ax-navy-800: #11203a;
  --ax-navy-700: #1a2e4f;
  --ax-navy-600: #29456f;
  --ax-steel-500: #5b9cd6;
  --ax-steel-400: #7eb4e0;
  --ax-steel-300: #a3cae8;
  --ax-ice-200: #d6e3ef;
  --ax-ice-100: #e8eef4;
  --ax-ice-50: #f3f6fa;

  /* — Neutrals — warm off-white, not pure */
  --ax-paper: #f8f9fb;
  --ax-paper-warm: #fbfaf7;
  --ax-bone: #ecece6;

  /* — Accents — used sparingly */
  --ax-amber: #c89a4a;       /* membership / warm cta */
  --ax-amber-soft: #e8c98a;
  --ax-signal: #4a8fcc;      /* live / upcoming */

  /* — Semantic — */
  --ax-bg: var(--ax-paper);
  --ax-bg-elev: #ffffff;
  --ax-fg: var(--ax-navy-900);
  --ax-fg-muted: #4a5870;
  --ax-fg-subtle: #8a94a8;
  --ax-rule: #d8dde6;
  --ax-rule-soft: #e8ebf0;
  --ax-glass: rgba(255, 255, 255, 0.62);
  --ax-glass-stroke: rgba(255, 255, 255, 0.85);

  /* — Type — */
  --ax-font-display: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --ax-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --ax-font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* — Radii — */
  --ax-r-xs: 4px;
  --ax-r-sm: 8px;
  --ax-r-md: 14px;
  --ax-r-lg: 20px;
  --ax-r-xl: 28px;

  /* — Spacing rhythm — */
  --ax-gutter: clamp(16px, 4vw, 48px);
  --ax-section: clamp(64px, 9vw, 128px);
  --ax-max: 1320px;

  /* — Shadows — soft, never harsh */
  --ax-shadow-1: 0 1px 2px rgba(10, 22, 40, 0.04), 0 2px 8px rgba(10, 22, 40, 0.04);
  --ax-shadow-2: 0 2px 6px rgba(10, 22, 40, 0.06), 0 12px 32px rgba(10, 22, 40, 0.07);
  --ax-shadow-glow: 0 0 0 1px rgba(91, 156, 214, 0.15), 0 18px 60px -20px rgba(10, 22, 40, 0.25);

  /* — Motion — */
  --ax-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ax-ease-emph: cubic-bezier(0.83, 0, 0.17, 1);
}

/* — Dark theme — switched via [data-theme="dark"] on root */
[data-theme="dark"] {
  --ax-bg: #06101e;
  --ax-bg-elev: #0d1a2e;
  --ax-fg: #eef2f8;
  --ax-fg-muted: #a8b3c7;
  --ax-fg-subtle: #6b7a92;
  --ax-rule: #1c2a44;
  --ax-rule-soft: #14213a;
  --ax-glass: rgba(20, 33, 58, 0.62);
  --ax-glass-stroke: rgba(126, 180, 224, 0.18);
  --ax-paper: #06101e;
  --ax-paper-warm: #08142a;
  --ax-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
  --ax-shadow-2: 0 2px 6px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.45);
  --ax-shadow-glow: 0 0 0 1px rgba(91, 156, 214, 0.25), 0 18px 60px -20px rgba(91, 156, 214, 0.25);
}

/* — Density — */
[data-density="compact"] {
  --ax-section: clamp(48px, 6vw, 88px);
}

/* — Reset — */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ax-font-sans);
  background: var(--ax-bg);
  color: var(--ax-fg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg { display: block; max-width: 100%; }
input, textarea, select { font: inherit; color: inherit; }

/* — Type scale — */
.ax-display {
  font-family: var(--ax-font-display);
  font-weight: 400;
  font-size: clamp(48px, 7.5vw, 112px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.ax-h1 {
  font-family: var(--ax-font-display);
  font-weight: 400;
  font-size: clamp(40px, 5.5vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.ax-h2 {
  font-family: var(--ax-font-display);
  font-weight: 400;
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.014em;
  text-wrap: balance;
}
.ax-h3 {
  font-family: var(--ax-font-sans);
  font-weight: 500;
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.ax-eyebrow {
  font-family: var(--ax-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ax-fg-muted);
}
.ax-mono {
  font-family: var(--ax-font-mono);
  font-feature-settings: "ss01", "zero";
}
.ax-lead {
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.5;
  color: var(--ax-fg-muted);
  text-wrap: pretty;
  max-width: 64ch;
}
.ax-body { font-size: 16px; line-height: 1.6; color: var(--ax-fg-muted); text-wrap: pretty; }
.ax-small { font-size: 13px; line-height: 1.5; }

/* — Layout — */
.ax-container {
  width: 100%;
  max-width: var(--ax-max);
  margin: 0 auto;
  padding: 0 var(--ax-gutter);
}
.ax-section { padding: var(--ax-section) 0; }
.ax-rule { height: 1px; background: var(--ax-rule); border: 0; margin: 0; }

/* — Buttons — */
.ax-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--ax-font-sans);
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  transition: transform .25s var(--ax-ease), background .25s var(--ax-ease), color .25s var(--ax-ease), box-shadow .25s var(--ax-ease);
  white-space: nowrap;
  border: 1px solid transparent;
}
.ax-btn--primary {
  background: var(--ax-navy-900);
  color: var(--ax-paper);
}
.ax-btn--primary:hover { background: var(--ax-navy-800); transform: translateY(-1px); }
.ax-btn--ghost {
  border-color: var(--ax-rule);
  color: var(--ax-fg);
}
.ax-btn--ghost:hover { border-color: var(--ax-fg); }
.ax-btn--accent {
  background: var(--ax-amber);
  color: var(--ax-navy-950);
}
.ax-btn--accent:hover { background: var(--ax-amber-soft); }
.ax-btn .arrow {
  display: inline-block;
  transition: transform .25s var(--ax-ease);
}
.ax-btn:hover .arrow { transform: translateX(4px); }

/* — Glass card — */
.ax-glass {
  background: var(--ax-glass);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--ax-glass-stroke);
  border-radius: var(--ax-r-lg);
}

/* — Tag chip — */
.ax-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ax-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--ax-rule);
  color: var(--ax-fg-muted);
  background: var(--ax-bg-elev);
}
.ax-tag--live {
  color: #1a6e3a;
  border-color: rgba(26, 110, 58, 0.25);
  background: rgba(26, 110, 58, 0.06);
}
[data-theme="dark"] .ax-tag--live {
  color: #6fd494;
  border-color: rgba(111, 212, 148, 0.25);
  background: rgba(111, 212, 148, 0.08);
}
.ax-tag--upcoming {
  color: var(--ax-steel-500);
  border-color: rgba(91, 156, 214, 0.3);
  background: rgba(91, 156, 214, 0.08);
}
.ax-tag--past {
  color: var(--ax-fg-subtle);
}

/* — Input — */
.ax-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--ax-r-sm);
  border: 1px solid var(--ax-rule);
  background: var(--ax-bg-elev);
  color: var(--ax-fg);
  font-size: 15px;
  transition: border-color .2s var(--ax-ease), box-shadow .2s var(--ax-ease);
}
.ax-input:focus { outline: none; border-color: var(--ax-steel-500); box-shadow: 0 0 0 3px rgba(91, 156, 214, 0.15); }

/* — Animated curve background (the brand motif) — */
.ax-curve-bg {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.ax-curve-bg svg { width: 100%; height: 100%; }

/* — Scrollbar — */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ax-rule); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--ax-fg-subtle); }

/* — Selection — */
::selection { background: var(--ax-navy-900); color: var(--ax-paper); }

/* — Utility — */
.ax-grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.6;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* — Marquee — */
@keyframes ax-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* — Subtle fade-in — */
@keyframes ax-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.ax-rise { animation: ax-rise .8s var(--ax-ease) both; }
