/* =============================================================================
   ZAFRONIX — Premium polish layer
   Loaded AFTER style.css. Adds the craft layer that closes the "template →
   design-led" gap: bespoke icon system, gradient-hairline surfaces, a grain
   texture, a reworked value-first hero, a proof band, and motion choreography.
   Scoped to additive classes + a few intentional overrides so the base
   stylesheet stays the single source of layout truth.
   ============================================================================= */

:root {
  /* Elevation — layered shadows read as real depth, not a flat glow. */
  --elev-1: 0 1px 2px rgba(0,0,0,0.30), 0 2px 8px rgba(0,0,0,0.22);
  --elev-2: 0 2px 4px rgba(0,0,0,0.32), 0 12px 32px rgba(0,0,0,0.34);
  --elev-3: 0 8px 24px rgba(0,0,0,0.40), 0 24px 64px rgba(0,0,0,0.42);
  /* Brand glow, tuned for restraint (one hero moment, not everywhere). */
  --ring-brand: 0 0 0 1px rgba(108,60,224,0.35), 0 0 48px rgba(108,60,224,0.22);
  --surface-1: #0e0e22;
  --surface-2: #12122c;
  --hairline: rgba(139,157,195,0.14);
}

/* ===== Grain — a barely-there texture over the whole page. The single most
   effective "not a flat template" cue; opacity is deliberately low. ===== */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* Keep real content above the grain + bg-grid. */
.nav, main, footer { position: relative; z-index: 1; }

/* ===== Bespoke icon system — replaces every emoji. Consistent 1.5px stroke,
   inherits color so it can go brand-cyan on chips, muted in cards. ===== */
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vector-effect: non-scaling-stroke;
}
.icon--lg { width: 28px; height: 28px; }

/* A gradient-stroked icon for feature cards — the brand accent, applied to the
   line art via an SVG <linearGradient> referenced by the symbol (see sprite). */
.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  color: var(--accent-cyan);
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(135deg, rgba(108,60,224,0.55), rgba(0,212,255,0.35)) border-box;
  border: 1px solid transparent;
  box-shadow: var(--elev-1);
  margin-bottom: 18px;
}

/* ===== Gradient-hairline surface — the card treatment that reads "designed".
   A 1px transparent border filled by a subtle brand gradient via the
   padding-box/border-box double-background trick. ===== */
.surface {
  background:
    linear-gradient(var(--surface-1), var(--surface-1)) padding-box,
    linear-gradient(160deg, rgba(139,157,195,0.22), rgba(139,157,195,0.04) 40%, transparent) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  box-shadow: var(--elev-1);
}

/* ===========================================================================
   HERO — value-first rework. The giant logo lockup is retired (it lived in
   the nav already and duplicated the H1's "AI · Security · Data"); the fold
   now leads with an eyebrow, a big confident headline, proof, and CTAs.
   =========================================================================== */
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  padding: 7px 16px;
  border-radius: 100px;
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.18);
  margin-bottom: 28px;
  animation: fadeInUp 0.8s ease-out both;
}
.hero__eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}

/* Override the base tagline size — a premium hero commits to scale. */
.hero .hero__tagline {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 15ch;
  margin: 0 auto 24px;
}
.hero .hero__tagline .grad {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .hero__description {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 640px;
}

/* Category chips — icon + label, replacing the emoji badges. */
.hero__badges { gap: 12px; margin-top: 8px; }
.badge {
  padding: 9px 16px 9px 12px;
  color: var(--text-primary);
  background: rgba(17,17,40,0.5);
  border: 1px solid var(--hairline);
  transition: border-color 0.25s, transform 0.25s;
}
.badge:hover { border-color: rgba(0,212,255,0.4); transform: translateY(-1px); }
.badge .icon { width: 17px; height: 17px; color: var(--accent-cyan); }

/* Proof strip under the hero CTAs — the real metrics, pulled above the fold. */
.hero__proof {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 28px;
  margin-top: 48px;
  padding-top: 30px;
  border-top: 1px solid var(--hairline);
  animation: fadeInUp 0.8s ease-out 0.8s both;
}
.hero__proof-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.hero__proof-item .icon { width: 16px; height: 16px; color: var(--accent-green); }
.hero__proof-item strong { color: var(--text-primary); font-weight: 600; }

/* Refined hero radial mesh — a premium light source behind the headline,
   layered over the existing bg-grid. Pure CSS, no image weight. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% 30%, rgba(108,60,224,0.20), transparent 70%),
    radial-gradient(40% 30% at 72% 18%, rgba(0,212,255,0.12), transparent 70%),
    radial-gradient(45% 35% at 25% 40%, rgba(0,255,178,0.07), transparent 70%);
  z-index: 0;
}

/* ===== Buttons — a touch more presence + a premium ghost variant. ===== */
.btn { transition: transform 0.25s, box-shadow 0.25s, background 0.25s, border-color 0.25s; }
.btn--primary { box-shadow: 0 6px 20px rgba(108,60,224,0.32), inset 0 1px 0 rgba(255,255,255,0.18); }
.btn--secondary,
.btn--ghost {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hairline);
  color: var(--text-primary);
}
.btn--secondary:hover,
.btn--ghost:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(0,212,255,0.4);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* ===========================================================================
   SECTION SURFACES — solutions tiles + philosophy cards get the gradient
   hairline + real elevation + icon tiles.
   =========================================================================== */
