/* ═══════════════════════════════════════════════════════════════════
   merastore — Ultimate Premium Dark Theme (v2.0)
   Aesthetics: Futuristic · High-Contrast · Cyber-Premium
   Palette: Void Black · Pure White · Neon Red · Emerald · Sapphire
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* ─── Core Colors (Fine-tuned HSL) ───────────────────────────── */
  --black-void: #000000;
  --black-near: #050505;
  --black-soft: #0a0a0a;
  --black-card: #0f0f0f;

  --white-pure: #ffffff;
  --white-soft: rgba(255, 255, 255, 0.95);
  --white-muted: rgba(255, 255, 255, 0.65);
  --white-dim: rgba(255, 255, 255, 0.35);

  /* ─── Accents ────────────────────────────────────────────────── */
  --red-neon: #ff1f3d;
  --red-glow: rgba(255, 31, 61, 0.45);
  --red-deep: #b3001b;

  --green-neon: #00ff85;
  --green-glow: rgba(0, 255, 133, 0.35);
  --green-deep: #00a355;

  --blue-neon: #00d2ff;
  --blue-glow: rgba(0, 210, 255, 0.4);
  --blue-deep: #0088cc;

  /* ─── Semantic Layer ─────────────────────────────────────────── */
  --primary: var(--red-neon);
  --secondary: var(--blue-neon);
  --accent: var(--green-neon);

  /* ─── Surfaces & Glass ───────────────────────────────────────── */
  --glass: rgba(10, 10, 10, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-bright: rgba(255, 255, 255, 0.15);
  --surface-glow: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.04) 0%, transparent 70%);

  /* ─── FX & Decorations ──────────────────────────────────────── */
  --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 30px var(--red-glow);
  --radius-main: 20px;
  --radius-pill: 999px;

  --tech-grid: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

/* ──────────────────────────────────────────────────────────────────────────
   ELITE MICRO-INTERACTIONS
   ────────────────────────────────────────────────────────────────────────── */

/* Page Transition Overlay */
.transition-overlay {
  position: fixed;
  inset: 0;
  background: var(--black-void);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.transition-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* Custom Neural Cursor */
.custom-cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--red-neon);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 0 10px var(--red-neon);
  transform: translate(-50%, -50%);
  display: block;
}

.custom-cursor-follower {
  position: fixed;
  width: 30px;
  height: 30px;
  border: 1px solid var(--red-neon);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.2;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, opacity 0.3s;
  display: block;
}

/* Global Scroll Progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(to right, var(--red-neon), var(--blue-neon));
  z-index: 10001;
  width: 0%;
  box-shadow: 0 0 5px var(--red-neon);
}

* {
  cursor: none !important;
}

@media (max-width: 1024px) {
  * {
    cursor: auto !important;
  }

  .custom-cursor,
  .custom-cursor-follower {
    display: none !important;
  }
}

/* ─── Reset & Core ─────────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--black-near);
  color: var(--white-soft);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  position: relative;
}

/* Tech Grid Decorative layer */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--tech-grid);
  background-size: 30px 30px;
  z-index: -1;
  opacity: 0.5;
  pointer-events: none;
}

/* ─── Premium Background Elements ─────────────────────────────── */
#three-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.4;
  pointer-events: none;
}

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -2;
  opacity: 0.25;
  pointer-events: none;
  animation: blobMotion 25s infinite alternate ease-in-out;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--red-neon), transparent);
  top: -100px;
  left: -150px;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--blue-neon), transparent);
  bottom: -150px;
  right: -150px;
  animation-delay: -5s;
}

@keyframes blobMotion {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }

  50% {
    transform: translate(50px, 80px) scale(1.1) rotate(15deg);
  }

  100% {
    transform: translate(-30px, -40px) scale(0.9) rotate(-10deg);
  }
}

