/* ============================================================
   AIMO ENGINEERING — base system
   Shared reset, tokens, layout primitives, typography.
   Per-direction overrides live in themes.css.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

:root {
  /* graphite scale */
  --g-000: #06080b;
  --g-050: #0a0d11;
  --g-100: #0e1116;
  --g-150: #12161c;
  --g-200: #171c23;
  --g-300: #1f2630;
  --g-400: #2a323d;
  --hair:  rgba(255,255,255,.07);
  --hair-2: rgba(255,255,255,.12);

  /* text */
  --t-hi:  #eef2f6;
  --t-mid: #aeb8c4;
  --t-lo:  #6d7884;
  --t-dim: #49535e;

  /* accents (oklch-derived, shared chroma family) */
  --blue:  #2e7bff;
  --blue-d:#1a47c7;
  --cyan:  #3fe0ff;
  --cyan-d:#1aa7c9;
  --amber: #ffb020;

  /* role tokens (overridden per direction) */
  --bg:        var(--g-050);
  --panel:     var(--g-100);
  --panel-2:   var(--g-150);
  --line:      var(--hair);
  --accent:    var(--cyan);
  --accent-2:  var(--blue);
  --glow:      0 0 0 rgba(0,0,0,0);
  --grid-op:   .035;

  --font-display: "Saira", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1280px;
  --pad: clamp(20px, 5vw, 64px);
  --radius: 14px;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  background: var(--bg);
  color: var(--t-hi);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .5s ease, color .5s ease;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

/* ---------- layout primitives ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.section { position: relative; padding-block: clamp(52px, 7vw, 104px); }
.section--tight { padding-block: clamp(40px, 5vw, 72px); }

/* ---------- type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: currentColor;
  opacity: .8;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.04; letter-spacing: -.015em; color: var(--t-hi); }
.h-hero { font-size: clamp(40px, 5.6vw, 88px); font-weight: 700; letter-spacing: -.03em; overflow-wrap: normal; text-wrap: pretty; }
.h-sec  { font-size: clamp(32px, 4.2vw, 60px); }
.h-card { font-size: clamp(20px, 1.6vw, 26px); }
.lede   { font-size: clamp(17px, 1.35vw, 21px); color: var(--t-mid); line-height: 1.62; max-width: 60ch; }
.muted  { color: var(--t-lo); }
.mono   { font-family: var(--font-mono); }
.label  {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--t-lo);
}

/* ---------- buttons ---------- */
.btn {
  --bpad: 15px 26px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: var(--bpad);
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: .06em;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: transform .25s ease, background .25s ease, border-color .25s, box-shadow .35s;
  white-space: nowrap;
}
.btn .arr { transition: transform .3s cubic-bezier(.2,.7,.3,1); }
.btn:hover .arr { transform: translateX(4px); }
.btn--primary {
  background: var(--accent);
  color: #03070d;
  font-weight: 600;
  box-shadow: var(--glow);
}
.btn--primary:hover { transform: translateY(-2px); }
.btn--ghost {
  border-color: var(--hair-2);
  color: var(--t-hi);
  background: rgba(255,255,255,.015);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- chips / tags ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--t-mid);
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 100px;
  background: rgba(255,255,255,.02);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* ---------- decorative rules / ticks ---------- */
.rule { height: 1px; background: var(--line); border: 0; }
.crosshair { position: relative; }
.crosshair::before, .crosshair::after {
  content: ""; position: absolute; background: var(--line);
}
.tick-row { display: flex; gap: 4px; align-items: flex-end; height: 14px; }
.tick-row i { display: block; width: 1px; height: 100%; background: var(--t-dim); }
.tick-row i:nth-child(5n+1) { height: 14px; background: var(--accent); opacity: .7; }
.tick-row i:not(:nth-child(5n+1)) { height: 7px; }

/* ---------- reveal animation (only hides when JS is active) ---------- */
.js [data-reveal] {
  opacity: 0; transform: translateY(22px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--rd, 0ms);
}
.js [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- background grid layer ---------- */
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--accent) 1px, transparent 1px),
    linear-gradient(90deg, var(--accent) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: var(--grid-op);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 78%);
  transition: opacity .5s ease;
}
.bg-vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(120% 80% at 50% -10%, transparent 40%, rgba(0,0,0,.45) 100%);
}
.page { position: relative; z-index: 1; }
