.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(184, 201, 221, 0.2);
  background: rgba(8, 18, 31, 0.88);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: grid;
  gap: var(--space-3);
  align-items: center;
  padding-block: 0.9rem;
}

.brand {
  display: inline-flex;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 150ms ease-out, opacity 150ms ease-out;
}

.brand:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.brand:active {
  transform: translateY(0);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  opacity: 0.9;
  transition: color 200ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms cubic-bezier(0.4, 0, 0.2, 1), background-color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-list a.active {
  color: var(--color-accent);
  font-weight: 600;
  opacity: 1;
  background: rgba(36, 216, 164, 0.14);
}

.nav-list a:hover {
  opacity: 1;
  background: rgba(184, 201, 221, 0.12);
  text-decoration: none;
}

.nav-list a:focus-visible {
  outline: 2px solid rgba(79, 198, 171, 0.9);
  outline-offset: 2px;
  background: rgba(79, 198, 171, 0.18);
  text-decoration: none;
}

.language-control {
  display: grid;
  gap: 0.45rem;
  justify-self: start;
}

.language-label {
  font-size: 0.87rem;
  color: var(--text-muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.language-select {
  display: none;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(184, 201, 221, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(16, 36, 58, 0.8);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}

.language-select:hover {
  background: rgba(24, 46, 74, 0.95);
  border-color: rgba(184, 201, 221, 0.5);
}

.language-select:focus-visible {
  outline: 2px solid rgba(79, 198, 171, 0.9);
  outline-offset: 2px;
}

@media (max-width: 1000px) {
  .language-select {
    display: block;
  }
  .desktop-only {
    display: none;
  }
}

.mobile-only {
  display: none;
}

@media (max-width: 1000px) {
  .mobile-only {
    display: block;
  }
  .desktop-only {
    display: none;
  }
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.hero::before {
  width: 480px;
  height: 480px;
  left: -180px;
  top: -210px;
  background: radial-gradient(circle, rgba(36, 216, 164, 0.26), transparent 72%);
}

.cursor-glow {
  position: fixed;
  width: 200px;
  height: 200px;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(80, 160, 133, 0.12) 0%,
    rgba(80, 112, 160, 0.06) 40%,
    rgba(160, 140, 80, 0.03) 70%,
    transparent 100%
  );
  filter: blur(25px);
  pointer-events: none;
  opacity: 0;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1);
  mix-blend-mode: screen;
  z-index: -1;
}

.hero-grid {
  display: grid;
  gap: var(--space-5);
  align-items: center;
}

.hero-image-wrap {
  margin: 0;
  justify-self: center;
  width: min(320px, 100%);
  perspective: 900px;
}

.hero-content {
  display: grid;
  gap: var(--space-3);
}

.cta-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.section-projects .container,
.section-timeline .container,
.section-tech .container,
.section-github .container {
  display: grid;
  gap: var(--space-4);
}

.section-tech {
  position: relative;
  overflow: hidden;
}

.section-tech::before {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 147, 71, 0.1), transparent 70%);
  filter: blur(40px);
  top: 20px;
  left: -80px;
  pointer-events: none;
  z-index: 0;
}

.section-tech .container {
  position: relative;
  z-index: 1;
}

.project-grid {
  display: grid;
  gap: var(--space-3);
}

.timeline-carousel {
  display: grid;
  gap: var(--space-2);
}

.timeline-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.timeline-hint {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-hint::before {
  content: ":: ";
  color: var(--accent);
}

.timeline-controls {
  display: inline-flex;
  gap: 0.45rem;
}

.timeline-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(16, 36, 58, 0.82);
  cursor: pointer;
  transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1), border-color 200ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-nav:hover {
  border-color: rgba(184, 201, 221, 0.55);
  background: rgba(33, 70, 107, 0.9);
  box-shadow: 0 8px 18px rgba(1, 7, 14, 0.28);
}

.timeline-nav:focus-visible {
  outline: 2px solid rgba(79, 198, 171, 0.9);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .timeline-nav:hover {
    transform: translateY(-2px);
    transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1), background-color 200ms cubic-bezier(0.4, 0, 0.2, 1), border-color 200ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  .timeline-nav:focus-visible {
    transform: translateY(-2px);
  }
}

/* Timeline toolbar - above the scrollable area */
.timeline-toolbar {
  position: relative;
  z-index: 3;
  margin-bottom: 1.5rem;
}

/* Track wrapper - positioning context for fades */
.timeline-track-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.timeline-track {
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  cursor: grab;
  border-radius: var(--radius-md);
}

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

.timeline-track.is-dragging {
  cursor: grabbing;
  user-select: none;
  scroll-snap-type: none;
}

/* Edge fade overlays - scoped to track wrapper only */
.timeline-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.timeline-fade-left {
  left: 0;
  background: linear-gradient(
    to right,
    rgba(5, 13, 22, 0.95),
    rgba(5, 13, 22, 0)
  );
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.timeline-fade-right {
  right: 0;
  background: linear-gradient(
    to left,
    rgba(5, 13, 22, 0.95),
    rgba(5, 13, 22, 0)
  );
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.timeline-fade.visible {
  opacity: 1;
}

.timeline-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0.9rem 0 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  min-width: max-content;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 2.35rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(184, 201, 221, 0.08), rgba(36, 216, 164, 0.15), rgba(184, 201, 221, 0.08));
  pointer-events: none;
  z-index: -1;
}

.timeline-item {
  min-width: clamp(240px, 32vw, 300px);
  max-width: 320px;
  min-height: 300px;
  flex-shrink: 0;
  scroll-snap-align: center;
}

.timeline-item:nth-child(even) {
  transform: translateY(16px);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1200px) {
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.section-heading {
  display: grid;
  gap: var(--space-2);
  max-width: 68ch;
}

.repo-filters {
  display: grid;
  gap: var(--space-3);
}

.filter-field {
  display: grid;
  gap: 0.4rem;
}

.repo-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.site-footer {
  position: relative;
  border-top: 1px solid rgba(184, 201, 221, 0.2);
  background: rgba(5, 13, 22, 0.72);
  overflow: hidden;
}

.site-footer::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -150px;
  bottom: -180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(36, 216, 164, 0.14), transparent 70%);
  filter: blur(2px);
  pointer-events: none;
}

.site-footer .container {
  border-top: 1px solid rgba(184, 201, 221, 0.12);
}

.footer-inner {
  padding-block: var(--space-6);
  display: grid;
  gap: var(--space-3);
}

.footer-links {
  padding: 0;
  margin: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

@media (min-width: 740px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
    gap: var(--space-4);
  }

  .nav-list {
    justify-content: center;
  }

  .language-control {
    justify-self: end;
  }

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

  .project-card-hero {
    grid-column: span 2;
  }

  .repo-filters {
    grid-template-columns: repeat(2, minmax(0, 220px));
  }

  .timeline-item {
    min-width: clamp(260px, 30vw, 320px);
  }
}

@media (min-width: 920px) {
  .hero-grid {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: var(--space-6);
  }

  .hero-image-wrap {
    justify-self: stretch;
  }
}
