section {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--section-pad);
  border-top: 1px solid var(--border);
  transition: border-color var(--theme-transition);
}

.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  transition: color var(--theme-transition);
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3rem;
  line-height: 1.2;
  transition: font-family 0.4s, color var(--theme-transition);
}

body.art-mode .section-title {
  font-family: var(--font-hand);
  font-size: 2.8rem;
}

/* ── Cards ────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

#projects-grid {
  grid-template-columns: repeat(2, minmax(400px, 1fr));
  gap: 2rem;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
  transition: background var(--theme-transition), border-color var(--theme-transition), transform var(--hover-transition), box-shadow var(--hover-transition);
  position: relative;
  overflow: hidden;
}

.card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.2); }
.card-icon  { font-size: 1.8rem; margin-bottom: 1rem; }

.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  transition: font-family 0.4s, color var(--theme-transition);
}

body.art-mode .card-title { font-family: var(--font-hand); font-size: 1.4rem; }

.card-sub  { font-size: 0.82rem; color: var(--accent); margin-bottom: 0.8rem; letter-spacing: 0.05em; transition: color var(--theme-transition); }
.card-desc { font-size: 0.9rem;  color: var(--muted);  line-height: 1.7; transition: color var(--theme-transition); }
.card-year { position: absolute; top: 1.2rem; right: 1.2rem; font-size: 0.75rem; color: var(--border); letter-spacing: 0.08em; }

/* ── Timeline ─────────────────────────────────── */
.timeline, .edu-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Vertical rail down the left of every timeline — Experience,
   Education and Art Journey. (.art-timeline also carries .timeline,
   so this one selector covers all three.) */
.timeline::before, .edu-timeline::before {
  content: '';
  position: absolute;
  left: 1.5rem;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
  transition: background var(--theme-transition);
}

.timeline-item {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1.5rem;
  padding-bottom: 3rem;
  position: relative;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  margin-top: 0.35rem;
  margin-left: 0.8rem;
  transition: background var(--theme-transition), border-color var(--theme-transition);
  position: relative;
  z-index: 1;
}

.timeline-content { padding-bottom: 0.5rem; }

.timeline-role {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
  transition: color var(--theme-transition), font-family 0.4s;
}

body.art-mode .timeline-role { font-family: var(--font-hand); font-size: 1.4rem; }

.timeline-org  { color: var(--accent); font-size: 0.9rem; margin-bottom: 0.25rem; font-style: italic; transition: color var(--theme-transition); }
.timeline-date { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.08em; margin-bottom: 0.8rem; transition: color var(--theme-transition); }
.timeline-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.7; transition: color var(--theme-transition); }

/* ── Skill Pills ──────────────────────────────── */
.skills-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.skill-pill {
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text);
  letter-spacing: 0.05em;
  transition: all var(--hover-transition);
}

.skill-pill:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); transform: scale(1.05); }

/* ── Gallery Masonry ──────────────────────────── */
.gallery-intro {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 2rem;
  font-style: italic;
  font-family: var(--font-italic);
  transition: color var(--theme-transition);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 240px; /* ← DESKTOP card height — adjust here */
  gap: 1rem;
}

/* Childhood paintings — full-width break out of parent grid */
.gallery-subtitle-block {
  grid-column: 1 / -1;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.gallery-subtitle {
  font-size: 1.4rem;
  font-family: var(--font-hand) ;
  color: var(--heading);
  margin: 0;
}
.gallery-subtitle-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}
.gallery-childhood-block {
  margin-top: 0;
}
.gallery-grid--childhood {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 240px;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* Size variants */
.gallery-item--tall   { grid-row: span 2; }
.gallery-item--wide   { grid-column: span 2; }
.gallery-item--normal { grid-row: span 1; grid-column: span 1; }
.gallery-item--both { grid-row: span 2; grid-column: span 2; }

.gallery-item {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform var(--hover-transition), box-shadow var(--hover-transition);
}

.gallery-item:hover { transform: scale(1.02); box-shadow: 0 16px 48px rgba(0,0,0,0.2); }

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}

