/* ============================================================
   RoundPenguin v2 — Global Styles
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* ---------- Theme: Midnight (default) ---------- */
:root {
  --rp-bg:      10 15 30;
  --rp-bg2:     13 21 48;
  --rp-surface: 19 27 53;
  --rp-indigo:  91 95 239;
  --rp-cyan:    0 212 255;
  --rp-text:    240 244 255;
  --rp-muted:   136 146 176;
}

/* ---------- Theme: Forest ---------- */
.theme-forest {
  --rp-bg:      7 20 16;
  --rp-bg2:     10 28 22;
  --rp-surface: 14 38 30;
  --rp-indigo:  0 187 140;
  --rp-cyan:    90 255 200;
  --rp-text:    240 255 249;
  --rp-muted:   110 160 140;
}

/* ---------- Theme: Ember ---------- */
.theme-ember {
  --rp-bg:      18 12 8;
  --rp-bg2:     26 16 10;
  --rp-surface: 36 22 14;
  --rp-indigo:  239 107 53;
  --rp-cyan:    255 179 71;
  --rp-text:    255 248 240;
  --rp-muted:   176 152 128;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: rgb(var(--rp-bg));
  color: rgb(var(--rp-text));
  -webkit-font-smoothing: antialiased;
}

/* ---------- Gradient Text ---------- */
.gradient-text {
  background: linear-gradient(135deg, rgb(var(--rp-indigo)) 0%, rgb(var(--rp-cyan)) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Glassmorphism Card ---------- */
.glass-card {
  background: rgb(var(--rp-surface) / 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgb(var(--rp-indigo) / 0.18);
  border-radius: 16px;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  border-color: rgb(var(--rp-indigo) / 0.4);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgb(var(--rp-indigo) / 0.1);
}

/* ---------- Navbar ---------- */
.nav-glass {
  background: rgb(var(--rp-bg) / 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgb(var(--rp-indigo) / 0.12);
  transition: background 0.3s ease;
}

.nav-glass.scrolled {
  background: rgb(var(--rp-bg) / 0.97);
}

/* ---------- Hero Background ---------- */
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgb(var(--rp-indigo) / 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgb(var(--rp-cyan) / 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 50% 70% at 60% 80%, rgba(16, 217, 160, 0.08) 0%, transparent 55%),
    rgb(var(--rp-bg));
  animation: heroShift 12s ease-in-out infinite alternate;
}

@keyframes heroShift {
  0%   { filter: hue-rotate(0deg) brightness(1); }
  50%  { filter: hue-rotate(15deg) brightness(1.05); }
  100% { filter: hue-rotate(-10deg) brightness(0.97); }
}

/* ---------- Grid Overlay ---------- */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(var(--rp-indigo) / 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--rp-indigo) / 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, rgb(var(--rp-indigo)) 0%, rgb(var(--rp-cyan)) 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1.75rem;
  border-radius: 10px;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgb(var(--rp-indigo) / 0.35);
}

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: rgb(var(--rp-text));
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1.75rem;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid rgb(var(--rp-indigo) / 0.4);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-ghost:hover {
  border-color: rgb(var(--rp-indigo) / 0.8);
  background: rgb(var(--rp-indigo) / 0.08);
  transform: translateY(-1px);
}

/* ---------- Icon Box ---------- */
.icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgb(var(--rp-indigo) / 0.12);
  border: 1px solid rgb(var(--rp-indigo) / 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

/* ---------- Section Label ---------- */
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(var(--rp-indigo));
  background: rgb(var(--rp-indigo) / 0.1);
  border: 1px solid rgb(var(--rp-indigo) / 0.25);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

/* ---------- Badges (semantic — do not theme) ---------- */
.badge-green {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #10D9A0;
  background: rgba(16, 217, 160, 0.1);
  border: 1px solid rgba(16, 217, 160, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-green::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10D9A0;
  display: inline-block;
  animation: pulse-green 2s ease-in-out infinite;
}

.badge-amber {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #F5A623;
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid rgba(245, 166, 35, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-amber::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #F5A623;
  display: inline-block;
}

/* ---------- Product Cards ---------- */
.product-card {
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgb(var(--rp-indigo) / 0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.product-card:hover::before { opacity: 1; }

.product-card--coming {
  background: rgb(var(--rp-surface) / 0.5);
}

.product-card--coming::before {
  background: linear-gradient(135deg, rgba(16, 217, 160, 0.05) 0%, transparent 60%);
}

/* ---------- CTA Gradient Section ---------- */
.cta-gradient {
  background: linear-gradient(135deg, rgb(var(--rp-indigo)) 0%, rgb(var(--rp-cyan)) 100%);
  position: relative;
  overflow: hidden;
}

.cta-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Animations ---------- */
@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

@keyframes pulse-brandify {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.brandify-glow {
  animation: pulse-brandify 2s ease-in-out infinite;
}

/* ---------- Downloads Page ---------- */
.tool-card {
  background: rgb(var(--rp-surface) / 0.7);
  border: 1px solid rgb(var(--rp-indigo) / 0.18);
  border-radius: 16px;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-card:hover {
  border-color: rgb(var(--rp-indigo) / 0.45);
  transform: translateY(-3px);
  box-shadow: 0 24px 48px rgb(var(--rp-indigo) / 0.12);
}

.filter-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid rgb(var(--rp-indigo) / 0.2);
  color: rgb(var(--rp-muted));
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: rgb(var(--rp-indigo) / 0.15);
  border-color: rgb(var(--rp-indigo) / 0.5);
  color: rgb(var(--rp-text));
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgb(var(--rp-muted));
  background: rgb(var(--rp-muted) / 0.08);
  border: 1px solid rgb(var(--rp-muted) / 0.15);
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgb(var(--rp-bg)); }
::-webkit-scrollbar-thumb { background: rgb(var(--rp-indigo) / 0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgb(var(--rp-indigo) / 0.7); }

/* ---------- Selection ---------- */
::selection { background: rgb(var(--rp-indigo) / 0.3); color: rgb(var(--rp-text)); }

/* ---------- Focus visible ---------- */
:focus-visible { outline: 2px solid rgb(var(--rp-indigo)); outline-offset: 3px; border-radius: 4px; }

/* ---------- Form Elements ---------- */
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgb(var(--rp-muted));
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: rgb(var(--rp-bg) / 0.9);
  border: 1px solid rgb(var(--rp-indigo) / 0.22);
  border-radius: 10px;
  color: rgb(var(--rp-text));
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  padding: 0.72rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder { color: rgb(var(--rp-muted) / 0.4); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgb(var(--rp-indigo) / 0.7);
  box-shadow: 0 0 0 3px rgb(var(--rp-indigo) / 0.1);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%238892B0'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.2rem;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-select option { background: rgb(var(--rp-bg2)); color: rgb(var(--rp-text)); }

.form-textarea { resize: vertical; min-height: 130px; line-height: 1.6; }

/* ---------- Responsive helpers ---------- */
@media (max-width: 640px) {
  .hero-bg {
    background:
      radial-gradient(ellipse 120% 60% at 50% 30%, rgb(var(--rp-indigo) / 0.2) 0%, transparent 65%),
      rgb(var(--rp-bg));
  }
}

/* ---------- Product Identity Bar ---------- */
.product-id-bar {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 40;
  height: 44px;
  background: rgb(var(--rp-bg2) / 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-bottom: 1px solid rgb(var(--rp-indigo) / 0.18);
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.product-id-bar.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.product-id-bar__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.product-id-bar__name {
  font-size: 0.875rem;
  font-weight: 700;
  color: rgb(var(--rp-text));
  white-space: nowrap;
}
.product-id-bar__cta {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.9rem;
  border-radius: 8px;
  background: rgb(var(--rp-indigo) / 0.25);
  border: 1px solid rgb(var(--rp-indigo) / 0.45);
  color: rgb(var(--rp-text));
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.product-id-bar__cta:hover {
  background: rgb(var(--rp-indigo) / 0.28);
  border-color: rgb(var(--rp-indigo) / 0.6);
}
@media (max-width: 480px) {
  .product-id-bar__cta { display: none; }
}

/* ---------- Nav dropdown items ---------- */
.nav-dd-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease;
  outline: none;
  text-decoration: none;
}
.nav-dd-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ---------- FOUC prevention ---------- */
body { opacity: 0; transition: opacity 0.2s ease; }
body.rp-ready { opacity: 1; }