/* ==========================================================================
   TopAgent — Cinematic 3D — shared stylesheet
   Design system: near-black bg, indigo->cyan bloom accents, Bricolage Grotesque
   + Sora type. Mobile-first. All motion is transform/opacity/clip-path only.
   ========================================================================== */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..700&family=Sora:wght@400;500;600&display=swap');

/* ---------- Design tokens ---------- */
:root {
  --bg: #07070c;
  --bg-2: #0a0a14;
  --ink: #EDEBF6;
  --muted: #9a97b5;
  --muted-2: #6f6c87;
  --indigo: #6E56F7;
  --cyan: #22D3EE;
  --violet: #8b74ff;
  --line: rgba(237, 235, 246, 0.12);
  --line-soft: rgba(237, 235, 246, 0.07);
  --glow-indigo: rgba(110, 86, 247, 0.45);
  --glow-cyan: rgba(34, 211, 238, 0.35);
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-bg-hover: rgba(255, 255, 255, 0.05);

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Sora', system-ui, sans-serif;

  --grad-accent: linear-gradient(95deg, var(--indigo) 0%, var(--violet) 45%, var(--cyan) 100%);
  --grad-text: linear-gradient(95deg, var(--indigo) 0%, var(--violet) 50%, var(--cyan) 100%);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 0.25s;
  --dur-med: 0.5s;
  --dur-slow: 0.9s;

  --container: 1280px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --nav-h: 84px;

  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
html.has-lenis { scroll-behavior: auto; }

body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

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

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

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

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

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

/* Respect user OS-level reduced-motion preference: kill everything heavy immediately */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Base ---------- */
html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* clip (not hidden) prevents horizontal scroll WITHOUT creating a scroll
     container — so position:sticky (services emblem) stays smooth. */
  overflow-x: clip;
  position: relative;
}

/* Film grain + noise overlay — fixed, decorative, never blocks content or clicks */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 3;
  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='120' height='120'%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: 160px 160px;
}