/* Hover overlay */
.gallery-hover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 55%, transparent 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem;
  pointer-events: none;
}

.gallery-item:hover .gallery-hover-overlay { opacity: 1; }
.gallery-hover-title { font-family: var(--font-hand); font-size: 1.3rem; color: #fff; margin-bottom: 0.25rem; }
.gallery-hover-meta  { font-size: 0.78rem; color: rgba(255,255,255,0.75); letter-spacing: 0.05em; }

/* ── Contact ──────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.contact-info { display: flex; flex-direction: column; gap: 1.2rem; }
.contact-item { display: flex; align-items: flex-start; gap: 1rem; }
.contact-icon { font-size: 1.3rem; width: 2.2rem; text-align: center; margin-top: 0.1rem; }

.contact-detail h4 {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.2rem;
  transition: color var(--theme-transition);
}

.contact-detail p { font-size: 0.92rem; color: var(--muted); transition: color var(--theme-transition); }

/* ── Social links: colored real-app logos, no wrapper circle ──── */
.social-icon-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--hover-transition), opacity var(--hover-transition);
}
.social-icon-link:hover { transform: translateY(-3px); opacity: 0.9; }

.social-icon-mark {
  height: 30px;
  width: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.social-icon-mark svg { height: 100%; width: auto; display: block; }

.social-icon-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* Contact section: logo + platform name, no boundary/background */
.contact-social-row { display: flex; gap: 1.1rem; margin-top: 0.3rem; flex-wrap: wrap; }
.contact-social-row .social-icon-link--labeled {
  transition: transform var(--hover-transition), opacity var(--hover-transition);
}
.contact-social-row .social-icon-link--labeled:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}
.contact-social-row .social-icon-mark { height: 24px; width: auto; }
.contact-social-row [data-icon="youtube"] .social-icon-mark { height: 19px; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-field { display: flex; flex-direction: column; gap: 0.4rem; }

.form-field label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--theme-transition);
}

.form-field input, .form-field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: background var(--theme-transition), border-color var(--theme-transition), color var(--theme-transition);
  outline: none;
  resize: none;
}

.form-field input:focus, .form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* ── Lightbox ─────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeUp 0.25s ease;
  cursor: pointer;
}

.lightbox-box {
  position: relative;
  max-width: min(1400px, 96vw);
  width: 100%;
  background: #0b0b0b;
  border-radius: 12px;
  overflow: hidden;
  cursor: default;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
}

/* ── Stage: image + prev/next arrows ───────────── */
.lightbox-stage { position: relative; display: flex; align-items: center; justify-content: center; background: #000; overflow: hidden; }

.lightbox-img-wrap { position: relative; width: 100%; touch-action: pan-y; overflow: hidden; }

.lightbox-box img { width: 100%; max-height: 78vh; object-fit: contain; display: block; background: #000; }

/* ── Caption: hidden by default, revealed only when hovering the
   lower part of the image (desktop) or on tap (phone) ─────────── */
.lightbox-caption-zone {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 42%;             /* hover target = lower part of the image only */
}

.lightbox-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.35) 60%, transparent);
  color: #fff;
  padding: 2.2rem 1.5rem 1rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;    /* purely visual — hover is detected by the zone beneath it */
}
.lightbox-title { font-family: var(--font-hand); font-size: 1.4rem; color: #fff; }
.lightbox-meta  { font-size: 0.82rem; color: rgba(255,255,255,0.75); margin-top: 0.2rem; }
.lightbox-count { color: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .lightbox-caption-zone:hover ~ .lightbox-caption { opacity: 1; transform: translateY(0); }
}
.lightbox-img-wrap.lb-caption-visible .lightbox-caption { opacity: 1; transform: translateY(0); }

/* ── Close button — top-right of the box ───────── */
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(0,0,0,0.8); }

/* ── Lightbox left/right navigation (desktop + mobile) ────────── */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  backdrop-filter: blur(2px);
}
.lightbox-nav:hover { background: rgba(0,0,0,0.7); transform: translateY(-50%) scale(1.08); }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