.solutions-strip__tile,
.philosophy__card {
  background:
    linear-gradient(var(--surface-1), var(--surface-1)) padding-box,
    linear-gradient(160deg, rgba(139,157,195,0.20), rgba(139,157,195,0.03) 45%, transparent) border-box;
  border: 1px solid transparent;
  box-shadow: var(--elev-1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.solutions-strip__tile:hover,
.solutions-strip__tile:focus-visible,
.philosophy__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--elev-2);
}
.philosophy__card:hover {
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(160deg, rgba(108,60,224,0.45), rgba(0,212,255,0.18) 50%, transparent) border-box;
}

/* Emoji icon spans → icon tiles. The old .philosophy__icon becomes a tile box. */
.philosophy__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  font-size: 0; /* hide any leftover emoji fallback */
  border-radius: 14px;
  color: var(--accent-cyan);
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(135deg, rgba(108,60,224,0.55), rgba(0,212,255,0.35)) border-box;
  border: 1px solid transparent;
  box-shadow: var(--elev-1);
  margin-bottom: 18px;
}
.philosophy__icon .icon { width: 26px; height: 26px; }

.solutions-strip__tile .icon-tile { margin-bottom: 16px; }

/* ===== Proof / metrics band — restyle the stats into a proper band. ===== */
.about__stats { gap: 20px; }
.stat {
  background:
    linear-gradient(var(--surface-1), var(--surface-1)) padding-box,
    linear-gradient(160deg, rgba(139,157,195,0.18), transparent 60%) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 26px 22px;
  box-shadow: var(--elev-1);
}
.stat__number {
  background: var(--accent-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  /* These are now qualitative word-tokens (Auditable / Reversible / …), not
     big numbers — size them to fit the 2-col grid without overflow. */
  font-size: clamp(1.35rem, 2.3vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* ===========================================================================
   MOTION — staggered scroll reveals. The base stylesheet (style.css) already
   owns the reveal mechanism: `.reveal { opacity:0 }` → main.js adds
   `.reveal--visible` on intersect → `opacity:1`. We do NOT re-declare that
   here (an earlier version wrongly keyed the "visible" state to `.is-visible`,
   which main.js never sets — leaving every `.reveal` stuck invisible). We only
   ADD a gentle per-item stagger delay, which layers onto the base transition.
   Respects reduced-motion (no delay → no staggered hold on visible content).
   =========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .solutions-strip__grid .reveal:nth-child(2) { transition-delay: 0.06s; }
  .solutions-strip__grid .reveal:nth-child(3) { transition-delay: 0.12s; }
  .solutions-strip__grid .reveal:nth-child(4) { transition-delay: 0.18s; }
  .solutions-strip__grid .reveal:nth-child(5) { transition-delay: 0.24s; }
  .philosophy__grid .reveal:nth-child(2) { transition-delay: 0.06s; }
  .philosophy__grid .reveal:nth-child(3) { transition-delay: 0.12s; }
  .philosophy__grid .reveal:nth-child(4) { transition-delay: 0.18s; }
}

/* ===========================================================================
   MOBILE-FIRST — the reworked hero + chips + proof must scale cleanly.
   =========================================================================== */
@media (max-width: 768px) {
  .hero { padding-top: 96px; }
  .hero__content { padding: 32px 0 24px; }
  .hero .hero__tagline { font-size: clamp(2rem, 9vw, 2.9rem); max-width: 18ch; }
  .hero__proof { gap: 12px 18px; margin-top: 34px; padding-top: 22px; }
  .hero__proof-item { font-size: 0.82rem; }
  .hero__badges { flex-direction: row; flex-wrap: wrap; }
  .badge { font-size: 0.8rem; padding: 8px 14px 8px 11px; }
  /* Hero CTAs stack full-width for thumb reach; kill inline margins. */
  .hero__cta { display: flex; flex-direction: column; gap: 12px; }
  .hero__cta .btn { width: 100%; justify-content: center; margin-left: 0 !important; }
}

/* ===========================================================================
   PAGE PROPAGATION — how-we-build.html + solutions.html.
   These pages load premium.css so the icon system + surfaces + motion match
   the homepage. Rules here target THEIR component classes (page-local layout
   lives in each page's own <style>; this only layers the premium finish).
   =========================================================================== */

/* How We Build — the principle "icon" span was a 2.5rem emoji; it now holds an
   SVG <use>. Turn it into the same gradient-bordered icon tile the homepage
   uses so the line-art reads as a designed mark, not a loose glyph. */
.principle__icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  font-size: 0 !important;              /* kill the old emoji sizing */
  border-radius: 14px;
  color: var(--accent-cyan);
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(135deg, rgba(108,60,224,0.55), rgba(0,212,255,0.35)) border-box;
  border: 1px solid transparent;
  box-shadow: var(--elev-1);
  margin-bottom: 16px;
}
.principle__icon .icon { width: 26px; height: 26px; }

/* Solutions — API family tiles get the gradient-hairline surface + elevation
   + a lift on hover, matching the homepage solution cards. */
.api-family__tile {
  background:
    linear-gradient(var(--surface-1), var(--surface-1)) padding-box,
    linear-gradient(160deg, rgba(139,157,195,0.20), rgba(139,157,195,0.03) 45%, transparent) border-box !important;
  border: 1px solid transparent !important;
  box-shadow: var(--elev-1);
}
.api-family__tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--elev-2);
  border-color: transparent !important;
}

