/* ===========================
   CSS VARIABLES & RESET
=========================== */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2230;
  --bg-hover: #21283a;
  --accent: #58a6ff;
  --accent-green: #3fb950;
  --accent-orange: #f0883e;
  --accent-red: #f85149;
  --accent-purple: #bc8cff;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --border: #30363d;
  --border-accent: #58a6ff40;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 50px;
  --font-mono: "JetBrains Mono", monospace;
  --font-main: "Inter", sans-serif;
  --transition: all 0.3s ease;
  --nav-height: 64px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ===========================
   SCROLLBAR
=========================== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ===========================
   BUTTONS
=========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
}
.btn-primary:hover {
  background: #79baff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent);
  color: #0d1117;
  transform: translateY(-2px);
}

/* ===========================
   NAVBAR
=========================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  z-index: 1000;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-icon {
  color: var(--accent);
  font-size: 1.3rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  background: var(--border-accent);
  border-color: var(--border-accent);
}

.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(--text-primary);
  border-radius: 2px;
  transition: 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
=========================== */
.hero {
  min-height: auto;
  padding: calc(var(--nav-height) + 60px) 5% 80px;
  padding-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(88, 166, 255, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(63, 185, 80, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-content {
  max-width: 560px;
  animation: fadeUp 0.8s ease forwards;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-green);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.hero-title {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.accent {
  color: var(--accent);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 420px;
}

.hero-btns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-graphic {
  flex-shrink: 0;
  animation: fadeUp 0.8s ease 0.2s forwards;
  opacity: 0;
}

.code-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 2;
  min-width: 360px;
  box-shadow: var(--shadow);
  position: relative;
}

.code-block::before {
  content: "● ● ●";
  position: absolute;
  top: 12px;
  left: 16px;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 4px;
}

.code-block .line {
  display: block;
}

.kw {
  color: #ff7b72;
}
.fn {
  color: #d2a8ff;
}
.str {
  color: #a5d6ff;
}
.cm {
  color: var(--text-muted);
}

/* ===========================
   SECTIONS
=========================== */
.section {
  padding: 50px 5%;
  max-width: 1100px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 2px;
  display: block;
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

.section-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.2rem;
  letter-spacing: 10px;
  padding: 8px 0;
}

/* ===========================
   GITHUB FINDER
=========================== */
.search-container {
  max-width: 620px;
  margin: 0 auto 40px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 6px 6px 20px;
  gap: 12px;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.search-icon {
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 8px 0;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  background: var(--accent);
  color: #0d1117;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  flex-shrink: 0;
}

.search-btn:hover {
  background: #79baff;
  transform: scale(1.03);
}

/* Spinner */
.spinner-container {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px;
}

.spinner-container.show {
  display: flex;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-text {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Error Box */
.error-box {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: var(--radius);
  padding: 16px 24px;
  max-width: 480px;
  margin: 0 auto 32px;
  color: var(--accent-red);
  font-size: 0.9rem;
  animation: fadeUp 0.3s ease;
}

.error-box.show {
  display: flex;
}

/* Profile Card */
.profile-card {
  display: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 720px;
  margin: 0 auto 40px;
  box-shadow: var(--shadow-card);
  animation: fadeUp 0.4s ease;
}

.profile-card.show {
  display: block;
}

.profile-top {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--border-accent);
  object-fit: cover;
}

.avatar-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--accent);
  color: #0d1117;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border: 2px solid var(--bg-secondary);
}

.profile-info {
  flex: 1;
  min-width: 200px;
}

.profile-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.profile-login {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.profile-bio {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 14px;
  line-height: 1.5;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.profile-meta span {
  color: var(--text-secondary);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-meta i {
  color: var(--accent);
}

/* Stats */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  transition: var(--transition);
}

.stat-box:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
}

.profile-gh-btn {
  width: 100%;
  justify-content: center;
}

/* Repos */
.repos-section {
  display: none;
  max-width: 720px;
  margin: 0 auto;
  animation: fadeUp 0.4s ease;
}

.repos-section.show {
  display: block;
}

.repos-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.repos-title i {
  color: var(--accent);
}

.repos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.repo-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.repo-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.12);
}

.repo-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.repo-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.repo-meta {
  display: flex;
  gap: 14px;
  align-items: center;
}

.repo-lang {
  font-size: 0.75rem;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 5px;
}

.repo-lang::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
  display: inline-block;
}

.repo-stars,
.repo-forks {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===========================
   QUIZ
=========================== */
.quiz-start,
.quiz-game,
.quiz-result {
  display: none;
  max-width: 680px;
  margin: 0 auto;
}

.quiz-start.show,
.quiz-game.show,
.quiz-result.show {
  display: block;
  animation: fadeUp 0.4s ease;
}

.quiz-start-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
}

.quiz-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.quiz-start-card h3 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.quiz-rules {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.quiz-rules li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-rules li i {
  color: var(--accent-green);
  font-size: 0.8rem;
}

/* Quiz Game */
.quiz-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.quiz-progress {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.quiz-timer-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.quiz-timer-box.danger {
  border-color: var(--accent-red);
  color: var(--accent-red);
  animation: pulse 0.5s ease infinite alternate;
}

.quiz-progressbar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 24px;
  overflow: hidden;
}

.quiz-progressbar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 10%;
}

.quiz-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
}

