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

/* Light mode (default) */
:root {
  --bg-primary: #f5f1eb;
  --bg-secondary: #ebe7e0;
  --bg-tertiary: #e0dbd3;
  --text-primary: #2b2520;
  --text-secondary: #5a5248;
  --text-muted: #8a8278;
  --accent-ochre: #a8703e;
  --accent-ochre-dim: #8a5c32;
  --accent-sage: #4a6b4a;
  --accent-sage-dim: #3d5a3d;
  --border-color: #d4cfc6;
  --timeline-line: #d4cfc6;
  --timeline-dot: #a8703e;
  --nav-bg: rgba(245, 241, 235, 0.92);
  --nav-bg-solid: rgba(245, 241, 235, 0.97);
  --ease: cubic-bezier(0.25, 0, 0.2, 1);
}

/* Dark mode via user toggle */
[data-theme="dark"] {
  --bg-primary: #1e2028;
  --bg-secondary: #252830;
  --bg-tertiary: #2c2f3a;
  --text-primary: #e8e2d6;
  --text-secondary: #b8b2a6;
  --text-muted: #8a8478;
  --accent-ochre: #c4956a;
  --accent-ochre-dim: #a07a56;
  --accent-sage: #6b7c6b;
  --accent-sage-dim: #556355;
  --border-color: #3a3d48;
  --timeline-line: #3a3d48;
  --timeline-dot: #c4956a;
  --nav-bg: rgba(30, 32, 40, 0.92);
  --nav-bg-solid: rgba(30, 32, 40, 0.97);
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.nav-open {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Syne', sans-serif;
  line-height: 1.2;
}

a {
  color: var(--accent-ochre);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

a:hover {
  color: var(--text-primary);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.75rem 1.5rem;
  background: var(--accent-ochre);
  color: var(--bg-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  color: var(--bg-primary);
}

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

:focus-visible {
  outline: 2px solid var(--accent-ochre);
  outline-offset: 2px;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s ease;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 480px) {
  .nav-inner {
    padding: 0.5rem 0.75rem;
  }
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.15;
  flex-shrink: 0;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  transition: all 0.3s var(--ease);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-links a svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg-solid);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links a {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
  transform-origin: center;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

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

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .theme-toggle {
    padding: 0.6rem;
  }

  .theme-toggle svg {
    width: 22px;
    height: 22px;
  }
}

.theme-toggle .icon-moon,
.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle[data-active="dark"] .icon-sun { display: block; }
.theme-toggle[data-active="light"] .icon-moon { display: block; }

/* Main timeline container */
.timeline-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
  position: relative;
}

@media (max-width: 480px) {
  .timeline-container {
    padding: 5rem 0.75rem 2rem;
  }
}

/* The continuous timeline line */
.timeline-line {
  position: absolute;
  left: 28px;
  top: 8rem;
  bottom: 4rem;
  width: 2px;
  background: var(--timeline-line);
}

@media (max-width: 768px) {
  .timeline-line {
    left: 12px;
  }
}

@media (max-width: 480px) {
  .timeline-line {
    left: 8px;
  }
}

/* Phase section */
.phase {
  position: relative;
  padding-left: 80px;
  margin-bottom: 5rem;
  scroll-margin-top: 5rem;
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

.js .phase {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

@media (max-width: 768px) {
  .phase {
    padding-left: 45px;
    margin-bottom: 3.5rem;
  }
}

@media (max-width: 480px) {
  .phase {
    padding-left: 32px;
    margin-bottom: 2.5rem;
  }
}

/* Timeline dot */
.phase::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--timeline-dot);
  z-index: 2;
  transition: background 0.3s var(--ease);
}

.phase:hover::before {
  background: var(--timeline-dot);
}

@media (max-width: 768px) {
  .phase::before {
    left: 5px;
    width: 14px;
    height: 14px;
    top: 6px;
  }
}

@media (max-width: 480px) {
  .phase::before {
    left: 2px;
    width: 12px;
    height: 12px;
    top: 6px;
  }
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--timeline-dot); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.phase.phase-active::before {
  background: var(--timeline-dot);
  animation: dot-pulse 2s ease-in-out infinite;
}

/* Connector from dot to content */
.phase::after {
  content: '';
  position: absolute;
  left: 37px;
  top: 15px;
  width: 30px;
  height: 2px;
  background: var(--timeline-line);
}

@media (max-width: 768px) {
  .phase::after {
    left: 19px;
    top: 12px;
    width: 16px;
  }
}

@media (max-width: 480px) {
  .phase::after {
    left: 14px;
    top: 11px;
    width: 10px;
  }
}

/* Phase label */
.phase-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-ochre);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.phase-label .phase-number {
  background: var(--accent-ochre-dim);
  color: var(--bg-primary);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
}

.phase-timestamp {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  font-family: 'Space Grotesk', sans-serif;
}

@media (max-width: 480px) {
  .phase-label {
    font-size: 0.75rem;
  }

  .phase-timestamp {
    font-size: 0.75rem;
  }
}

.phase-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.phase-title--small {
  font-size: 1.3rem;
}

@media (max-width: 480px) {
  .phase-title {
    font-size: 1.3rem;
  }
}

/* Hero phase */
.hero-content {
  padding: 2rem 0;
}

.hero-name {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.75rem;
}

.hero-role {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--accent-ochre);
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.hero-tagline {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: var(--text-secondary);
  font-style: italic;
  border-left: 3px solid var(--accent-sage);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
  max-width: 550px;
}

.hero-bio {
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.hero-interests {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.hero-interests-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.hero-interest-tag {
  font-size: 0.78rem;
  color: var(--accent-sage);
  border: 1px solid var(--accent-sage-dim);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-ochre);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn-outline {
  background: transparent;
  color: var(--accent-ochre);
  border: 1.5px solid var(--accent-ochre);
}

.btn-outline:hover {
  background: var(--accent-ochre);
  color: var(--bg-primary);
}

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

@media (max-width: 768px) {
  .hero-buttons {
    flex-direction: column;
  }

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

/* Education cards */
.edu-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.3s var(--ease);
}

.edu-card:hover {
  border-color: var(--accent-ochre-dim);
}

.edu-degree {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.edu-school {
  font-size: 0.9rem;
  color: var(--accent-ochre);
  margin-bottom: 0.5rem;
}

.edu-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

@media (max-width: 480px) {
  .edu-card {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }
}

/* Experience entries */
.exp-entry {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-color);
}

.exp-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

@media (max-width: 480px) {
  .exp-entry {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
  }
}

.exp-role {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.exp-company {
  font-size: 0.95rem;
  color: var(--accent-ochre);
  margin-bottom: 0.25rem;
}

.exp-dates {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.exp-list {
  list-style: none;
  padding: 0;
}

.exp-list li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.4rem;
}

.exp-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-sage);
}

/* Skills */
.skills-category {
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2rem;
}

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

@media (max-width: 480px) {
  .skills-category {
    margin-bottom: 1.5rem;
  }
}

.skills-category-name {
  grid-column: 1 / -1;
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-ochre);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skills-category-name svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.skill-row {
  margin-bottom: 0.5rem;
}

.skill-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (max-width: 480px) {
  .skill-name {
    font-size: 0.82rem;
  }
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

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

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.5rem;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent-ochre-dim);
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .project-card {
    padding: 1rem;
  }
}

.project-type {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-sage);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.project-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  flex-grow: 1;
}