/* Solutions — the big product cards keep their layout/banner but gain real
   depth (elevation) instead of a flat 1px border, with a stronger lift. */
.project-card {
  box-shadow: var(--elev-2);
}
.project-card:hover {
  box-shadow: var(--elev-3);
}

/* ===========================================================================
   "BY THE NUMBERS" — portfolio traction as premium metric cards. Count-ups
   run in main.js; cards under their data-min floor are hidden (weak-number
   gate). Section header uses the shared .section-header from style.css.
   =========================================================================== */
.metrics { padding: 40px 0 60px; }
.metrics .section-header { margin-bottom: 40px; }
.metrics__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
@media (max-width: 860px) { .metrics__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .metrics__grid { grid-template-columns: 1fr; } }
.metric {
  text-align: center;
  padding: 32px 22px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(var(--surface-1), var(--surface-1)) padding-box,
    linear-gradient(160deg, rgba(139,157,195,0.22), rgba(139,157,195,0.03) 45%, transparent) border-box;
  border: 1px solid transparent;
  box-shadow: var(--elev-1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.metric:hover {
  transform: translateY(-4px);
  box-shadow: var(--elev-2);
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(160deg, rgba(108,60,224,0.45), rgba(0,212,255,0.18) 50%, transparent) border-box;
}
.metric[hidden] { display: none; }
.metric__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.035em;
  background: var(--accent-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}
.metric__label {
  display: block;
  margin-top: 12px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
}
.metric__sub {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* ===========================================================================
   CLOSING CTA BAND — the hard conversion action.
   =========================================================================== */
.cta-band { padding: 40px 0 110px; }
.cta-band__inner {
  position: relative;
  overflow: hidden;
  text-align: center;
  border-radius: var(--radius-xl);
  padding: clamp(48px, 7vw, 88px) clamp(24px, 5vw, 64px);
  background:
    linear-gradient(var(--surface-1), var(--surface-1)) padding-box,
    linear-gradient(135deg, rgba(108,60,224,0.55), rgba(0,212,255,0.30) 55%, rgba(0,255,178,0.18)) border-box;
  border: 1px solid transparent;
  box-shadow: var(--elev-2);
}
/* brand light source behind the CTA copy */
.cta-band__inner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(70% 120% at 50% -10%, rgba(108,60,224,0.22), transparent 70%);
}
.cta-band__inner > * { position: relative; z-index: 1; }
.cta-band__inner h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  max-width: 20ch;
  margin: 14px auto 0;
  letter-spacing: -0.02em;
}
.cta-band__inner p {
  max-width: 620px;
  margin: 18px auto 0;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.6;
}
.cta-band__actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}
@media (max-width: 480px) {
  .cta-band__actions { flex-direction: column; }
  .cta-band__actions .btn { width: 100%; justify-content: center; }
}
