/* ===== Savitech — Base Styles ===== */
:root {
  --bg-0: #08090B;
  --bg-1: #0D0F12;
  --bg-2: #14171C;
  --bg-3: #1B1F26;
  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text-1: #F5F5F4;
  --text-2: #A8A8A6;
  --text-3: #74746F;
  --text-4: #52524F;
  --accent: #C8FF5C;
  --accent-dim: rgba(200, 255, 92, 0.16);
  --accent-faint: rgba(200, 255, 92, 0.06);
  --warn: #FF6B35;
  --max: 1320px;
  --pad: 28px;
  --radius: 16px;
  /* Premium easing curves */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-snap: cubic-bezier(.2, .9, .2, 1);
  --t-fast: 220ms;
  --t-base: 380ms;
  --t-slow: 700ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg-0); color: var(--text-1); }
html { scroll-behavior: smooth; }
html { scroll-padding-top: 100px; }
body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  letter-spacing: -0.005em;
  background:
    radial-gradient(900px 600px at 12% 8%, rgba(124,196,255,0.06), transparent 60%),
    radial-gradient(800px 600px at 88% 18%, rgba(200,255,92,0.05), transparent 60%),
    radial-gradient(900px 700px at 50% 90%, rgba(184,155,255,0.05), transparent 65%),
    var(--bg-0);
}

/* Floating orbs that show through glass */
.bg-orbs {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-orbs::before, .bg-orbs::after {
  content: '';
  position: absolute;
  width: 720px; height: 720px; border-radius: 50%;
  filter: blur(110px);
  opacity: 0.45;
  will-change: transform;
}
.bg-orbs::before {
  top: 25%; left: -14%;
  background: radial-gradient(circle, var(--accent), transparent 60%);
  animation: orbA 60s ease-in-out infinite;
}
.bg-orbs::after {
  top: 55%; right: -12%;
  background: radial-gradient(circle, #7CC4FF, transparent 60%);
  animation: orbB 78s ease-in-out infinite;
}
.bg-orbs .orb-c {
  position: absolute;
  width: 600px; height: 600px; border-radius: 50%;
  bottom: -10%; left: 40%;
  filter: blur(100px);
  opacity: 0.35;
  background: radial-gradient(circle, #B89BFF, transparent 60%);
  animation: orbC 90s ease-in-out infinite;
  will-change: transform;
}
@keyframes orbA {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(120px, -80px, 0) scale(1.12); }
  66% { transform: translate3d(60px, 100px, 0) scale(0.95); }
}
@keyframes orbB {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-160px, -120px, 0) scale(1.18); }
}
@keyframes orbC {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  40% { transform: translate3d(-100px, -60px, 0) scale(1.1); }
  70% { transform: translate3d(80px, 40px, 0) scale(0.9); }
}

/* Cursor-attracting glow — follows mouse, painted via JS-set CSS vars */
.cursor-glow {
  position: fixed;
  pointer-events: none;
  width: 520px; height: 520px;
  left: var(--mx, 50%); top: var(--my, 50%);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent) 0%, transparent 55%);
  opacity: 0.12;
  filter: blur(60px);
  z-index: 0;
  mix-blend-mode: screen;
  transition: opacity .4s ease;
}

/* 3D card lift */
.card-3d {
  transform-style: preserve-3d;
  transition:
    transform var(--t-slow) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out),
    border-color var(--t-base) var(--ease-out),
    background var(--t-base) var(--ease-out);
  will-change: transform;
}
.card-3d:hover {
  border-color: rgba(255,255,255,0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    0 40px 90px -25px rgba(0,0,0,0.8),
    0 0 80px -10px var(--accent-faint);
}
.card-3d > * { transform: translateZ(0); }
.card-3d .lift-1 { transform: translateZ(20px); transition: transform var(--t-slow) var(--ease-out); }
.card-3d .lift-2 { transform: translateZ(40px); transition: transform var(--t-slow) var(--ease-out); }
.card-3d:hover .lift-1 { transform: translateZ(34px); }
.card-3d:hover .lift-2 { transform: translateZ(64px); }

/* ===== 3D motion utilities ===== */
@keyframes floatY {
  0%, 100% { transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg); }
  50% { transform: translate3d(0, -14px, 0) rotateX(2deg) rotateY(-2deg); }
}
@keyframes floatYRev {
  0%, 100% { transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg); }
  50% { transform: translate3d(0, 12px, 0) rotateX(-2deg) rotateY(2deg); }
}
@keyframes spinSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-faint), 0 0 40px -10px var(--accent-dim); }
  50% { box-shadow: 0 0 0 10px transparent, 0 0 60px -10px var(--accent); }
}

.float-3d { animation: floatY 9s ease-in-out infinite; transform-style: preserve-3d; }
.float-3d-rev { animation: floatYRev 11s ease-in-out infinite; transform-style: preserve-3d; }
.spin-slow { animation: spinSlow 40s linear infinite; }

