/* ==========================================================================
   Yun-Yun (Alice) Tsai — personal site
   Layout inspired by morningmoni.github.io (Bocor theme), rewritten from scratch.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;600;700;900&family=Ek+Mukta:wght@400;600;700&display=swap');

@font-face {
  font-family: 'kouzan';
  src: url('../../KouzanBrushFont.ttf');
  font-display: swap;
}

:root {
  --accent: #3dc9b3;
  --accent-dark: #268778;
  --accent-text: #237769;
  --accent-soft: #d5e3df;
  --accent-tint: #edf5f2;
  --text: #555;
  --text-dark: #222;
  --text-muted: #666;
  --rule: #e5e5e5;
  --rule-soft: #dedede;
  --bg: #fff;
  --bg-gray: #f9f9f9;
  --bg-card: #fff;
  --bg-dark: #2b2b2b;
  --nav-bg: rgba(255,255,255,.96);
  --shadow: rgba(0,0,0,.08);
  --venue: #526760;
  --disabled: #aaa;
  --footer-text: #bbb;
  --footer-link: #ddd;
  --footer-sep: #777;
  color-scheme: light;
  --nav-height: 64px;
  --content-width: 800px;
  --hero-image: url('../../images/hero-bg.jpg');
  --font-body: 'Ek Mukta', 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

[data-theme="dark"] {
  --accent-text: #5fd6c2;
  --accent-soft: #2c4a44;
  --accent-tint: #1b2e2a;
  --text: #c9c9c9;
  --text-dark: #f1f1f1;
  --text-muted: #9a9a9a;
  --rule: #2e2e2e;
  --rule-soft: #333;
  --bg: #121212;
  --bg-gray: #1a1a1a;
  --bg-card: #1e1e1e;
  --bg-dark: #0b0b0b;
  --nav-bg: rgba(18,18,18,.94);
  --shadow: rgba(0,0,0,.5);
  --venue: #9fc2b9;
  --disabled: #666;
  --footer-text: #999;
  --footer-link: #ccc;
  --footer-sep: #555;
  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 16px); }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  transition: background-color .3s ease, color .3s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 20px;
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-dark);
}

p { margin: 0 0 20px; }

a {
  color: var(--accent-text);
  text-decoration: none;
  transition: color .2s ease-in-out, background-color .2s ease-in-out, border-color .2s ease-in-out;
}
a:hover, a:focus { color: var(--accent-dark); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 4px; }

img { max-width: 100%; height: auto; }

b, strong { font-weight: 600; color: var(--text-dark); }

blockquote {
  margin: 0 0 20px;
  padding: 8px 20px;
  border-left: 3px solid var(--accent);
  font-style: italic;
  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: 0;
}

.zh-name { font-family: 'kouzan', serif; font-size: 1.35em; font-weight: 600; color: var(--text-dark); }

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.content { max-width: var(--content-width); margin: 0 auto; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px;
  background: var(--hero-image) no-repeat center 30% / cover;
  color: #fff;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.45) 100%);
}
.hero > .hero-inner { position: relative; z-index: 1; max-width: 860px; }

.hero h1 {
  margin: 0 0 14px;
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
.hero p.tagline {
  margin: 0 0 36px;
  font-size: 22px;
  font-weight: 400;
  color: #f3f3f3;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.hero p.tagline .zh-name { color: #fff; }

.hero.hero-sm { min-height: 42vh; padding: 140px 24px 70px; }
.hero.hero-sm h1 { font-size: 34px; letter-spacing: 4px; }
.hero.hero-sm p.tagline { font-size: 18px; margin-bottom: 0; }

.social {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin: 0; padding: 0; list-style: none;
}
.social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  border-radius: 6px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  font-size: 22px;
  backdrop-filter: blur(2px);
}
.social a:hover, .social a:focus { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }

/* Mouse-trail stars in the hero (ported from the reference's #star / floatOne..Five) */
.hero { overflow: hidden; }
.star-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.mouse-star {
  position: absolute;
  --sway: 0px;
  font-size: 26px; line-height: 1;
  transform: translate(-50%, -50%);
  animation-duration: 1.05s; animation-iteration-count: 1; animation-fill-mode: forwards;
  animation-timing-function: ease-out;
  text-shadow: 0 0 6px rgba(0,0,0,.25);
  will-change: transform, opacity;
}
/* Leaves drift up/sideways, tumble and shrink while fading (adapted from the reference's floatOne..Five) */
@keyframes floatOne   { 0%,45% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) translate3d(var(--sway), -25px, 0) scale(.3) rotate(120deg); } }
@keyframes floatTwo   { 0%,45% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) translate3d(var(--sway), -40px, 0) scale(.2) rotate(-150deg); } }
@keyframes floatThree { 0%,45% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) translate3d(var(--sway), -55px, 0) scale(.35) rotate(200deg); } }
@keyframes floatFour  { 0%,45% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) translate3d(var(--sway), -70px, 0) scale(.2) rotate(-90deg); } }
@keyframes floatFive  { 0%,45% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) translate3d(var(--sway), -85px, 0) scale(.25) rotate(160deg); } }

