/* ==========================================================================
   Infilabs — Reset, Elements & Layout Primitives
   --------------------------------------------------------------------------
   Modern reset, base element styling, accessibility utilities, container and
   section rhythm, and the shared background decorations (mesh, grid lines).
   ========================================================================== */

/* ------------------------------------------------------------------- reset */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

/* Ambient page glow behind everything — cheap, GPU-friendly depth. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(70rem 40rem at 78% -8%, hsl(var(--brand-2-h) 80% 40% / 0.16), transparent 62%),
    radial-gradient(60rem 36rem at 8% 4%, hsl(var(--brand-h) 88% 42% / 0.15), transparent 60%);
}

[data-theme='light'] body::before {
  background:
    radial-gradient(70rem 40rem at 80% -10%, hsl(var(--brand-2-h) 84% 62% / 0.16), transparent 62%),
    radial-gradient(60rem 36rem at 6% 2%, hsl(var(--brand-h) 90% 60% / 0.14), transparent 60%);
}

img,
svg,
video,
canvas,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

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

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

address {
  font-style: normal;
}

table {
  border-collapse: collapse;
}

/* Firefox needs the details marker removed explicitly. */
summary {
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker,
summary::marker {
  display: none;
  content: '';
}

::selection {
  background: hsl(var(--brand-h) 90% 60% / 0.32);
  color: var(--text);
}

/* --------------------------------------------------------------- typography */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-snug);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 600;
  color: var(--text);
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Gradient headline text. Falls back to a solid colour where unsupported. */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .grad-text {
    color: var(--brand);
    -webkit-text-fill-color: currentColor;
  }
}

/* Body copy inside content bands. */
.prose {
  color: var(--text-2);
  font-size: var(--fs-md);
  max-width: 62ch;
}

.prose + .prose {
  margin-top: var(--sp-4);
}

/* Small monospaced label above headings. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--sp-4);
  padding: 0.34rem 0.75rem 0.34rem 0.55rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  line-height: 1;
}

[data-theme='light'] .eyebrow {
  color: var(--accent-deep);
}

.eyebrow svg {
  flex: none;
  opacity: 0.85;
}

.eyebrow--hero {
  padding-left: 0.7rem;
}

/* Live indicator dot inside the hero eyebrow. */
.pulse {
  position: relative;
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--brand-3);
}

.pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--brand-3);
  animation: pulse-ring 2.4s var(--ease-out) infinite;
}

/* ------------------------------------------------------------ accessibility */

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: calc(var(--z-preloader) + 1);
  padding: 0.7rem 1.15rem;
  border-radius: var(--r-sm);
  /* A darker blue than --brand: white text on --brand measures 4.45:1, just
     under the 4.5 AA threshold. This stop clears it at 6.8:1. */
  background: hsl(var(--brand-h) 92% 46%);
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-sm);
  transition: top var(--dur) var(--ease);
}

.skip-link:focus-visible {
  top: 1rem;
}

/* Single, consistent focus treatment across every interactive element. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ------------------------------------------------------------------ layout */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: var(--container-narrow);
}

main {
  position: relative;
  z-index: var(--z-base);
}

.section {
  position: relative;
  padding-block: var(--band);
}

.section--tight {
  padding-block: var(--band-tight);
}

/* Dark feature band. In light theme this inverts the local palette (see
   tokens.css) which produces the mixed light/dark section rhythm.

   `color` MUST be re-declared here. Re-scoping the --text token alone is not
   enough: `color` is computed on <body> from the page-level --text, and
   headings simply inherit that computed value. Without this line, headings
   inside a dark band render in the light theme's dark ink — dark on dark. */
.section--dark {
  background: var(--surface-1);
  border-block: 1px solid var(--line);
  color: var(--text);
  overflow: clip;
}

.section__foot {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-8);
}

/* Section header block */
.section-head {
  max-width: 62ch;
  margin-bottom: var(--sp-8);
}

.section-head--center {
  max-width: 68ch;
  margin-inline: auto;
  text-align: center;
}

.section-head__title {
  font-size: var(--fs-2xl);
  letter-spacing: var(--tr-tight);
}

.section-head__lede {
  margin-top: var(--sp-4);
  color: var(--text-2);
  font-size: var(--fs-md);
}

/* ------------------------------------------------------ background decoration */

/* Animated gradient blobs. `filter: blur` on a transformed element stays on the
   compositor, so this animates without repaint cost. */
.mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mesh__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  will-change: transform;
}

.mesh__blob--1 {
  width: 42rem;
  height: 42rem;
  top: -14rem;
  left: -10rem;
  background: radial-gradient(circle, hsl(var(--brand-h) 92% 56% / 0.6), transparent 68%);
  animation: blob-drift-a 26s var(--ease) infinite alternate;
}

.mesh__blob--2 {
  width: 38rem;
  height: 38rem;
  top: -6rem;
  right: -12rem;
  background: radial-gradient(circle, hsl(var(--brand-2-h) 86% 62% / 0.55), transparent 68%);
  animation: blob-drift-b 32s var(--ease) infinite alternate;
}

.mesh__blob--3 {
  width: 30rem;
  height: 30rem;
  bottom: -14rem;
  left: 32%;
  background: radial-gradient(circle, hsl(var(--brand-3-h) 90% 52% / 0.45), transparent 68%);
  animation: blob-drift-c 24s var(--ease) infinite alternate;
}

.mesh--soft .mesh__blob {
  opacity: 0.3;
  filter: blur(90px);
}

/* Faint technical grid, masked so it fades out toward the edges. */
.grid-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(80% 70% at 50% 30%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 30%, #000 20%, transparent 78%);
  opacity: 0.75;
}

.grid-lines--fade {
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  opacity: 0.5;
}

/* Glass panel treatment. `backdrop-filter` is progressive — the solid
   background beneath keeps contrast where it is unsupported. */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  box-shadow: var(--sh-sm);
}

/* Top highlight edge — the detail that reads as "premium glass". */
.glass::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.28), transparent);
  opacity: 0.8;
  pointer-events: none;
}

[data-theme='light'] .glass::before {
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.9), transparent);
}

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

.flip {
  transform: scaleX(-1);
}

.ico {
  flex: none;
}

/* Reduced motion: disable decorative animation everywhere, keeping the site
   fully usable. Handled here rather than per-component. */
@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;
  }
}
