/* ================================================================
   GapDomain — Elevated Theme Layer  v1.0
   Load LAST on every page. Pure visual overrides — no class names,
   IDs, or markup changes. Safe over inline page styles and gd.css.
   ================================================================ */

/* ── Refined palette ── */
:root {
  --bg: #07070a;
  --bg2: #0d0d12;
  --bg3: #16161d;
  --bg4: #1d1d26;
  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.12);
  --card: #101016;
  --accent: #e10600;
  --accent2: #ff3b21;
  --text: #f6f6f8;
  --muted: #9d9dab;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 56px rgba(0, 0, 0, 0.65);
  --shadow-accent: 0 8px 32px rgba(225, 6, 0, 0.32);
  --grad-accent: linear-gradient(135deg, #ff3b21 0%, #e10600 45%, #b00400 100%);
  --grad-text: linear-gradient(110deg, #ff4d33 10%, #e10600 50%, #ff7a29 90%);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Ambient backdrop: layered glows + faint grid ── */
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 50% -8%, rgba(225, 6, 0, 0.13), transparent 65%),
    radial-gradient(ellipse 45% 35% at 88% 12%, rgba(255, 122, 41, 0.05), transparent 70%),
    radial-gradient(ellipse 50% 40% at 8% 30%, rgba(74, 158, 255, 0.04), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 56px 56px, 56px 56px;
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
}

/* ── Selection + scrollbar ── */
::selection { background: rgba(225, 6, 0, 0.55); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: #2a2a33 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #25252e; border-radius: 99px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(225, 6, 0, 0.6); }

/* ── Typography polish ── */
h1, h2, h3, .display { letter-spacing: 0.04em; }
.hero h1 {
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.55);
}
.hero h1 em,
.cta-banner h2 em {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent); /* fallback */
  filter: drop-shadow(0 0 24px rgba(225, 6, 0, 0.35));
}
.stat-val:not(.loading) {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px rgba(225, 6, 0, 0.25));
}

/* ── Section tags: racing tick ── */
.section-tag {
  position: relative;
  padding-left: 1.4rem;
  letter-spacing: 3px !important;
}
.section-tag::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%) skewX(-18deg);
  width: 14px; height: 3px;
  background: var(--grad-accent);
  border-radius: 1px;
  box-shadow: 0 0 12px rgba(225, 6, 0, 0.7);
}
.section-header.center .section-tag,
.section-header.center.section-tag { padding-left: 1.4rem; }

/* ── Nav: deep glass + gradient hairline ── */
nav {
  background: rgba(7, 7, 10, 0.72) !important;
  backdrop-filter: blur(20px) saturate(1.6) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.6) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}
nav::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(225, 6, 0, 0.55) 28%, rgba(255, 122, 41, 0.4) 50%, rgba(225, 6, 0, 0.55) 72%, transparent 100%);
  pointer-events: none;
}
/* Logo: user's own gd-logo.png — render untouched, subtle lift on hover only */
.nav-logo {
  transition: transform 0.3s var(--ease-out);
}
.nav-logo:hover {
  transform: scale(1.03);
}

