/* ════════════════════════════════════════════════════════════════
   INVATECHS · VISUAL LANGUAGE v2 — "Engineered Intelligence"
   Subtle evolution of the live site's Swiss/minimal direction.
   Brand: yellow #EFD91B + ink rgb(34,34,34) / #181602 (logo black).
   New: IBM Plex Mono technical layer + flow/pipeline motifs.
   ════════════════════════════════════════════════════════════════ */

:root {
  /* ── Brand accent (yellow) ── */
  --accent:        #EFD91B;   /* fills, markers, borders, on-dark text */
  --accent-hover:  #E0CB14;
  --accent-text:   #877900;   /* readable accent for small text on white */
  --accent-tint:   #FBF6D9;   /* hover fills */

  /* ── Light surfaces (warm-neutral, matches logo black) ── */
  --bg:          #FFFFFF;
  --surface:     #F7F6F2;
  --line:        #E5E4DE;
  --line-light:  #F0EFEA;
  --ink:         #181602;     /* logo black */
  --ink-2:       #222222;     /* brand rgb(34,34,34) */
  --body:        #45433A;
  --muted:       #6F6D63;

  /* ── Dark "system" surfaces (warm black, from brand #222) ── */
  --dark-950:    #161509;
  --dark-900:    #1E1C0E;
  --dark-800:    #2A2817;
  --dark-line:   rgba(239, 217, 27, 0.16);
  --dark-text:   #DDDACB;
  --dark-muted:  #97947F;

  /* ── Type ── */
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:   'IBM Plex Mono', 'SF Mono', Consolas, monospace;

  /* ── Geometry ── */
  --max:         1180px;
  --col:         min(var(--max), calc(100% - 3rem));
  --radius:      2px;

  /* ── Motion ── */
  --speed:       200ms;
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset / base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--ink); text-decoration: none; transition: color var(--speed); cursor: pointer; }
a:hover { color: var(--ink-2); }

::selection { background: var(--accent); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ════════════════════════════════════════════
   TYPOGRAPHY
   ════════════════════════════════════════════ */

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

.display {
  font-size: clamp(2.3rem, 5vw, 3.9rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.h-section {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  max-width: 24ch;
}

.h-card {
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.lede {
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  line-height: 1.6;
  color: var(--body);
  max-width: 56ch;
  text-wrap: pretty;
}

p { color: var(--body); text-wrap: pretty; }

/* Yellow highlighter — the brand's signature move */
.hl {
  background: linear-gradient(transparent 62%, var(--accent) 62%, var(--accent) 94%, transparent 94%);
}

/* ── Mono technical layer ── */
.kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker .idx {
  white-space: nowrap;
  color: var(--ink);
  font-weight: 600;
  background: var(--accent);
  padding: 0.1em 0.4em;
}
.kicker::after {
  content: "";
  flex: 0 0 36px;
  height: 1px;
  background: var(--line);
}
.kicker--bare::after { display: none; }

.mono-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--body);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.3em 0.7em;
  white-space: nowrap;
}
.mono-tag::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--accent);
  flex: none;
}

/* ════════════════════════════════════════════
   DARK CONTEXT — add .on-dark to any section
   ════════════════════════════════════════════ */
.on-dark {
  background: var(--dark-950);
  color: var(--dark-text);
}
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: #fff; }
.on-dark p, .on-dark .lede { color: var(--dark-text); }
.on-dark .kicker { color: var(--dark-muted); }
.on-dark .kicker .idx { color: var(--ink); background: var(--accent); }
.on-dark .kicker::after { background: var(--dark-line); }
.on-dark .mono-tag { color: var(--dark-muted); border-color: var(--dark-line); }
.on-dark .mono-tag::before { background: var(--accent); }
.on-dark a:not(.btn) { color: var(--accent); }
.on-dark a:not(.btn):hover { color: #fff; }

/* ════════════════════════════════════════════
   LAYOUT PRIMITIVES
   ════════════════════════════════════════════ */
.container { width: var(--col); margin-inline: auto; }

.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.section-head {
  display: grid;
  gap: 1.1rem;
  margin-bottom: clamp(2.2rem, 5vw, 3.5rem);
}
.section-head .lede { margin-top: 0.2rem; }

/* Technical texture (tweakable: dots / grid / none).
   Applied to sections carrying .grid-texture. */
[data-texture="grid"] .grid-texture {
  background-image:
    linear-gradient(var(--grid-line, rgba(24,22,2,0.04)) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line, rgba(24,22,2,0.04)) 1px, transparent 1px);
  background-size: 56px 56px;
}
[data-texture="grid"] .on-dark.grid-texture,
[data-texture="grid"] .grid-texture.on-dark {
  --grid-line: rgba(239, 217, 27, 0.05);
}

