:root {
  /* Design tokens */
  --primary-color: #333;
  --accent-color: #0077cc;
  --bg-light: #f9f9f9;
  --font-body: 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --font-heading: 'Open Sans', sans-serif;
  --radius: 8px;
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
}

/* ============ Global Reset ============ */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-body); }
body {
  background-color: #fff;
  color: #252424;
  line-height: 1.6;
}

/* Optional shared container */
.container { max-width: 900px; margin: 0 auto; padding: 0 var(--spacing-sm); }

/* ============ Slick Header (pill nav) ============ */
/* Use these if your HTML header uses: .site-header > .header-inner > .site-nav .nav-pill */
.site-header {
  background: linear-gradient(90deg, #4a148c, #0077cc);
  padding: 10px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.header-inner {
  max-width: 1100px;   /* a bit wider so the pill has breathing room */
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: opacity 0.2s ease;
}
.brand:hover { opacity: 0.85; }

.site-nav .nav-pill {
  list-style: none;
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 18px);
  padding: 8px 12px;
  margin: 0;
  border-radius: 9999px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(4px);
}
.site-nav .nav-pill a {
  color: #fff;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 9999px;
  transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease;
}
.site-nav .nav-pill a:hover { background: rgba(255,255,255,0.22); transform: translateY(-1px); }
.site-nav .nav-pill a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.site-nav .nav-pill a.active {
  background: #fff;
  color: #4a148c;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12) inset, 0 3px 10px rgba(0,0,0,0.12);
}

/* Optional page title (if you move <h1> out of header) */
.page-title {
  text-align: center;
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.5vw, 2.25rem);
  margin: var(--spacing-md) 0 var(--spacing-sm);
  color: #222;
}

/* ============ Banner ============ */
section.banner {
  width: 100%;
  margin-bottom: var(--spacing-md);
  overflow: hidden;
}
section.banner img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  opacity: 0;
  animation: fade-in 2s forwards;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ============ CV Actions (Download) ============ */
.cv-actions {
  max-width: 900px;           /* match .container */
  margin: 0 auto var(--spacing-sm);
  text-align: right;
}
.download-link {
  color: var(--accent-color);
  text-decoration: none;
  position: relative;
  font-family: var(--font-heading);
}
.download-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%; height: 2px;
  background: var(--accent-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.download-link:hover::after,
.download-link:focus::after { transform: scaleX(1); }

/* ============ PDF Card ============ */
.card {
  background: var(--bg-light);
  border: 1px solid #ccc;
  border-radius: var(--radius);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: var(--spacing-md);
}
section.pdf {
  max-width: 900px;
  margin: 0 auto var(--spacing-lg);
}
section.pdf embed {
  display: block;
  width: 100%;
  height: clamp(420px, 70vh, 820px);
  border-radius: calc(var(--radius) - 2px);
}

/* ============ Afterword ============ */
#afterword p {
  font-style: italic;
  font-size: 0.9em;
  text-align: center;
  margin: var(--spacing-md) var(--spacing-sm) 0 0;
}

/* ============ Courses ============ */
#courses { margin: 0 auto var(--spacing-lg); }  /* use class="container" in HTML for width */

/* Centered heading + decorative underline */
#courses h2 {
  font-family: var(--font-heading);
  font-size: 1.75em;
  color: var(--primary-color);
  text-align: center;
  margin-left: 0; /* guard against stray global margins */
}
#courses h2::after {
  content: '';
  display: block;
  width: 120px;
  height: 3px;
  background: var(--primary-color);
  margin: var(--spacing-xs) auto 0;
  border-radius: 2px;
}

/* Short intro paragraph under the H2 (optional) */
.courses-intro {
  max-width: 70ch;
  margin: 0 auto var(--spacing-md);
  color: #555;
  font-size: 1.05em;
  text-align: center;
  line-height: 1.6;
}

/* Grid of year cards */
.courses-grid {
  display: grid;
  gap: var(--spacing-md);
  grid-template-columns: 1fr;  /* mobile */
}
@media (min-width: 720px) {
  .courses-grid { grid-template-columns: repeat(2, 1fr); } /* wider cards on tablet/desktop */
}

.year {
  background: var(--bg-light);
  border: 1px solid #ccc;
  border-radius: var(--radius);
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
  padding: var(--spacing-md);
}
.year h3 {
  font-family: var(--font-heading);
  margin-bottom: var(--spacing-sm);
  position: relative;
}
.year h3::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary-color);
  margin-top: var(--spacing-xs);
}
.year ul { list-style: none; margin: 0; padding: 0; }
.year li + li { margin-top: 6px; }

/* Course links: code black, title accent; keep one line on wider screens */
.year a {
  color: var(--accent-color);
  text-decoration: none;
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
@media (min-width: 720px) { .year a { white-space: nowrap; } }
.year a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%; height: 2px;
  background: var(--accent-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.year a:hover::after,
.year a:focus::after { transform: scaleX(1); }

.year a .code {
  color: #000;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ============ Footer ============ */
footer {
  background-color: var(--primary-color);
  color: #fff;
  text-align: center;
  padding: var(--spacing-sm) 0;
}
.social-links a {
  color: #fff;
  font-size: 1.5em;
  margin: 0 var(--spacing-xs);
  display: inline-block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.social-links a:hover,
.social-links a:focus {
  transform: scale(1.1);
  opacity: 0.8;
}

/* ============ Responsive Tweaks ============ */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 10px; }
  .site-nav .nav-pill { flex-wrap: wrap; justify-content: center; padding: 6px 10px; }
  .site-nav .nav-pill a { padding: 8px 12px; }

  .cv-actions { text-align: center; }
  section.pdf { margin-bottom: var(--spacing-md); }
  section.pdf embed { height: 500px; }
}
@media (max-width: 480px) {
  .page-title { font-size: 1.6rem; }
  section.pdf embed { height: 340px; }
}

/* ============ Reduced Motion ============ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

body {
  background: linear-gradient(to bottom, #d16ba5, #c777b9, #ba83ca, #aa8fd8, #9a9ae1, #8aa7ec, #79b3f4, #69bff8, #52cffe, #41dfff, #46eefa, #5ffbf1);
  background-attachment: fixed;
}

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 5px;  /* thickness of the bar */
  background: linear-gradient(90deg, #4a148c, #0077cc);
  width: 0%;
  z-index: 9999;
  transition: width 0.15s ease-out;
}

/* ================= Fade in ================= */

.fade-in {
  opacity: 0;
  transform: translateY(20px); /* slight slide up */
  will-change: opacity, transform;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

