/* ===========================
   CSS Reset & Custom Properties
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #0a0a0f;
  --color-bg-alt: #111118;
  --color-surface: #1a1a24;
  --color-primary: #6c63ff;
  --color-primary-hover: #574fd6;
  --color-accent: #ff6584;
  --color-text: #e0e0e0;
  --color-text-muted: #9090a0;
  --color-border: #2a2a3a;
  --color-white: #ffffff;

  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Courier New', monospace;

  --transition: 0.3s ease;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(108, 99, 255, 0.12);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

/* ===========================
   Utility Classes
   =========================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  color: var(--color-white);
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 2px;
  margin: 0.6rem auto 0;
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition), transform var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ===========================
   Navigation
   =========================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: background var(--transition), box-shadow var(--transition);
}

#navbar.scrolled {
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

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

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  position: relative;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===========================
   Hero Section
   =========================== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem 3rem;
  background: radial-gradient(ellipse at 70% 50%, rgba(108, 99, 255, 0.08) 0%, transparent 60%),
    var(--color-bg);
  gap: 3rem;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-content,
.hero-visual {
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 580px;
}

.hero-greeting {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--color-primary);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  background: rgba(108, 99, 255, 0.08);
  border: 1px solid rgba(108, 99, 255, 0.25);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  color: var(--color-white);
  background: linear-gradient(135deg, #ffffff 30%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 400;
  color: var(--color-text-muted);
  margin-bottom: 1.2rem;
  min-height: 2.2rem;
}

.cursor {
  animation: blink 1s step-end infinite;
  color: var(--color-primary);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

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

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.social-links {
  display: flex;
  gap: 1.2rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 1.1rem;
  transition: color var(--transition), border-color var(--transition),
    background var(--transition), transform var(--transition);
}

.social-links a:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: rgba(108, 99, 255, 0.08);
  transform: translateY(-3px);
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Scroll-down indicator */
/* .scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: calc(50% - 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  z-index: 2;
  transition: color var(--transition), border-color var(--transition);
  animation: scrollBounce 2s ease-in-out infinite;
} */

/* .scroll-indicator:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
} */

/* @keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
} */

.avatar-ring {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: conic-gradient(var(--color-primary), var(--color-accent), var(--color-primary));
  padding: 4px;
  animation: spin 8s linear infinite;
  flex-shrink: 0;
}

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

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 800;
  color: var(--color-primary);
  animation: spin 8s linear infinite reverse;
}
.terminal-text {
  font-family: 'Courier New', monospace;
  color: #22c55e;
  min-height: 60px;
  white-space: pre-line;
}
.form-control {
  width: 100%;
  padding: 0.425rem .5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

/* ===========================
   About Section
   =========================== */
#about {
  padding: 6rem 0;
  background: var(--color-bg-alt);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text p {
  color: var(--color-text-muted);
  margin-bottom: 1.2rem;
  font-size: 1rem;
}

.about-text .btn {
  margin-top: 0.5rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr); 
  gap: 1.5rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
}

.stat-card-link {
  display: block;
  height: 100%;
  text-decoration: none;
}

.stat-number {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===========================
   Skills Section
   =========================== */
#skills {
  padding: 6rem 0;
  background: var(--color-bg);
}

.skills-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.skills-cat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.skills-cat-card:hover {
  border-color: rgba(108, 99, 255, 0.4);
  box-shadow: 0 0 28px rgba(108, 99, 255, 0.09);
}

.skills-cat-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.skills-cat-header i {
  font-size: 1rem;
  color: var(--color-primary);
}

.skills-cat-header h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-white);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.skills-pills {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.skill-pill {
  /* display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: default;
  position: relative;
  transition: transform var(--transition), border-color var(--transition),
    background var(--transition), box-shadow var(--transition); */
    display: flex;
  align-items: center;
  gap: 0.8rem;

  width: 100%;
  padding: 0.75rem 1rem;

  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);

  transition: all 0.25s ease;
}

.skill-pill:hover {
  transform: scale(1.025);
  border-color: var(--color-primary);
  background: rgba(108, 99, 255, 0.08);
  box-shadow: 0 0 16px rgba(108, 99, 255, 0.22);
}

.skill-pill .skill-icon {
  font-size: 1.05rem;
  color: var(--color-primary);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  transition: color var(--transition);
}

.skill-pill:hover .skill-icon {
  color: var(--color-accent);
}

.skill-pill .skill-name {
  font-size: 0.85rem;
  color: var(--color-text);
  flex: 1;
}

/* Tooltip */
.skill-pill[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.72rem;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
  box-shadow: var(--shadow);
}

.skill-pill[data-tooltip]:hover::after {
  opacity: 1;
}

/* ===========================
   Projects Section
   =========================== */