.project-grade {
  font-size: 0.8rem;
  color: var(--accent-ochre);
  margin-bottom: 0.75rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.tech-tag {
  font-size: 0.72rem;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

.project-link {
  font-size: 0.8rem;
  color: var(--accent-ochre);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.project-link svg {
  width: 14px;
  height: 14px;
}

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

.project-type-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.project-type-icon svg {
  width: 13px;
  height: 13px;
}

/* CTFs */
.ctf-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ctf-entry {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  transition: border-color 0.3s var(--ease);
}

.ctf-entry:hover {
  border-color: var(--accent-ochre-dim);
}

@media (max-width: 768px) {
  .ctf-entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .ctf-entry {
    padding: 0.75rem 1rem;
  }

  .ctf-rank {
    min-width: auto;
    padding: 0.25rem 0.5rem;
  }
}

.ctf-rank {
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bg-primary);
  background: var(--accent-ochre);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  min-width: 70px;
  text-align: center;
}

.ctf-rank.top-30 {
  background: var(--accent-ochre-dim);
}

.ctf-rank.top-100 {
  background: var(--accent-sage);
  color: var(--text-primary);
}

.ctf-info {
  flex: 1;
}

.ctf-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

.ctf-description {
  margin-top: 0.25rem;
  color: var(--text-secondary);
}

/* Certifications */
.cert-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cert-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem 1.25rem;
  text-align: center;
  text-decoration: none;
  display: block;
  color: inherit;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.cert-badge:hover {
  border-color: var(--accent-ochre-dim);
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  .cert-grid {
    flex-direction: column;
  }

  .cert-badge {
    width: 100%;
  }
}

.cert-icon {
  color: var(--accent-ochre);
  margin-bottom: 0.4rem;
}

.cert-icon svg {
  width: 22px;
  height: 22px;
}

.cert-name {
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cert-year {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Achievements */
.achievement-list {
  list-style: none;
}

.achievement-list li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  border-bottom: 1px solid var(--border-color);
}

.achievement-list li:last-child {
  border-bottom: none;
}

.achievement-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 8px;
  height: 8px;
  background: var(--accent-ochre);
  border-radius: 2px;
  transform: rotate(45deg);
}

/* Languages */
.lang-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.lang-item strong {
  color: var(--text-primary);
}

@media (max-width: 480px) {
  .lang-list {
    flex-direction: column;
    gap: 0.4rem;
  }
}

.section-intro {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 500px;
  font-size: 0.95rem;
}

/* Contact */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  transition: all 0.3s var(--ease);
}

.contact-link:hover {
  color: var(--accent-ochre);
  border-color: var(--accent-ochre-dim);
  background: var(--bg-secondary);
}

.contact-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent-ochre);
}