[data-texture="dots"] .grid-texture { position: relative; }
/* Keep section content above the texture overlay (same mechanism as the
   homepage hero, whose .container is positioned). */
[data-texture="dots"] .grid-texture > .container { position: relative; }
[data-texture="dots"] .grid-texture::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(100deg, var(--fade-from, #FFFFFF) 10%, var(--fade-to, rgba(255,255,255,0)) 55%),
    radial-gradient(var(--dot, rgba(24,22,2,0.20)) 1.3px, transparent 1.4px);
  background-size: 100% 100%, 20px 20px;
}
[data-texture="dots"] .on-dark.grid-texture::before,
[data-texture="dots"] .grid-texture.on-dark::before {
  --dot: rgba(239, 217, 27, 0.13);
  --fade-from: #161509;
  --fade-to: rgba(22, 21, 9, 0);
}

/* ════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1;
  padding: 0.95em 1.7em;
  min-height: 48px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--speed), border-color var(--speed), color var(--speed), transform var(--speed);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

/* Primary: brand yellow, ink text; inverts to ink on hover */
.btn--primary { background: var(--accent); color: var(--ink); }
.btn--primary:hover { background: var(--ink); color: var(--accent); }

.btn--ghost { background: var(--bg); color: var(--ink); border-color: rgba(24,22,2,0.3); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }

.on-dark .btn--ghost { background: transparent; color: #fff; border-color: rgba(221,218,203,0.32); }
.on-dark .btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.on-dark .btn--primary:hover { background: #fff; color: var(--ink); }

.btn .arr { font-family: var(--font-mono); font-weight: 400; }

/* Inline text-link with arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 600;
  font-size: 0.92rem;
}
.link-arrow .arr {
  font-family: var(--font-mono);
  transition: transform var(--speed) var(--ease);
}
.link-arrow:hover .arr { transform: translateX(4px); }

/* ════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════ */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 2.5vw, 2rem);
  transition: border-color var(--speed), box-shadow var(--speed);
}
a.card { display: block; color: inherit; }
.card:hover {
  border-color: var(--ink);
  box-shadow: 0 3px 0 0 var(--accent) inset;
}

.card .card-idx {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.card:hover .card-idx { color: var(--ink); }

.on-dark .card {
  background: var(--dark-900);
  border-color: var(--dark-line);
}
.on-dark .card:hover { border-color: var(--accent); box-shadow: none; }

/* ── Stat block ── */
.stat .stat-n {
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat .stat-n em {
  font-style: normal;
  background: linear-gradient(transparent 55%, var(--accent) 55%, var(--accent) 96%, transparent 96%);
}
.stat .stat-l {
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.on-dark .stat .stat-n { color: #fff; }
.on-dark .stat .stat-l { color: var(--dark-muted); }

/* ════════════════════════════════════════════
   SCROLL REVEAL (gated on motion tweak + OS pref)
   ════════════════════════════════════════════ */
/* Hidden state is OPT-IN via .pre (added by JS right before observing),
   so content is always visible when JS/IO is unavailable. */
.reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  [data-motion="on"] .reveal.pre {
    opacity: 0;
    transform: translateY(18px);
  }
  [data-motion="on"] .reveal {
    transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