.scroll-hint {
  position: absolute; left: 0; right: 0; bottom: 24px; z-index: 1;
  text-align: center; font-size: 24px; color: #fff; opacity: .8;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-height);
  background: transparent;
  border-top: 5px solid transparent;
  transition: background-color .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.site-nav.is-visible {
  background: var(--nav-bg);
  border-top-color: var(--accent);
  box-shadow: 0 2px 10px var(--shadow);
}
.site-nav .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }

/* Over the hero (not yet scrolled) the nav is transparent with white text */
.site-nav:not(.is-visible) .brand,
.site-nav:not(.is-visible) .nav-toggle,
.site-nav:not(.is-visible) .theme-toggle { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.site-nav:not(.is-visible) .theme-toggle { border-color: rgba(255,255,255,.5); }
.site-nav:not(.is-visible) .theme-toggle:hover { background: rgba(255,255,255,.15); color: #fff; }

.brand {
  font-family: var(--font-heading);
  font-size: 20px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-dark);
}
.brand:hover { color: var(--accent-dark); text-decoration: none; }

.nav-links { display: flex; gap: 6px; margin: 0 0 0 auto; padding: 0; list-style: none; order: 2; }
.nav-links a {
  display: block; padding: 8px 14px;
  font-family: var(--font-heading); font-size: 14px; font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase;
  color: var(--text-dark); border-radius: 4px;
}
.nav-links a:hover, .nav-links a:focus, .nav-links a.active { color: var(--accent-dark); background: var(--accent-tint); text-decoration: none; }
@media (min-width: 768px) {
  .site-nav:not(.is-visible) .nav-links a { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
  .site-nav:not(.is-visible) .nav-links a:hover, .site-nav:not(.is-visible) .nav-links a:focus, .site-nav:not(.is-visible) .nav-links a.active { color: #fff; background: rgba(255,255,255,.15); }
}

.nav-right { display: flex; align-items: center; gap: 8px; order: 3; margin-left: 20px; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  background: none; border: 1px solid var(--rule); border-radius: 50%;
  color: var(--text-dark); font-size: 15px; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.theme-toggle:hover { background: var(--accent-tint); border-color: var(--accent-dark); color: var(--accent-dark); }
.theme-toggle .fa-sun { display: none; }
[data-theme="dark"] .theme-toggle .fa-sun { display: inline-block; }
[data-theme="dark"] .theme-toggle .fa-moon { display: none; }

.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer; color: var(--text-dark); font-size: 22px;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding: 80px 0; transition: background-color .3s ease; }
.bg-gray { background: var(--bg-gray); }

.section-heading { text-align: center; margin-bottom: 44px; }
.section-heading h2 {
  margin: 0 0 12px;
  font-size: 24px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
}
.section-heading .divider { display: block; width: 40px; height: 2px; margin: 0 auto; background: var(--accent); }
.section-heading p { margin: 14px 0 0; color: var(--text-muted); }

.section-link { text-align: center; margin-bottom: 32px; }
.section-link a { font-weight: 600; }

.subheading {
  margin: 48px 0 18px;
  font-size: 18px; font-weight: 700;
  color: var(--text-dark);
}
.subheading .zh-sec { color: var(--accent-dark); margin-right: 6px; }

/* About */
#about .content { max-width: 960px; }
.about-intro {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  margin-bottom: 20px;
}
.about-portrait {
  --crop-size: 56%;   /* portion of the source photo shown (head to waist) */
  --crop-x: 17%;      /* left edge of the crop window in the source photo */
  --crop-y: 12%;      /* top edge of the crop window in the source photo */
  position: relative;
  width: 300px; height: 300px;
  overflow: hidden;
  border-radius: 50%;
  border: 4px solid var(--accent-tint);
  box-shadow: 0 6px 24px var(--shadow);
  background: var(--bg-gray);
}
.about-portrait img {
  position: absolute; top: 0; left: 0;
  width: calc(100% / 0.56); height: calc(100% / 0.56);
  max-width: none;
  object-fit: cover;
  transform: translate(calc(-1 * var(--crop-x)), calc(-1 * var(--crop-y)));
}
.about-text p:last-child { margin-bottom: 0; }
.misc-note {
  grid-column: 1 / -1;
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--accent-tint);
  border-left: 4px solid var(--accent-dark);
  border-radius: 4px;
  font-size: 15.5px;
  line-height: 1.75;
}
.about-greeting { margin-bottom: 10px; font-size: 20px; color: var(--text-dark); }
.alien-float {
  display: inline-block;
  animation: alienFloat 1.1s ease-in-out infinite;
}
@keyframes alienFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-9px) rotate(-12deg); }
  75% { transform: translateY(-9px) rotate(12deg); }
}
.about-greeting .typing { font-family: ui-monospace, 'Courier New', monospace; }
.about-greeting .typing::after {
  content: ''; display: inline-block;
  width: 2px; height: 1em; margin-left: 3px; vertical-align: -2px;
  background: var(--accent-dark);
  animation: caretBlink .9s step-end infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

/* News */
.news-list { margin: 0; padding: 0; list-style: none; }
.news-list li {
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1px solid var(--rule-soft);
}
.news-list li:last-child { border-bottom: 0; }
.news-date { font-weight: 600; color: var(--accent-dark); margin-right: 6px; white-space: nowrap; }
.collapse { display: none; }
.collapse.is-open { display: block; }
.news-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 8px auto 0; padding: 8px 18px;
  background: none; border: 1px solid var(--accent-soft); border-radius: 999px;
  color: var(--accent-text); font: inherit; font-size: 14px; cursor: pointer;
}
.news-toggle:hover { background: var(--accent-tint); border-color: var(--accent-dark); }
.news-toggle-wrap { text-align: center; }