#projects {
  padding: 6rem 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(108, 99, 255, 0.14), transparent 35%),
    radial-gradient(circle at 85% 30%, rgba(255, 101, 132, 0.1), transparent 38%),
    var(--color-bg-alt);
}

#projects .container {
  position: relative;
}

.projects-intro {
  max-width: 700px;
  margin: -1.4rem auto 2.4rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.97rem;
}

.subsection-title {
  margin: 1.5rem 0 1rem;
  font-size: 1.2rem;
  color: var(--color-white);
  letter-spacing: 0.4px;
}

.project-card {
  position: relative;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)), var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.featured {
  border-color: rgba(108, 99, 255, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.badge {
  font-size: 0.7rem;
  background: rgba(108, 99, 255, 0.2);
  color: #d8d6ff;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-left: 0.45rem;
  border: 1px solid rgba(108, 99, 255, 0.5);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
  border-color: var(--color-primary);
}

.project-image {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.2), rgba(255, 101, 132, 0.16));
  display: flex;
  align-items: center;
  justify-content: center;
  height: 170px;
  font-size: 3.5rem;
  color: #cdc9ff;
}

.project-info {
  padding: 1.5rem;
}

.project-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.6rem;
}

.project-info p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.tag {
  background: rgba(108, 99, 255, 0.12);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  border: 1px solid rgba(108, 99, 255, 0.25);
}

.project-links {
  display: flex;
  gap: 0.75rem;
}

.projects-toggle-wrap {
  display: flex;
  justify-content: center;
  margin: 100px 0 0;
  position: relative;
  z-index: 2;
}

.projects-toggle-btn {
  min-width: 220px;
  justify-content: center;
}

.projects-toggle-btn .toggle-icon {
  transition: transform var(--transition);
}

.projects-toggle-btn.is-open .toggle-icon {
  transform: rotate(180deg);
}

.other-projects-wrap {
  margin-top: 0.9rem;
  animation: projectReveal 0.45s ease;
}

.other-projects-wrap[hidden] {
  display: none !important;
}

.projects-grid-other .project-card {
  padding: 1.3rem;
}

.projects-grid-other .project-card h3 {
  font-size: 1.03rem;
  color: var(--color-white);
  margin-bottom: 0.35rem;
}

.projects-grid-other .project-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

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

/* ===========================
   Contact Section
   =========================== */
#contact {
  padding: 6rem 0;
  background: var(--color-bg);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
  align-items: start;
}

.contact-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 1rem;
}

.contact-info > p {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.contact-items {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--color-text);
  font-size: 0.9rem;
}

.contact-item i {
  color: var(--color-primary);
  font-size: 1.1rem;
  width: 20px;
  flex-shrink: 0;
}

.contact-item a {
  color: var(--color-primary);
  transition: opacity var(--transition);
}

.contact-item a:hover {
  opacity: 0.8;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--color-text-muted);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

.contact-form input.invalid,
.contact-form textarea.invalid {
  border-color: var(--color-accent);
}

.error-msg {
  font-size: 0.8rem;
  color: var(--color-accent);
  min-height: 1rem;
}

.form-success {
  color: #4caf82;
  font-size: 0.9rem;
  text-align: center;
  margin-top: 0.5rem;
}

/* ===========================
   Footer
   =========================== */
footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
}

footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

footer p {
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--color-primary);
}

/* ===========================
   Animations / Scroll Reveal (managed by GSAP)
   =========================== */

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 900px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .skills-categories {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  #hero {
    flex-direction: column-reverse;
    text-align: center;
    padding-top: 8rem;
  }

  .hero-buttons,
  .social-links {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.97);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1rem;
    border-top: 1px solid var(--color-border);
  }

  .nav-links.open {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .avatar-ring {
    width: 200px;
    height: 200px;
  }

  .about-stats {
    grid-template-columns: 1fr 1fr;
  }

  .skills-categories {
    grid-template-columns: 1fr;
  }

  footer .container {
    flex-direction: column;
    text-align: center;
  }
}
.coffee-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.coffee-modal.active {
  opacity: 1;
  pointer-events: all;
}

.coffee-content {
  background: #111827;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  color: white;
  max-width: 420px;
  width: 90%;
}

.close-coffee {
  margin-top: 1rem;
  background: transparent;
  border: 1px solid white;
  color: white;
  padding: 8px 16px;
  cursor: pointer;
}

/* ===========================
   CTF Challenge Enhancements
   =========================== */

.ctf-stage-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.4rem;
}

.ctf-stage-pip {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #374151;
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
  flex-shrink: 0;
}

.ctf-stage-pip.active {
  background: rgba(108, 99, 255, 0.2);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 8px rgba(108, 99, 255, 0.4);
}

