/* ==========================================================================
   MELON789 CORE DESIGN TOKENS & FOUNDATIONAL STYLES
   File: assets/css/theme-core.css
   ========================================================================== */

:root {
  /* --- Brand Color Palette --- */
  --color-bg-primary: #070d0b;           /* Obsidian Emerald Dark */
  --color-bg-secondary: #0b1016;         /* Slate Black */
  --color-bg-tertiary: #121820;          /* Deep Card Surface */
  --color-surface-glass: rgba(18, 28, 23, 0.85); /* Glassmorphism Base */
  --color-surface-card: #1a1a1a;         /* Opaque Card Surface */
  --color-surface-hover: rgba(26, 38, 30, 0.95);

  /* --- Primary Action Green --- */
  --color-primary: #3ca519;              /* Vibrant Melon Green */
  --color-primary-dark: #0f6b43;         /* Brand Emerald Dark */
  --color-primary-light: #22c55e;        /* Light Leaf Green */
  --color-primary-glow: rgba(60, 165, 25, 0.45);

  /* --- Gold / Amber Accents --- */
  --color-gold: #ffd700;                 /* Regal Gold */
  --color-gold-hover: #eab308;           /* Warm Amber Gold */
  --color-gold-dark: #ca8a04;            /* Bronze Gold */
  --color-gold-glow: rgba(255, 215, 0, 0.4);

  /* --- Typography Colors --- */
  --color-text-primary: #ffffff;
  --color-text-secondary: #cbd5e1;
  --color-text-muted: #94a3b8;
  --color-text-gold: #ffd700;

  /* --- Feedback & Status Colors --- */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  /* --- Borders --- */
  --border-subtle: 1px solid rgba(255, 255, 255, 0.08);
  --border-glass: 1px solid rgba(60, 165, 25, 0.25);
  --border-gold: 1px solid rgba(255, 215, 0, 0.35);

  /* --- Typography Families --- */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* --- Typography Scale --- */
  --font-size-xs: 0.75rem;     /* 12px */
  --font-size-sm: 0.875rem;    /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;    /* 18px */
  --font-size-xl: 1.25rem;     /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 1.875rem;   /* 30px */
  --font-size-4xl: 2.25rem;    /* 36px */
  --font-size-5xl: 3rem;       /* 48px */

  /* --- Spacing Scale (8pt Grid) --- */
  --spacing-1: 0.25rem;   /* 4px */
  --spacing-2: 0.5rem;    /* 8px */
  --spacing-3: 0.75rem;   /* 12px */
  --spacing-4: 1rem;      /* 16px */
  --spacing-5: 1.25rem;   /* 20px */
  --spacing-6: 1.5rem;    /* 24px */
  --spacing-8: 2rem;      /* 32px */
  --spacing-10: 2.5rem;   /* 40px */
  --spacing-12: 3rem;     /* 48px */
  --spacing-16: 4rem;     /* 64px */

  /* --- Border Radii --- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* --- Glassmorphism & Elevation --- */
  --glass-blur: blur(14px);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 12px 32px -6px rgba(0, 0, 0, 0.65);
  --shadow-glow-gold: 0 12px 32px -6px rgba(0, 0, 0, 0.65);

  /* --- Responsive Breakpoints --- */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;

  /* --- Transitions --- */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Foundational Reset & Layout --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, rgba(15, 107, 67, 0.25) 0%, transparent 60%),
              radial-gradient(circle at 80% 20%, rgba(60, 165, 25, 0.12) 0%, transparent 40%),
              var(--color-bg-primary);
  overflow-x: hidden;
  padding-bottom: 76px; /* Space for mobile sticky bar */
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: rgba(52, 211, 153, 0.28);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid #34d399;
  outline-offset: 3px;
}

/* Dominant MELON789 Hero Brand Lockup inside H1 */
.hero-brand-showcase {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.hero-rtp .hero-brand-showcase,
.hero-trust .hero-brand-showcase,
.text-center .hero-brand-showcase {
  justify-content: center;
}

.hero-brand-word {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.8vw, 4.1rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: #ffd700;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.16) 0%, rgba(16, 185, 129, 0.18) 100%);
  border: 2px solid rgba(255, 215, 0, 0.55);
  padding: 0.2rem 0.85rem 0.26rem;
  border-radius: 14px;
  box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.7);
}

.hero-brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.42rem 0.95rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
  line-height: 1.25;
}