/* Shimmer text */
.shimmer-text {
  background: linear-gradient(90deg, var(--text-1) 0%, var(--accent) 50%, var(--text-1) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite;
}

/* Universal scene perspective */
main { perspective: 1600px; perspective-origin: 50% 30%; }

/* Reveal — make 3D */
.reveal { opacity: 0; transform: translate3d(0, 30px, -60px) rotateX(8deg); transition: opacity 1.0s ease, transform 1.0s cubic-bezier(.2,.7,.2,1); transform-origin: 50% 100%; }
.reveal.in { opacity: 1; transform: translate3d(0, 0, 0) rotateX(0deg); }
.reveal-stagger > * { opacity: 0; transform: translate3d(0, 22px, -40px) rotateX(6deg); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); transform-origin: 50% 100%; }
.reveal-stagger.in > * { opacity: 1; transform: translate3d(0, 0, 0) rotateX(0deg); }

/* Service cards get a subtle continuous float when not hovered */
.services-grid > *:nth-child(odd) { animation: floatY 12s ease-in-out infinite; }
.services-grid > *:nth-child(even) { animation: floatYRev 14s ease-in-out infinite; }
.services-grid > *:hover { animation: none; }
.work-grid > *:nth-child(3n+1) { animation: floatY 13s ease-in-out infinite; }
.work-grid > *:nth-child(3n+2) { animation: floatYRev 15s ease-in-out infinite; }
.work-grid > *:nth-child(3n+3) { animation: floatY 17s ease-in-out infinite; }
.work-grid > *:hover { animation: none; }

/* Glow pulsing on primary CTA */
.btn-primary { animation: glowPulse 3.5s ease-in-out infinite; }
#root { position: relative; z-index: 1; }
::selection { background: var(--accent); color: #000; }

a { color: inherit; text-decoration: none; transition: color var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-out); }
button { font-family: inherit; cursor: pointer; transition: all var(--t-fast) var(--ease-out); }
img { max-width: 100%; display: block; }

/* Page-load fade in */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#root > nav, main { animation: pageFadeIn .9s var(--ease-out) both; }
main { animation-delay: 120ms; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: 'ss01','ss02','cv01'; }
.shell { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* ===== Section header pattern ===== */
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--accent);
}

h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.025em; margin: 0; }
.h-display {
  font-size: clamp(40px, 6.4vw, 96px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  font-weight: 400;
  text-wrap: balance;
}
.h-section {
  font-size: clamp(32px, 4.4vw, 62px);
  line-height: 1.0;
  letter-spacing: -0.035em;
  font-weight: 400;
  text-wrap: balance;
}
.h-card {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 500;
}
.lede { color: var(--text-2); font-size: clamp(15px, 1.2vw, 18px); line-height: 1.5; max-width: 60ch; text-wrap: pretty; }
.italic-display { font-family: 'Instrument Serif', 'Space Grotesk', serif; font-style: italic; font-weight: 400; letter-spacing: -0.02em; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid rgba(255,255,255,0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  color: var(--text-1);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(255,255,255,0.03),
    0 4px 14px -4px rgba(0,0,0,0.5);
  transition:
    transform var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.10), transparent 70%);
  transform: translateX(-100%);
  transition: transform .8s var(--ease-out);
  pointer-events: none;
}
.btn:hover::before { transform: translateX(100%); }
.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 12px 32px -8px rgba(0,0,0,0.6);
}
.btn:active { transform: translateY(0); transition-duration: 80ms; }
.btn .arrow { transition: transform var(--t-base) var(--ease-out); }
.btn:hover .arrow { transform: translate(3px, -3px); }
.btn-primary {
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent), white 18%) 0%, var(--accent) 60%, color-mix(in oklab, var(--accent), black 12%) 100%);
  color: #0a0c08;
  border-color: color-mix(in oklab, var(--accent), white 20%);
  font-weight: 600;
  letter-spacing: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    0 10px 32px -8px var(--accent),
    0 0 0 1px rgba(0,0,0,0.04);
}
.btn-primary:hover {
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent), white 28%) 0%, var(--accent) 70%, color-mix(in oklab, var(--accent), black 8%) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    0 0 0 6px var(--accent-dim),
    0 18px 48px -10px var(--accent);
}
.btn-ghost {
  background: rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.08);
}
.btn-ghost:hover { background: rgba(255,255,255,0.06); }

