/* ==========================================================================
   QivaLabs, Design System v2
   Flat colour fields (no gradients, no glow), confident type, layered-border
   depth, diversified layout families, GSAP-driven scroll storytelling.
   ========================================================================== */

:root {
  /* Color, brand teal/navy retained (real logo colours), refined neutrals */
  --ink: #0c1116;            /* near-black, not pure, used for dark sections */
  --navy: #0a1628;           /* brand navy, signature dark section */
  --deep: #0b2f3d;           /* secondary dark, teal-leaning, breaks navy monotony */
  --text: #16232b;           /* primary text on light */
  --text-soft: #445764;      /* secondary text on light */
  --muted: #6b8089;          /* tertiary / meta text */
  --on-dark: #cfe0e6;        /* primary text on dark sections */
  --on-dark-soft: #93aebb;   /* secondary text on dark sections */

  --teal: #0b9baa;           /* brand accent, flat, single accent site-wide */
  --teal-dark: #086a75;      /* hover / active */
  --teal-tint: #eaf6f7;      /* accent tint on light bg */
  --teal-tint-dark: rgba(23, 196, 214, 0.12); /* accent tint on dark bg */

  --bg: #ffffff;
  --bg-alt: #f5f7f8;         /* warm-cool neutral alt section */
  --border: #e2e9eb;
  --border-strong: #c7d4d7;

  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.25rem;
  --space-5: 3.5rem;
  --space-6: 5.5rem;
  --space-7: 7.5rem;
  --space-8: 10rem;

  --radius: 14px;
  --radius-sm: 8px;

  /* Depth: layered borders + hue-tinted shadow, never pure black, never glow */
  --shadow-sm: 0 1px 2px rgba(12, 22, 28, 0.06);
  --shadow-md: 0 12px 28px -8px rgba(11, 41, 48, 0.16);
  --shadow-lg: 0 28px 60px -16px rgba(11, 41, 48, 0.22);
  --shadow-dark: 0 20px 50px -12px rgba(0, 0, 0, 0.45);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-sm: 0.2s;
  --duration-md: 0.45s;
}

/* ─── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }
img, picture, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

body {
  font-family: var(--font-body);
  color: var(--text-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.65;
  font-size: 16px;
  position: relative;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.25rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.85rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.01em; }
h4 { font-size: 1.05rem; letter-spacing: -0.005em; }

p { max-width: 68ch; }
p.lede { font-size: 1.2rem; line-height: 1.55; color: var(--text-soft); max-width: 52ch; }

em, i.emph { font-style: italic; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Grain (fixed, non-scrolling, cheap) ───────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%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");
}

/* ─── Layout ─────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.section { padding-block: var(--space-7); position: relative; }
.section--tight { padding-block: var(--space-5); }
.section--alt { background: var(--bg-alt); }
.section--navy { background: var(--navy); color: var(--on-dark); }
.section--deep { background: var(--deep); color: var(--on-dark); }
.section--navy h1, .section--navy h2, .section--navy h3,
.section--deep h1, .section--deep h2, .section--deep h3 { color: #fff; }

.grid { display: grid; gap: var(--space-4); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

.stack { display: flex; flex-direction: column; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* ─── Bento grid (asymmetric, real spans, not equal boxes) ──────────── */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-3); }
.bento > * { grid-column: span 2; }
.bento .span-3 { grid-column: span 3; }
.bento .span-4 { grid-column: span 4; }
.bento .span-6 { grid-column: span 6; }
@media (max-width: 860px) {
  .bento { grid-template-columns: 1fr; }
  .bento > * { grid-column: span 1 !important; }
}

/* ─── Asymmetric split (hero / feature) ──────────────────────────────── */
.split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--space-5); align-items: center; }
.split--reverse { grid-template-columns: 0.85fr 1.15fr; }
.split--reverse > :first-child { order: 2; }
@media (max-width: 900px) {
  .split, .split--reverse { grid-template-columns: 1fr; }
  .split--reverse > :first-child { order: 0; }
}

/* ─── Horizontal scroll-snap row ─────────────────────────────────────── */
.scroll-row {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--space-2);
  scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row > * { scroll-snap-align: start; flex: 0 0 auto; }

/* ─── Marquee (max one per page) ─────────────────────────────────────── */
.marquee { overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; gap: var(--space-5); width: max-content; will-change: transform; }
.marquee__track span { font-family: var(--font-heading); font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.6rem); color: var(--border-strong); white-space: nowrap; }
.section--navy .marquee__track span, .section--deep .marquee__track span { color: rgba(255,255,255,0.16); }