/* ── Thumbnail strip — jump to any painting ────── */
.lightbox-thumbs {
  display: flex;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  background: #111;
  scrollbar-width: thin;
}
.lightbox-thumbs::-webkit-scrollbar { height: 6px; }
.lightbox-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.lightbox-thumb {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
}
.lightbox-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox-thumb-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.lightbox-thumb:hover { opacity: 0.85; transform: translateY(-2px); }
.lightbox-thumb--active { opacity: 1; border-color: var(--accent); }

@media (max-width: 768px) {
  .lightbox-overlay { padding: 0.75rem; }
  .lightbox-box img { max-height: 56vh; }
  .lightbox-nav { width: 38px; height: 38px; font-size: 1.5rem; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
  .lightbox-close { width: 34px; height: 34px; font-size: 1.1rem; top: 8px; right: 8px; }
  .lightbox-thumb { width: 52px; height: 52px; }
  .lightbox-thumbs { padding: 0.6rem; gap: 0.45rem; }
}

/* ── Footer ───────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
  transition: border-color var(--theme-transition), color var(--theme-transition);
}
footer span { color: var(--accent); transition: color var(--theme-transition); }

/* ── Floating Toggle ──────────────────────────── */
.floating-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  cursor: pointer;
  border-radius: 50px;
  border: none;
  background: none;
  padding: 0;
  transition: transform 0.2s;
}

.floating-toggle:hover {
  transform: translateY(-3px) scale(1.35);
}

.floating-toggle-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: transparent;
  transition: transform 0.2s;
}

.floating-toggle:active .floating-toggle-inner { transform: scale(0.96); }

.floating-icon {
  width: 66px;
  height: 66px;
  object-fit: contain;
  filter: drop-shadow(0 0px 18px rgba(220, 205, 91, 0.65));
  flex-shrink: 0;
  border-radius: 50%;
}

/* ── Course Cards ─────────────────────────────── */
.course-card-code { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem; transition: color var(--theme-transition); }
.course-card-footer { margin-top: 1rem; font-size: 0.8rem; color: var(--accent); letter-spacing: 0.05em; }
.course-card:hover .course-card-footer { text-decoration: underline; }

/* ── Course Modal ─────────────────────────────── */
.course-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: pointer;
}

.course-modal-overlay.open { display: flex; }

.course-modal-box {
  position: relative;
  /* Flex column: the header is a normal, non-scrolling flex item and
     .course-modal-scroll is the only part that scrolls. This avoids the
     old position:sticky-inside-overflow approach entirely, so there is
     no seam at the rounded corners and the scrollbar can never be
     painted over the title bar. */
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 780px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  cursor: default;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  transition: background var(--theme-transition), border-color var(--theme-transition);
}

.course-modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.5rem; color: var(--muted); cursor: pointer; line-height: 1; transition: color 0.2s; z-index: 10; }
.course-modal-close:hover { color: var(--accent); }

.course-modal-share { position: absolute; top: 1.05rem; right: 3.4rem; background: none; border: none; font-size: 1.1rem; color: var(--muted); cursor: pointer; line-height: 1; transition: color 0.2s; z-index: 10; }
.course-modal-share:hover { color: var(--accent); }
.course-modal-share:disabled { color: var(--accent); cursor: default; }

.course-modal-header {
  display: flex; gap: 1.5rem; align-items: flex-start;
  flex: 0 0 auto;
  padding: 2rem 2.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  /* Stack above .course-modal-scroll so the shadow below actually casts
     onto the scrolled content instead of being painted over by it. */
  position: relative;
  z-index: 2;
  /* Slight dark shadow under the title bar to separate it visually from
     the content scrolling underneath. */
  box-shadow: 0 6px 10px -6px rgba(0,0,0,0.5);
  transition: background var(--theme-transition), border-color var(--theme-transition);
}
.course-modal-header--stack { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

/* The only element inside the box that actually scrolls. */
.course-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.course-modal-body { padding: 2rem 2.5rem 2.5rem; }

.course-modal-emoji { font-size: 3rem; line-height: 1; flex-shrink: 0; }
.course-modal-code  { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.4rem; }
.course-modal-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; line-height: 1.2; transition: font-family 0.4s, color var(--theme-transition); }
body.art-mode .course-modal-title { font-family: var(--font-hand); font-size: 2rem; }
.course-modal-section { margin-bottom: 2rem; }
.course-modal-section h3 { font-size: 0.78rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }

