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

:root {
  --bg: #080810;
  --bg2: #0d0d1a;
  --bg3: #111128;
  --card: #0f0f20;
  --card-border: rgba(124,58,237,.25);
  --accent: #7c3aed;
  --accent2: #a855f7;
  --green: #22c55e;
  --yellow: #eab308;
  --text: #e2e8f0;
  --muted: #64748b;
  --font: 'Space Grotesk', sans-serif;
  --mono: 'Space Mono', monospace;
}

html { scroll-behavior: smooth; }

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

.hidden { display: none !important; }

/* ── LOADER ── */
#loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader-inner { width: min(520px, 90vw); }

.loader-bar-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.loader-bar-track {
  flex: 1;
  height: 4px;
  background: rgba(124,58,237,.2);
  border-radius: 2px;
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width .1s linear;
  box-shadow: 0 0 12px var(--accent);
}
.loader-pct {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--accent2);
  width: 3rem;
  text-align: right;
}

.terminal-window {
  background: #0c0c1e;
  border: 1px solid rgba(124,58,237,.3);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(124,58,237,.15);
}
.terminal-titlebar {
  background: #161630;
  padding: .6rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green  { background: #28c840; }
.terminal-title {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--muted);
}
.terminal-body {
  padding: 1.2rem 1.5rem 1.5rem;
  font-family: var(--mono);
  font-size: .82rem;
  min-height: 140px;
}
.terminal-line {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: .5rem;
  opacity: 0;
  animation: termFade .3s forwards;
}
.terminal-line .arrow { color: var(--accent2); }
.terminal-line .warn  { color: var(--yellow); }
.terminal-line .ok    { color: var(--green); }
.terminal-cursor {
  display: inline-block;
  width: 9px; height: 15px;
  background: var(--accent2);
  animation: blink .7s infinite;
  vertical-align: middle;
}
@keyframes blink { 0%,49%{opacity:1} 50%,100%{opacity:0} }
@keyframes termFade { to { opacity: 1 } }

/* ── STARS ── */
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(8,8,16,.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(124,58,237,.15);
}
.nav-logo {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .05em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: .75rem;
  letter-spacing: .12em;
  transition: color .2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-cmd {
  background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.4);
  color: var(--accent2);
  font-family: var(--mono);
  font-size: .72rem;
  padding: .4rem .9rem;
  cursor: pointer;
  border-radius: 4px;
  letter-spacing: .08em;
  transition: all .2s;
}
.nav-cmd:hover { background: rgba(124,58,237,.3); }
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}

/* ── SECTIONS ── */
section {
  position: relative;
  z-index: 2;
  padding: 7rem 5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── HERO ── */
#home { padding-top: 9rem; text-align: center; align-items: center; }
.hero-eyebrow {
  font-family: var(--mono);
  font-size: .65rem;
  letter-spacing: .25em;
  color: var(--muted);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp .6s .4s forwards;
}
.hero-title {
  display: flex;
  flex-direction: column;
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.03em;
}
.hero-title .reveal-line {
  opacity: 0;
  transform: translateY(40px);
  animation: fadeUp .7s forwards;
}
.hero-title .reveal-line:nth-child(1) { animation-delay: .5s; }
.hero-title .reveal-line:nth-child(2) { animation-delay: .7s; }
.hero-title .reveal-line:nth-child(3) { animation-delay: .9s; }

.gradient-text {
  background: linear-gradient(90deg, var(--accent) 0%, #ec4899 50%, #f97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  margin-top: 2rem;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.8;
  opacity: 0;
  animation: fadeUp .7s 1.1s forwards;
}
.hero-btns {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
  opacity: 0;
  animation: fadeUp .7s 1.3s forwards;
}

/* ── BUTTONS ── */
.btn {
  padding: .75rem 2rem;
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all .2s;
  border: none;
}
.btn-filled {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px rgba(124,58,237,.4);
}
.btn-filled:hover { background: var(--accent2); transform: translateY(-2px); box-shadow: 0 0 30px rgba(124,58,237,.6); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.15);
}
.btn-ghost:hover { border-color: var(--accent2); color: var(--accent2); transform: translateY(-2px); }
.btn.full { width: 100%; text-align: center; }

/* ── SECTION TITLE ── */
.section-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  text-align: center;
  letter-spacing: -.02em;
  margin-bottom: 1rem;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.8;
  margin-bottom: 3.5rem;
}
.section-sub strong { color: var(--text); }