/* Soft ambient bloom glows behind content, fixed */
.bg-bloom {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-bloom::before,
.bg-bloom::after {
  content: '';
  position: absolute;
  width: min(60vw, 720px);
  height: min(60vw, 720px);
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.28;
}
.bg-bloom::before {
  top: -10%;
  left: -10%;
  background: radial-gradient(circle, var(--indigo), transparent 70%);
}
.bg-bloom::after {
  bottom: -15%;
  right: -10%;
  background: radial-gradient(circle, var(--cyan), transparent 70%);
  opacity: 0.2;
}

main, header, footer, section { position: relative; z-index: 2; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.h1, h1 { font-size: clamp(2.6rem, 7vw + 0.5rem, 6.4rem); }
.h2, h2 { font-size: clamp(2rem, 4.5vw + 0.5rem, 3.6rem); }
.h3, h3 { font-size: clamp(1.4rem, 2vw + 0.6rem, 2rem); }
.h4, h4 { font-size: clamp(1.1rem, 1vw + 0.6rem, 1.35rem); font-weight: 600; }

p { color: var(--muted); }

.lede {
  font-size: clamp(1.05rem, 1vw + 0.85rem, 1.35rem);
  color: var(--muted);
  max-width: 46ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}
.eyebrow::before {
  content: '';
  width: 1.6em;
  height: 1px;
  background: var(--cyan);
  display: inline-block;
}

.gradient-text {
  background: var(--grad-text);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.brand-mark b, .brand-mark strong { font-weight: 700; }

.brand, .brand-word, .brand-mark, .preloader__mark{ display:inline-flex; align-items:center; gap:.45em; }
.brand-arrow{ width:auto; height:1.05em; flex:none; }
.preloader__mark .brand-arrow{ height:1.15em; }

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

.section {
  padding-block: clamp(4rem, 10vw, 8rem);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
  max-width: 60ch;
}

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

.grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.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: -60px;
  left: 1rem;
  z-index: 1000;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus {
  top: 1rem;
}

/* Focus visibility across the whole site */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.95em 1.7em;
  border-radius: 999px;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  will-change: transform;
}

.btn-accent {
  background: var(--grad-accent);
  color: #07070c;
  box-shadow: 0 0 0 0 var(--glow-indigo);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px -6px var(--glow-indigo);
}
.btn-accent:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  border-color: rgba(237, 235, 246, 0.35);
  background: rgba(255,255,255,0.04);
  transform: translateY(-2px);
}

.btn-block { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

/* ---------- Tag chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.chip {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.4em 0.9em;
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  background: var(--bg);
  transition: opacity 0.6s var(--ease-in-out), visibility 0.6s var(--ease-in-out);
}
.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
/* NEVER-BLANK failsafe: if JS never runs at all (disabled/blocked), app.js's
   hard timeout can't fire either — so a pure-CSS animation force-hides the
   preloader on a timer regardless. Content underneath is real HTML and is
   already visible; this guarantees it is never trapped. */
@keyframes forcePreloaderHide {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}
.preloader {
  animation: forcePreloaderHide 0.01s linear 4.8s forwards;
}
.preloader__mark {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 400;
  color: var(--ink);
}
.preloader__mark b { font-weight: 700; }
.preloader__bar {
  width: min(260px, 60vw);
  height: 2px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.preloader__fill {
  height: 100%;
  width: 0%;
  background: var(--grad-accent);
  transition: width 0.2s linear;
}
.preloader__pct {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* NEVER-BLANK: the curtain must default to OFF-SCREEN in pure CSS (no JS
   required to hide it). JS opts IN to the covering state only at the exact
   moment it needs it (page-load reveal, outgoing link click) via .is-active,
   and always removes it again on a timer — see app.js pageTransitions().
   If JS never runs at all, the curtain never appears and content is never
   blocked. */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: var(--grad-accent);
  transform: translateY(101%);
  pointer-events: none;
  transition: transform 0.5s var(--ease-in-out);
}
.curtain.is-active {
  transform: translateY(0%);
}
.curtain.is-leaving {
  transform: translateY(-101%);
}

/* ---------- Custom cursor (desktop / fine pointer only) ---------- */
.cursor-ring, .cursor-dot {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 800;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
}
.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(237, 235, 246, 0.5);
  transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out), border-color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--cyan);
}
.cursor-ring.is-hover {
  width: 64px;
  height: 64px;
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
}
.cursor-ring.is-hidden, .cursor-dot.is-hidden { opacity: 0; }

@media (hover: none), (pointer: coarse) {
  .cursor-ring, .cursor-dot { display: none; }
}

/* ---------- Nav ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 700;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(7, 7, 12, 0.35);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-med) var(--ease-out), background var(--dur-med) var(--ease-out);
}
.site-nav.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(7, 7, 12, 0.72);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-size: 1.3rem;
  z-index: 2;
}

.nav-links {
  display: none;
}

.nav-cta {
  display: none;
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
    align-items: center;
    gap: clamp(1.5rem, 2.5vw, 2.75rem);
  }
  .nav-links a {
    position: relative;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--muted);
    padding: 0.4em 0;
    transition: color var(--dur-fast) var(--ease-out);
  }
  .nav-links a::after {
    content: '';
    position: absolute;
    left: 0; right: 100%;
    bottom: 0;
    height: 1px;
    background: var(--grad-accent);
    transition: right var(--dur-fast) var(--ease-out);
  }
  .nav-links a:hover,
  .nav-links a[aria-current="page"] {
    color: var(--ink);
  }
  .nav-links a:hover::after,
  .nav-links a[aria-current="page"]::after {
    right: 0;
  }
  .nav-cta {
    display: inline-flex;
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Hamburger */
.hamburger {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
@media (min-width: 900px) {
  .hamburger { display: none; }
}
.hamburger__box {
  width: 22px;
  height: 14px;
  position: relative;
}
.hamburger__line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--dur-fast) var(--ease-in-out), opacity var(--dur-fast) var(--ease-in-out), top var(--dur-fast) var(--ease-in-out);
}
.hamburger__line:nth-child(1) { top: 0; }
.hamburger__line:nth-child(2) { top: 6px; }
.hamburger__line:nth-child(3) { top: 12px; }

.hamburger[aria-expanded="true"] .hamburger__line:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}
.hamburger[aria-expanded="true"] .hamburger__line:nth-child(2) {
  opacity: 0;
}
.hamburger[aria-expanded="true"] .hamburger__line:nth-child(3) {
  top: 6px;
  transform: rotate(-45deg);
}