@media (max-width: 768px) {
  .contact-links {
    flex-direction: column;
    gap: 0.75rem;
  }

  .contact-link {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Subsection grouping */
.subsection {
  margin-top: 2.5rem;
}

.subsection:first-child {
  margin-top: 0;
}

@media (max-width: 480px) {
  .subsection {
    margin-top: 1.5rem;
  }
}

.subsection-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-sage);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 3rem 2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  max-width: 1100px;
  margin: 0 auto;
}

.footer-colophon {
  margin-bottom: 0.5rem;
}


/* Scroll to top button */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
  z-index: 90;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--accent-ochre);
  color: var(--bg-primary);
  border-color: var(--accent-ochre);
}

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

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .js .phase {
    opacity: 1;
    transform: none;
  }

  .project-card:hover,
  .cert-badge:hover {
    transform: none;
  }

  .scroll-top {
    transition: none;
  }
}

/* Print stylesheet */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #1a1a1a !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transition: none !important;
    animation: none !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.4;
  }

  .nav,
  .scroll-top,
  .theme-toggle,
  .nav-toggle {
    display: none !important;
  }

  .timeline-container {
    padding: 0;
  }

  .timeline-line {
    display: none;
  }

  .phase {
    padding-left: 0;
    margin-bottom: 1.5rem;
    opacity: 1 !important;
    transform: none !important;
    page-break-inside: avoid;
  }

  .phase::before,
  .phase::after {
    display: none;
  }

  .phase-label {
    margin-bottom: 0.25rem;
  }

  .phase-label .phase-number {
    border: 1px solid #999;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-buttons {
    display: none;
  }

  .projects-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .project-card {
    border: 1px solid #ccc;
    padding: 0.75rem;
    page-break-inside: avoid;
  }

  .project-link {
    display: none;
  }

  .edu-card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  .cert-badge {
    border: 1px solid #ccc;
  }

  .cert-grid {
    gap: 0.5rem;
  }

  .ctf-entry {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  .contact-link {
    border: 1px solid #ccc;
  }

  a[href]::after {
    content: none;
  }

  .site-footer {
    border-top: 1px solid #ccc;
    font-size: 9pt;
  }

  .btn.btn-primary {
    display: none;
  }
}
