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

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.3s ease;
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1100px;
}

[data-theme="dark"] {
  --bg: #0a0a0f;
  --bg-alt: #111118;
  --bg-card: #16161d;
  --bg-card-hover: #1c1c25;
  --text: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --border: #27272a;
  --border-hover: #3f3f46;
  --tag-bg: rgba(99, 102, 241, 0.1);
  --tag-text: #a5b4fc;
  --nav-bg: rgba(10, 10, 15, 0.85);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-alt: #f4f4f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f9f9fb;
  --text: #18181b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --accent: #4f46e5;
  --accent-hover: #6366f1;
  --accent-glow: rgba(79, 70, 229, 0.1);
  --border: #e4e4e7;
  --border-hover: #d4d4d8;
  --tag-bg: rgba(79, 70, 229, 0.08);
  --tag-text: #4f46e5;
  --nav-bg: rgba(250, 250, 250, 0.85);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

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

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* NAV */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

.nav__container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.5px;
}

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

.nav__links {
  display: flex;
  gap: 32px;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

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

.nav__link:hover::after {
  width: 100%;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

[data-theme="dark"] .theme-toggle__icon--moon { display: none; }
[data-theme="light"] .theme-toggle__icon--sun { display: none; }

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

.nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: all var(--transition);
}

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

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

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

/* HERO */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 64px;
}

.hero__content {
  max-width: 680px;
}

.hero__greeting {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero__name {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.hero__title {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.hero__subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero__cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}

.hero__scroll a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.hero__scroll a:hover {
  color: var(--accent);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-8px); }
  60% { transform: translateX(-50%) translateY(-4px); }
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

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

/* SECTIONS */
.section {
  padding: 100px 0;
}

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

.section__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 48px;
  letter-spacing: -0.5px;
  position: relative;
  display: inline-block;
}

.section__title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ABOUT */
.about__text {
  max-width: 700px;
}

.about__text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1rem;
  line-height: 1.7;
}

.about__text strong {
  color: var(--text);
  font-weight: 600;
}

.about__details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.about__detail-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 4px;
}

.about__detail-value {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* SKILLS */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition);
}

.skill-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.skill-card__icon {
  color: var(--accent);
  margin-bottom: 16px;
}

.skill-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.skill-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* TAGS */
.tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 500;
}

.tag--sm {
  padding: 2px 8px;
  font-size: 0.72rem;
}

/* PROJECTS */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
}

.project-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.project-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

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

.project-card__links {
  display: flex;
  gap: 12px;
}

.project-card__links a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.project-card__links a:hover {
  color: var(--accent);
}

.project-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-card__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 20px;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* TIMELINE */
.timeline {
  position: relative;
  padding-left: 32px;
}

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

.timeline__item {
  position: relative;
  padding-bottom: 40px;
}

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

.timeline__marker {
  position: absolute;
  left: -32px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--bg);
  z-index: 1;
  transition: background var(--transition);
}

[data-theme="light"] .timeline__marker {
  background: var(--bg-alt);
}

.timeline__item:first-child .timeline__marker {
  background: var(--accent);
}

.timeline__content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}

.timeline__content:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.timeline__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline__company {
  font-size: 1.1rem;
  font-weight: 600;
}

.timeline__role {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline__list {
  margin-bottom: 16px;
}

.timeline__list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.timeline__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* CONTACT */
.contact__content {
  max-width: 560px;
  text-align: center;
  margin: 0 auto;
}

.contact__text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.contact__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.contact__link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.contact__link svg {
  flex-shrink: 0;
}

.contact__btn {
  padding: 14px 48px;
  font-size: 1rem;
}

/* FOOTER */
.footer {
  padding: 32px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

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

/* ANIMATIONS */
.animate-fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s ease forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav__links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
  }

  .nav__links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav__hamburger {
    display: flex;
  }

  .skills__grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .section {
    padding: 72px 0;
  }

  .hero__cta {
    flex-direction: column;
  }

  .hero__cta .btn {
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .skills__grid {
    grid-template-columns: 1fr;
  }

  .timeline {
    padding-left: 24px;
  }

  .timeline__marker {
    left: -24px;
    width: 12px;
    height: 12px;
  }

  .timeline::before {
    left: 5px;
  }

  .timeline__header {
    flex-direction: column;
  }
}