/* Mobile overlay menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 690;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--gutter);
  clip-path: circle(4% at calc(100% - 40px) 42px);
  visibility: hidden;
  transition: clip-path 0.6s var(--ease-in-out), visibility 0s linear 0.6s;
}
.mobile-menu.is-open {
  clip-path: circle(150% at calc(100% - 40px) 42px);
  visibility: visible;
  transition: clip-path 0.6s var(--ease-in-out), visibility 0s linear 0s;
}
.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 9vw, 2.8rem);
  font-weight: 600;
  padding: 0.35em 0;
  border-bottom: 1px solid var(--line-soft);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.mobile-menu.is-open a {
  opacity: 1;
  transform: translateY(0);
}
.mobile-menu.is-open a:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.is-open a:nth-child(2) { transition-delay: 0.16s; }
.mobile-menu.is-open a:nth-child(3) { transition-delay: 0.22s; }
.mobile-menu.is-open a:nth-child(4) { transition-delay: 0.28s; }
.mobile-menu.is-open a:nth-child(5) { transition-delay: 0.34s; }
.mobile-menu a:hover, .mobile-menu a:focus-visible { color: var(--cyan); }
.mobile-menu__cta {
  margin-top: 2rem;
  align-self: flex-start;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out) 0.4s, transform 0.5s var(--ease-out) 0.4s;
}
.mobile-menu.is-open .mobile-menu__cta {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

.hero__canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(7,7,12,0.35) 0%, rgba(7,7,12,0.15) 35%, rgba(7,7,12,0.75) 100%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  width: 100%;
}

.hero__eyebrow { margin-bottom: 1.5rem; }

.hero__title {
  font-size: clamp(2.6rem, 8vw, 6.8rem);
  max-width: 16ch;
}
.hero__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.05em;
}
.hero__title .line span {
  display: inline-block;
  will-change: transform;
}

.hero__sub {
  margin-top: 1.75rem;
  max-width: 52ch;
  font-size: clamp(1.05rem, 1vw + 0.85rem, 1.3rem);
}

.hero__cta {
  margin-top: 2.5rem;
}

.hero__scroll-cue {
  position: absolute;
  bottom: clamp(1.5rem, 4vw, 2.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero__scroll-cue span {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--cyan), transparent);
  position: relative;
  overflow: hidden;
}
.hero__scroll-cue span::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--ink);
  animation: scrollcue 1.8s ease-in-out infinite;
}
@keyframes scrollcue {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__scroll-cue span::after { animation: none; display: none; }
}

/* ---------- Marquee ---------- */
.marquee {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding-block: clamp(1.25rem, 3vw, 2rem);
  overflow: hidden;
  white-space: nowrap;
}
.marquee__track {
  display: inline-flex;
  gap: clamp(2rem, 5vw, 4rem);
  animation: marquee 28s linear infinite;
  will-change: transform;
}
.marquee[data-dir="reverse"] .marquee__track {
  animation-direction: reverse;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--muted);
}
.marquee__item::after {
  content: '\2727';
  color: var(--cyan);
  font-size: 0.6em;
}
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .marquee { overflow-x: auto; }
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  transform-style: preserve-3d;
  will-change: transform;
}
.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad-accent);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.card__glow {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-indigo), transparent 70%);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
  pointer-events: none;
  transform: translate(-50%, -50%);
  left: var(--glow-x, 50%);
  top: var(--glow-y, 50%);
}
.card:hover {
  background: var(--card-bg-hover);
  border-color: rgba(237,235,246,0.22);
}
.card:hover::before,
.card:hover .card__glow {
  opacity: 1;
}
@media (hover: none) {
  .card::before, .card__glow { display: none; }
}

.card__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(110,86,247,0.18), rgba(34,211,238,0.1));
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
  color: var(--cyan);
}
.card__icon svg { width: 26px; height: 26px; }

.card h3 { margin-bottom: 0.75rem; }
.card p { margin-bottom: 1.25rem; }

