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

/* ─── TOKENS ─── */
:root {
  --bg:        #e8e4d9;
  --bg-alt:    #dedad0;
  --surface:   #f2ede4;
  --border:    #c8c3b8;
  --text:      #1a1a1a;
  --text-muted:#6b6760;
  --accent:    #1a1a1a;
  --mono:      'IBM Plex Mono', monospace;
  --sans:      'Inter', sans-serif;
  --term-bg:   #1a1a1a;
  --term-text: #e0e0e0;
  --term-green:#4ec94e;
  --term-orange:#f0a946;
  --term-prompt:#9ca3af;
}

[data-theme="dark"] {
  --bg:        #16161a;
  --bg-alt:    #1e1e24;
  --surface:   #232329;
  --border:    #333340;
  --text:      #e8e4d9;
  --text-muted:#888880;
  --accent:    #e8e4d9;
}

/* ─── BASE ─── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}

a { color: inherit; text-decoration: none; }
code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--border);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ─── NAV ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 2rem;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}

.nav.scrolled {
  border-color: var(--border);
  background: var(--bg);
}

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

.nav-links a {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: color 0.2s;
  padding: 0.2rem;
}
.theme-toggle:hover { color: var(--text); }

.resume-btn {
  font-family: var(--mono);
  font-size: 0.8rem;
  border: 1px solid var(--text);
  padding: 0.4rem 1rem;
  border-radius: 3px;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}
.resume-btn:hover { background: var(--text); color: var(--bg); }

/* ─── HERO ─── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  gap: 4rem;
  padding: 8rem 6rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-left {
  flex: 1;
  min-width: 0;
}

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 3px;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.hero-name {
  font-family: var(--mono);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 440px;
  margin-bottom: 2rem;
  line-height: 1.8;
}

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

.btn-primary {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.65rem 1.4rem;
  border-radius: 3px;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; }

.btn-ghost {
  font-family: var(--mono);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  padding: 0.65rem 1.4rem;
  border-radius: 3px;
  color: var(--text);
  transition: background 0.2s;
}
.btn-ghost:hover { background: var(--surface); }

.hero-socials {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.hero-socials a {
  color: var(--text-muted);
  transition: color 0.2s;
}
.hero-socials a:hover { color: var(--text); }

.visitor-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
}

#visitor-count { font-weight: 600; color: var(--text); }

/* ─── TERMINAL ─── */
.hero-right { flex: 1; min-width: 0; max-width: 480px; }

.terminal {
  background: var(--term-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  background: #2a2a2e;
}

.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;
  margin-right: auto;
  color: #666;
  font-size: 0.75rem;
}

.terminal-body {
  padding: 1rem 1.2rem 1.2rem;
  line-height: 1.75;
}

.t-line { color: var(--term-text); white-space: nowrap; overflow: hidden; }
.t-prompt { color: var(--term-prompt); }
.t-cmd { color: #fff; margin-left: 0.4rem; }
.t-header { color: #888; font-size: 0.72rem; }
.t-ok { color: var(--term-green); }
.t-success { color: var(--term-green); }
.t-muted { color: #777; }

.t-cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
  color: var(--term-green);
}

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

/* ─── SECTIONS ─── */
.section {
  padding: 5rem 6rem;
  background: var(--bg);
}
.section-alt { background: var(--bg-alt); }

.section-inner {
  max-width: 960px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--text);
  margin-top: 0.4rem;
  width: 100%;
}

/* ─── ABOUT ─── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

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

.about-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.about-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-align: center;
}
.stat-num {
  display: block;
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── SKILLS ─── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.skill-group-title {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 500;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tag {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--border);
  color: var(--text);
  padding: 0.3rem 0.65rem;
  border-radius: 3px;
  transition: background 0.2s;
}
.tag:hover { background: var(--text); color: var(--bg); }

.tag-sm { font-size: 0.72rem; padding: 0.2rem 0.5rem; }

/* ─── EXPERIENCE ─── */
.exp-item {
  border-left: 2px solid var(--border);
  padding-left: 1.75rem;
  margin-bottom: 2.5rem;
  position: relative;
}

.exp-item::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--text);
  border-radius: 50%;
  position: absolute;
  left: -5px;
  top: 0.45rem;
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.exp-role {
  font-size: 1rem;
  font-weight: 600;
}
.exp-company {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.exp-date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.exp-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ─── PROJECTS ─── */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.project-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.project-card:last-child { margin-bottom: 0; }

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.project-name {
  font-size: 1rem;
  font-weight: 600;
}
.project-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }

/* ─── SHARED PILL ─── */
.link-pill {
  font-family: var(--mono);
  font-size: 0.73rem;
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}
.link-pill:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ─── BULLET LIST ─── */
.bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.bullet-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 1.2rem;
  position: relative;
}
.bullet-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text);
}

/* ─── CONTACT ─── */
.contact-inner { text-align: center; }
.contact-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}
.contact-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}
.contact-chip:hover { background: var(--text); color: var(--bg); }

/* ─── FOOTER ─── */
.footer {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-alt);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .hero, .section { padding-left: 3rem; padding-right: 3rem; }
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    padding: 7rem 1.5rem 3rem;
    gap: 2.5rem;
  }
  .hero-right { max-width: 100%; width: 100%; }
  .section { padding: 3.5rem 1.5rem; }
  .about-grid { grid-template-columns: 1fr; }
  .nav { justify-content: flex-start; padding: 0.75rem 1.5rem; }
  .nav-links { display: none; }
}

@media (max-width: 480px) {
  .hero-name { font-size: 2rem; }
  .terminal { font-size: 0.68rem; }
  .skills-grid { grid-template-columns: 1fr; }
}