.hero-headline-main {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* Highlighted Inline Brand Mention in Body Copy */
.brand-inline {
  display: inline-block;
  color: #ffd700;
  font-weight: 800;
  background: rgba(255, 215, 0, 0.14);
  border: 1px solid rgba(255, 215, 0, 0.35);
  padding: 0.04rem 0.45rem;
  border-radius: 6px;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* --- Container Utility --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-4);
  padding-right: var(--spacing-4);
}

/* --- Glassmorphic Card Primitive --- */
.card-glass {
  background: var(--color-surface-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card-glass:hover {
  border-color: rgba(60, 165, 25, 0.45);
  box-shadow: var(--shadow-glow);
}

/* --- Button Primitives --- */
.btn-cta, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.25;
  border-radius: 12px;
  padding: 0.85rem 1.75rem;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-normal), filter var(--transition-fast);
  text-decoration: none;
}

.btn-cta:active, .btn:active {
  transform: translateY(1px) scale(0.98);
}

/* Primary Green Action Button */
.btn-primary {
  background: linear-gradient(135deg, #15803d 0%, #065f46 100%);
  color: #ffffff;
  border: 1px solid rgba(52, 211, 153, 0.38);
  box-shadow: 0 8px 22px -4px rgba(0, 0, 0, 0.6);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.75);
}

/* Radiant Gold Button */
.btn-gold {
  background: linear-gradient(135deg, #ffd700 0%, #f59e0b 100%);
  color: #070d0b;
  box-shadow: 0 8px 22px -4px rgba(0, 0, 0, 0.6);
}

.btn-gold:hover {
  filter: brightness(1.08);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.75);
}

/* Subtle Outline Button */
.btn-outline {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.65rem 1.4rem;
  font-size: var(--font-size-sm);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

/* Glow Button Effect */
.btn-glow {
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.65);
}

.btn-glow:hover {
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.8);
}

/* Shimmer Animation on CTAs */
.btn-cta::after, .btn-pulse::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: rotate(25deg);
  animation: ctaShimmer 4s infinite;
}

@keyframes ctaShimmer {
  0% { left: -60%; }
  20% { left: 140%; }
  100% { left: 140%; }
}

/* --- Badge & Tag Styles --- */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--color-success);
}

.pulse-dot, .live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Text Colors */
.text-gold { color: var(--color-gold); }
.text-green { color: var(--color-primary-light); }
.text-center { text-align: center; }

/* --- Mobile Sticky Action Bar --- */
.mobile-sticky-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-3);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: var(--spacing-3) var(--spacing-4);
  background: rgba(7, 13, 11, 0.95);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: var(--border-glass);
}

@media (min-width: 768px) {
  .mobile-sticky-bar {
    display: none;
  }
}

/* --- Global Mobile Responsive Refinements (<= 640px) --- */
@media (max-width: 640px) {
  .site-header {
    padding: 0.55rem 0;
  }

  .header-container {
    gap: 0.5rem;
  }

  .site-header .brand-logo {
    height: 40px;
    width: 75px;
  }

  .site-header .header-actions {
    gap: 0.45rem;
  }

  .site-header .btn,
  .site-header .btn-cta,
  .site-header .btn-header {
    padding: 0.5rem 0.9rem;
    font-size: 0.78rem;
    border-radius: 9px;
    white-space: nowrap;
    letter-spacing: 0.02em;
  }

  .hero-brand-showcase {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .hero-rtp .hero-brand-showcase,
  .hero-trust .hero-brand-showcase,
  .text-center .hero-brand-showcase {
    align-items: center;
  }

  .hero-brand-word {
    font-size: clamp(2.15rem, 9.5vw, 2.75rem);
    padding: 0.18rem 0.75rem 0.22rem;
    border-radius: 12px;
  }

  .hero-brand-tag {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    letter-spacing: 0.04em;
  }

  .hero-headline-main {
    font-size: clamp(1.35rem, 5.5vw, 1.75rem);
    line-height: 1.25;
  }

  .btn-cta,
  .btn {
    padding: 0.85rem 1.15rem;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    border-radius: 11px;
  }

  .hero-section .btn-hero,
  .hero-rtp .btn-hero,
  .hero-trust .btn-hero-trust,
  .calc-card .btn-calc {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    line-height: 1.3;
  }

  .mobile-sticky-bar {
    padding: 0.6rem 0.85rem;
    gap: 0.65rem;
  }

  .mobile-sticky-bar .btn,
  .mobile-sticky-bar .btn-cta,
  .mobile-sticky-bar .btn-sticky,
  .mobile-sticky-bar .btn-trust-sticky {
    flex-shrink: 0;
    white-space: nowrap;
    width: auto;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    border-radius: 9px;
  }
}
