/* ==========================================================================
   ABELIA SOLUTION — Base styles, reset, typography, layout primitives
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--color-accent-glow-strong);
  color: var(--color-text);
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: var(--lh-heading);
  margin: 0;
  text-wrap: balance;
  color: var(--color-text);
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 700; }
h4 { font-size: var(--fs-h4); font-weight: 700; }

button { font-family: inherit; }

/* --- Focus & accessibility ------------------------------------------- */

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--color-accent);
  color: #FFFFFF;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

.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;
}

/* --- Layout ------------------------------------------------------------ */

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

main { display: block; }

.section {
  padding: var(--space-24) 0;
  border-top: 1px solid var(--color-border);
  position: relative;
}
.section.alt { background: var(--color-bg-secondary); }
.section.no-border { border-top: none; }
.section.tight { padding: var(--space-16) 0; }

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 760px;
  margin-bottom: var(--space-16);
}
.section-head.center { align-items: center; text-align: center; margin-left: auto; margin-right: auto; }

.section-lead {
  color: var(--color-text-secondary);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body);
  max-width: 680px;
}

.idx {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.06em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--color-accent);
  opacity: 0.7;
  transform: scaleX(1);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out);
}
/* Inside a .reveal container, the little tick "draws in" once the section
   scrolls into view instead of just sitting there pre-rendered. */
.reveal:not(.in-view) .eyebrow::before { transform: scaleX(0); }
.reveal.in-view .eyebrow::before { transition-delay: 0.05s; }

/* --- Utilities (kept intentionally small: layout/spacing one-offs that
   don't warrant a dedicated component, used instead of inline style="" so
   the CSP can stay style-src 'self' with no 'unsafe-inline'). ------------- */

.text-secondary { color: var(--color-text-secondary); }
.text-accent { color: var(--color-accent-text); }
.text-md { font-size: 0.95rem; }
.lh-loose { line-height: 1.8; }
.text-center { text-align: center; }
.justify-center { justify-content: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.stack { display: flex; flex-direction: column; gap: var(--space-8); }
.gap-16 { gap: var(--space-16); }
.items-start { align-items: start; }
.py-32 { padding: var(--space-32) 0; }
.mt-2 { margin-top: var(--space-2); } .mb-2 { margin-bottom: var(--space-2); }
.mt-3 { margin-top: var(--space-3); } .mb-3 { margin-bottom: var(--space-3); }
.mt-5 { margin-top: var(--space-5); } .mb-5 { margin-bottom: var(--space-5); }
.mt-6 { margin-top: var(--space-6); } .mb-6 { margin-bottom: var(--space-6); }
.mt-8 { margin-top: var(--space-8); } .mb-8 { margin-bottom: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }

.list-clean { display: flex; flex-direction: column; gap: 10px; }
.list-clean li { font-size: 0.92rem; color: var(--color-text-secondary); padding-left: 18px; position: relative; }
.list-clean li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 6px; height: 1px; background: var(--color-accent); }
.list-clean li b { color: var(--color-text); font-weight: 600; }

/* --- Grid helpers -------------------------------------------------------- */

.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

/* --- Background schematic grid (very subtle, decorative) ----------------- */

/* Two large, very soft indigo blobs drifting behind the content — replaces
   a flat grid texture with something closer to how Linear/Raycast-style
   dark tools actually build depth: light sources, not graph paper. */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-ambient::before,
.bg-ambient::after {
  content: "";
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 780px;
  max-height: 780px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
  filter: blur(40px);
  opacity: 0.55;
  animation: ambient-drift 42s ease-in-out infinite alternate;
}
.bg-ambient::before { top: -18vw; right: -14vw; }
.bg-ambient::after { bottom: -22vw; left: -16vw; animation-duration: 54s; animation-delay: -20s; }

@keyframes ambient-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-4%, 5%) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-ambient::before, .bg-ambient::after { animation: none; }
}

/* --- Grain overlay: a very faint film-grain texture across the whole site,
   the kind of tactile detail that keeps flat dark surfaces from reading as
   a generic template. Pure CSS/SVG, no image request. --------------------- */

.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* --- Scroll progress rail: thin signal line on the right edge, filling as
   the page is read. A small nod to the "monitoring" identity of the brand. */

.scroll-rail {
  position: fixed;
  top: 0;
  right: 0;
  width: 3px;
  height: 100vh;
  z-index: 90;
  pointer-events: none;
}
.scroll-rail-fill {
  width: 100%;
  height: 100%;
  transform: scaleY(0);
  transform-origin: top;
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-dim));
  box-shadow: 0 0 10px var(--color-accent-glow-strong);
  transition: transform 0.12s linear;
}

/* --- Reduced motion ------------------------------------------------------- */

@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;
    scroll-behavior: auto !important;
  }
}
