:root {
  --bg-color: #0d0e15;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-green: #10b981;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.15), transparent 25%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Navbar */
.navbar {
  position: fixed; top: 0; width: 100%; z-index: 100;
  background: rgba(13, 14, 21, 0.7); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
}

.nav-content {
  max-width: 1200px; margin: 0 auto; padding: 1rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
}

.brand {
  display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: white;
  font-weight: 700; font-size: 1.2rem;
}
.logo { display: flex; align-items: center; }
.logo svg { width: 24px; height: 24px; color: var(--accent-blue); }

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links > a { color: var(--text-secondary); text-decoration: none; font-weight: 500; transition: all 0.3s; }
.nav-links > a:hover { color: white; }
.nav-donate-link {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: white !important;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.nav-donate-link:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5); }

.donate-group { display: flex; gap: 0.75rem; border-left: 1px solid var(--border-light); padding-left: 1.5rem; }
.btn-donate {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.5rem 1rem;
  border-radius: 8px; font-size: 0.85rem; font-weight: 600; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border-light); transition: all 0.3s;
  flex: 1;
}
.btn-donate svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-donate.kofi { color: #29abe0; }
.btn-donate.saweria { color: #F2A900; }
.btn-donate.trakteer { color: #e12c33; }
.btn-donate:hover { background: var(--surface-hover); border-color: var(--border-hover); transform: translateY(-2px); }

/* Hero Donate */
.hero-donate { margin-top: 2rem; margin-bottom: 1rem; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.donate-title { font-size: 0.9rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin: 0; }
.inline-donate { border-left: none; padding-left: 0; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.inline-donate .btn-donate { min-width: 120px; padding: 0.6rem 1rem; flex: 0 1 auto; }

/* Hero */
.hero { max-width: 800px; margin: 10rem auto 6rem; text-align: center; padding: 0 2rem; }
.badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1rem; border-radius: 20px; background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2); color: #60a5fa; font-size: 0.85rem; font-weight: 600; margin-bottom: 2rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #60a5fa; box-shadow: 0 0 10px #60a5fa; }
.hero h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; line-height: 1.2; margin-bottom: 1.5rem; }
.hero h1 span { background: linear-gradient(135deg, #60a5fa, #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.1rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto; }

/* Grid Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem 6rem; }
.grid-layout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

/* --- 3D FLIP CARDS --- */
.card {
  perspective: 1500px;
  background: transparent;
  min-height: 520px; /* Ensure sufficient height for flip content */
}

.card-flipper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 520px;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.card.flipped .card-flipper {
  transform: rotateY(180deg);
}

.card-front {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 520px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #11121a; /* solid fallback */
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card-back {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #11121a; /* solid fallback */
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card:hover .card-front, .card:hover .card-back {
  border-color: var(--border-hover);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.card-back {
  transform: rotateY(180deg);
}

/* Card Content internals */
.card-gradient { height: 4px; width: 100%; flex-shrink: 0; }
.orion-grad { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.sonix-grad { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.aether-grad { background: linear-gradient(90deg, #10b981, #34d399); }

.card-inner { padding: 2.5rem; display: flex; flex-direction: column; height: 100%; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; flex-shrink: 0; }
.app-brand { display: flex; flex-direction: column; gap: 1rem; }
.icon-box {
  width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
  border: 1px solid var(--border-light); display: grid; place-items: center; box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}
.icon-box svg { width: 28px; height: 28px; color: white; }
.app-brand h2 { font-size: 1.5rem; font-weight: 700; }

.status { font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: 12px; letter-spacing: 0.05em; }
.status.live { color: #34d399; background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); }

.meta-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; flex-shrink: 0; }
.meta-tags span {
  font-size: 0.8rem; color: #cbd5e1; padding: 4px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-light);
}

.description { color: var(--text-secondary); font-size: 1rem; margin-bottom: 2rem; }

.card-bottom { display: flex; flex-direction: column; gap: 1.5rem; margin-top: auto; }
.metrics { display: flex; justify-content: space-between; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-light); }
.metric { display: flex; flex-direction: column; gap: 0.3rem; }
.val { font-size: 1.3rem; font-weight: 700; color: white; }
.lbl { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

/* Action Buttons Grid */
.action-buttons { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 1rem; border-radius: 12px; font-family: inherit; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: all 0.3s; border: none; text-decoration: none; width: 100%;
}
.btn svg { width: 20px; height: 20px; }

.btn.primary { background: linear-gradient(135deg, #3b82f6, #60a5fa); color: white; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6); }

.btn.secondary { background: var(--surface); color: white; border: 1px solid var(--border-light); }
.btn.secondary:hover { background: var(--surface-hover); border-color: var(--border-hover); transform: translateY(-2px); }

.btn.btn-icon { width: 52px; padding: 0; color: var(--text-secondary); }
.btn.btn-icon:hover { color: white; }

/* Card Back specifics */
.back-title { font-size: 1.3rem; font-weight: 700; color: white; }
.btn-close { 
  background: transparent; border: none; color: var(--text-secondary); font-size: 1.2rem; cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; transition: 0.2s;
}
.btn-close:hover { background: rgba(255,255,255,0.1); color: white; }

.changelog-content {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Scrollbar for changelog */
.changelog-content::-webkit-scrollbar { width: 4px; }
.changelog-content::-webkit-scrollbar-track { background: transparent; }
.changelog-content::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

.changelog-text h3, .changelog-text h4 { color: white; margin: 1.5rem 0 0.5rem; font-size: 1rem; }
.changelog-text h3:first-child { margin-top: 0; }
.changelog-text ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.changelog-text li { margin-bottom: 0.3rem; }
.changelog-text a { color: var(--accent-blue); text-decoration: none; }
.changelog-text a:hover { text-decoration: underline; }

/* Loader */
.loader {
  width: 30px; height: 30px; border: 3px solid var(--border-light); border-top-color: var(--accent-blue);
  border-radius: 50%; animation: spin 1s linear infinite; margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }


footer { border-top: 1px solid var(--border-light); padding: 3rem 2rem; margin-top: auto; }
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 1rem; color: var(--text-secondary); font-size: 0.9rem; }
.logo-small { display: flex; align-items: center; }
.logo-small svg { width: 20px; height: 20px; color: var(--text-secondary); }

/* Scroll Animations */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for cards */
.grid-layout .card:nth-child(1) { transition-delay: 0.1s; }
.grid-layout .card:nth-child(2) { transition-delay: 0.25s; }
.grid-layout .card:nth-child(3) { transition-delay: 0.4s; }

/* Pulse animation for Live status */
@keyframes pulseLive {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.status.live { animation: pulseLive 2s infinite; }

@media (max-width: 900px) {
  .grid-layout { grid-template-columns: 1fr; }
  .nav-links { gap: 1rem; }
  .nav-links > a[href="#apps"] { display: none; }
}
