/* ========================================
   Variables & Reset
   ======================================== */

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-card-hover: #1c2330;
  --accent: #3fb950;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --border: #30363d;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 900px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

/* ========================================
   Layout
   ======================================== */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section--alt {
  background: var(--bg-card);
}

.section__title {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

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

/* ========================================
   Navigation
   ======================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav__logo {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav__logo:hover {
  opacity: 1;
  color: var(--accent);
}

.nav__logo-icon {
  flex-shrink: 0;
}

.nav__logo-text {
  display: inline;
  line-height: 1;
}

.nav__dot {
  color: var(--accent);
  font-size: 2rem;
  font-weight: 500;
  line-height: 0;
  position: relative;
  top: 0.05em;
  left: -0.05em;
}

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

.nav__links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav__links a:hover {
  color: var(--text);
  opacity: 1;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ========================================
   Hero
   ======================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 0 4rem;
}

.terminal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-width: 620px;
}

.terminal__header {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}

.terminal__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal__dot--red { background: #ff5f56; }
.terminal__dot--yellow { background: #ffbd2e; }
.terminal__dot--green { background: #27c93f; }

.terminal__body {
  padding: 1.5rem;
  font-family: var(--font-mono);
}

.terminal__line {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.terminal__line--location {
  margin-top: 0.5rem;
}

.terminal__prompt {
  color: var(--accent);
  margin-right: 0.5rem;
}

.terminal__command {
  color: var(--text);
}

.terminal__output {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.terminal__output h1,
h1.terminal__output {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Typing animation */
.typing {
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: type 0.8s steps(20, end) 0.5s forwards;
}

.typing--delay {
  animation: type 1s steps(35, end) 1.8s forwards;
}

.typing--delay-2 {
  animation: type 0.6s steps(15, end) 3.2s forwards;
}

h1.typing {
  border-right: 2px solid var(--accent);
  animation:
    type 0.8s steps(20, end) 0.5s forwards,
    blink-caret 0.6s step-end 0.5s 3;
}

@keyframes type {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--accent); }
}

/* Hero links */
.hero__links {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.hero__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.2s, border-color 0.2s;
}

.hero__link:hover {
  color: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}

.hero__link svg {
  flex-shrink: 0;
}

/* ========================================
   About
   ======================================== */

.about__content p {
  max-width: 640px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.about__content p:last-child {
  margin-bottom: 0;
}

/* ========================================
   Skills
   ======================================== */

.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.skills__heading {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

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

.tag {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.825rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ========================================
   Experience / Timeline
   ======================================== */

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline__item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__marker {
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.timeline__role {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.25rem 0;
}

.timeline__company {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.timeline__desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 560px;
}

/* ========================================
   Projects
   ======================================== */

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.projects__loading {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project-card__name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-card__name svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.project-card__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 1rem;
}

.project-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.project-card__lang {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.project-card__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.project-card__stars {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.projects__error {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

/* ========================================
   Footer / Contact
   ======================================== */

.footer {
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border);
}

.footer__text {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.footer__link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.footer__copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 640px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(13, 17, 23, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 0.75rem;
  }

  .nav__links.active {
    display: flex;
  }

  .nav__toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
  }

  .nav__toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav__toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
  }

  .hero {
    min-height: auto;
    padding: 5rem 0 3rem;
  }

  h1.terminal__output {
    font-size: 1.25rem;
  }

  .section {
    padding: 3.5rem 0;
  }

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

  .hero__links {
    flex-direction: column;
  }

  .hero__link {
    justify-content: center;
  }
}