.course-topics-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.course-topics-list li { font-size: 0.9rem; color: var(--text); padding: 0.5rem 0.8rem; background: var(--card); border: 1px solid var(--border); border-radius: 6px; transition: background var(--theme-transition), border-color var(--theme-transition), color var(--theme-transition); }
.course-topics-list li::before { content: ''; }

.course-links-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.course-link-pill { display: inline-block; padding: 0.5rem 1.1rem; border-radius: 50px; background: var(--card); border: 1px solid var(--accent); color: var(--accent); font-size: 0.82rem; text-decoration: none; letter-spacing: 0.05em; transition: background 0.2s, color 0.2s; }
.course-link-pill:hover { background: var(--accent); color: var(--bg); }

.course-videos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.course-video-wrap iframe { width: 100%; aspect-ratio: 16/9; border-radius: 8px; border: 1px solid var(--border); display: block; }
.course-video-title { font-size: 0.82rem; color: var(--muted); margin-top: 0.4rem; text-align: center; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .contact-grid      { grid-template-columns: 1fr; gap: 2rem; }
  .course-modal-body { padding: 1.5rem; }
  .course-modal-header {
    flex-direction: column; gap: 0.8rem;
    padding: 1.5rem 1.5rem 1rem;
  }
  /* Mobile: drop the emoji/icon at the top of the card, keep just the name */
  .course-modal-emoji, .course-modal-icon-img { display: none; }
  .course-topics-list  { grid-template-columns: 1fr; }
  .course-videos-grid  { grid-template-columns: 1fr; }

  .floating-toggle { bottom: 1.5rem; right: 1.5rem; }

  /* Gallery: 2 columns on mobile, square cells */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 280px; /* ← TABLET card height — adjust here */
  }

  /* All items same size on mobile — no span stretching */
  .gallery-item--tall,
  .gallery-item--wide,
  .gallery-item--both,
  .gallery-item--normal {
    grid-row:    span 1;
    grid-column: span 1;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 170px; /* ← MOBILE card height — adjust here */
  }
}

/* ─────────────────────────────────────────────── */
/*  UNIVERSITY COURSE GROUPS                       */
/* ─────────────────────────────────────────────── */

.courses-by-uni {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.uni-group-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--accent);
}

.uni-group-emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.uni-group-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  transition: color var(--theme-transition), font-family 0.4s;
}

body.art-mode .uni-group-name {
  font-family: var(--font-hand);
  font-size: 1.6rem;
}

/* ── Ink drawing canvas (academic mode) ───────── */
/* position:fixed keeps the canvas locked to the viewport.
   This means clientX/clientY coordinates always match exactly,
   regardless of scroll position.                              */
#inkCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 998;
}

/* ── University logo + bold name (fix 3 & 4) ─── */
.uni-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.uni-group-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;          /* bolder */
  color: var(--text);
  letter-spacing: 0.01em;
  transition: color var(--theme-transition), font-family 0.4s;
}

body.art-mode .uni-group-name {
  font-family: var(--font-hand);
  font-size: 1.7rem;
}

/* Gap before second university group (fix 3) */
.uni-group--spaced {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px dashed var(--border);
}

/* Bold org names everywhere in timeline (fix 4) */
.timeline-org {
  font-weight: 700 !important;
  font-size: 1rem !important;
  font-style: normal !important;
  color: var(--accent);
  transition: color var(--theme-transition);
}

/* ── Per-topic resources (fix 7) ──────────────── */
.course-topics-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.topic-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  transition: background var(--theme-transition), border-color var(--theme-transition);
}

.topic-name {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
  display: block;
  margin-bottom: 0.35rem;
}

.topic-name::before {
  content: '▸ ';
  color: var(--accent);
}

.topic-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.topic-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.7rem;
  border-radius: 50px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.2s;
}

.topic-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.topic-link--disabled {
  cursor: default;
  pointer-events: none;
}