/* ── SKILLS ── */
#skills { background: var(--bg2); }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}
.skill-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1.2rem .8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  transition: all .25s;
  cursor: default;
}
.skill-card:hover {
  border-color: var(--accent2);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(124,58,237,.3);
}
.skill-card img { width: 38px; height: 38px; object-fit: contain; }
.skill-card span { font-size: .7rem; color: var(--muted); text-align: center; }

/* ── PROJECTS ── */
#projects { background: var(--bg); }
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.project-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 2rem;
  transition: all .25s;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(124,58,237,.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .3s;
}
.project-card:hover::before { opacity: 1; }
.project-card:hover {
  border-color: rgba(124,58,237,.6);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(124,58,237,.2);
}
.project-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: .8rem;
  color: var(--text);
}
.project-card p {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.project-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.project-tags span {
  font-size: .65rem;
  font-family: var(--mono);
  background: rgba(124,58,237,.1);
  border: 1px solid rgba(124,58,237,.3);
  color: var(--accent2);
  padding: .25rem .6rem;
  border-radius: 999px;
}

/* ── CONTACT ── */
#contact { background: var(--bg2); }
.contact-github {
  display: flex;
  justify-content: center;
}
.github-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2rem 3rem;
  text-decoration: none;
  color: var(--text);
  transition: all .25s;
  box-shadow: 0 0 0 rgba(124,58,237,0);
}
.github-card:hover {
  border-color: rgba(124,58,237,.7);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(124,58,237,.25);
  color: var(--accent2);
}
.github-card svg { flex-shrink: 0; opacity: .85; }
.github-card:hover svg { opacity: 1; }
.github-card-text { display: flex; flex-direction: column; gap: .4rem; }
.github-handle { font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em; }
.github-sub { font-size: .8rem; color: var(--muted); font-family: var(--mono); }

/* ── FOOTER ── */
footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2.5rem;
  border-top: 1px solid rgba(124,58,237,.1);
  background: var(--bg);
}
.footer-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.footer-icons a {
  color: var(--muted);
  transition: color .2s;
}
.footer-icons a:hover { color: var(--accent2); }
.footer-copy {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .1em;
}

/* ── STATUS BAR ── */
.statusbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 99;
  background: rgba(8,8,16,.92);
  border-top: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem 1.2rem;
  font-family: var(--mono);
  font-size: .7rem;
}
.status-left { display: flex; align-items: center; gap: .6rem; }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: .4; }
}
.status-sep { color: rgba(255,255,255,.2); }
.status-text { color: var(--green); }
#uptime { color: var(--accent2); letter-spacing: .1em; }
#statusToggle { color: var(--muted); cursor: pointer; }

/* ── CMD PALETTE ── */
.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
}
.cmd-box {
  width: min(560px, 90vw);
  background: #0f0f22;
  border: 1px solid rgba(124,58,237,.5);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 40px rgba(124,58,237,.2);
}
#cmdInput {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(124,58,237,.2);
  color: var(--text);
  font-family: var(--mono);
  font-size: .9rem;
  padding: 1rem 1.2rem;
  outline: none;
}
.cmd-results { padding: .5rem 0; }
.cmd-item {
  padding: .6rem 1.2rem;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.cmd-item:hover, .cmd-item.active {
  background: rgba(124,58,237,.15);
  color: var(--text);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── PROGRESS BAR TOP ── */
#progressBar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 999;
  width: 0%;
  transition: width .1s;
  box-shadow: 0 0 8px var(--accent);
}

/* ── RESPONSIVE ── */
html, body { overflow-x: hidden; max-width: 100vw; }

@media (max-width: 900px) {
  section { padding: 5rem 1.5rem; width: 100%; }
  #home { align-items: center; text-align: center; }
  .hero-btns { justify-content: center; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 54px; left: 0; right: 0;
    background: rgba(8,8,16,.98);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(124,58,237,.2);
    gap: 1.2rem;
    z-index: 99;
  }
  .nav-hamburger { display: block; }

  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: .7rem;
    width: 100%;
  }

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

  .contact-github { padding: 0 1rem; }
  .github-card { padding: 1.5rem; width: 100%; }
}

@media (max-width: 480px) {
  section { padding: 5rem 1rem; }
  .hero-title { font-size: clamp(2.8rem, 14vw, 4rem); }
  .hero-sub { font-size: .85rem; }
  .hero-btns { flex-direction: column; width: 100%; max-width: 260px; }
  .skills-grid { grid-template-columns: repeat(3, 1fr); gap: .6rem; }
  .skill-card { padding: .9rem .5rem; }
  .skill-card img { width: 30px; height: 30px; }
  .section-title { font-size: 1.8rem; }
  .github-card { flex-direction: column; text-align: center; }
}