/* ===== Variables ===== */
:root {
  --bg: #141414;
  --text: #d4d4d4;
  --text-bright: #f5f5f5;
  --text-muted: #a3a3a3;
  --text-dim: #737373;
  --text-faint: #525252;
  --accent: #e5e5e5;
  --accent-glow: rgba(229, 229, 229, 0.1);
  --border: #262626;
  --surface: rgba(38, 38, 38, 0.5);
  --amber: #f59e0b;
  --selection: rgba(229, 229, 229, 0.15);
}

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

::selection {
  background: var(--selection);
  color: var(--text-bright);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== Scroll progress ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  background: var(--text-dim);
  z-index: 200;
  width: 0%;
}

/* ===== Main container ===== */
.main {
  position: relative;
  z-index: 3;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Section base ===== */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-faint);
  margin-bottom: 40px;
  font-weight: 400;
}

/* ===== Tags (shared) ===== */
.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(229, 229, 229, 0.04);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(229, 229, 229, 0.08);
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== Show more button ===== */
.show-more-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 0;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.show-more-btn:hover {
  color: var(--text-bright);
}

.collapsible-hidden {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.collapsible-hidden.expanded {
  max-height: 2000px;
}

.cert-grid.collapsible-hidden {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cert-grid.collapsible-hidden:not(.expanded) {
  max-height: 0;
}

/* ===== Top Navigation ===== */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(20, 20, 20, 0.8);
  border-bottom: 1px solid var(--border);
}

.topnav-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topnav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-bright);
  letter-spacing: -0.5px;
}

.topnav-links {
  display: flex;
  gap: 28px;
}

.topnav-link {
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.topnav-link:hover {
  color: var(--text);
}

.topnav-link.active {
  color: var(--text-bright);
}

.topnav-link:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Hamburger — hidden on desktop */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}

/* Mobile menu overlay — hidden by default */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

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

.mobile-menu-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}

.mobile-menu-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.mobile-menu-link:hover {
  color: var(--text-bright);
}

.mobile-menu-link:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 4px;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 0 80px;
}

.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  font-weight: 400;
}

.hero-name {
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -3px;
  line-height: 1.0;
  color: var(--text-bright);
  margin-bottom: 20px;
}

.hero-typed {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  color: var(--text-muted);
  min-height: 24px;
  margin-bottom: 28px;
}

.typed-cursor {
  display: inline-block;
  width: 2px;
  height: 18px;
  background: var(--text-muted);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

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

.hero-bio {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 520px;
  font-weight: 300;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 40px;
}

.cta-primary {
  background: var(--text-bright);
  color: var(--bg);
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
  text-decoration: none;
  border: none;
}

.cta-primary:hover {
  opacity: 0.85;
}

.cta-primary:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 4px;
}

.cta-secondary {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.cta-secondary:hover {
  color: var(--text-bright);
  border-color: var(--text-dim);
}

.cta-secondary:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 4px;
}

.hero-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

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

/* ===== Terminal ===== */
.terminal {
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(26, 26, 26, 0.6);
  border-bottom: 1px solid var(--border);
}

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

.terminal-dot--red { background: #f87171; }
.terminal-dot--yellow { background: #fbbf24; }
.terminal-dot--green { background: #34d399; }

.terminal-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 8px;
}

.terminal-body {
  padding: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 2.1;
}

.terminal-gap {
  height: 8px;
}

.prompt { color: var(--text-bright); }
.cmd { color: var(--text); }
.output { color: var(--text-muted); }

.t-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--text-muted);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

/* ===== Services ===== */
.services-carousel {
  position: relative;
}

.services-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}

.services-track::-webkit-scrollbar {
  display: none;
}

.services-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  padding: 0 0 3px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
}

.services-arrow--prev { left: -8px; }
.services-arrow--next { right: -8px; }

.services-carousel:hover .services-arrow,
.services-arrow:focus-visible {
  opacity: 1;
}

.services-arrow:hover {
  background: rgba(38, 38, 38, 1);
  border-color: var(--text-dim);
  color: var(--text-bright);
}

.services-arrow:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 2px;
}

.service-card {
  flex: 0 0 calc((100% - 32px) / 3);
  scroll-snap-align: start;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(26, 26, 26, 0.4);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.service-card:hover {
  border-color: rgba(229, 229, 229, 0.12);
  transform: translateY(-2px);
}

.service-icon {
  margin-bottom: 16px;
}

.service-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.5;
}

