/* Pro dev: terminal/IDE inspired, sharp hierarchy, minimal chrome */

:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #0d1117;
  --bg-tertiary: #151b23;
  --bg-card: #0d1117;
  --bg-card-hover: #161b22;
  --accent: #39bae6;
  --accent-dim: rgba(57, 186, 230, 0.12);
  --accent-green: #7fd962;
  --text-primary: #e6e1cf;
  --text-secondary: #8b949e;
  --text-muted: #5c6370;
  --border: #1e2329;
  --border-focus: #39bae6;
  --radius: 4px;
  --transition: 0.15s ease;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.5s;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
}

[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #f0f0f0;
  --bg-tertiary: #e8e8e8;
  --bg-card: #ffffff;
  --bg-card-hover: #f6f6f6;
  --accent: #0984e3;
  --accent-dim: rgba(9, 132, 227, 0.08);
  --accent-green: #00b894;
  --text-primary: #1e1e1e;
  --text-secondary: #4a4a4a;
  --text-muted: #7a7a7a;
  --border: #e0e0e0;
  --border-focus: #0984e3;
}

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

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  font-family: var(--font-sans);
  line-height: 1.65;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color var(--transition), color var(--transition);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(57, 186, 230, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 186, 230, 0.02) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 32px);
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Navbar */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(8px);
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.nav-brand {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  transition: color var(--transition);
}

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

.nav-menu {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-menu li a {
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  border-radius: var(--radius);
  transition: var(--transition);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.nav-menu li a:hover {
  color: var(--text-primary);
}

.nav-menu li a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
}

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

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.hamburger-line {
  width: 18px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: var(--transition);
}

.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(3px, 3px);
}

.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(3px, -3px);
}

body.nav-open {
  overflow: hidden;
}

/* Header / About — terminal-style */
.header {
  padding: clamp(100px, 18vw, 140px) 0 clamp(72px, 12vw, 96px);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.header .container {
  text-align: left;
}

.header .prompt {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.header .prompt::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 2px;
  background: var(--accent-green);
  animation: cursorBlink 1s step-end infinite;
  vertical-align: -0.15em;
}

.header .prompt span {
  color: var(--accent-green);
}

.header h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.header .lead {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
}

.header .about-text {
  max-width: 540px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-mono);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.social-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Sections — // label style */
section {
  padding: clamp(56px, 10vw, 80px) 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

section h2 {
  font-size: clamp(1.5rem, 3.5vw, 1.85rem);
  font-weight: 600;
  margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

section h2::after {
  display: none;
}

/* Experience */
.experience {
  background: var(--bg-secondary);
}

.experience .timeline {
  position: relative;
  padding-left: 0;
}

.experience .timeline::after {
  display: none;
}

.timeline-item {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  max-width: 100%;
  transition: var(--transition);
}

.timeline-item:hover {
  border-left-color: var(--accent-green);
  background: var(--bg-card-hover);
}

.timeline-item:nth-child(odd),
.timeline-item:nth-child(even) {
  margin-left: 0;
  margin-right: 0;
}

.timeline-item::after {
  display: none;
}

.timeline-item h3 {
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.timeline-item .company-line {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.timeline-item .company-line strong {
  color: var(--accent);
  font-weight: 500;
}

.timeline-item .date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.timeline-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.timeline-item ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-item ul li {
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

.timeline-item ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
}

/* Education */
.education {
  background: var(--bg-secondary);
  text-align: left;
}

.education h3 {
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

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

/* Projects */
.projects {
  background: var(--bg-primary);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
  max-width: 100%;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: var(--transition);
}

.project-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.project-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.55;
}

.github-link {
  color: var(--text-muted);
  font-size: 1rem;
  transition: var(--transition);
}

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

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 2px;
  border: 1px solid var(--border);
}

/* Resume */
.resume {
  background: var(--bg-secondary);
  text-align: left;
}

.resume-content {
  max-width: 520px;
}

.resume-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.resume-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  border-radius: var(--radius);
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid transparent;
}

.view-btn {
  background: var(--accent);
  color: #0a0e14;
  border-color: var(--accent);
}

.view-btn:hover {
  filter: brightness(1.15);
}

.download-btn {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.download-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Skills */
.skills {
  background: var(--bg-primary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 1rem;
  max-width: 100%;
}

.skills-grid div {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: left;
  transition: var(--transition);
}

.skills-grid div:hover {
  border-color: var(--accent);
}

.skills-grid h4 {
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skills-grid p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Achievements */
.achievements {
  background: var(--bg-secondary);
  padding: clamp(56px, 10vw, 80px) 0;
}

.achievements ul {
  list-style: none;
  padding: 0;
  max-width: 100%;
}

.achievements ul li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
  transition: var(--transition);
}

.achievements ul li:last-child {
  margin-bottom: 0;
}

.achievements ul li:hover {
  border-color: var(--border-focus);
}

.achievement-link {
  display: inline-block;
  margin-top: 0.4rem;
  color: var(--accent);
  font-weight: 500;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  text-decoration: none;
  transition: color var(--transition);
}

.achievement-link:hover {
  color: var(--accent-green);
}

/* Responsive */
@media (max-width: 1024px) {
  .timeline-item {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-primary);
    flex-direction: column;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 0.25rem;
    z-index: 999;
  }

  .nav-menu.mobile-open {
    display: flex;
  }

  .nav-menu li a {
    padding: 0.85rem 1.25rem;
    font-size: 0.9rem;
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .nav-menu li a.active {
    border-left-color: var(--accent);
  }

  .mobile-toggle {
    display: flex;
    order: 2;
  }

  .theme-toggle {
    order: 2;
  }

  .header .container {
    text-align: center;
  }

  .header .about-text {
    margin-left: auto;
    margin-right: auto;
  }

  .social-links {
    justify-content: center;
  }

  .timeline-item {
    margin-left: 0;
  }

  .education {
    text-align: center;
  }

  .resume {
    text-align: center;
  }

  .resume-content {
    margin-left: auto;
    margin-right: auto;
  }

  .resume-buttons {
    justify-content: center;
  }

  .skills-grid div {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .header {
    min-height: auto;
    padding: 90px 0 56px;
  }

  .social-links {
    flex-direction: column;
    align-items: stretch;
  }

  .social-links a {
    justify-content: center;
  }

  .resume-buttons {
    flex-direction: column;
  }

  .resume-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (hover: none) and (pointer: coarse) {
  .project-card:hover,
  .skills-grid div:hover,
  .timeline-item:hover {
    transform: none;
  }
}

/* Scroll-triggered animations */
.animate {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--duration) var(--ease-out),
    transform var(--duration) var(--ease-out);
}

.animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* delay applied via JS from data-animate-delay */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.05ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .animate {
    opacity: 1;
    transform: none;
  }
  .header .prompt::after {
    animation: none;
  }
}
