/* ==========================================================================
   REAL LIQUID GLASS (iOS 26 SPECULAR OPTICS) + LIVING PILL BUTTONS + UBER MODALS
   ========================================================================== */

/* 01 · Flat light blur backdrop */
.glass-surface {
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-top: 1px solid var(--border-glass-top);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6), inset 0 1px 1.5px rgba(255, 255, 255, 0.4);
  position: relative;
}

/* 02 · Flowing Caustic Light behind the card */
.caustic-backdrop {
  position: fixed;
  inset: -60px;
  background:
    radial-gradient(circle 380px at 15% 20%, rgba(245, 158, 11, 0.14) 0%, transparent 70%),
    radial-gradient(circle 420px at 85% 75%, rgba(56, 189, 248, 0.12) 0%, transparent 70%),
    radial-gradient(circle 320px at 50% 50%, rgba(16, 185, 129, 0.08) 0%, transparent 65%);
  filter: blur(54px);
  animation: causticDrift 16s infinite alternate ease-in-out;
  pointer-events: none;
  z-index: 0;
}

@keyframes causticDrift {
  0% { transform: scale(1) translate3d(0, 0, 0); }
  50% { transform: scale(1.08) translate3d(20px, -20px, 0); }
  100% { transform: scale(0.95) translate3d(-16px, 16px, 0); }
}

/* 03 · 66% High-ISO Film Grain (Rendered on Canvas only behind glass, 0% on glass) */
#bg-grain-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0.066;
  mix-blend-mode: overlay;
  z-index: 1;
}

/* 04 & 06 · Snell Optical Refraction (IOR 1.58) + C∞ Meniscus Curve */
.liquid-card {
  position: relative;
  border-radius: var(--radius-card);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.65),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.40),
    inset 0 -1.5px 2px rgba(0, 0, 0, 0.55),
    inset 1px 0 1px rgba(255, 255, 255, 0.12),
    inset -1px 0 1px rgba(255, 255, 255, 0.12);
  z-index: 10;
}

/* 05 · 7-Wavelength Cauchy Chromatic Dispersion Rim */
.liquid-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.5px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(239, 68, 68, 0.35) 15%,
    rgba(249, 115, 22, 0.35) 30%,
    rgba(250, 204, 21, 0.4) 45%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(34, 197, 94, 0.4) 55%,
    rgba(6, 182, 212, 0.35) 70%,
    rgba(139, 92, 246, 0.35) 85%,
    transparent 100%
  );
  border-top-left-radius: var(--radius-card);
  border-top-right-radius: var(--radius-card);
  pointer-events: none;
}

/* 07 · 9 LIVING PILL BUTTONS (Jared Spool $300M Rule / No forced login) */
.living-btn {
  position: relative;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  background: #0D0C14;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.40);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  overflow: hidden;
  transition-property: transform, border-color, box-shadow;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

/* 5 Signal Dot */
.signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: signalPulse 2s infinite ease-in-out;
  flex-shrink: 0;
}
@keyframes signalPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* 6 Hover Arrow turns 350ms */
.living-btn .btn-arrow {
  transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
}
.living-btn:hover .btn-arrow {
  transform: translateX(3px) rotate(-10deg);
}

/* 7 Cursor Follow Light Glow */
.living-btn::after {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(circle 70px at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.18) 0%, transparent 80%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 250ms ease;
}
.living-btn:hover::after {
  opacity: 1;
}

/* 8 Magnet: subtle lean toward cursor */
.living-btn {
  transform: translate3d(var(--lean-x, 0px), var(--lean-y, 0px), 0);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), background 180ms ease, border-color 180ms ease;
}

/* 9 Press Scale .97 */
.living-btn:active {
  transform: translate3d(var(--lean-x, 0px), var(--lean-y, 0px), 0) scale(0.97) !important;
}

/* App Glass Button */
.app-glass-btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 180ms ease;
}
.app-glass-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}
.app-glass-btn:active {
  transform: scale(0.97);
}

.btn-action-tile.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent-blue);
}

/* UBER BASE & MATERIAL 3 MODALS (24px uniform padding / Single line of truth) */
.uber-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 12, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}
.uber-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.uber-modal-card {
  width: 100%;
  max-width: 440px;
  background: #14121E;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: 1px solid rgba(255, 255, 255, 0.40);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  transform: translateY(14px) scale(0.98);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.uber-modal-overlay.open .uber-modal-card {
  transform: translateY(0) scale(1);
}
.uber-modal-title {
  font-size: 19px;
  font-weight: 700;
  color: #FFFFFF;
}
.uber-modal-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.uber-modal-truth {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  font-size: 13px;
}
.uber-modal-truth strong {
  color: var(--accent-emerald);
}
.uber-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.uber-modal-actions button {
  flex: 1;
}
.btn-uber-primary {
  min-height: 46px;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  color: #0B0A0F;
  border: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 150ms ease;
}
.btn-uber-primary:active {
  transform: scale(0.97);
}
.btn-uber-secondary {
  min-height: 46px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 150ms ease;
}
.btn-uber-secondary:active {
  transform: scale(0.97);
}