.service-card:hover .service-icon svg {
  stroke: var(--text-bright);
}

.service-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.service-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.65;
  font-weight: 300;
}

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

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

.timeline-item {
  position: relative;
  padding: 20px 24px;
  margin-bottom: 8px;
  border-radius: 10px;
  transition: background 0.3s ease, border-color 0.3s ease;
  border: 1px solid transparent;
  cursor: default;
}

.timeline-item:hover {
  background: var(--surface);
  border-color: rgba(229, 229, 229, 0.04);
}

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 28px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text-faint);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.timeline-item:hover .timeline-dot {
  border-color: var(--text-muted);
  box-shadow: 0 0 8px rgba(229, 229, 229, 0.1);
}

.exp-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 300;
}

.exp-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
  letter-spacing: -0.3px;
  transition: color 0.2s;
}

.timeline-item:hover .exp-title {
  color: var(--text-bright);
}

.exp-company {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.exp-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.65;
  margin-top: 10px;
  font-weight: 300;
}

/* ===== Certifications ===== */
.cert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cert-card {
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(26, 26, 26, 0.4);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.cert-status {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  background: rgba(229, 229, 229, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.4;
}

.cert-card:has(.cert-status) .cert-details {
  padding-right: 64px;
}

.cert-card:hover {
  transform: translateY(-2px);
  border-color: rgba(229, 229, 229, 0.1);
}

.cert-inner {
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.cert-logo {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}

.cert-logo img {
  width: 28px;
  height: 28px;
}

.cert-details {
  flex: 1;
}

.cert-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: 1.35;
}

.cert-issuer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.skills-group {
  margin-bottom: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(26, 26, 26, 0.3);
}

.skills-group-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-weight: 400;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
  background: rgba(38, 38, 38, 0.6);
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  cursor: default;
}

.skill-tag:hover {
  border-color: rgba(229, 229, 229, 0.12);
  background: rgba(229, 229, 229, 0.04);
  transform: translateY(-1px);
}

.skill-tag--alt {
  background: transparent;
  border-style: dashed;
  border-color: rgba(229, 229, 229, 0.18);
  color: var(--text-bright);
}

.skill-tag--alt:hover {
  background: rgba(229, 229, 229, 0.04);
  border-color: rgba(229, 229, 229, 0.32);
}

/* ===== Contact ===== */
.contact-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 28px;
  font-weight: 300;
  max-width: 480px;
}

.contact-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.contact-link:hover {
  color: var(--text-bright);
  border-color: var(--text-dim);
  background: rgba(229, 229, 229, 0.03);
  transform: translateY(-1px);
}

.contact-link:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 4px;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
}

/* ===== Responsive — Mobile ===== */
@media (max-width: 640px) {
  .main {
    padding: 0 16px;
  }

  .hero {
    padding: 100px 0 60px;
  }

  .hero-name {
    font-size: 40px;
    letter-spacing: -1.5px;
  }

  .hero-typed {
    font-size: 13px;
  }

  .hero-bio {
    font-size: 14px;
  }

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

  .section {
    padding: 60px 0;
  }

  .topnav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .cert-grid,
  .cert-grid.collapsible-hidden {
    grid-template-columns: 1fr;
  }

  .timeline {
    padding-left: 24px;
  }

  .timeline-dot {
    left: -20px;
  }

  .timeline-item {
    padding: 16px;
  }

  .contact-links {
    flex-direction: column;
  }

  .contact-link {
    justify-content: center;
  }

  .terminal-body {
    padding: 16px;
    font-size: 11px;
  }

  .service-card {
    flex: 0 0 88%;
  }

  .services-track {
    padding-right: 12%;
    scroll-padding-left: 0;
  }

  .services-arrow {
    display: none;
  }

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

/* ===== Focus indicators ===== */
.show-more-btn:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 4px;
  border-radius: 2px;
}

.mobile-menu-close:focus-visible,
.hamburger:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 4px;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .status-dot {
    animation: none;
  }

  .t-cursor,
  .typed-cursor {
    animation: none;
    opacity: 1;
  }

  .timeline-item,
  .cert-card,
  .skill-tag,
  .contact-link,
  .cta-primary,
  .service-card {
    transition: none;
  }

  .hero-name {
    opacity: 1;
  }
}
