/* ==========================================================
   STYLE.CSS — Dark-themed portfolio with purple accent
   ========================================================== */

/* ---- CSS Variables ---- */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-body: #d4d4d4;
  --accent: #a855f7;
  --accent-light: #c084fc;
  --accent-glow: rgba(168, 85, 247, 0.14);
  --accent-glow-strong: rgba(168, 85, 247, 0.28);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --error: #ff4d4d;
  --error-bg: rgba(255, 77, 77, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Utility ---- */
.hidden {
  display: none !important;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow), 0 0 60px rgba(168, 85, 247, 0.05); }
  50% { box-shadow: 0 0 30px var(--accent-glow-strong), 0 0 80px rgba(168, 85, 247, 0.1); }
}

@keyframes welcomePulse {
  0% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.1); }
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================
   ACCESS GATE
   ========================================================== */
.gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.gate-card {
  width: 100%;
  max-width: 440px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 48px 36px;
  text-align: center;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: fadeInUp 0.7s ease-out;
}

.gate-icon {
  color: var(--accent);
  margin-bottom: 24px;
  opacity: 0.9;
}

.gate-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.gate-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  letter-spacing: 0.01em;
}

/* ---- Form ---- */
.input-wrapper {
  display: flex;
  gap: 10px;
}

#key-input {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  letter-spacing: 0.03em;
}

#key-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

#key-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#key-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-bg);
  animation: shake 0.5s ease-in-out;
}

#unlock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

#unlock-btn:hover {
  background: var(--accent-light);
  box-shadow: 0 0 24px var(--accent-glow-strong);
  transform: translateY(-1px);
}

#unlock-btn:active {
  transform: translateY(0);
}

#unlock-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.spinner {
  animation: spin 0.8s linear infinite;
}

/* Error Message */
.error-msg {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--error);
  animation: slideDown 0.3s ease-out;
  letter-spacing: 0.01em;
}

/* ---- Gate Discord ---- */
.gate-discord {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.gate-discord-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.gate-discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #5865F2;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.01em;
}

.gate-discord-btn:hover {
  background: #4752C4;
  box-shadow: 0 0 24px rgba(88, 101, 242, 0.35);
  transform: translateY(-2px);
}

.gate-discord-btn:active {
  transform: translateY(0);
}

/* ==========================================================
   MAIN CONTENT
   ========================================================== */
.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Welcome Flash ---- */
.welcome-flash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg);
  color: var(--accent);
  z-index: 100;
  animation: welcomePulse 1.4s ease-in-out forwards;
  pointer-events: none;
}

.welcome-flash p {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ==========================================================
   NAVBAR
   ========================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
}

.navbar-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.discord-btn:hover {
  color: #5865F2;
  background: rgba(88, 101, 242, 0.1);
  border-color: rgba(88, 101, 242, 0.25);
}

.navbar-links {
  display: flex;
  gap: 4px;
}

.nav-btn {
  padding: 8px 18px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-btn.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-color: rgba(168, 85, 247, 0.2);
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 80px 0 50px;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ==========================================================
   CATEGORY CARDS (HOME VIEW)
   ========================================================== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition);
  animation: cardReveal 0.6s ease-out both;
}

.category-card:nth-child(1) { animation-delay: 0.4s; }
.category-card:nth-child(2) { animation-delay: 0.5s; }
.category-card:nth-child(3) { animation-delay: 0.6s; }
.category-card:nth-child(4) { animation-delay: 0.7s; }

.category-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(168, 85, 247, 0.25);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--accent-glow);
}

.category-icon {
  color: var(--accent);
  margin-bottom: 4px;
}

.category-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.category-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.category-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 4px 12px;
  border-radius: 100px;
  width: fit-content;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ==========================================================
   PROJECT CARDS GRID
   ========================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding-bottom: 80px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--transition);
  animation: cardReveal 0.6s ease-out both;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.15s; }
.project-card:nth-child(3) { animation-delay: 0.2s; }
.project-card:nth-child(4) { animation-delay: 0.25s; }
.project-card:nth-child(5) { animation-delay: 0.3s; }
.project-card:nth-child(6) { animation-delay: 0.35s; }
.project-card:nth-child(7) { animation-delay: 0.4s; }
.project-card:nth-child(8) { animation-delay: 0.45s; }
.project-card:nth-child(9) { animation-delay: 0.5s; }

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-hover);
}

/* ---- Program Icons ---- */
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.card-icon-ps {
  background: #001e36;
  color: #31a8ff;
  border: 1px solid rgba(49, 168, 255, 0.25);
}

.card-icon-pr {
  background: #00005b;
  color: #9999ff;
  border: 1px solid rgba(153, 153, 255, 0.25);
}

.card-icon-me {
  background: #1b0036;
  color: #c891ff;
  border: 1px solid rgba(200, 145, 255, 0.25);
}

.card-icon-ae {
  background: #00005b;
  color: #9999ff;
  border: 1px solid rgba(153, 153, 255, 0.25);
}

.card-icon-plugin {
  background: #0d2b1a;
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-download:hover {
  background: var(--accent-light);
  box-shadow: 0 0 20px var(--accent-glow-strong);
  transform: translateY(-1px);
}

.btn-alt {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-alt:hover {
  background: var(--accent-glow);
  border-color: rgba(168, 85, 247, 0.45);
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  font-style: italic;
}

/* ==========================================================
   EMPTY STATE
   ========================================================== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeIn 0.4s ease-out;
}

.empty-state p {
  font-size: 1rem;
  font-weight: 500;
}

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
  text-align: center;
  padding: 40px 24px 60px;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  opacity: 0.6;
  letter-spacing: 0.03em;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 640px) {
  .gate-card {
    padding: 36px 24px;
  }

  .input-wrapper {
    flex-direction: column;
  }

  #unlock-btn {
    width: 100%;
    justify-content: center;
  }

  .hero {
    padding: 60px 0 30px;
  }

  .navbar-inner {
    flex-direction: column;
    height: auto;
    padding: 12px 16px;
    gap: 10px;
  }

  .navbar-brand-group {
    gap: 10px;
  }

  .discord-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

  .navbar-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .nav-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

  .categories-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