.topic-video-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.7rem;
  border-radius: 50px;
  background: var(--accent);
  border: none;
  color: var(--bg);
  font-size: 0.75rem;
  cursor: pointer;
  transition: filter 0.2s;
  font-family: var(--font-body);
}

.topic-video-btn:hover { filter: brightness(1.15); }

.topic-video-slot {
  margin-top: 0.6rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.topic-video-slot iframe {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
  border: none;
}

/* ── Justified description paragraphs ─────────────────────────── */
/* hyphens:none keeps words whole — no "re-arrange" split across two
   lines. Justification then stretches the spaces instead.
   (To stop an existing hyphen in the data from becoming a line break,
   type a non-breaking hyphen U+2011 there instead of a normal "-".) */
.entry-desc,
.timeline-desc,
#about .academic-only p,
#about .art-only p {
  text-align: justify;
  hyphens: none;
  -webkit-hyphens: none;
  overflow-wrap: break-word;   /* only ever wraps a word too long to fit */
}

/* Short single-line text reads badly when justified — the last line
   of a one-line paragraph gets stretched edge to edge. */
@media (max-width: 600px) {
  .entry-desc,
  .timeline-desc { text-align: left; }
}

/* ================================================================
   SHARED TIMELINE ENTRY  —  Experience + Education
   Both sections use the same markup and the same type scale, so the
   two academic timelines read as one consistent system. Edit here to
   change both at once.

     [ logo ]  entry-title   ← accent, display font
               entry-sub     ← normal text colour
               [ chips ]     ← result / period
     entry-desc              ← full width, starts under the logo
     entry-highlight         ← optional labelled callouts
   ================================================================ */

.entry-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

/* Base logo box. --org-logo-scale lets a single logo be nudged smaller
   or larger than the rest, set per entry via `logoScale` in the data. */
.org-logo {
  --org-logo-scale: 1;
  --org-logo-size: 34px;
  width:  calc(var(--org-logo-size) * var(--org-logo-scale));
  height: calc(var(--org-logo-size) * var(--org-logo-scale));
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Larger than a plain inline icon, since it spans several lines here.
   Change --org-logo-size to resize every entry logo at once; per-entry
   `logoScale` in the data file still applies on top of it. */
.entry-logo {
  --org-logo-size: 56px;
  margin-top: 6px;            /* lowers the logo slightly from the top of the text */
}

.entry-logo,
.project-card-icon {
  filter: drop-shadow(4px 4px 4px rgba(0, 0, 0, 0.95));
}

.entry-head-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;               /* lets long names wrap instead of overflowing */
}

.entry-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.3;
  transition: color var(--theme-transition), font-family 0.4s;
}

.entry-sub {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  transition: color var(--theme-transition);
}

/* ── Chips: result / period ───────────────────────────────────── */
/* The facts people scan for, lifted out of the paragraph below. */
.entry-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.entry-chip {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding: 0.18rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  white-space: nowrap;
  transition: color var(--theme-transition), border-color var(--theme-transition);
}

/* The number itself (wrapped in <b> in the data) carries the emphasis. */
.entry-chip b {
  color: var(--accent);
  font-weight: 700;
  transition: color var(--theme-transition);
}

/* ── Description ──────────────────────────────────────────────── */
/* Full width, starting at the same left edge as the logo — only the
   head block is indented. */
.entry-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 1rem;
  transition: color var(--theme-transition);
}

/* ── Highlight callouts (thesis, achievements…) ───────────────── */
/* Plain block — the uppercase label alone separates it from the
   paragraph above, so no rule or indent is needed. */
.entry-highlight {
  margin-top: 0.9rem;
}

.entry-highlight-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text);
  margin-bottom: 0.3rem;
  transition: color var(--theme-transition);
}

/* Same light blue as .entry-desc, so the callout body reads as part of
   the surrounding paragraph text. */
.entry-highlight-value {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  transition: color var(--theme-transition);
}

@media (max-width: 600px) {
  .entry-head       { gap: 0.75rem; }
  .entry-logo       { --org-logo-size: 46px; }
  .entry-title      { font-size: 1.05rem; }
  .entry-sub        { font-size: 0.92rem; }
  .entry-desc       { font-size: 0.86rem; margin-top: 0.85rem; }
}