/* ── Buttons: gradient, lift, shine sweep ── */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary {
  background: var(--grad-accent) !important;
  box-shadow: 0 2px 12px rgba(225, 6, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), filter 0.25s var(--ease-out);
}
.btn-primary:hover {
  background: var(--grad-accent) !important;
  filter: brightness(1.12) saturate(1.1);
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(225, 6, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary::before {
  content: '';
  position: absolute; top: 0; bottom: 0; left: -80%;
  width: 50%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s var(--ease-out);
  pointer-events: none;
  z-index: 1;
}
.btn-primary:hover::before { left: 130%; }
.btn-ghost, .btn-outline {
  backdrop-filter: blur(6px);
  transition: all 0.25s var(--ease-out);
}
.btn-ghost:hover, .btn-outline:hover {
  box-shadow: 0 0 0 1px rgba(225, 6, 0, 0.4), 0 4px 20px rgba(225, 6, 0, 0.18);
  transform: translateY(-1px);
}
.btn-gold {
  background: linear-gradient(135deg, #ffc940 0%, #f5a623 60%, #e08900 100%) !important;
  box-shadow: 0 2px 14px rgba(245, 166, 35, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-gold:hover { box-shadow: 0 8px 28px rgba(245, 166, 35, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4); }

/* ── Cards: glass + gradient edge + lift ── */
.card, .step {
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(160deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.03) 35%, rgba(225, 6, 0, 0.06) 100%) border-box;
  border: 1px solid transparent;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), background 0.35s var(--ease-out);
}
.card:hover, .step:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(225, 6, 0, 0.18);
}
.card.clickable:hover {
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.6), 0 0 36px rgba(225, 6, 0, 0.14), 0 0 0 1px rgba(225, 6, 0, 0.4);
}
.card img { transition: transform 0.6s var(--ease-out); }
.card.clickable:hover > img,
.card.clickable:hover > a > img { transform: scale(1.045); }

/* ── Step numbers: glowing ring ── */
.step-num {
  background: radial-gradient(circle at 35% 30%, rgba(255, 80, 50, 0.35), rgba(225, 6, 0, 0.12)) !important;
  border: 1px solid rgba(225, 6, 0, 0.55) !important;
  box-shadow: 0 0 24px rgba(225, 6, 0, 0.28), inset 0 0 12px rgba(225, 6, 0, 0.15);
}

/* ── Chips ── */
.chip, .filter-chip {
  backdrop-filter: blur(4px);
  transition: all 0.22s var(--ease-out);
}
.chip:hover, .filter-chip:hover { transform: translateY(-1px); }
.chip.active, .filter-chip.active {
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.22), rgba(225, 6, 0, 0.08)) !important;
  border-color: rgba(225, 6, 0, 0.65) !important;
  color: #ff6b5a !important;
  box-shadow: 0 0 16px rgba(225, 6, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ── Forms: focus glow ── */
.form-input {
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.form-input:hover { border-color: rgba(255, 255, 255, 0.16) !important; }
.form-input:focus {
  border-color: rgba(225, 6, 0, 0.7) !important;
  background: rgba(225, 6, 0, 0.04) !important;
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.14), 0 0 24px rgba(225, 6, 0, 0.1);
}

/* ── Modals: deep glass ── */
.modal {
  background: rgba(15, 15, 20, 0.92) !important;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.75), 0 0 60px rgba(225, 6, 0, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
.modal-overlay { backdrop-filter: blur(10px) brightness(0.7) !important; -webkit-backdrop-filter: blur(10px) brightness(0.7) !important; }

/* ── Hero: animated orbs + vignette ── */
.hero { isolation: isolate; }
.hero::before {
  content: '';
  position: absolute; inset: -20%;
  background:
    radial-gradient(circle 420px at 18% 22%, rgba(225, 6, 0, 0.16), transparent 70%),
    radial-gradient(circle 360px at 84% 64%, rgba(255, 122, 41, 0.09), transparent 70%),
    radial-gradient(circle 300px at 60% 10%, rgba(74, 158, 255, 0.06), transparent 70%);
  animation: gdOrbDrift 22s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 100% 80% at 50% 50%, transparent 55%, rgba(7, 7, 10, 0.55) 100%);
  pointer-events: none;
  z-index: -1;
}
@keyframes gdOrbDrift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(3%, -2%) scale(1.06); }
  100% { transform: translate(-3%, 2%) scale(1.02); }
}
.hero-tag {
  animation: gdTagPulse 3.2s ease-in-out infinite;
}
@keyframes gdTagPulse {
  0%, 100% { box-shadow: 0 0 18px rgba(225, 6, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.07); }
  50%      { box-shadow: 0 0 34px rgba(225, 6, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
}

/* ── Page banners (inner pages) ── */
.page-banner-overlay {
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(7, 7, 10, 0.35) 55%, transparent 100%),
    radial-gradient(ellipse 60% 100% at 15% 100%, rgba(225, 6, 0, 0.18), transparent 60%) !important;
}
.page-banner-content h1 {
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.7);
}

/* ── Tab bar ── */
.tab-btn { transition: color 0.22s var(--ease-out), border-color 0.22s var(--ease-out), text-shadow 0.22s var(--ease-out); }
.tab-btn.active { text-shadow: 0 0 18px rgba(225, 6, 0, 0.5); }

/* ── Badges: soft glow ── */
.badge { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.badge-red  { box-shadow: 0 0 14px rgba(225, 6, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.badge-gold { box-shadow: 0 0 14px rgba(245, 166, 35, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06); }

/* ── CTA banner: animated gradient seam ── */
.cta-banner {
  position: relative;
  background:
    radial-gradient(ellipse 70% 120% at 50% -20%, rgba(225, 6, 0, 0.22), transparent 60%),
    linear-gradient(135deg, rgba(225, 6, 0, 0.10), rgba(225, 6, 0, 0.02)) !important;
  overflow: hidden;
}
.cta-banner::before, .cta-banner::after {
  content: '';
  position: absolute; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(225, 6, 0, 0.7), rgba(255, 122, 41, 0.5), rgba(225, 6, 0, 0.7), transparent);
  background-size: 200% 100%;
  animation: gdSeam 6s linear infinite;
}
.cta-banner::before { top: 0; }
.cta-banner::after { bottom: 0; animation-direction: reverse; }
@keyframes gdSeam {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* ── Footer ── */
footer {
  position: relative;
  background: linear-gradient(to bottom, var(--bg2), #08080b) !important;
}
footer::before {
  content: '';
  position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(225, 6, 0, 0.4), transparent);
}

/* ── Reveal: smoother entrance ── */
.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

/* ── Toast ── */
.toast {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(20, 20, 27, 0.92) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 24px rgba(225, 6, 0, 0.1) !important;
}

/* ── Upload zone ── */
.upload-zone { transition: all 0.3s var(--ease-out); }
.upload-zone:hover, .upload-zone.drag-over {
  box-shadow: 0 0 32px rgba(225, 6, 0, 0.12), inset 0 0 24px rgba(225, 6, 0, 0.05);
}

/* ── Avatars / user chip ── */
.nav-user-avatar {
  background: var(--grad-accent) !important;
  box-shadow: 0 0 12px rgba(225, 6, 0, 0.35);
}
.nav-user-chip { transition: all 0.25s var(--ease-out); }
.nav-user-chip:hover {
  box-shadow: 0 0 16px rgba(225, 6, 0, 0.2);
  transform: translateY(-1px);
}

/* ── Motion safety ── */
@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero-tag, .cta-banner::before, .cta-banner::after { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ── Mobile: lighten effects ── */
@media (max-width: 768px) {
  body { background-attachment: scroll; }
  .hero::before { animation-duration: 30s; }
}
