/* ────────────────────────────────────────────────────────
   Drifter — Motion, glow & micro-interactions
   ──────────────────────────────────────────────────────── */

:root[data-theme="dark"] {
  --glow-accent: 0 0 26px rgba(200, 168, 75, 0.38);
  --glow-buy:    0 0 20px rgba(63, 184, 111, 0.32);
  --cta-ink:     #1c170a;
  --gradient-cta: linear-gradient(135deg, #e6d29a 0%, #c8a84b 100%);
  --gradient-cta-hover: linear-gradient(135deg, #f1e2b4 0%, #d6b85c 100%);
  --gradient-mesh: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(200,168,75,.16), transparent),
                   radial-gradient(ellipse 50% 40% at 90% 10%, rgba(200,168,75,.06), transparent);
}

:root[data-theme="light"] {
  --glow-accent: 0 4px 20px rgba(154, 125, 46, 0.3);
  --glow-buy:    0 4px 16px rgba(47, 158, 90, 0.22);
  --cta-ink:     #fffdf7;
  --gradient-cta: linear-gradient(135deg, #b9933a 0%, #9a7d2e 100%);
  --gradient-cta-hover: linear-gradient(135deg, #caa44a 0%, #a98a36 100%);
  --gradient-mesh: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(154,125,46,.12), transparent),
                   radial-gradient(ellipse 50% 40% at 90% 10%, rgba(154,125,46,.05), transparent);
}

/* ── Page enter ── */
@keyframes drift-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes drift-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes drift-pulse-glow {
  0%, 100% { box-shadow: var(--glow-accent); }
  50%      { box-shadow: 0 0 32px rgba(200, 168, 75, 0.6); }
}
@keyframes drift-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
@keyframes drift-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes drift-logo-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes drift-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}

.animate-in {
  animation: drift-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.animate-in-delay-1 { animation-delay: 0.08s; }
.animate-in-delay-2 { animation-delay: 0.16s; }
.animate-in-delay-3 { animation-delay: 0.24s; }
.animate-in-delay-4 { animation-delay: 0.32s; }

main.page {
  animation: drift-fade-in 0.4s ease both;
}

/* ── Hero mesh background ── */
.hero-mesh {
  position: relative;
  overflow: hidden;
}
.hero-mesh::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-mesh);
  pointer-events: none;
  z-index: 0;
}
.hero-mesh > * {
  position: relative;
  z-index: 1;
}

/* ── Icons ── */
.dr-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.icon-box {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1px solid var(--border-2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
}
.icon-box--accent {
  background: linear-gradient(145deg, rgba(200,168,75,.15), rgba(200,168,75,.04));
  color: var(--accent);
}
.icon-box--buy {
  background: linear-gradient(145deg, rgba(63,184,111,.15), rgba(63,184,111,.04));
  color: var(--buy);
}
.icon-box--purple {
  background: linear-gradient(145deg, rgba(167,139,250,.15), rgba(167,139,250,.04));
  color: var(--purple);
}
.feature-card:hover .icon-box {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--glow-accent);
  border-color: var(--accent);
}
.feature-card:hover .dr-icon {
  transform: scale(1.1);
}

.logo-icon {
  color: var(--buy);
  transition: transform 0.4s ease;
}
.logo:hover .logo-icon {
  transform: rotate(-8deg) scale(1.08);
}

/* ── CTA buttons (Get started, trial, primary) ── */
.btn-cta,
.btn-primary.btn-lg,
.nav-public .nav-links .btn-primary {
  background: var(--gradient-cta) !important;
  border: none !important;
  color: var(--cta-ink) !important;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(200, 168, 75, 0.3);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease,
              filter 0.2s ease !important;
}
.btn-cta::after,
.btn-primary.btn-lg::after,
.nav-public .nav-links .btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.25) 50%, transparent 60%);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.2s;
}
.btn-cta:hover,
.btn-primary.btn-lg:hover,
.nav-public .nav-links .btn-primary:hover {
  background: var(--gradient-cta-hover) !important;
  color: var(--cta-ink) !important;
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--glow-accent), 0 8px 24px rgba(200, 168, 75, 0.32);
  filter: brightness(1.04);
}
.btn-cta:hover::after,
.btn-primary.btn-lg:hover::after,
.nav-public .nav-links .btn-primary:hover::after {
  opacity: 1;
  animation: drift-shimmer 1.2s ease infinite;
}
.btn-cta:active,
.btn-primary.btn-lg:active,
.nav-public .nav-links .btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-ghost-outline {
  background: transparent !important;
  border: 1px solid var(--border-2) !important;
  color: var(--text) !important;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s !important;
}
.btn-ghost-outline:hover {
  border-color: var(--accent) !important;
  background: rgba(200, 168, 75, 0.08) !important;
  color: var(--accent) !important;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(200, 168, 75, 0.2);
}

/* Fix nav link hover overriding button colors */
.nav-public .nav-links a:not(.btn):hover {
  color: var(--text);
}
.nav-public .nav-links a:not(.btn) {
  position: relative;
  transition: color 0.2s;
}
.nav-public .nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.nav-public .nav-links a:not(.btn):hover::after {
  transform: scaleX(1);
}

/* Nav user tabs — glass links styled in nav-mobile.css */
.nav-user .nav-links a:not(.nav-glass-link) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.nav-user .nav-links a:not(.nav-glass-link):hover {
  background: rgba(200, 168, 75, 0.06);
}
.nav-user .nav-links a:not(.nav-glass-link).active {
  background: rgba(200, 168, 75, 0.08);
}

/* Plan cards */
.plan-card {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.25s,
              box-shadow 0.3s;
}
.plan-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(200, 168, 75, 0.15);
}
.plan-card.featured {
  box-shadow: 0 0 0 1px rgba(200, 168, 75, 0.3), var(--glow-accent);
}
.plan-card.featured:hover {
  animation: drift-pulse-glow 2s ease infinite;
}

/* Terminal tabs */
.terminal-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s;
  border-radius: 6px 6px 0 0;
}
.terminal-tab:hover {
  background: rgba(200, 168, 75, 0.08);
  transform: translateY(-1px);
}
.terminal-tab.active {
  background: rgba(200, 168, 75, 0.1);
  text-shadow: 0 0 20px rgba(200, 168, 75, 0.4);
}
.terminal-topbar-links a {
  transition: color 0.2s, transform 0.15s;
}
.terminal-topbar-links a:hover {
  color: var(--accent) !important;
  transform: translateX(2px);
}

/* User pill */
.user-pill {
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.user-pill:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 168, 75, 0.12);
  transform: translateY(-1px);
}
.user-dropdown.show {
  animation: drift-fade-up 0.2s ease both;
}

/* Auth card */
.auth-card {
  animation: drift-fade-up 0.5s ease both;
}

/* Live indicators */
.live-dot {
  animation: drift-live 2s ease infinite !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
