/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-card-hover: #1c2128;
  --border: #30363d;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --text-heading: #f0f6fc;
  --accent: #3fb950;
  --accent-hover: #56d364;
  --tag-bg: #10261b;
  --tag-text: #7ee787;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --radius: 8px;
  --transition: 0.2s ease;
  --max-width: 900px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
}

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

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

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

section {
  padding: 5rem 0;
}

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

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  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-heading);
  letter-spacing: -0.5px;
}

.nav-logo span {
  color: var(--accent);
}

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

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

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

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}

/* ===== Hero ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 60px;
}

.hero-content {
  width: 100%;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 320px);
  gap: 3rem;
  align-items: center;
}

.hero-copy {
  max-width: 680px;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text);
  max-width: 540px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

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

.hero-media {
  position: relative;
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: -16px;
  background: radial-gradient(circle at top, rgba(63, 185, 80, 0.32), transparent 65%);
  filter: blur(18px);
  z-index: 0;
}

.hero-portrait {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, 320px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  justify-self: end;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #0d1117;
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background-color: var(--bg-card);
  color: var(--text-heading);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

/* ===== Section Headings ===== */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.section-heading {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.section-divider {
  width: 40px;
  height: 3px;
  background-color: var(--accent);
  margin-bottom: 2.5rem;
  border-radius: 2px;
}

/* ===== About ===== */
#about {
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1rem;
}

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

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

.skill-category h4 {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.skill-list li {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-list li::before {
  content: "▸";
  color: var(--accent);
  font-size: 0.75rem;
}

/* ===== Resume ===== */
#resume {
  border-top: 1px solid var(--border);
}

.resume-subheading {
  margin-top: 3.5rem;
}

.resume-entries {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.resume-entry {
  border-left: 2px solid var(--border);
  padding: 1.25rem 0 1.25rem 1.5rem;
  transition: border-color var(--transition);
}

.resume-entry:hover {
  border-left-color: var(--accent);
}

.resume-roles {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.resume-entry:last-child .resume-roles:only-child {
  margin-bottom: 0;
}

.resume-role-row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  align-items: baseline;
}

.resume-dates {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.resume-title {
  font-size: 0.95rem;
  color: var(--text-heading);
  line-height: 1.5;
}

.resume-body {
  padding-left: 0;
}

.resume-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

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

.resume-tech {
  font-size: 0.825rem !important;
  color: var(--text-muted);
  opacity: 0.8;
}

.resume-download {
  margin-top: 2.5rem;
}

@media (max-width: 480px) {
  .resume-role-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

/* ===== Contact ===== */
#contact {
  border-top: 1px solid var(--border);
}

.contact-content {
  max-width: 540px;
}

.contact-content p {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.contact-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== SSH Public Keys ===== */
#ssh-keys {
  border-top: 1px solid var(--border);
}

.ssh-keys {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ssh-key {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  white-space: pre;
}

/* ===== Footer ===== */
footer {
  padding: 2rem 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.footer-links {
  display: flex;
  gap: 1.5rem;
}

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

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    gap: 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-hamburger {
    display: flex;
  }

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

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

  section {
    padding: 3.5rem 0;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-media {
    order: -1;
  }

  .hero-portrait {
    width: min(100%, 280px);
    margin: 0 auto;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

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