/* Service model canvas inside card (services page) */
.card__model {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, rgba(110,86,247,0.14), transparent 70%), var(--bg-2);
  border: 1px solid var(--line-soft);
  margin-bottom: 1.5rem;
  overflow: hidden;
  position: relative;
}
.card__model canvas { width: 100%; height: 100%; }

/* ---------- Services grid (services.html — uniform, static per-service visual) ---------- */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}
@media (max-width: 1040px) { .svc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .svc-grid { grid-template-columns: 1fr; } }

.svc-card { display: flex; flex-direction: column; }
.svc-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(110,86,247,0.20), transparent 62%),
    radial-gradient(circle at 72% 74%, rgba(34,211,238,0.12), transparent 60%),
    var(--bg-2);
  border: 1px solid var(--line-soft);
}
.svc-card__media img {
  width: 86%; height: 86%;
  object-fit: contain;
  filter: drop-shadow(0 18px 42px rgba(6,6,16,0.65));
  transition: transform var(--dur-med) var(--ease-out);
}
.svc-card:hover .svc-card__media img { transform: translateY(-6px) scale(1.03); }
.svc-card__ico {
  width: 54%; height: 54%;
  display: grid; place-items: center;
  border-radius: 22px;
  color: var(--cyan);
  background: linear-gradient(160deg, rgba(110,86,247,0.20), rgba(34,211,238,0.10));
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px -20px var(--glow-indigo);
}
.svc-card__ico svg { width: 46%; height: 46%; }
.svc-card__num {
  font-family: var(--font-body);
  font-weight: 700; font-size: 0.82rem; letter-spacing: 0.12em;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}
.svc-card h3 { font-size: clamp(1.2rem, 1.8vw, 1.5rem); margin-bottom: 0.6rem; }
.svc-card p { color: var(--muted); font-size: 0.96rem; line-height: 1.6; margin-bottom: 1.15rem; flex: 1 1 auto; }

/* ---------- Emblem layout (services.html — sticky shared 3D + scroll rows) ---------- */
.emblem-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 3rem);
}
@media (min-width: 860px) {
  .emblem-layout {
    grid-template-columns: 340px 1fr;
    align-items: start;
  }
}

.emblem-sticky {
  position: relative;
}
@media (min-width: 860px) {
  .emblem-sticky {
    position: sticky;
    top: calc(var(--nav-h) + 2rem);
  }
}

.card__model--large {
  aspect-ratio: 1 / 1;
  margin-bottom: 1rem;
}

.emblem-caption {
  font-size: 0.8rem;
  color: var(--muted-2);
  text-align: center;
}

.emblem-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  overflow: hidden;
}

.emblem-row {
  background: var(--bg);
  padding: clamp(1.75rem, 4vw, 3rem);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  transition: background var(--dur-med) var(--ease-out);
}
.emblem-row .process-item__num {
  color: var(--cyan);
  margin-bottom: 0.25rem;
}
.emblem-row:hover {
  background: rgba(255,255,255,0.02);
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  text-align: center;
}
@media (min-width: 780px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
}
.stat__label {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.stats-caption {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted-2);
}

/* ---------- Work cards ---------- */
.work-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: var(--card-bg);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.work-card:hover { border-color: rgba(237,235,246,0.25); }

@media (min-width: 860px) {
  .work-card { grid-template-columns: 1.1fr 1fr; }
  .work-card:nth-child(even) { grid-template-columns: 1fr 1.1fr; }
  .work-card:nth-child(even) .work-card__media { order: 2; }
}

