/* Project Yielding — Obsidian Dark-Mode Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-obsidian: #06070b;
  --bg-surface: #0b0e16;
  --bg-card: rgba(15, 20, 34, 0.78);
  --bg-card-hover: rgba(20, 27, 46, 0.92);
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-bright: rgba(99, 102, 241, 0.42);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-indigo: #6366f1;
  --accent-violet: #8b5cf6;
  --accent-cyan: #22d3ee;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --discord: #5865f2;
  --discord-hover: #4752c4;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-glow: 0 0 36px rgba(99, 102, 241, 0.22);
}

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

html, body {
  min-height: 100%;
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -15%, rgba(99, 102, 241, 0.18), transparent 65%),
    radial-gradient(ellipse 50% 35% at 85% 15%, rgba(34, 211, 238, 0.09), transparent 60%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

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

code, pre, .font-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Container & Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.page-main {
  flex: 1;
  padding: 2.25rem 0 4rem;
}

/* Persistent Top Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 7, 11, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 70px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.45);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.18s ease, background 0.18s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}

/* Auth User Menu (Top-Left) */
.user-menu {
  position: relative;
}

.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}

.user-trigger:hover {
  border-color: var(--border-bright);
  background: rgba(255, 255, 255, 0.09);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 200px;
  background: #0f1422;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.4rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
  display: none;
  z-index: 60;
}

.user-dropdown.open {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.dropdown-item.danger {
  color: #fb7185;
}

/* Glass Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.card-hover:hover {
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
  color: #fff;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-discord {
  background: var(--discord);
  color: #fff;
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.45);
}

.btn-discord:hover:not(:disabled) {
  background: var(--discord-hover);
  transform: translateY(-1px);
}

.btn-discord-hero {
  background: linear-gradient(135deg, #5865f2 0%, #7289da 55%, #4752c4 100%);
  color: #ffffff;
  padding: 1rem 2.2rem;
  font-size: 1.08rem;
  font-weight: 700;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.65), 0 12px 35px rgba(88, 101, 242, 0.48);
  animation: discordPulse 2.6s infinite;
}

.btn-discord-hero:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 42px rgba(88, 101, 242, 0.65);
}

@keyframes discordPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.55), 0 12px 35px rgba(88, 101, 242, 0.45); }
  50% { box-shadow: 0 0 0 12px rgba(88, 101, 242, 0), 0 14px 40px rgba(88, 101, 242, 0.62); }
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.24);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.btn-danger:hover:not(:disabled) {
  background: var(--accent-rose);
  color: #fff;
}

.btn-emerald {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.btn-emerald:hover:not(:disabled) {
  background: var(--accent-emerald);
  color: #022c22;
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
}

/* Badges & Tag Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-keysystem { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.32); }
.badge-keyless { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.32); }
.badge-tag { background: rgba(34, 211, 238, 0.12); color: #67e8f9; border: 1px solid rgba(34, 211, 238, 0.26); }
.badge-premium { background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(139, 92, 246, 0.22)); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.42); }
.badge-free { background: rgba(99, 102, 241, 0.16); color: #c7d2fe; border: 1px solid rgba(99, 102, 241, 0.32); }
.badge-online { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-maintenance { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Notice & Callout Banners */
.notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.14), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(245, 158, 11, 0.35);
  margin-bottom: 1.75rem;
}

.callout-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.16), rgba(34, 211, 238, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.38);
  margin-bottom: 1.75rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  max-width: 860px;
  margin: 0 auto 2.5rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.32);
  color: #a5b4fc;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #ffffff 25%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 1.75rem;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.bento-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: var(--accent-cyan);
  font-size: 1.2rem;
}

/* Inputs & Forms */
.input, .textarea, .select {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(6, 7, 11, 0.75);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.18s ease;
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent-indigo);
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

/* Code Viewer */
.code-viewer {
  background: #05070c;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.code-body {
  padding: 0.9rem 1rem;
  height: calc(5 * 1.6em + 1.8rem);
  overflow: auto;
  font-size: 0.84rem;
  line-height: 1.6;
  color: #e2e8f0;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.45) rgba(255, 255, 255, 0.03);
}

.code-body::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.code-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

.code-body::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.45);
  border-radius: 999px;
}

.code-body::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.7);
}

.tok-kw { color: #c084fc; font-weight: 500; }
.tok-str { color: #34d399; }
.tok-fn { color: #38bdf8; }
.tok-cmt { color: #64748b; font-style: italic; }

/* Service Drawer */
.service-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease, margin-top 0.28s ease;
}

.service-drawer.open {
  max-height: 420px;
  margin-top: 1rem;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.step-node {
  flex: 1;
  text-align: center;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.step-node.active {
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
  color: #fff;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.18);
}

.step-node.done {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 10, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 80;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  background: #0d1220;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

#toast-root {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 100;
}

.toast {
  padding: 0.8rem 1.15rem;
  border-radius: var(--radius-md);
  background: #111827;
  border: 1px solid var(--border-bright);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  animation: fadeUp 0.2s ease;
}

.toast.error { border-color: rgba(244, 63, 94, 0.6); color: #fecdd3; }
.toast.success { border-color: rgba(16, 185, 129, 0.6); color: #a7f3d0; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar-inner { flex-wrap: wrap; height: auto; padding: 0.75rem 0; }
  .nav-links { width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 0.25rem; }
}

/* Brand & Homepage Logo (py-logo.png) */
.brand-logo {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.hero-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.hero-logo {
  width: 96px;
  height: 96px;
  max-width: 96px;
  max-height: 96px;
  border-radius: 22px;
  object-fit: contain;
  border: 1px solid rgba(99, 102, 241, 0.38);
  background: radial-gradient(circle at 50% 35%, rgba(99, 102, 241, 0.2), rgba(11, 14, 22, 0.92));
  padding: 0.65rem;
  box-shadow: 0 0 42px rgba(99, 102, 241, 0.35);
}
