/* ============================================================
   Liquid Glass Material System — v3 (Enhanced Visibility)
   Single accent: #4f7ef7. Orbs are now vivid enough
   that the glass blur is clearly perceptible.
============================================================ */

:root {
  /* ===== Backgrounds ===== */
  --bg:   #f5f6fa;
  --bg-2: #eeeef5;
  --bg-3: #e5e5ef;

  /* ===== Text ===== */
  --text-primary:   #0c0c10;
  --text-secondary: #38383f;
  --text-muted:     #86869a;
  --text-faint:     #acacc2;

  /* ===== Accent ===== */
  --accent:        #4f7ef7;
  --accent-soft:   rgba(79, 126, 247, 0.10);
  --accent-border: rgba(79, 126, 247, 0.28);

  /* ===== Glass Alpha ===== */
  --glass-1: rgba(255, 255, 255, 0.58);
  --glass-2: rgba(255, 255, 255, 0.42);
  --glass-3: rgba(255, 255, 255, 0.26);

  /* ===== Glass Borders ===== */
  --gb-1: rgba(255, 255, 255, 0.90);
  --gb-2: rgba(255, 255, 255, 0.70);
  --gb-3: rgba(255, 255, 255, 0.48);

  /* ===== Ambient Orb Colors — vivid enough for blur to show ===== */
  --orb-a: rgba(160, 195, 255, 0.80);   /* clear blue */
  --orb-b: rgba(190, 180, 255, 0.70);   /* soft purple */
  --orb-c: rgba(170, 230, 240, 0.60);   /* soft cyan */
  --orb-d: rgba(220, 200, 255, 0.65);   /* pale violet */

  /* ===== Radius ===== */
  --r-sm:   0.75rem;
  --r-md:   1.25rem;
  --r-lg:   1.75rem;
  --r-xl:   2.25rem;
  --r-full: 9999px;

  /* ===== Shadows ===== */
  --s-1: 0 2px 16px rgba(60, 80, 180, 0.06);
  --s-2: 0 6px 32px rgba(60, 80, 180, 0.09);
  --s-3: 0 14px 56px rgba(60, 80, 180, 0.12);
}

/* ===== Page background — richer gradient so orbs pop ===== */
body {
  background:
    radial-gradient(ellipse 90% 70% at 15% -5%,  rgba(160,195,255,0.45) 0%, transparent 55%),
    radial-gradient(ellipse 75% 65% at 90%  10%,  rgba(195,185,255,0.38) 0%, transparent 52%),
    radial-gradient(ellipse 65% 55% at 50% 100%,  rgba(165,220,255,0.35) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 80%  80%,  rgba(210,195,255,0.28) 0%, transparent 50%),
    var(--bg);
}

/* ===== Ambient Orbs ===== */
.orb {
  position: absolute;
  border-radius: 40% 55% 48% 52% / 45% 40% 60% 50%;
  pointer-events: none;
  transform: translateZ(0);
  will-change: transform;
}

/* Soft blur — just enough to be smooth, not too much that color is lost */
.orb-blur-sm { filter: blur(48px); }
.orb-blur-md { filter: blur(72px); }
.orb-blur-lg { filter: blur(96px); }

/* ===== Noise grain overlay ===== */
.noise::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.032;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

/* ═══════════════════════════════════════════
   GLASS LEVELS — the core material system
═══════════════════════════════════════════ */

/* --- Level 1: Subtle — navbar, small UI chips --- */
.g1 {
  background: var(--glass-1);
  border: 1px solid var(--gb-1);
  box-shadow: var(--s-1),
              inset 0 1px 0 rgba(255,255,255,0.80),
              inset 0 -1px 0 rgba(255,255,255,0.25);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .g1 {
    backdrop-filter: blur(14px) saturate(160%) brightness(1.04);
    -webkit-backdrop-filter: blur(14px) saturate(160%) brightness(1.04);
  }
}

/* --- Level 2: Medium — cards, panels --- */
.g2 {
  background: var(--glass-2);
  border: 1px solid var(--gb-2);
  box-shadow: var(--s-2),
              inset 0 1.5px 0 rgba(255,255,255,0.90),
              inset 0 -1px 0 rgba(255,255,255,0.20),
              inset 1px 0 0 rgba(255,255,255,0.50);
  position: relative;
  isolation: isolate;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .g2 {
    backdrop-filter: blur(22px) saturate(180%) brightness(1.06);
    -webkit-backdrop-filter: blur(22px) saturate(180%) brightness(1.06);
  }
}
/* Inner highlight sweep on g2 */
.g2::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.55) 0%,
    rgba(255,255,255,0.08) 40%,
    transparent 65%
  );
  z-index: 1;
}

/* --- Level 3: Strong — hero objects, featured panels --- */
.g3 {
  background: var(--glass-3);
  border: 1px solid var(--gb-3);
  box-shadow: var(--s-3),
              inset 0 2px 0 rgba(255,255,255,0.95),
              inset 0 -1px 0 rgba(255,255,255,0.15),
              inset 1px 0 0 rgba(255,255,255,0.60),
              inset -1px 0 0 rgba(255,255,255,0.20);
  position: relative;
  isolation: isolate;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .g3 {
    backdrop-filter: blur(32px) saturate(200%) brightness(1.08);
    -webkit-backdrop-filter: blur(32px) saturate(200%) brightness(1.08);
  }
}
/* Strong inner highlight + radial glow */
.g3::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 80% at 20% -5%,  rgba(255,255,255,0.75) 0%, transparent 50%),
    linear-gradient(160deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.05) 55%, transparent 80%);
  z-index: 1;
}
/* Edge glow (bottom-right) */
.g3::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 100% 110%, rgba(160,195,255,0.22) 0%, transparent 60%);
  z-index: 1;
}

