/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:             #0d1117;
  --bg-alt:         #161b22;
  --border:         #30363d;
  --accent:         #58a6ff;
  --accent-dim:     #1f6feb;
  --text:           #e6edf3;
  --muted:          #8b949e;
  --card-bg:        #161b22;
  --card-hover:     #1c2128;
  --nav-scrolled-bg:rgba(13,17,23,.85);
  --tag-bg:         rgba(88,166,255,.1);
  --tag-border:     rgba(88,166,255,.25);
  --tag-bg-hover:   rgba(88,166,255,.2);

  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;

  --nav-h: 64px;
  --section-gap: 6rem;
  --container-w: 1100px;
  --narrow-w: 720px;
}

/* ─── LIGHT THEME ────────────────────────────────────────── */
[data-theme="light"] {
  --bg:             #ffffff;
  --bg-alt:         #f6f8fa;
  --border:         #d0d7de;
  --accent:         #0969da;
  --accent-dim:     #0550ae;
  --text:           #1f2328;
  --muted:          #57606a;
  --card-bg:        #ffffff;
  --card-hover:     #f6f8fa;
  --nav-scrolled-bg:rgba(255,255,255,.90);
  --tag-bg:         rgba(9,105,218,.08);
  --tag-border:     rgba(9,105,218,.25);
  --tag-bg-hover:   rgba(9,105,218,.15);
}

/* ─── THEME TRANSITION ───────────────────────────────────── */
body, .nav, .project-card, .timeline-card, .contact-card, .tag {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── NAV ────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.nav.scrolled {
  background: var(--nav-scrolled-bg);
  backdrop-filter: blur(12px);
  border-color: var(--border);
}
.nav-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
}
.nav-links {
  display: flex;
  gap: 2rem;
}
.nav-links a {
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 3rem) 1.5rem 4rem;
  max-width: var(--container-w);
  margin: 0 auto;
  position: relative;
}
.hero-inner {
  display: flex;
  align-items: center;
  gap: 4rem;
}
.hero-avatar {
  flex-shrink: 0;
  position: relative;
}
.hero-avatar img,
.avatar-fallback {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid var(--border);
  flex-shrink: 0;
}
.hero-avatar img {
  object-fit: cover;
  display: block;
}
.avatar-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 500;
  color: var(--accent);
}

.hero-greeting {
  font-size: 1rem;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 0.5rem;
}
.hero-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.hero-title {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--muted);
  min-height: 1.6em;
  margin-bottom: 1.25rem;
}
.type-cursor::after {
  content: '|';
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }

.hero-bio {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 2rem;
}
.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #0d1117;
}
.btn-primary:hover { background: #79c0ff; transform: translateY(-1px); }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* ─── SCROLL HINT ────────────────────────────────────────── */
.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: fadeInUp 1.5s ease 1s both;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scrollDrop 1.5s ease-in-out infinite;
}
@keyframes scrollDrop {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ─── ACCENT ─────────────────────────────────────────────── */
.accent { color: var(--accent); }

/* ─── SECTIONS ───────────────────────────────────────────── */
.section { padding: var(--section-gap) 1.5rem; }
.section-alt { background: var(--bg-alt); }
.container { max-width: var(--container-w); margin: 0 auto; }
.container-narrow { max-width: var(--narrow-w); margin: 0 auto; text-align: center; }

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.section-sub {
  color: var(--muted);
  margin-bottom: 3rem;
}

/* ─── TAGS ───────────────────────────────────────────────── */
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  background: var(--tag-bg);
  color: var(--accent);
  border: 1px solid var(--tag-border);
  border-radius: 20px;
  padding: 0.3rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  transition: background 0.2s, border-color 0.2s;
}
.tag:hover { background: var(--tag-bg-hover); }
.tag-sm { padding: 0.2rem 0.65rem; font-size: 0.78rem; }

/* ─── SKILLS ─────────────────────────────────────────────── */
.skills-core {
  gap: 0.75rem;
}
.skills-core .tag {
  font-size: 0.9rem;
  padding: 0.45rem 1.1rem;
}