/* ─── Animations ───────────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ─── Navigation ───────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  padding: 0 4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  z-index: 2000;
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
  height: 64px;
  border-color: var(--glass-border-bright);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.nav-logo:hover {
  transform: scale(1.02);
}

.nav-logo img {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 10px var(--red-glow));
}

.nav-logo span {
  font-family: 'Outfit', 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--white-pure) 30%, var(--red-neon) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--white-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-links a:hover {
  color: var(--white-pure);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--tech-grid);
}

.nav-links a.active {
  background: var(--red-glow);
  color: var(--white-pure);
  border: 1px solid var(--red-neon);
}

/* ─── Hero Components ────────────────────────────────────────── */
.hero {
  padding: 120px 24px 60px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  padding: 6px 16px;
  background: rgba(255, 31, 61, 0.1);
  border: 1px solid rgba(255, 31, 61, 0.2);
  border-radius: var(--radius-pill);
  color: var(--red-neon);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 20px;
  letter-spacing: -2px;
}

.gradient-text {
  background: linear-gradient(to right, #fff, #ff1f3d, #00d2ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textGradientMove 5s linear infinite alternate;
}

@keyframes textGradientMove {
  0% {
    background-position: 0% central;
  }

  100% {
    background-position: 100% central;
  }
}

.hero p {
  font-size: 18px;
  color: var(--white-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ─── Tool Cards & Grids ─────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.tool-card {
  position: relative;
  background: var(--black-card);
  border-radius: var(--radius-main);
  border: 1px solid var(--glass-border);
  padding: 40px;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--surface-glow);
  opacity: 0;
  transition: opacity 0.4s;
}

.tool-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(255, 31, 61, 0.4);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 31, 61, 0.1);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  color: var(--white-pure);
  margin-bottom: 12px;
  position: relative;
}

.tool-card p {
  font-size: 15px;
  color: var(--white-muted);
  margin-bottom: 24px;
  position: relative;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: var(--red-neon);
  color: #fff;
  box-shadow: 0 10px 25px rgba(255, 31, 61, 0.35);
}

.btn-primary:hover {
  background: #ff3d5a;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 40px rgba(255, 31, 61, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--white-pure);
  border: 1px solid var(--glass-border-bright);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--red-neon);
  transform: translateY(-2px);
}

/* ─── Forms & Inputs ─────────────────────────────────────────── */
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border-bright);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--white-pure);
  font-family: inherit;
  font-size: 15px;
  transition: all 0.3s ease;
  outline: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--red-neon);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 15px rgba(255, 31, 61, 0.15);
}

/* ─── Chat Interface ─────────────────────────────────────────── */
.chat-shell {
  max-width: 900px;
  width: calc(100% - 40px);
  margin: 0 auto 100px;
  background: var(--black-card);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-window {
  height: 550px;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: radial-gradient(circle at 50% 100%, rgba(255, 31, 61, 0.03) 0%, transparent 60%);
}

.chat-message {
  max-width: 80%;
  padding: 14px 20px;
  border-radius: 20px;
  font-size: 15px;
  animation: chatMsgIn 0.4s cubic-bezier(0.17, 0.84, 0.44, 1);
}

@keyframes chatMsgIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.chat-message.user {
  align-self: flex-end;
  background: var(--blue-neon);
  color: #000;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

.chat-message.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white-pure);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 4px;
}

.chat-input-row {
  padding: 20px;
  display: flex;
  gap: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-top: 1px solid var(--glass-border);
}

/* ─── Background Remover FX ──────────────────────────────────── */
.upload-zone {
  background: rgba(255, 255, 255, 0.01);
  border: 2px dashed var(--glass-border-bright);
  padding: 80px 40px;
  border-radius: 24px;
  transition: all 0.4s;
}

.upload-zone:hover {
  background: rgba(255, 31, 61, 0.02);
  border-color: var(--red-neon);
}

.upload-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  background: var(--red-neon);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px var(--red-glow);
}

/* ─── Footer ─────────────────────────────────────────────────── */
.footer-compact {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.4);
}

.policy-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.policy-links a {
  color: var(--white-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.policy-links a:hover {
  color: var(--red-neon);
}

/* ─── Responsive Essentials ──────────────────────────────────── */
@media (max-width: 768px) {
  .navbar {
    padding: 0 20px;
  }

  .nav-links {
    display: none;
  }

  /* Add mobile menu later if needed */
  .hero h1 {
    font-size: 42px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .chat-window {
    height: 400px;
  }
}