/* ─── Section header ─────────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-dark);
  background: var(--teal-tint);
  border: 1px solid rgba(11, 155, 170, 0.25);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  margin-bottom: var(--space-2);
}
.section--navy .eyebrow, .section--deep .eyebrow {
  color: #7fe0ea;
  background: var(--teal-tint-dark);
  border-color: rgba(127, 224, 234, 0.3);
}

.section-head { max-width: 42rem; margin-bottom: var(--space-5); }
.section-head--center { margin-inline: auto; text-align: center; }

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 0.9rem 1.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--duration-sm) var(--ease), color var(--duration-sm) var(--ease),
    border-color var(--duration-sm) var(--ease), transform var(--duration-sm) var(--ease),
    box-shadow var(--duration-sm) var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-dark); box-shadow: var(--shadow-md); }

.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--teal); color: var(--teal-dark); }

.btn--on-dark { background: #fff; color: var(--navy); }
.btn--on-dark:hover { background: var(--teal-tint); }

.btn--ghost-on-dark { background: transparent; color: var(--on-dark); border-color: rgba(255,255,255,0.25); }
.btn--ghost-on-dark:hover { border-color: #7fe0ea; color: #7fe0ea; }

.btn--sm { padding: 0.65rem 1.2rem; font-size: 0.85rem; }
.btn--block { width: 100%; justify-content: center; }

/* ─── Cards, layered border + tinted elevation, no glow ─────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  transition: box-shadow var(--duration-md) var(--ease), transform var(--duration-md) var(--ease),
    border-color var(--duration-md) var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--border-strong);
}
.card--dark {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.1);
}
.card--dark:hover { box-shadow: var(--shadow-dark); border-color: rgba(255,255,255,0.2); }

.card__icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--teal-tint);
  color: var(--teal-dark);
  font-size: 1.35rem;
  margin-bottom: var(--space-2);
}
.card--dark .card__icon { background: var(--teal-tint-dark); color: #7fe0ea; }

.card__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: var(--space-2); }
.tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--teal-tint);
  color: var(--teal-dark);
  border: 1px solid rgba(11, 155, 170, 0.2);
}
.tag--neutral { background: var(--bg-alt); color: var(--text-soft); border-color: var(--border); }

/* ─── Nav / Header ───────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-md) var(--ease), box-shadow var(--duration-md) var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-heading); font-weight: 700; font-size: 1.18rem; color: var(--text); }
.brand img { height: 28px; width: 28px; }
.brand span.accent { color: var(--teal); }

.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-links a { padding: 0.5rem 0.85rem; font-size: 0.9rem; font-weight: 600; color: var(--text-soft); border-radius: 6px; transition: color var(--duration-sm) var(--ease), background-color var(--duration-sm) var(--ease); }
.nav-links a:hover { color: var(--text); background: var(--bg-alt); }
.nav-links a[aria-current="page"] { color: var(--teal-dark); background: var(--teal-tint); }

.nav-cta { display: flex; align-items: center; gap: 0.75rem; }
.nav-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); align-items: center; justify-content: center; cursor: pointer; font-size: 1.1rem; }

.mobile-menu { display: none; position: fixed; top: 72px; left: 0; right: 0; bottom: 0; background: var(--bg); z-index: 99; padding: var(--space-3); overflow-y: auto; }
.mobile-menu.is-open { display: block; }
.mobile-menu a { display: block; padding: 1rem 0.5rem; font-size: 1.1rem; font-weight: 700; font-family: var(--font-heading); color: var(--text); border-bottom: 1px solid var(--border); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-cta .btn--primary { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ─── Hero ───────────────────────────────────────────────────────────── */
.hero { padding-top: calc(72px + 4.5rem); padding-bottom: var(--space-6); background: var(--navy); color: var(--on-dark); position: relative; overflow: hidden; }
.hero__content { position: relative; }
.hero h1 { color: #fff; margin-bottom: var(--space-2); }
.hero .split h1 { font-size: clamp(2.1rem, 3.8vw, 3.4rem); }
.hero .btn--primary { background: var(--teal); }
.hero__visual { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/5; }
.hero__visual img { width: 100%; height: 100%; object-fit: cover; }

/* ─── Abstract geometric visual (flat panels, no photo, no gradient) ─── */
.visual-abstract {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}
.visual-abstract .panel {
  position: absolute;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
}
.visual-abstract .panel--1 { width: 62%; height: 46%; top: 8%; left: 8%; background: var(--teal); opacity: 0.9; }
.visual-abstract .panel--2 { width: 46%; height: 34%; bottom: 12%; left: 20%; background: var(--deep); border-color: rgba(127,224,234,0.25); }
.visual-abstract .panel--3 { width: 34%; height: 34%; top: 30%; right: 6%; background: transparent; border: 1px solid rgba(127,224,234,0.5); }
.visual-abstract .panel--4 { width: 20%; height: 20%; bottom: 6%; right: 10%; background: #7fe0ea; opacity: 0.16; }
.visual-abstract.visual-abstract--light { background: var(--bg-alt); border-color: var(--border); }
.visual-abstract.visual-abstract--light .panel--3 { border-color: rgba(11,155,170,0.4); }
.visual-abstract.visual-abstract--light .panel--4 { background: var(--teal); opacity: 0.14; }

.breadcrumb { display: flex; gap: 0.4rem; align-items: center; font-size: 0.8rem; color: var(--on-dark-soft); margin-bottom: var(--space-3); }
.breadcrumb a { color: var(--on-dark-soft); }
.breadcrumb a:hover { color: #7fe0ea; }

/* ─── Stats strip ────────────────────────────────────────────────────── */
.stats { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.stat__value { font-family: var(--font-heading); font-size: clamp(2.1rem, 4vw, 3rem); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.section--navy .stat__value, .section--deep .stat__value { color: #fff; }
.stat__label { font-size: 0.86rem; color: var(--muted); }
.section--navy .stat__label, .section--deep .stat__label { color: var(--on-dark-soft); }

/* ─── Filters ────────────────────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: var(--space-4); }
.filter-btn { padding: 0.5rem 1.05rem; font-size: 0.85rem; font-weight: 600; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); color: var(--text-soft); cursor: pointer; transition: all var(--duration-sm) var(--ease); }
.filter-btn:hover { border-color: var(--teal); color: var(--teal-dark); }
.filter-btn.is-active { background: var(--text); color: #fff; border-color: var(--text); }

.filter-item { transition: opacity var(--duration-md) var(--ease); }
.filter-item[hidden] { display: none; }

/* ─── Forms ──────────────────────────────────────────────────────────── */
.field { margin-bottom: var(--space-3); }
.field label { display: block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 0.4rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 0.8rem 1rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); font-size: 0.95rem; transition: border-color var(--duration-sm) var(--ease), box-shadow var(--duration-sm) var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11, 155, 170, 0.15); }
.field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: var(--space-2); }
.form-status { padding: 1rem; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: var(--space-3); }
.form-status--success { background: var(--teal-tint); color: var(--teal-dark); border: 1px solid rgba(11,155,170,0.3); }
.form-status--error { background: #fdeeee; color: #b3261e; border: 1px solid #f3c9c7; }
.form-status[hidden] { display: none; }

/* ─── Footer ─────────────────────────────────────────────────────────── */
.site-footer { background: var(--ink); color: var(--on-dark-soft); }
.site-footer .container { padding-block: var(--space-6) var(--space-4); }
.site-footer h4 { color: var(--on-dark); font-family: var(--font-heading); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--space-2); }
.site-footer a { color: var(--on-dark-soft); font-size: 0.9rem; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.6fr; gap: var(--space-5); }
.footer-links { display: grid; gap: 0.6rem; }
.footer-services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem 1.5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-block: var(--space-3); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-size: 0.78rem; color: #56707a; }
.social-row { display: flex; gap: 0.6rem; margin-top: var(--space-2); }
.social-row a { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; transition: border-color var(--duration-sm) var(--ease), background-color var(--duration-sm) var(--ease); }
.social-row a:hover { border-color: var(--teal); background: rgba(11,155,170,0.12); color: #fff; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; gap: var(--space-4); } }

/* ─── Scroll reveal (GSAP-driven; class toggled by main.js) ─────────── */
[data-reveal] { opacity: 0; transform: translateY(28px); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ─── Sticky stack (process / how-we-work) ──────────────────────────── */
.stack-pin { position: relative; }
.stack-card { min-height: 60vh; display: flex; align-items: center; }

/* ─── Divider / utility ──────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: var(--space-1); } .mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.mb-1 { margin-bottom: var(--space-1); } .mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); } .mb-4 { margin-bottom: var(--space-4); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 200; background: var(--teal); color: #fff; padding: 0.75rem 1.25rem; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* ─── Related / list rows ────────────────────────────────────────────── */
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3); }
.includes-list { display: grid; gap: 0.85rem; }
.includes-list li { display: flex; gap: 0.65rem; align-items: flex-start; font-size: 0.95rem; color: var(--text-soft); }
.includes-list i { flex: none; margin-top: 0.2rem; color: var(--teal); }

.category-block { margin-bottom: var(--space-6); }
.category-block h2 { font-size: 1.4rem; margin-bottom: var(--space-3); }

/* ─── Magnetic CTA target (transform only, GPU-cheap) ────────────────── */
[data-magnetic] { display: inline-flex; will-change: transform; }
