/* ==========================================================================
   QIX SERVICE IT — theme.css
   Design system: "Precision Instrument"
   Deep-ink technical editorial. Acid-lime signal accent. Blueprint atmosphere.

   NOTE ON MOTION: this site deliberately does NOT ship a
   `prefers-reduced-motion` opt-out. The site owner runs Windows with system
   animations disabled and requires the site to animate regardless.
   Do not add reduced-motion suppression rules to this project.
   ========================================================================== */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Surfaces — cool near-black, never pure #000 */
  --ink-950:  #04060A;
  --ink-900:  #06080D;
  --ink-850:  #090C13;
  --ink-800:  #0C1119;
  --ink-750:  #111823;
  --ink-700:  #16202D;
  --ink-600:  #1F2C3C;

  /* Hairlines */
  --line:        rgba(180, 205, 235, 0.09);
  --line-soft:   rgba(180, 205, 235, 0.05);
  --line-strong: rgba(180, 205, 235, 0.18);

  /* Foreground */
  --fg:       #EAEFF5;
  --fg-muted: #A3B0C0;
  --fg-dim:   #7C8895;

  /* Signal palette */
  --acid:        #C8FF4D;
  --acid-deep:   #A6E024;
  --acid-glow:   rgba(200, 255, 77, 0.35);
  --cobalt:      #3D6DFF;
  --cobalt-glow: rgba(61, 109, 255, 0.35);
  --teal:        #4FE3C1;
  --amber:       #FFB454;
  --rose:        #FF6B8A;

  /* Type */
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;

  /* Fluid type scale */
  --step--2: clamp(0.69rem, 0.67rem + 0.11vw, 0.75rem);
  --step--1: clamp(0.83rem, 0.79rem + 0.19vw, 0.94rem);
  --step-0:  clamp(1rem, 0.95rem + 0.26vw, 1.12rem);
  --step-1:  clamp(1.2rem, 1.11rem + 0.44vw, 1.45rem);
  --step-2:  clamp(1.44rem, 1.29rem + 0.72vw, 1.9rem);
  --step-3:  clamp(1.73rem, 1.5rem + 1.13vw, 2.44rem);
  --step-4:  clamp(2.07rem, 1.72rem + 1.72vw, 3.14rem);
  --step-5:  clamp(2.49rem, 1.97rem + 2.57vw, 4.03rem);
  --step-6:  clamp(2.99rem, 2.23rem + 3.78vw, 5.18rem);
  --step-7:  clamp(3.4rem, 2.4rem + 5.1vw, 6.4rem);

  /* Space */
  --gutter: clamp(1.25rem, 0.9rem + 1.7vw, 2.5rem);
  --section: clamp(4.5rem, 3rem + 7vw, 9rem);
  --shell: 1280px;
  --shell-narrow: 880px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow-md: 0 18px 40px -20px rgba(0,0,0,.85);
  --shadow-lg: 0 40px 90px -40px rgba(0,0,0,.95);

  /* Motion */
  --ease-out: cubic-bezier(.22,1,.36,1);
  --ease-in-out: cubic-bezier(.65,0,.35,1);
  --ease-spring: cubic-bezier(.34,1.42,.64,1);
  --t-fast: 160ms;
  --t-mid: 280ms;
  --t-slow: 520ms;

  /* Z-scale */
  --z-decor: 0;
  --z-body: 10;
  --z-sticky: 30;
  --z-nav: 50;
  --z-overlay: 70;
  --z-cursor: 90;

  color-scheme: dark;
}

/* ---------- 2. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* JS drives smooth scrolling so it survives OS "reduce motion" settings */
  scroll-behavior: auto;
  /* Reveal animations start translated sideways; clipping here (not just on
     body, which does not reliably propagate) stops that offset from creating
     a stray horizontal scrollbar. `clip` pairs with visible overflow-y, so it
     does not turn the root into a scroll container. */
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink-950);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
h1 { font-size: var(--step-7); font-weight: 700; }
h2 { font-size: var(--step-5); }
h3 { font-size: var(--step-2); letter-spacing: -0.02em; }
h4 { font-size: var(--step-1); letter-spacing: -0.015em; }

p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* figure and blockquote carry a UA `margin: 1em 40px`, and dl/dd carry their
   own — left in place they silently strangle the width of any card built from
   them. Zero them here rather than patching each component. */
figure, blockquote, dl, dd { margin: 0; }
img, svg, video { display: block; max-width: 100%; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

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

:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
  border-radius: 3px;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--ink-900); }
::-webkit-scrollbar-thumb {
  background: var(--ink-700);
  border-radius: 99px;
  border: 3px solid var(--ink-900);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-600); }

/* ---------- 3. LAYOUT PRIMITIVES ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: var(--z-body);
}
.shell--narrow { max-width: var(--shell-narrow); }

.section { padding-block: var(--section); position: relative; }
.section--tight { padding-block: calc(var(--section) * 0.62); }

.grid { display: grid; gap: clamp(1rem, 0.6rem + 1.6vw, 1.75rem); }
.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

.flow-lg { display: flex; flex-direction: column; gap: clamp(1.75rem,1rem+2.4vw,3rem); }

/* ---------- 4. TYPE UTILITIES ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--acid);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  line-height: 1;
}
.eyebrow::before {
  content: "";
  width: 1.9em;
  height: 1px;
  background: currentColor;
  opacity: .75;
  transform-origin: left;
  animation: ruleGrow 1.4s var(--ease-out) both;
}
.eyebrow--muted { color: var(--fg-dim); }

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 62ch;
  font-weight: 400;
}

.body-muted { color: var(--fg-muted); max-width: 68ch; }
.small { font-size: var(--step--1); }
.mono { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: .08em; }
.dim { color: var(--fg-dim); }
.acid { color: var(--acid); }
.center { text-align: center; }
.center .lede, .center .body-muted { margin-inline: auto; }
.center .eyebrow::before { display: none; }

.grad-text {
  background: linear-gradient(96deg, var(--fg) 0%, var(--fg) 34%, var(--acid) 64%, var(--teal) 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradShift 9s var(--ease-in-out) infinite alternate;
}

.section-head { max-width: 76ch; }
.section-head h2 { margin-top: 1.1rem; }
.section-head .lede { margin-top: 1.2rem; }

.section-index {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--fg-dim);
  letter-spacing: .18em;
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-bottom: 2.2rem;
  text-transform: uppercase;
}
.section-index b { color: var(--acid); font-weight: 500; }
.section-index i {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
  font-style: normal;
}

/* ---------- 5. RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .cols-3, .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cols-4 { grid-template-columns: 1fr; }
}

/* ---------- 6. A11Y HELPERS ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: .7rem 1.1rem;
  background: var(--acid);
  color: var(--ink-950);
  border-radius: var(--r-sm);
  font-weight: 600;
  transform: translateY(-180%);
  transition: transform var(--t-mid) var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(0); }