.work-card__media {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.work-card__media--bansal {
  background: radial-gradient(120% 120% at 20% 20%, rgba(110,86,247,0.45), transparent 55%),
              radial-gradient(120% 120% at 80% 80%, rgba(34,211,238,0.35), transparent 55%),
              linear-gradient(135deg, #14142a, #0a0a14);
}
.work-card__media--rockpaper {
  background: radial-gradient(120% 120% at 80% 20%, rgba(139,116,255,0.4), transparent 55%),
              radial-gradient(120% 120% at 20% 85%, rgba(237,235,246,0.18), transparent 60%),
              linear-gradient(135deg, #0d0d0d, #1a1a1a);
}
.work-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(237,235,246,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237,235,246,0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mix-blend-mode: overlay;
}
.work-card__mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: rgba(237,235,246,0.85);
  letter-spacing: -0.01em;
  text-align: center;
  padding: 1rem;
}

.work-card__body {
  padding: clamp(1.75rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
}
.work-card__body .chips { margin-bottom: 0.25rem; }
.work-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 600;
  color: var(--cyan);
  width: fit-content;
}
.work-card__link svg {
  width: 16px; height: 16px;
  transition: transform var(--dur-fast) var(--ease-out);
}
.work-card__link:hover svg { transform: translate(3px, -3px); }

/* ---------- Process ---------- */
.process-list {
  display: grid;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  overflow: hidden;
}
.process-item {
  background: var(--bg);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
}
.process-item__num {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--muted-2);
  width: 2.5ch;
}
.process-item__tag {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

/* ---------- About ---------- */
.about-lead {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 600;
  max-width: 24ch;
  line-height: 1.2;
}
.about-body { max-width: 62ch; display: flex; flex-direction: column; gap: 1.25rem; }
.about-signature {
  margin-top: 2.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
}
.marks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 2rem;
}
.marks span {
  font-size: 0.85rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.marks span::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  display: inline-block;
}

/* ---------- Contact ---------- */
.contact-hero {
  padding-top: calc(var(--nav-h) + clamp(3rem, 8vw, 6rem));
}
.contact-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
}
@media (min-width: 880px) {
  .contact-grid { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
}
.contact-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.contact-detail__row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line-soft);
}
.contact-detail__label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  width: 8ch;
  flex-shrink: 0;
}
.contact-detail__value {
  font-weight: 600;
  color: var(--ink);
}
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.socials a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.6em 1.3em;
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.socials a:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(34,211,238,0.06);
}

.big-cta {
  text-align: center;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 5vw, 4rem);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(110,86,247,0.16), transparent 60%),
    var(--card-bg);
  position: relative;
  overflow: hidden;
}
.big-cta h2 { max-width: 20ch; margin-inline: auto; }
.big-cta p { max-width: 48ch; margin-inline: auto; margin-top: 1rem; }
.big-cta .btn-row { justify-content: center; margin-top: 2.25rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding-block: clamp(3rem, 6vw, 4.5rem);
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2.5rem;
  padding-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 2rem;
}
.footer-brand { max-width: 34ch; }
.footer-brand p { margin-top: 0.75rem; font-size: 0.9rem; }
.footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(2rem, 6vw, 5rem);
}
.footer-col h4 { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 1rem; font-weight: 600; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a { color: var(--muted); font-size: 0.9rem; transition: color var(--dur-fast) var(--ease-out); }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--muted-2);
}

/* ---------- Reveal / scroll animation system ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  will-change: transform, opacity;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-reveal-delay="1"] { transition-delay: 0.08s; }
.reveal[data-reveal-delay="2"] { transition-delay: 0.16s; }
.reveal[data-reveal-delay="3"] { transition-delay: 0.24s; }
.reveal[data-reveal-delay="4"] { transition-delay: 0.32s; }

/* NEVER-BLANK failsafe: force reveal after 4.5s even if JS/observer never fires */
@keyframes forceReveal {
  to { opacity: 1; transform: translateY(0); }
}
.reveal {
  animation: forceReveal 0.01s linear 4.5s forwards;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }
}

/* ---------- Services page specific ---------- */
.services-hero {
  padding-top: calc(var(--nav-h) + clamp(3rem, 8vw, 5rem));
  padding-bottom: clamp(2rem, 5vw, 3rem);
}
.services-list {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2rem);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .services-list { grid-template-columns: repeat(2, 1fr); }
}
.services-list .card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
@media (min-width: 720px) {
  .services-list .card:nth-child(odd):last-child .card__model { max-width: 340px; }
}

.stack-closer {
  margin-top: clamp(3rem, 6vw, 5rem);
}

/* ---------- Work page specific ---------- */
.work-list {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

/* ---------- Misc utility ---------- */
.mt-0 { margin-top: 0 !important; }
.text-center { text-align: center; }

/* WebGL fallback note (visually subtle, only shown if JS adds a flag) */
.gl-fallback-note {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--muted-2);
  z-index: 2;
  opacity: 0.6;
}