/* Cards (What I Enjoy) */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card {
  display: flex; flex-direction: column;
  padding: 36px 28px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--rule); border-radius: 8px;
  transition: transform .2s ease-in-out, border-color .2s ease-in-out, box-shadow .2s ease-in-out;
}
.card:hover { transform: translateY(-10px); border-color: var(--accent); box-shadow: 0 10px 30px var(--shadow); }
.card-icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent-tint); color: var(--accent-dark); font-size: 26px;
}
.card h3 { font-size: 20px; margin-bottom: 10px; }
.card .divider { display: block; width: 40px; height: 2px; margin: 0 auto 22px; background: var(--accent); }
.card p { flex: 1; text-align: left; font-size: 15px; }
.card p.card-text-center { text-align: center; }

.btn {
  display: inline-block; padding: 10px 24px;
  font-family: var(--font-heading); font-size: 14px; font-weight: 600; letter-spacing: .5px;
  color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 4px;
}
.btn:hover, .btn:focus { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-outline { color: var(--accent-text); background: transparent; }
.btn-outline:hover { color: #fff; }
.card .btn { align-self: center; margin-top: 8px; }
.card .btn + .btn { margin-left: 8px; }
.card-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.card-actions .btn { margin: 0; }

/* Experience timeline */
.timeline {
  list-style: none;
  margin: 0 0 48px 6px;
  padding: 0 0 0 28px;
  border-left: 2px solid var(--accent-soft);
}
.timeline > li {
  position: relative;
  padding-bottom: 24px; margin-bottom: 24px;
  border-bottom: 1px solid var(--rule-soft);
}
.timeline > li:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.timeline > li::before {
  content: '';
  position: absolute; top: 10px; left: -35px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent-dark);
  box-shadow: 0 0 0 3px var(--bg-gray);
}
.timeline-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.timeline-logo {
  flex: 0 0 auto;
  width: 44px; height: 44px; object-fit: contain;
  background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 4px;
}
.timeline-org { font-size: 19px; font-weight: 600; color: var(--text-dark); }
.timeline-role { font-weight: 600; color: var(--text-dark); }
.timeline-date { font-size: 14px; color: var(--text-muted); }
.timeline-body { margin: 0; }

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 32px;
}
.details-grid .span-2 { grid-column: 1 / -1; }
.detail h3 { font-size: 18px; margin-bottom: 14px; }
.detail ul { margin: 0; padding-left: 20px; }
.detail li { margin-bottom: 10px; }
.detail dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.detail dt { color: var(--accent-dark); font-weight: 600; white-space: nowrap; }
.detail dd { margin: 0; }