/* ── About paragraphs ─────────────────────────────────────────── */
/* Full container width so the right edge lines up with every other
   section (it was capped at 760px and stopped ~244px short). */
.about-text {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--muted);
  transition: color var(--theme-transition);
}

.about-quote {
  font-size: 1.15rem;
  line-height: 2;
  color: var(--muted);
  font-family: 'Lora', serif;
  font-style: italic;
  transition: color var(--theme-transition);
}

.about-text + .about-text { margin-top: 1.5rem; }

/* ── Images are not draggable ─────────────────────────────────── */
/* Stops the browser's native "drag the picture out" ghost image on
   logos, buttons, avatars and artwork. -webkit-user-drag covers
   Chrome/Safari; Firefox needs the draggable="false" attribute, which
   render.js sets globally via a dragstart handler. */
img,
.avatar-frame,
.avatar-backdrop,
.avatar-person {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  -webkit-touch-callout: none;
}

/* ── Course card meta: code / semesters / credits ─────────────── */
/* Each part gets its own colour so the card can be scanned at a
   glance, the same idea as the chips in Experience and Education:
     code      → accent (yellow), the course's identity
     semester  → accent2 (blue), when it was taught — one per semester
     credits   → muted, the least important of the three            */
.course-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.course-card-code {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0;
  transition: color var(--theme-transition);
}

.course-card-semester {
  font-size: 0.72rem;
  color: var(--accent2);
  padding: 0.15rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--accent2) 45%, transparent);
  background: color-mix(in srgb, var(--accent2) 10%, transparent);
  border-radius: 4px;
  white-space: nowrap;
  transition: color var(--theme-transition), border-color var(--theme-transition),
              background var(--theme-transition);
}

.course-card-credits {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 4px;
  white-space: nowrap;
  transition: color var(--theme-transition), border-color var(--theme-transition),
              background var(--theme-transition);
}

/* ── Breathing room under card titles ─────────────────────────── */
/* The course title sat almost flush against its code/semester chips,
   and the project title against its tech pills. A larger gap lets the
   name register as a heading before the eye reaches the metadata. */
.course-card .card-title {
  margin-bottom: 0.9rem;
}

.project-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.project-card-titlewrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ── Stronger card hover ──────────────────────────────────────── */
/* Lifts further, brightens the surface, picks up an accent border and
   a soft accent glow, so the hovered card clearly separates from the
   grid rather than just nudging upward. */
.card {
  transition: background var(--theme-transition),
              border-color var(--hover-transition),
              transform var(--hover-transition),
              box-shadow var(--hover-transition);
}

.card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 5%, var(--card));
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.34),
              0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* Accent bar that wipes across the top edge on hover. .card already
   has overflow:hidden and position:relative, so it clips neatly. */
.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--hover-transition);
}

.card:hover::after { transform: scaleX(1); }

/* Title warms to the accent colour; the course "View Details" cue and
   any icon lift with it. */
.card:hover .card-title { color: var(--accent); }

.card-title { transition: font-family 0.4s, color var(--hover-transition); }

.course-card:hover .course-card-footer,
.card:hover .card-icon {
  transform: translateX(2px);
}

.course-card-footer, .card-icon {
  transition: transform var(--hover-transition), color var(--hover-transition);
  display: inline-block;
}

/* Respect users who ask for reduced motion — keep the colour cues,
   drop the movement. */
@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
  .card:hover::after { transform: scaleX(1); transition: none; }
  .course-card:hover .course-card-footer,
  .card:hover .card-icon { transform: none; }
}

/* ── More breathing room between timeline entries ─────────────── */
.timeline-item { padding-bottom: 3rem; }

#experience .timeline-item,
.edu-timeline .timeline-item {
  padding-bottom: 4.5rem;
}

#experience .timeline-item:last-child,
.edu-timeline .timeline-item:last-child {
  padding-bottom: 0;
}

@media (max-width: 600px) {
  #experience .timeline-item,
  .edu-timeline .timeline-item { padding-bottom: 3rem; }
}

