/* ===== Tokens ===== */
:root{
  --bg: #10131a;
  --surface: #171b26;
  --surface-2: #1e2333;
  --border: #2a3040;
  --text: #e8e6e1;
  --muted: #8b93a7;
  --amber: #ffb454;
  --mint: #6ee7b7;
  --font-display: 'Baloo 2', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;
}

body[data-theme="light"]{
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #eeece4;
  --border: #ddd8cc;
  --text: #1c1e26;
  --muted: #666e80;
}

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

html{ scroll-behavior: smooth; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

::selection{ background: var(--amber); color: #10131a; }

:focus-visible{
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

.accent{ color: var(--amber); }

.noise{
  position: fixed; inset:0; pointer-events:none; z-index:1;
  background-image: radial-gradient(circle at 20% 20%, rgba(110,231,183,0.06), transparent 40%),
                     radial-gradient(circle at 80% 70%, rgba(255,180,84,0.07), transparent 45%);
}

/* ===== Nav ===== */
.nav{
  position: sticky; top:0; z-index: 50;
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 24px;
  background: rgba(16,19,26,0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-brand{
  display:flex; align-items:center; gap:10px;
  text-decoration:none; color:var(--text);
  font-family: var(--font-display); font-weight:700; font-size: 1.1rem;
}
.nav-avatar{
  width:32px; height:32px; border-radius:50%;
  object-fit:cover; border: 2px solid var(--amber);
}
.nav-links{ display:flex; gap: 28px; }
.nav-links a{
  color: var(--muted); text-decoration:none; font-family: var(--font-mono);
  font-size: 0.9rem; letter-spacing: 0.02em;
  position:relative; transition: color 0.2s ease;
}
.nav-links a::after{
  content:''; position:absolute; left:0; bottom:-4px; width:0; height:2px;
  background: var(--mint); transition: width 0.25s ease;
}
.nav-links a:hover{ color: var(--text); }
.nav-links a:hover::after{ width:100%; }

.theme-toggle{
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); width: 36px; height:36px; border-radius:50%;
  cursor:pointer; font-size: 1rem; margin-left: 16px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.theme-toggle:hover{ transform: rotate(20deg); border-color: var(--amber); }

.nav-toggle{
  display:none; flex-direction:column; gap:5px;
  background:none; border:none; cursor:pointer; padding: 6px;
}
.nav-toggle span{
  width:22px; height:2px; background: var(--text); border-radius:2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2){ opacity:0; }
.nav-toggle.open span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero{
  position:relative;
  min-height: 100svh;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding: 100px 24px 60px;
  overflow:hidden;
}
.hero-glow{
  position:absolute; top:-20%; left:50%; transform:translateX(-50%);
  width: 900px; height: 900px; max-width: 200vw;
  background: radial-gradient(circle, rgba(255,180,84,0.10), transparent 60%);
  pointer-events:none; z-index:0;
}
.hero-inner{
  position:relative; z-index:2;
  display:flex; gap: 48px; align-items:center; justify-content:center;
  flex-wrap: wrap; max-width: 1080px; width:100%;
}

/* Terminal */
.terminal{
  flex: 1 1 420px; max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow:hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  opacity:0; transform: translateY(16px);
  animation: rise 0.7s ease forwards 0.1s;
}
.terminal-bar{
  display:flex; align-items:center; gap:8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.dot{ width:11px; height:11px; border-radius:50%; }
.dot.red{ background:#ff5f56; }
.dot.yellow{ background:#ffbd2e; }
.dot.green{ background:#27c93f; }
.terminal-title{
  margin-left: 8px; font-family: var(--font-mono); font-size:0.78rem; color: var(--muted);
}
.terminal-body{
  padding: 20px; min-height: 220px;
  font-family: var(--font-mono); font-size: 0.88rem;
}
.terminal-body pre{
  white-space: pre-wrap; word-break: break-word;
  color: var(--text);
}
.cursor{
  color: var(--mint); animation: blink 1s step-end infinite;
}

.hero-side{
  flex: 1 1 260px; max-width: 320px;
  display:flex; flex-direction:column; align-items:center; text-align:center;
  opacity:0; transform: translateY(16px);
  animation: rise 0.7s ease forwards 0.3s;
}
.avatar-frame{
  position:relative; width: 140px; height:140px; margin-bottom: 18px;
}
.avatar-img{
  width:100%; height:100%; border-radius:50%; object-fit:cover;
  border: 3px solid var(--amber);
  box-shadow: 0 0 0 6px rgba(255,180,84,0.08);
  animation: float 4.5s ease-in-out infinite;
}
.status-dot{
  position:absolute; bottom:8px; right:8px;
  width:18px; height:18px; border-radius:50%;
  background: var(--mint); border: 3px solid var(--bg);
}
.status-dot::after{
  content:''; position:absolute; inset:0; border-radius:50%;
  background: var(--mint); opacity:0.6;
  animation: pulse 2s ease-out infinite;
}
.hero-name{
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}
.hero-tag{
  color: var(--muted); font-size: 0.95rem; margin-top: 10px; max-width: 280px;
}
.hero-badges{
  display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top: 18px;
}
.badge{
  font-family: var(--font-mono); font-size: 0.75rem;
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px; color: var(--muted);
}

.scroll-cue{
  position:absolute; bottom: 28px; left:50%; transform:translateX(-50%);
  width:24px; height:38px; border:2px solid var(--border); border-radius:14px;
  z-index:2;
}
.scroll-cue span{
  position:absolute; top:6px; left:50%; transform:translateX(-50%);
  width:4px; height:8px; background: var(--mint); border-radius:2px;
  animation: scrollDown 1.6s ease infinite;
}

/* ===== Sections ===== */
.section{
  max-width: 1080px; margin: 0 auto;
  padding: 100px 24px;
}
.eyebrow{
  font-family: var(--font-mono); color: var(--mint);
  font-size: 0.8rem; letter-spacing: 0.05em; margin-bottom: 10px;
}
.section-title{
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 36px;
}
.reveal{
  opacity:0; transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view{ opacity:1; transform: translateY(0); }

/* About */
.about-grid{
  display:flex; gap: 48px; flex-wrap:wrap;
}
.about-text{
  flex: 1 1 340px; color: var(--muted); font-size: 1.02rem;
}
.about-text strong{ color: var(--text); }
.about-list{
  flex: 1 1 260px; list-style:none;
  display:flex; flex-direction:column; gap: 14px;
}
.about-list li{
  display:flex; align-items:center; gap:10px;
  font-family: var(--font-mono); font-size: 0.92rem;
  background: var(--surface); border:1px solid var(--border);
  padding: 12px 16px; border-radius: 10px;
}

/* Stack */
.stack-grid{
  display:grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.stack-card{
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 26px 20px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.stack-card:hover{
  transform: translateY(-6px);
  border-color: var(--amber);
}
.stack-icon{ font-size: 1.8rem; margin-bottom: 10px; }
.stack-card h3{
  font-family: var(--font-display); margin-bottom: 8px; font-size: 1.05rem;
}
.stack-card p{ color: var(--muted); font-size: 0.9rem; }

/* Skills */
.skills-list{
  display:flex; flex-direction:column; gap: 22px; max-width: 560px;
}
.skill-row{ width:100%; }
.skill-label{
  display:flex; justify-content:space-between;
  font-family: var(--font-mono); font-size: 0.88rem; margin-bottom: 8px;
}
.skill-pct{ color: var(--mint); }
.skill-track{
  width:100%; height: 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); overflow:hidden;
}
.skill-fill{
  height:100%; width:0%; border-radius:999px;
  background: linear-gradient(90deg, var(--amber), var(--mint));
  transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
.skills-note{
  color: var(--muted); font-size: 0.8rem; margin-top: 20px;
}
.skills-note code{
  font-family: var(--font-mono); background: var(--surface);
  padding: 1px 6px; border-radius: 4px;
}

/* Back to top */
.back-to-top{
  position: fixed; bottom: 24px; right: 24px; z-index: 40;
  width: 44px; height: 44px; border-radius:50%;
  background: var(--amber); color: var(--bg); border:none;
  font-size: 1.1rem; cursor:pointer;
  opacity:0; pointer-events:none; transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.back-to-top.show{ opacity:1; pointer-events:auto; transform: translateY(0); }
.back-to-top:hover{ transform: translateY(-4px); }

/* Projects */
.projects-grid{
  display:grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.project-card{
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px;
  position: relative; overflow:hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.project-card:hover{ transform: translateY(-6px); border-color: var(--mint); }
.project-card.placeholder{ opacity: 0.6; border-style: dashed; }
.project-top{
  font-family: var(--font-mono); color: var(--border);
  font-size: 2.2rem; font-weight:700; position:absolute; top:8px; right:16px;
}
.project-card h3{
  font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 8px;
  position:relative; z-index:1;
}
.project-card p{
  color: var(--muted); font-size: 0.88rem; margin-bottom: 14px;
  position:relative; z-index:1;
}
.project-card code{
  font-family: var(--font-mono); background: var(--surface-2);
  padding: 1px 6px; border-radius: 4px; font-size: 0.82rem;
}
.project-tags{ display:flex; gap:8px; flex-wrap:wrap; }
.project-tags span{
  font-family: var(--font-mono); font-size: 0.72rem;
  background: var(--surface-2); color: var(--mint);
  padding: 4px 10px; border-radius: 999px;
}

/* Contact */
.contact-section{ text-align:center; }
.contact-text{ color: var(--muted); margin-bottom: 24px; }
.contact-links{ display:flex; justify-content:center; gap: 14px; }
.contact-btn{
  font-family: var(--font-mono); text-decoration:none;
  color: var(--bg); background: var(--amber);
  padding: 12px 26px; border-radius: 999px; font-weight:600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display:inline-block;
}
.contact-btn:hover{
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(255,180,84,0.25);
}
.contact-note{
  margin-top: 22px; color: var(--muted); font-size: 0.8rem;
  max-width: 480px; margin-left:auto; margin-right:auto;
}

.footer{
  text-align:center; padding: 32px 24px 48px;
  color: var(--muted); font-family: var(--font-mono); font-size: 0.78rem;
  border-top: 1px solid var(--border);
}

/* ===== Animations ===== */
@keyframes rise{ to{ opacity:1; transform:translateY(0); } }
@keyframes blink{ 50%{ opacity:0; } }
@keyframes float{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-8px); }
}
@keyframes pulse{
  0%{ transform: scale(1); opacity:0.6; }
  100%{ transform: scale(2); opacity:0; }
}
@keyframes scrollDown{
  0%{ opacity:0; transform: translate(-50%,0); }
  30%{ opacity:1; }
  100%{ opacity:0; transform: translate(-50%,14px); }
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ===== Responsive ===== */
@media (max-width: 780px){
  .stack-grid, .projects-grid{ grid-template-columns: 1fr; }
  .hero-inner{ flex-direction: column-reverse; }
}

@media (max-width: 640px){
  .nav-links{
    position: fixed; top: 62px; right: 0;
    flex-direction: column; gap:0;
    background: var(--surface); border-left:1px solid var(--border); border-bottom:1px solid var(--border);
    width: 200px; border-radius: 0 0 0 14px; overflow:hidden;
    transform: translateX(100%); transition: transform 0.3s ease;
  }
  .nav-links.open{ transform: translateX(0); }
  .nav-links a{ padding: 14px 20px; border-bottom: 1px solid var(--border); }
  .nav-toggle{ display:flex; }
  .hero{ padding-top: 90px; }
  .section{ padding: 70px 20px; }
  }