/* Publications */
.pubs { padding-left: 26px; margin: 0; }
.pubs > li { padding: 0 0 22px 8px; margin-bottom: 22px; border-bottom: 1px solid var(--rule); }
.pubs > li:last-child { border-bottom: 0; margin-bottom: 0; }
.pubs > li::marker { color: var(--accent-dark); font-weight: 700; }
.paper-title { margin: 0 0 6px; font-family: inherit; font-size: 19px; font-weight: 600; line-height: 1.45; }
.paper-authors { margin: 0 0 10px; font-size: 14px; line-height: 1.65; }
/* Publication rows: thumbnail + body */
.pub-row { display: flex; gap: 18px; align-items: flex-start; }
.pub-thumb {
  flex: 0 0 160px; width: 160px; aspect-ratio: 4/3;
  border: 1px dashed var(--rule); border-radius: 6px;
  background: var(--bg-gray); color: var(--rule);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; overflow: hidden;
}
.pub-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pub-thumb:has(img) { border-style: solid; }
.pub-body { flex: 1; min-width: 0; }
.pub-tldr { display: none; margin: 8px 0 0; padding: 10px 14px; background: var(--accent-tint); border-left: 3px solid var(--accent-dark); border-radius: 4px; font-size: 13.5px; color: var(--text-muted); }
.pub-tldr.is-open { display: block; }
.tldr-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; margin: 0; border-radius: 999px;
  border: 1px solid var(--accent-dark); background: transparent;
  color: var(--accent-text); font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.tldr-toggle:hover { background: var(--accent-tint); }
.tldr-toggle::after { content: '\25BE'; font-size: 10px; }
.tldr-toggle[aria-expanded="true"]::after { content: '\25B4'; }
@media (max-width: 640px) {
  .pub-thumb { flex: 0 0 110px; width: 110px; font-size: 20px; }
}
.paper-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; line-height: 1.5; }
.paper-venue { margin-right: 8px; font-weight: 700; color: var(--venue); }
.paper-meta a {
  padding: 3px 10px;
  border: 1px solid var(--accent-soft); border-radius: 4px;
  color: var(--accent-text); white-space: nowrap;
}
.paper-meta a:hover { background: var(--accent-tint); border-color: var(--accent-dark); text-decoration: none; }
.paper-meta a.is-disabled { color: var(--disabled); border-style: dashed; pointer-events: none; }

/* Simple tables (awards / talks / service) */
.table { width: 100%; border-collapse: collapse; margin: 0 0 20px; }
.table td { padding: 10px 12px 10px 0; vertical-align: top; border-bottom: 1px solid var(--rule); }
.table tr:last-child td { border-bottom: 0; }
.table td:first-child { width: 130px; white-space: nowrap; font-weight: 600; color: var(--accent-dark); }

/* Galleries (subpages) */
.article { margin-bottom: 56px; }
.article h3 { font-size: 20px; margin: 36px 0 12px; }
.article ul { margin: 0 0 20px; padding-left: 22px; }
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 28px;
}
.gallery a { display: block; overflow: hidden; border-radius: 6px; background: var(--bg-gray); aspect-ratio: 4 / 3; }
.gallery img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s ease, filter .5s ease;
}
.gallery a:hover img { transform: scale(1.06); filter: brightness(1.05); }

/* CV embed */
.pdf-frame { width: 100%; height: calc(100vh - 140px); min-height: 600px; border: 1px solid var(--rule); border-radius: 6px; }