/* ─── PROJECTS ───────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.project-card-featured {
  grid-column: 1 / -1;
  flex-direction: row;
  padding: 0;
  overflow: hidden;
}
.project-featured-banner {
  flex: 0 0 55%;
  overflow: hidden;
}
.project-featured-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.project-card-featured:hover .project-featured-banner img {
  transform: scale(1.03);
}
.project-featured-body {
  flex: 1;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 680px) {
  .project-card-featured { flex-direction: column; }
  .project-featured-banner { flex: none; height: 180px; }
}
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-dim);
  box-shadow: 0 8px 30px rgba(88,166,255,.08);
}
.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.project-icon {
  width: 36px;
  height: 36px;
  color: var(--accent);
}
.project-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}
.project-links {
  display: flex;
  gap: 0.75rem;
}
.icon-link {
  color: var(--muted);
  transition: color 0.2s;
}
.icon-link svg { width: 20px; height: 20px; }
.icon-link:hover { color: var(--accent); }

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.project-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.25rem;
}
.project-tags { margin-top: auto; }

/* ─── TIMELINE ───────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-dim), transparent);
}
.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -2.45rem;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px rgba(88,166,255,.2);
}
.timeline-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s;
}
.timeline-card:hover { border-color: var(--accent-dim); }
.timeline-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}
.timeline-date, .timeline-location {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
}
.timeline-location { color: var(--muted); }
.timeline-role {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.timeline-company {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.timeline-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.timeline-bullets li {
  font-size: 0.9rem;
  color: var(--muted);
  padding-left: 1.1rem;
  position: relative;
}
.timeline-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ─── CONTACT ────────────────────────────────────────────── */
.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-size: 0.9rem;
  transition: all 0.2s;
}
.contact-card svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--accent); }
.contact-card:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
}

/* ─── AVAILABLE BADGE ────────────────────────────────────── */
.available-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-family: var(--mono);
  font-weight: 500;
  color: #3fb950;
  background: rgba(63,185,80,.1);
  border: 1px solid rgba(63,185,80,.3);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  vertical-align: middle;
  margin-left: 0.5rem;
  letter-spacing: 0.03em;
}
.available-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fb950;
  box-shadow: 0 0 0 0 rgba(63,185,80,.4);
  animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
  0%   { box-shadow: 0 0 0 0 rgba(63,185,80,.4); }
  70%  { box-shadow: 0 0 0 6px rgba(63,185,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(63,185,80,0); }
}

/* ─── STATS STRIP ────────────────────────────────────────── */
.stats-strip {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 3rem;
}
.stat-num {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-label {
  font-size: 0.78rem;
  font-family: var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ─── SERVICES ───────────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.service-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.service-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(88,166,255,.07);
}
.service-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
}
.service-icon svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.service-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.service-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.service-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.service-list li {
  font-size: 0.82rem;
  color: var(--muted);
  padding-left: 1rem;
  position: relative;
}
.service-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 2px;
}
.services-cta {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.services-cta p {
  color: var(--muted);
  font-size: 1rem;
}

/* ─── TESTIMONIALS ───────────────────────────────────────── */
/* ─── PROCESS ────────────────────────────────────────────── */
.process-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.process-step {
  display: flex;
  gap: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}
.process-step:hover {
  border-color: var(--accent-dim);
  transform: translateY(-3px);
}
.process-num {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.25;
  line-height: 1;
  flex-shrink: 0;
  min-width: 2.5rem;
}
.process-body { display: flex; flex-direction: column; gap: 0.5rem; }
.process-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.process-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.75;
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
    gap: 1.25rem;
  }
  .nav-toggle { display: flex; }
  .theme-toggle { width: 32px; height: 32px; }

  .hero-inner { flex-direction: column; text-align: center; gap: 2rem; }
  .hero-bio { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .hero-scroll-hint { display: none; }

  .timeline { padding-left: 1.25rem; }
  .timeline-dot { left: -1.7rem; }

  .contact-links { grid-template-columns: 1fr; }

  .stats-inner { grid-template-columns: 1fr 1fr; gap: 0; }
  .stat-divider { display: none; }
  .stat { padding: 1.25rem 0.5rem; border-bottom: 1px solid var(--border); }
  .stat:nth-child(odd) { border-right: 1px solid var(--border); }

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

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