/* --- Glass Sphere (special) --- */
.g-sphere {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .g-sphere {
    backdrop-filter: blur(28px) saturate(200%) brightness(1.10);
    -webkit-backdrop-filter: blur(28px) saturate(200%) brightness(1.10);
  }
}
.g-sphere::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 70% 60% at 30% 18%, rgba(255,255,255,0.90) 0%, rgba(255,255,255,0.0) 60%),
    radial-gradient(ellipse 50% 35% at 75% 80%, rgba(160,195,255,0.35) 0%, transparent 60%);
  z-index: 2;
  pointer-events: none;
}
.g-sphere::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.80);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.95),
    inset 0 -2px 0 rgba(160,195,255,0.20),
    0 8px 40px rgba(79,126,247,0.14),
    0 2px 8px rgba(255,255,255,0.6);
  z-index: 3;
  pointer-events: none;
}

/* ===== Glass Pill / Chip ===== */
.g-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.90);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), var(--s-1);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
@supports (backdrop-filter: blur(1px)) {
  .g-chip { backdrop-filter: blur(10px) saturate(150%); -webkit-backdrop-filter: blur(10px) saturate(150%); }
}

/* ===== Card hover accent ===== */
.card-hover {
  transition:
    transform 0.38s cubic-bezier(0.22,1,0.36,1),
    box-shadow 0.38s ease,
    border-color 0.22s ease;
}
.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--s-3), 0 0 0 1.5px var(--accent-border);
}

/* ===== Glass Input ===== */
.g-input {
  background: rgba(255,255,255,0.60);
  border: 1px solid rgba(255,255,255,0.80);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), var(--s-1);
  border-radius: var(--r-md);
  padding: 0.9rem 1.25rem;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  font-family: var(--font);
  font-size: 0.9375rem;
  transition: border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}
@supports (backdrop-filter: blur(1px)) {
  .g-input { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}
.g-input:focus {
  border-color: var(--accent-border);
  background: rgba(255,255,255,0.85);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 0 0 3px var(--accent-soft), var(--s-1);
}
.g-input::placeholder { color: var(--text-faint); }

/* ===== Buttons ===== */
.btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: var(--r-full);
  background: var(--text-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  transition: background 0.22s ease, transform 0.18s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-dark:hover {
  background: #1a1a24;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.85);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), var(--s-2);
  transition: background 0.22s ease, transform 0.18s ease, box-shadow 0.25s ease;
  color: var(--text-primary);
}
@supports (backdrop-filter: blur(1px)) {
  .btn-glass { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}
.btn-glass:hover {
  background: rgba(255,255,255,0.80);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), var(--s-3);
}

/* ===== Scroll progress bar ===== */
/* #scroll-progress {
  position: fixed;
  top: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(120,160,255,0.6));
  width: 0%;
  z-index: 60;
  border-radius: 0 999px 999px 0;
  transform-origin: left;
  opacity: 0;
  transition: opacity 0.3s;
} */

/* ===== Mouse glow ===== */
#mouse-glow {
  position: fixed;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(79,126,247,0.10) 0%, rgba(130,160,255,0.05) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
}

/* ===== Eyebrow ===== */
.eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ===== Divider ===== */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.06) 40%, rgba(0,0,0,0.06) 60%, transparent 100%);
}

/* ===== Nav scrolled state ===== */
#nav.scrolled {
  background: rgba(245,246,250,0.85) !important;
  backdrop-filter: blur(24px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
  box-shadow: var(--s-2) !important;
}

/* ===== Active nav link ===== */
.nav-link { position: relative; }
.nav-link.active { color: var(--text-primary) !important; opacity: 1 !important; }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 100%; height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* ===== Float animations ===== */
@keyframes float-a {
  0%,100% { transform: translateY(0px)   rotate(0.4deg);  }
  50%      { transform: translateY(-12px) rotate(-0.4deg); }
}
@keyframes float-b {
  0%,100% { transform: translateY(0px)  rotate(-0.6deg); }
  50%      { transform: translateY(-9px) rotate(0.6deg);  }
}
@keyframes float-c {
  0%,100% { transform: translateY(0px)   rotate(0.2deg);  }
  50%      { transform: translateY(-6px)  rotate(-0.2deg); }
}
@keyframes orb-drift {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(18px,-14px) scale(1.04); }
  66%      { transform: translate(-12px,10px) scale(0.97); }
}
.fa  { animation: float-a  9s  ease-in-out infinite; }
.fb  { animation: float-b  12s ease-in-out infinite; }
.fc  { animation: float-c  7s  ease-in-out infinite; }
.orb { animation: orb-drift 18s ease-in-out infinite; }
.orb:nth-child(2) { animation-delay: -6s; animation-duration: 22s; }
.orb:nth-child(3) { animation-delay: -12s; animation-duration: 16s; }
.orb:nth-child(4) { animation-delay: -4s; animation-duration: 25s; }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .fa, .fb, .fc, .orb { animation: none; }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  @supports (backdrop-filter: blur(1px)) {
    .g1 { backdrop-filter: blur(10px) saturate(150%); -webkit-backdrop-filter: blur(10px) saturate(150%); }
    .g2 { backdrop-filter: blur(16px) saturate(170%); -webkit-backdrop-filter: blur(16px) saturate(170%); }
    .g3 { backdrop-filter: blur(24px) saturate(190%); -webkit-backdrop-filter: blur(24px) saturate(190%); }
  }
  .orb { animation-duration: 25s !important; }
}

/* ===== Fallback (no backdrop-filter) ===== */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .g1 { background: rgba(242,242,248,0.96); }
  .g2 { background: rgba(238,238,246,0.94); }
  .g3 { background: rgba(234,234,244,0.92); }