.quiz-category {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-purple);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.quiz-question {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 28px;
  color: var(--text-primary);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  -webkit-text-fill-color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateX(4px);
}

.quiz-option.correct {
  border-color: var(--accent-green);
  background: rgba(63, 185, 80, 0.1);
  color: var(--accent-green);
}

.quiz-option.wrong {
  border-color: var(--accent-red);
  background: rgba(248, 81, 73, 0.1);
  color: var(--accent-red);
}

.quiz-option:disabled {
  cursor: not-allowed;
}

.option-letter {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

/* Quiz Result */
.result-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
}

.result-emoji {
  font-size: 4rem;
  margin-bottom: 16px;
}

.result-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.result-score {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 24px;
}

.result-score span {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.2rem;
}

.result-bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin-bottom: 20px;
  overflow: hidden;
}

.result-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--accent-green);
  transition: width 1s ease;
  width: 0%;
}

.result-msg {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.result-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===========================
   FOOTER
=========================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 5%;
  margin-top: 60px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  font-weight: 700;
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-credit {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ===========================
   ANIMATIONS
=========================== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.5;
  }
}

/* ===========================
   MEDIA QUERIES — RESPONSIVE
=========================== */

/* Tablet — max 900px */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: calc(var(--nav-height) + 40px);
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-sub {
    margin: 0 auto 32px;
  }

  .hero-btns {
    justify-content: center;
  }

  .hero-graphic {
    width: 100%;
    opacity: 1 !important;
  }

  .code-block {
    min-width: unset;
    width: 100%;
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .repos-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile — max 600px */
@media (max-width: 600px) {
  .navbar {
    padding: 0 4%;
  }

  .hamburger {
    display: flex;
    z-index: 1001;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 5%;
    gap: 4px;
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    overflow: hidden;
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: 12px;
    color: var(--text-primary);
    display: block;
    font-size: 1rem;
  }

  .hero-title {
    font-size: 2.6rem;
  }

  .section {
    padding: 60px 4%;
  }

  .search-box {
    flex-wrap: wrap;
    padding: 12px 16px;
    border-radius: var(--radius);
    gap: 10px;
  }

  .search-btn {
    width: 100%;
    justify-content: center;
  }

  .profile-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-meta {
    justify-content: center;
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .quiz-card {
    padding: 24px 20px;
  }

  .quiz-start-card,
  .result-card {
    padding: 32px 20px;
  }

  .result-btns {
    flex-direction: column;
  }

  .result-btns .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-btns {
    flex-direction: column;
    align-items: center;
  }

  .hero-btns .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Small Mobile — max 400px */
@media (max-width: 400px) {
  .hero-title {
    font-size: 2rem;
  }

  .stat-num {
    font-size: 1.2rem;
  }

  .quiz-option {
    padding: 12px 14px;
    font-size: 0.85rem;
  }
}