/* ── Wider spacing between timeline entries ───────────────────── */
#experience .timeline-item,
.edu-timeline .timeline-item {
  padding-bottom: 6rem;
}

@media (max-width: 600px) {
  #experience .timeline-item,
  .edu-timeline .timeline-item { padding-bottom: 3.75rem; }
}

/* ── Larger titles ────────────────────────────────────────────── */
/* Organisation / institution names in the timelines, and the course
   name on each card. */
.entry-title {
  font-size: 1.45rem;
}

.course-card .card-title {
  font-size: 1.25rem;
}

@media (max-width: 600px) {
  .entry-title            { font-size: 1.18rem; }
  .course-card .card-title { font-size: 1.12rem; }
}

/* ── Timeline dot: centred on the rail, larger ────────────────── */
/* The dot used to sit in the grid gutter and was nudged across with a
   margin, which left it ~2px left of the 1px rail. Positioning it
   absolutely against the rail's own offset and pulling it back by half
   its width centres it exactly, at any size. */

/* Absolute positioning takes the dot out of the grid, so the content
   must be pinned to column 2 — otherwise it falls back into the 3rem
   gutter column and the whole entry collapses to that width. */
.timeline-item > .timeline-content {
  grid-column: 2;
}

.timeline-dot {
  position: absolute;
  left: calc(1.5rem + 0.5px);
  top: 0.5rem;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  margin: 0;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  box-sizing: content-box;
  z-index: 1;
  transition: background var(--theme-transition), border-color var(--theme-transition);
}

/* ── Final spacing / sizing / hover tuning ────────────────────── */

/* Gap between timeline entries: 74px. */
#experience .timeline-item,
.edu-timeline .timeline-item {
  padding-bottom: 4.625rem;
}

@media (max-width: 600px) {
  #experience .timeline-item,
  .edu-timeline .timeline-item { padding-bottom: 3.25rem; }
}

/* Slightly smaller dot — 16px core inside a 3px background ring. */
.timeline-dot {
  width: 16px;
  height: 16px;
  border-width: 3px;
}

/* Card hover in light blue (--accent2) rather than the yellow accent,
   matching the semester chips on the course cards. */
.card:hover {
  border-color: color-mix(in srgb, var(--accent2) 60%, transparent);
  background: color-mix(in srgb, var(--accent2) 7%, var(--card));
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.34),
              0 0 0 1px color-mix(in srgb, var(--accent2) 26%, transparent);
}

.card::after            { background: var(--accent2); }
.card:hover .card-title { color: var(--accent2); }

/* ── Lighter, whiter blue card hover ──────────────────────────── */
/* --card-hover is --accent2 lifted toward white so the highlight
   reads as a pale glow rather than a saturated blue. */
.card {
  --card-hover: color-mix(in srgb, var(--accent2) 42%, white);
}

.card:hover {
  border-color: color-mix(in srgb, var(--card-hover) 70%, transparent);
  background: color-mix(in srgb, var(--card-hover) 8%, var(--card));
  box-shadow: 10px 10px 15px rgba(0, 0, 0, 0.9),
              0 0 0 1px color-mix(in srgb, var(--card-hover) 30%, transparent);
}

.card::after            { background: var(--card-hover); }
.card:hover .card-title { color: var(--card-hover); }

/* ── Non-interactive cards (e.g. Art Practice) ─────────────────── */
/* These cards aren't buttons — they don't open a modal or link
   anywhere — so they shouldn't pick up the clickable-card hover
   treatment (lift, glow, accent border/title, top-edge wipe). */
.card--static { cursor: default; }
.card--static:hover {
  transform: none;
  border-color: var(--border);
  background: var(--card);
  box-shadow: none;
}
.card--static::after { display: none; }
.card--static:hover .card-title { color: var(--text); }
.card--static:hover .card-icon  { transform: none; }

/* ── YouTube facade ───────────────────────────────────────────── */
/* Thumbnail stand-in shown until the person clicks; the real iframe
   only loads then. Sized identically to the iframe so nothing jumps. */