/* ===== Reveal — premium 3D entrances ===== */
.reveal { opacity: 0; transform: translate3d(0, 30px, -40px) rotateX(6deg); transition: opacity 1.1s var(--ease-out), transform 1.2s var(--ease-out); transform-origin: 50% 100%; }
.reveal.in { opacity: 1; transform: translate3d(0, 0, 0) rotateX(0); }
.reveal-stagger > * { opacity: 0; transform: translate3d(0, 22px, -20px) rotateX(4deg); transition: opacity .9s var(--ease-out), transform 1s var(--ease-out); transform-origin: 50% 100%; }
.reveal-stagger.in > * { opacity: 1; transform: translate3d(0, 0, 0) rotateX(0); }
.reveal-stagger.in > *:nth-child(1) { transition-delay: 40ms; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 90ms; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 140ms; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 190ms; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 240ms; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 290ms; }
.reveal-stagger.in > *:nth-child(7) { transition-delay: 340ms; }
.reveal-stagger.in > *:nth-child(8) { transition-delay: 390ms; }
.reveal-stagger.in > *:nth-child(9) { transition-delay: 440ms; }

/* Section container — generous space, premium rhythm */
section { position: relative; padding: clamp(96px, 11vw, 168px) 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: none; }
.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 72px);
}
.section-head .h-section { max-width: 14ch; }
.section-head .meta { color: var(--text-2); font-size: 15px; line-height: 1.55; max-width: 44ch; }
@media (max-width: 760px) {
  .section-head { grid-template-columns: 1fr; gap: 18px; }
}

/* ===== Card primitive — Liquid Glass ===== */
.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 40%, rgba(255,255,255,0.03) 100%),
    rgba(20, 23, 28, 0.40);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  position: relative;
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.09),
    inset 0 -1px 0 rgba(255,255,255,0.02),
    0 1px 0 rgba(0,0,0,0.4),
    0 16px 50px -20px rgba(0,0,0,0.7);
  isolation: isolate;
  transition: border-color var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              background var(--t-base) var(--ease-out);
}
/* Specular highlight overlay */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 30% at 50% -10%, rgba(255,255,255,0.10), transparent 60%),
    radial-gradient(ellipse 40% 100% at 100% 50%, rgba(255,255,255,0.04), transparent 70%);
  mix-blend-mode: screen;
  z-index: 0;
}
.card > * { position: relative; z-index: 1; }

/* Heavier glass — for hero panel & dialog */
.glass-deep {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.05) 100%),
    rgba(13, 15, 18, 0.55);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 0 0 1px rgba(255,255,255,0.02),
    inset 0 -40px 80px -40px rgba(0,0,0,0.35),
    0 30px 80px -20px rgba(0,0,0,0.7),
    0 0 60px -20px var(--accent-faint);
  position: relative;
  isolation: isolate;
}
.glass-deep::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 20% at 50% 0%, rgba(255,255,255,0.18), transparent 70%),
    radial-gradient(ellipse 30% 60% at 0% 100%, rgba(191,255,63,0.05), transparent 70%);
  z-index: 0;
}
.glass-deep > * { position: relative; z-index: 1; }

/* Light pill — translucent rounded chip */
.glass-pill {
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 4px 18px -6px rgba(0,0,0,0.5);
}

/* ===== Animated grid background ===== */
.grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 0%, transparent 75%);
  pointer-events: none;
}
.grid-bg.dotted {
  background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ===== Glow ===== */
.hero-glow {
  position: absolute;
  width: 800px; height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(191,255,63,0.18) 0%, rgba(191,255,63,0.05) 35%, transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}

/* ===== Marquee ===== */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 40s linear infinite; }
.marquee-mask { mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent); }

/* ===== Tag / pill ===== */
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 11px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-2);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01));
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
.tag-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* Form */
.input, .textarea, .select {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line-2);
  border-radius: 0;
  padding: 16px 0;
  color: var(--text-1);
  font: inherit;
  font-size: 16px;
  letter-spacing: -0.005em;
  outline: none;
  border-top: none; border-left: none; border-right: none;
  transition: border-color var(--t-base) var(--ease-out);
}
.input:focus, .textarea:focus, .select:focus { border-bottom-color: var(--accent); }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.textarea { resize: vertical; min-height: 90px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%23A1A1AA'%3E%3Cpath d='M6 8L2 4h8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0 center; background-size: 12px; padding-right: 24px; }
.select option { background: #14171C; color: var(--text-1); padding: 10px; }
.select option:disabled { color: var(--text-4); }

/* Kill autofill yellow/white in Chrome/Safari */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text-1) !important;
  -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
  box-shadow: 0 0 0 1000px transparent inset !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  caret-color: var(--text-1);
  transition: background-color 9999s ease-in-out 0s;
}
input:-webkit-autofill { font: inherit !important; }

/* Hide scrollbars everywhere — keep scrolling functional */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { width: 0; height: 0; display: none; }
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* Util */
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; }
.divider { height: 1px; background: var(--line); }
.kbd { font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--text-2); }
.dim { color: var(--text-3); }
.dim-2 { color: var(--text-2); }
.accent { color: var(--accent); }

/* Tweak panel size override */
.tweaks-panel { font-family: 'Space Grotesk', system-ui, sans-serif !important; }
