* { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  background: #0c0c10;
  color: #f0f0f8;
  font-family: 'Outfit', sans-serif;
  overflow-x: hidden;
  transition: background-color .25s ease, color .25s ease;
}
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #0c0c10; }
::-webkit-scrollbar-thumb { background: #3a3a54; border-radius: 3px; }

/* fade-up on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* nav underline active */
.nav-link { position: relative; padding-bottom: 2px; }
.nav-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: #6c63ff; border-radius: 2px; transition: width .25s; }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: #f0f0f8; }

/* hamburger */
.hamburger-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #2a2a3c;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
  background: transparent;
}
.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: #9090b0;
  transition: transform .2s ease, opacity .2s ease, background-color .2s ease;
}

/* marquee */
.marquee-track { display: flex; gap: .85rem; white-space: nowrap; width: max-content; animation: marquee 24s linear infinite; }
.marquee-track:hover { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* cursor blink */
.cursor { display: inline-block; width: 8px; height: 14px; background: #6c63ff; vertical-align: middle; animation: blink 1.1s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* green dot */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; display: inline-block; animation: pulse2 2s ease-in-out infinite; }
@keyframes pulse2 { 0%,100%{opacity:1} 50%{opacity:.35} }

/* orbit svg animation */
.orbit-ring { animation: spin 30s linear infinite; transform-origin: 200px 200px; }
.orbit-ring2 { animation: spin 22s linear infinite reverse; transform-origin: 200px 200px; }
@keyframes spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

/* project card hover */
.proj-card { transition: transform .3s, border-color .3s, box-shadow .3s; }
.proj-card:hover { transform: translateY(-5px); border-color: #6c63ff; box-shadow: 0 16px 48px rgba(0,0,0,.45), 0 0 0 1px rgba(108,99,255,.15); }
.proj-card:hover .proj-overlay { opacity: 1; }
.proj-overlay { transition: opacity .3s; }

/* tab panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* contrib card */
.contrib-card { transition: border-color .3s; }
.contrib-card:hover { border-color: #6c63ff; }

/* filter hide */
.proj-item.hidden { display: none !important; }

/* About overflow safeguards */
#about { overflow-x: clip; }
#about .grid > * { min-width: 0; }
#about .profile-photo-wrap {
  width: 190px;
  height: 190px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid #2a2a3c;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  background: #13131a;
}
#about .profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  transform: scale(1.22);
  transform-origin: center;
}
#about .about-tab { min-width: 0; }
#about .tab-panel .flex { min-width: 0; }
#about .tab-panel .flex > div:last-child { min-width: 0; }
#about .marquee-track { max-width: 100%; }

/* Mobile responsiveness */
@media (max-width: 768px) {
  #about .marquee-track {
    animation: none;
    width: 100%;
    white-space: normal;
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  h1 { font-size: 2.3rem !important; line-height: 1.08 !important; }
  #about .grid.grid-cols-3 { grid-template-columns: 1fr; }
  #flagship .grid.grid-cols-2 { grid-template-columns: 1fr; }
}

/* Light theme overrides */
body.light-theme {
  background: #f5f7fb;
  color: #1f2937;
}

body.light-theme::-webkit-scrollbar-track { background: #e5e7eb; }
body.light-theme::-webkit-scrollbar-thumb { background: #9ca3af; }

body.light-theme .bg-bg { background-color: #f5f7fb !important; }
body.light-theme .bg-bg2 { background-color: #eef2f7 !important; }
body.light-theme .bg-bg3 { background-color: #e4e8f0 !important; }
body.light-theme .bg-surface,
body.light-theme .proj-card,
body.light-theme .contrib-card { background-color: #ffffff !important; }

body.light-theme .border-border { border-color: #d1d5db !important; }
body.light-theme .border-border2 { border-color: #cbd5e1 !important; }

body.light-theme .text-white { color: #111827 !important; }
body.light-theme .text-muted,
body.light-theme .text-dim { color: #4b5563 !important; }
body.light-theme .hamburger-btn { border-color: #cbd5e1; }
body.light-theme .hamburger-line { background: #374151; }

body.light-theme .nav-link::after { background: #4f46e5; }
body.light-theme .nav-link.active { color: #111827 !important; }

body.light-theme .proj-card:hover,
body.light-theme .contrib-card:hover { box-shadow: 0 12px 30px rgba(79,70,229,.12); }
body.light-theme #about .profile-photo-wrap {
  border-color: #cbd5e1;
  background: #e5e7eb;
}