.video-facade {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  background-color: var(--surface);
  background-size: cover;
  background-position: center;
  position: relative;
  transition: border-color var(--hover-transition);
}

.video-facade:hover { border-color: var(--accent2); }

/* Dark scrim so the play button stays legible on bright thumbnails */
.video-facade::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
  transition: background var(--hover-transition);
}

.video-facade:hover::before { background: rgba(0, 0, 0, 0.12); }

/* Play triangle */
.video-facade-play {
  position: relative;
  width: 0; height: 0;
  border-style: solid;
  border-width: 13px 0 13px 22px;
  border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
  transition: transform var(--hover-transition);
}

.video-facade:hover .video-facade-play { transform: scale(1.15); }
/* ── Interactive Course Materials (wide project card) ─────────── */
/* Spans both columns of the projects grid. Each institution gets a
   small heading and a row of compact course cards that scrolls
   sideways when they don't all fit; the arrows only appear then. */
#projects-grid .project-card--wide { grid-column: 1 / -1; }

.cm-inst { margin-top: 0.4rem; min-width: 0; }

.cm-inst-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}

.cm-inst-logo { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; }

.cm-inst-name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.cm-inst-head--modal { border-bottom-color: var(--accent); margin-bottom: 1rem; }
.cm-inst-head--modal .cm-inst-logo { width: 32px; height: 32px; }
.cm-inst-head--modal .cm-inst-name { font-size: 1.15rem; }

.cm-shelf-wrap { position: relative; }

.cm-shelf {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 0.2rem 0.1rem 0.7rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  overscroll-behavior-x: contain;
}
.cm-shelf::-webkit-scrollbar { height: 6px; }
.cm-shelf::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.cm-mini {
  flex: 0 0 214px;
  scroll-snap-align: start;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color var(--hover-transition), background var(--hover-transition), transform var(--hover-transition);
}
.cm-mini:hover {
  border-color: color-mix(in srgb, var(--accent2) 70%, transparent);
  background: color-mix(in srgb, var(--accent2) 10%, var(--surface));
  transform: translateY(-2px);
}

.cm-mini-logo { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; }

.cm-mini-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }

.cm-mini-code {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
}

.cm-mini-title { font-size: 0.86rem; line-height: 1.35; color: var(--text); }
.cm-mini-count { font-size: 0.72rem; color: var(--muted); }

.cm-shelf-arrow {
  display: none;
  position: absolute;
  top: calc(50% - 0.35rem);
  transform: translateY(-50%);
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: border-color 0.2s, color 0.2s;
}
.cm-shelf-arrow:hover { border-color: var(--accent2); color: var(--accent2); }
.cm-shelf-arrow--prev { left: -0.6rem; }
.cm-shelf-arrow--next { right: -0.6rem; }
.cm-can-prev .cm-shelf-arrow--prev,
.cm-can-next .cm-shelf-arrow--next { display: block; }

/* Touch devices scroll by swiping, so the arrows would only get in the way */
@media (hover: none) {
  .cm-shelf-arrow { display: none !important; }
}

/* Modal: the course list needs more room than a single project */
.course-modal-box--wide { max-width: 1040px; }

.cm-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.cm-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color var(--hover-transition), transform var(--hover-transition), box-shadow var(--hover-transition);
}
.cm-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent2) 70%, transparent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.cm-card-preview {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  object-position: top;
  display: block;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.cm-card-body { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem 1rem 1rem; flex: 1; }
.cm-card-head { display: flex; align-items: center; gap: 0.65rem; }

.cm-card-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  transition: color var(--hover-transition);
}
.cm-card:hover .cm-card-title { color: var(--accent2); }

.cm-card-desc { font-size: 0.84rem; line-height: 1.6; color: var(--muted); margin: 0; }

.cm-card-open { margin-top: auto; font-size: 0.8rem; color: var(--accent); letter-spacing: 0.04em; }
.cm-card:hover .cm-card-open { text-decoration: underline; }

@media (max-width: 600px) {
  .cm-mini { flex-basis: 200px; }
  .cm-card-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .cm-mini:hover, .cm-card:hover { transform: none; }
}