/* Back to top */
#top {
  position: fixed; right: 24px; bottom: 24px; z-index: 900;
  display: none; width: 42px; height: 42px;
  border-radius: 8px; background: var(--accent); color: #fff;
  text-align: center; line-height: 42px; font-size: 18px; opacity: .7;
}
#top:hover { opacity: 1; text-decoration: none; color: #fff; }
#top.is-visible { display: block; }

/* --------------------------------------------------------------------------
   Scroll animations (same names/feel as css3-animate-it used by the reference)
   Elements with .animated start hidden; JS adds .go when they enter the viewport.
   -------------------------------------------------------------------------- */
.animated { opacity: 0; animation-duration: 1s; animation-fill-mode: both; }
.animated.slow { animation-duration: 1.5s; }
.animated.slower { animation-duration: 2s; }
.animated.go { opacity: 1; }
.animated.done { animation: none; opacity: 1; }
.no-js .animated { opacity: 1; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDown { 0% { opacity: 0; transform: translateY(-120px); } 50% { opacity: .3; } 100% { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { 0% { opacity: 0; transform: translateY(120px); } 50% { opacity: .3; } 100% { opacity: 1; transform: translateY(0); } }
@keyframes fadeInLeft { 0% { opacity: 0; transform: translateX(-120px); } 50% { opacity: .3; } 100% { opacity: 1; transform: translateX(0); } }
@keyframes bounceInDown {
  0% { opacity: 0; transform: translateY(-400px); }
  60% { opacity: 1; transform: translateY(30px); }
  80% { transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes rotateInDownLeft {
  0% { transform-origin: left bottom; transform: rotate(-90deg); opacity: 0; }
  100% { transform-origin: left bottom; transform: rotate(0); opacity: 1; }
}

.fadeIn.go { animation-name: fadeIn; }
.fadeInDown.go { animation-name: fadeInDown; }
.fadeInUp.go { animation-name: fadeInUp; }
.fadeInLeft.go { animation-name: fadeInLeft; }
.bounceInDown.go { animation-name: bounceInDown; }
.rotateInDownLeft.go { animation-name: rotateInDownLeft; }

/* Stagger items inside lists */
.stagger > .animated:nth-child(2) { animation-delay: .12s; }
.stagger > .animated:nth-child(3) { animation-delay: .24s; }
.stagger > .animated:nth-child(4) { animation-delay: .36s; }
.stagger > .animated:nth-child(5) { animation-delay: .48s; }
.stagger > .animated:nth-child(n+6) { animation-delay: .6s; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 36px 0;
  background: var(--bg-dark);
  color: var(--footer-text);
  font-size: 14px;
}
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer a { color: var(--footer-link); }
.site-footer a:hover { color: var(--accent); }
.site-footer p { margin: 0; }
.footer-contact span + span::before { content: '·'; margin: 0 10px; color: var(--footer-sep); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 36px; letter-spacing: 5px; }
}

@media (max-width: 767px) {
  :root { --nav-height: 58px; }
  .section { padding: 52px 0; }
  .section-heading { margin-bottom: 30px; }
  .hero { padding: 100px 20px; }
  .hero h1 { font-size: 26px; letter-spacing: 3px; }
  .hero p.tagline { font-size: 17px; }
  .hero.hero-sm h1 { font-size: 24px; }

  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    box-shadow: 0 10px 20px var(--shadow);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-right { margin-left: auto; }
  .nav-links a { padding: 12px 10px; }

  .about-intro { grid-template-columns: minmax(0, 1fr); gap: 24px; justify-items: center; }
  .about-portrait { width: min(300px, 80vw); height: min(300px, 80vw); }

  .timeline { margin-left: 2px; padding-left: 22px; }
  .timeline > li::before { left: -29px; }
  .timeline-logo { width: 38px; height: 38px; }
  .details-grid { grid-template-columns: minmax(0, 1fr); }
  .detail dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .detail dd { margin-bottom: 10px; }

  .pubs { padding-left: 22px; }
  .table td:first-child { width: auto; white-space: normal; display: block; padding-bottom: 0; border-bottom: 0; }
  .table td:last-child { display: block; padding-top: 2px; }

  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer .container { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .social a { width: 44px; height: 44px; font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-hint { animation: none; }
  .card, .card:hover, .gallery img { transition: none; transform: none; }
  .animated { opacity: 1; animation: none !important; }
}