.ctf-stage-pip.done {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  color: #22c55e;
}

.ctf-stage-connector {
  height: 2px;
  width: 36px;
  background: #374151;
  flex-shrink: 0;
  transition: background 0.3s;
}

.ctf-stage-connector.done {
  background: #22c55e;
}

.ctf-stage-desc {
  font-size: 0.82rem;
  color: #9ca3af;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.ctf-btn-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  justify-content: center;
}

.ctf-hint-btn {
  font-size: 0.85rem;
  padding: 0.55rem 1.1rem;
}

.ctf-hint-text {
  font-size: 0.82rem;
  color: #fbbf24;
  margin-top: 0.65rem;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  text-align: left;
  line-height: 1.5;
}

/* ===========================
   Earned Badge Floating Button
   =========================== */

.badge-earned-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #1a1200, #2d2000);
  border: 2px solid #fbbf24;
  border-radius: 50px;
  padding: 0.6rem 1.2rem;
  color: #fbbf24;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.35), 0 4px 16px rgba(0,0,0,0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: badgePulse 2.5s ease-in-out infinite;
}

.badge-earned-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 32px rgba(251, 191, 36, 0.55), 0 8px 24px rgba(0,0,0,0.5);
}

.badge-earned-icon {
  font-size: 1.1rem;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.35), 0 4px 16px rgba(0,0,0,0.5); }
  50% { box-shadow: 0 0 32px rgba(251, 191, 36, 0.6), 0 4px 16px rgba(0,0,0,0.5); }
}

/* ===========================
   Badge Modal
   =========================== */

.badge-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.badge-modal.active {
  opacity: 1;
  pointer-events: all;
}

.badge-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
}

.badge-modal-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 380px;
  width: 90%;
}

.badge-modal-close {
  position: absolute;
  top: -0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.badge-modal-close:hover {
  color: #fff;
}

/* ===========================
   Achievement Badge Design
   =========================== */

.achievement-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.badge-outer-ring {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: conic-gradient(
    #fbbf24 0deg,
    #f59e0b 60deg,
    #fcd34d 120deg,
    #f59e0b 180deg,
    #fbbf24 240deg,
    #fcd34d 300deg,
    #fbbf24 360deg
  );
  padding: 6px;
  animation: badgeRotate 10s linear infinite;
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.5), 0 0 80px rgba(251, 191, 36, 0.2);
}

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

.badge-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #1e1200, #0a0800);
  border: 3px solid #92400e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  animation: badgeRotate 10s linear infinite reverse;
  padding: 1rem;
}

.badge-trophy {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.8));
  margin-bottom: 0.1rem;
}

.badge-title {
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: #fbbf24;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

.badge-subtitle {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fef3c7;
  letter-spacing: 0.5px;
}

.badge-stages {
  display: flex;
  gap: 0.3rem;
  margin: 0.3rem 0;
}

.badge-stage-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid #22c55e;
  color: #22c55e;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.badge-label {
  font-size: 0.68rem;
  color: #92400e;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: 'Courier New', monospace;
}

.badge-brand {
  font-family: 'Courier New', monospace;
  font-size: 0.62rem;
  color: #78350f;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 0.15rem;
}

.badge-date {
  font-family: 'Courier New', monospace;
  font-size: 0.6rem;
  color: #78350f;
}

.badge-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.badge-persist-note {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* ===========================
   Button Hover Preview Tooltip
   =========================== */

#btn-hover-preview {
  position: absolute;
  z-index: 9000;
  min-width: 200px;
  max-width: 260px;
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: 0 8px 32px rgba(108, 99, 255, 0.25), 0 2px 12px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#btn-hover-preview::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid var(--color-primary);
}

#btn-hover-preview.bhp-visible {
  opacity: 1;
  transform: translateY(0);
}

.bhp-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.55rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
}

.bhp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.bhp-list li {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  padding-left: 0.9rem;
  position: relative;
}

.bhp-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 700;
}

/* ===========================
   Project Screen Preview
   =========================== */

#project-screen-preview {
  position: absolute;
  z-index: 9100;
  width: 280px;
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(108, 99, 255, 0.3), 0 2px 12px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#project-screen-preview::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid var(--color-primary);
}

#project-screen-preview.psp-visible {
  opacity: 1;
  transform: translateY(0);
}

.psp-browser-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--color-border);
}

.psp-dots {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.psp-dots span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.psp-dots span:nth-child(1) { background: #ff5f57; }
.psp-dots span:nth-child(2) { background: #ffbd2e; }
.psp-dots span:nth-child(3) { background: #28c840; }

.psp-url {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
}

.psp-screen {
  width: 100%;
  height: 160px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #12121e;
}

.psp-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: top;
  display: none;
}

.psp-loading {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
