/* ============================================================
   Zihan Zhang — Personal Website
   Light blue academic portfolio theme
   Colors adapted from reference design at localhost:8000
   Layout: tab-based single-page architecture
   ============================================================ */

:root {
  /* ---------- Color palette ---------- */
  --bg:        #f2f8fd;
  --bg-deep:   #e6f2fb;
  --card:      #ffffff;
  --primary:   #4a9fd4;
  --primary-dark: #2f7fb0;
  --primary-light: #9ed0ea;
  --accent:    #79bde0;
  --text:      #1e3a4f;
  --text-soft: #4a6b82;
  --text-faint: #7a97ab;
  --line:      #cfe6f4;
  --shadow:   0 2px 14px rgba(74, 159, 212, 0.10);
  --shadow-hover: 0 8px 28px rgba(74, 159, 212, 0.18);
  --radius:    14px;
  --radius-sm: 8px;

  /* Font stacks */
  --font-head: Georgia, "Times New Roman", serif;
  --font-body: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 80% -10%, #dceefb 0%, rgba(220, 238, 251, 0) 60%),
    radial-gradient(900px 420px at -10% 30%, #e3f2fc 0%, rgba(227, 242, 252, 0) 55%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--primary-dark); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary); text-decoration: underline; }
ul { list-style: none; padding: 0; margin: 0; }
button { font: inherit; cursor: pointer; }
p { margin: 0 0 0.6rem 0; }

/* ============================================================
   TOP NAVIGATION — frosted glass, pill-shaped tabs
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0;
}
.brand {
  font-family: var(--font-head);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--primary-dark) !important;
  padding: 16px 0;
  white-space: nowrap;
  text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--primary-dark) !important; }

.nav {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0;
}
.nav-list, .nav-side {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 10px 0;
}
.nav-list {
  flex: 1;
  justify-content: space-evenly;
}
.nav-side {
  justify-content: flex-end;
  flex: 0 0 auto;
}

.nav-link {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--text-soft) !important;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.nav-link:hover {
  background: var(--bg-deep);
  color: var(--primary-dark) !important;
  text-decoration: none;
}
.nav-link.is-active {
  background: var(--primary);
  color: #ffffff !important;
  font-weight: 600;
}
.nav-cta {
  background: var(--bg-deep);
  color: var(--primary-dark) !important;
  font-weight: 600;
  border: 1px solid var(--line);
}
.nav-cta:hover {
  background: var(--primary-light);
  color: var(--primary-dark) !important;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 0.5rem;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--primary-dark);
  border-radius: 2px;
  transition: 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem 1rem;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
  }
  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-list, .nav-side {
    flex: 0 0 auto;
    flex-direction: column;
    width: 100%;
    justify-content: flex-start;
  }
}

/* ============================================================
   MAIN — tab panels
   ============================================================ */
main {
  flex: 1;
  position: relative;
}
.tab-panel {
  display: none;
  animation: fadeIn 0.35s ease;
}
.tab-panel.is-active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   PAGE — inner content wrapper
   ============================================================ */
.page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 52px 24px 72px;
}

/* ---------- Page header ---------- */
.page-head { margin-bottom: 34px; }
.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 6px;
}
.page-title {
  font-family: var(--font-head);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 8px;
  line-height: 1.2;
}
.page-lead {
  color: var(--text-faint);
  font-size: 0.98rem;
  margin: 0;
  max-width: 720px;
  letter-spacing: 0.2px;
}
@media (max-width: 600px) {
  .page-title { font-size: 1.7rem; }
  .page { padding: 34px 16px 56px; }
}

.page-body { display: block; }

/* ============================================================
   HOME PAGE
   ============================================================ */
.home-shell {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 52px 24px 40px;
}
.home-wrap { max-width: 1100px; margin: 0 auto 44px; }

/* Intro card: text on left, circular photo on right, vertically centered */
.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 3rem;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 56px;
}
.home-intro-text { min-width: 0; }
.home-photo {
  display: flex;
  justify-content: center;
  align-items: center;
}
.home-photo img {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  object-fit: contain;
  object-position: center center;
  border: 4px solid var(--card);
  box-shadow: var(--shadow-hover);
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.home-photo img:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 30px rgba(74, 159, 212, 0.25);
}
@media (max-width: 920px) {
  .home-intro { grid-template-columns: 1fr; gap: 2rem; padding: 40px; }
  .home-photo { order: -1; }
  .home-photo img { width: 240px; height: 240px; }
}
.home-intro h1 {
  font-family: var(--font-head);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 6px;
  letter-spacing: 0.3px;
}
.home-intro p { margin: 0 0 20px; color: var(--text-soft); }
.home-intro p:last-of-type { margin-bottom: 0; }
.home-intro strong { color: var(--primary-dark); }
.home-links {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
  font-size: 0.98rem;
}
.home-links a { font-weight: 600; }
@media (max-width: 600px) {
  .home-intro { padding: 34px 26px 30px; }
  .home-intro h1 { font-size: 1.8rem; }
}

/* ============================================================
   SECTION GRID — 6 cards on home page
   ============================================================ */
.section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1000px) { .section-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .section-grid { grid-template-columns: 1fr; } }

.section-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.section-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.section-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-deep);
}
.section-thumb img,
.section-thumb svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.section-card:hover .section-thumb img,
.section-card:hover .section-thumb svg { transform: scale(1.05); }
.section-hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(74, 159, 212, 0.85), rgba(47, 127, 176, 0.9));
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.section-card:hover .section-hover { opacity: 1; }
.section-info { padding: 14px 18px; text-align: center; }
.section-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin: 0 0 4px;
}
.section-sub {
  font-size: 0.88rem;
  color: var(--text-faint);
  margin: 0;
}

/* ============================================================
   CARDS / BLOCKS — content sections
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 30px;
  margin-bottom: 20px;
}
.block-title {
  font-family: var(--font-head);
  font-size: 1.42rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  padding-left: 14px;
  border-left: 4px solid var(--primary-light);
}
.block-lead { color: var(--text-faint); font-size: 0.95rem; margin: 0 0 18px; }
.prose-text { color: var(--text-soft); line-height: 1.75; margin: 0 0 0.75rem; }
.prose-h3 {
  font-family: var(--font-head);
  font-size: 1.16rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 1.5rem 0 0.6rem;
}

/* ---------- Subblocks ---------- */
.subblock-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 1.5rem;
}
.subblock-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
}
.subblock-title {
  font-family: var(--font-head);
  font-size: 1.42rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}
.subblock-sub { margin: 4px 0 0; color: var(--text-faint); font-size: 0.93rem; }
.subblock-body { color: var(--text-soft); }

/* ---------- Two column layout ---------- */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

.prose p { margin: 0 0 0.85rem; line-height: 1.75; }
.prose strong { color: var(--primary-dark); }
.keywords { font-size: 0.93rem; color: var(--text-faint); }

/* ---------- Side card (ESG download) ---------- */
.side-card {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}
.side-card-meta { font-size: 0.82rem; color: var(--text-faint); margin: 0.6rem 0 0; }

/* ---------- Quote / blockquote ---------- */
.quote {
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  font-size: 0.94rem;
  color: var(--text-soft);
  margin: 14px 0;
}
.quote p { margin-bottom: 10px; }
.quote p:last-child { margin-bottom: 0; }
.quote ol { padding-left: 1.25rem; margin: 0.4rem 0; }
.quote li { margin-bottom: 8px; line-height: 1.6; }

/* ---------- Doc link (pill) ---------- */
.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 6px 8px 6px 0;
  transition: all 0.2s ease;
}
.doc-link:hover {
  background: var(--primary-light);
  text-decoration: none;
}

/* ============================================================
   GALLERY — photo grid (from reference design)
   ============================================================ */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin: 16px 0 28px;
}
.gallery figure {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  margin: 0;
}
.gallery figure:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: var(--bg-deep);
}
.gallery figcaption {
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text-soft);
}
/* Eco Ranger game cover: portrait source shown at the standard gallery height,
   with the crop window shifted down so the ranger character stays fully visible. */
.gallery figure.game-cover img { object-position: center 70%; }

/* Shift the crop window upward inside a standard-height gallery image
   (e.g., Volunteer B's first photo) so both people's heads stay visible. */
.gallery img.img-focus-top {
  object-position: center 20%;
}

/* Clickable PDF thumbnail inside the gallery — keeps the PDF page's native
   aspect ratio (16:9) instead of cropping like a photo. */
.gallery figure.pdf-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
}
.gallery figure.pdf-thumb a {
  display: block;
  width: 100%;
  text-align: center;
}
.gallery figure.pdf-thumb img {
  width: auto;
  height: 200px;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto;
  background: var(--bg-deep);
  transition: transform 0.25s ease;
}
.gallery figure.pdf-thumb:hover img {
  transform: scale(1.03);
}

/* Sub-section heading inside a card (e.g., "Designed merchandises", "Stall") */
.sub-h3 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 1.5rem 0 0.75rem;
  padding-left: 12px;
  border-left: 3px solid var(--primary-light);
}

/* ============================================================
   SAGE — prose block inside each card
   ============================================================ */
.prose-block {
  color: var(--text-soft);
  line-height: 1.78;
  font-size: 0.97rem;
}
.prose-block p { margin: 0 0 0.85rem; }
.prose-block--sage { margin-top: 1.5rem; }
.prose-block--sage p:last-child { margin-bottom: 0; }

/* When a card contains only prose (no title), tighten the top space by one line. */
.card--prose-only .prose-block--sage { margin-top: 0; }

.sage-bullets {
  list-style: none;
  padding-left: 0;
  margin: 0.6rem 0 1.1rem;
}
.sage-bullets li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.55rem;
  line-height: 1.7;
  color: var(--text-soft);
}
.sage-bullets li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.78em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.numbered-list {
  list-style: decimal;
  padding-left: 1.4rem;
  margin: 0.6rem 0 1.1rem;
}
.numbered-list li {
  margin-bottom: 0.55rem;
  line-height: 1.7;
  color: var(--text-soft);
}
.numbered-list li::marker { color: var(--primary-dark); font-weight: 600; }

/* Cursor hint for clickable images */
img.zoomable { cursor: zoom-in; }
.merch-tile img.zoomable,
.gallery img.zoomable,
.cover-frame img.zoomable,
.home-photo img { transition: transform 0.3s ease; }
.merch-tile:hover img.zoomable,
.gallery figure:hover img.zoomable { transform: scale(1.03); }

/* ============================================================
   MERCH GRID
   ============================================================ */
.merch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 16px 0 20px;
}
@media (max-width: 900px) { .merch-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .merch-grid { grid-template-columns: 1fr; } }
.merch-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.merch-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.merch-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; }

/* ---------- Cover frame ---------- */
.cover-frame {
  margin: 0 0 28px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  max-width: 720px;
}
.cover-frame--tall { max-width: 560px; }
.cover-frame img { width: 100%; height: auto; object-fit: cover; }

/* ============================================================
   ECO RANGER — link CTA card + headings
   ============================================================ */
.eco-cta {
  text-align: center;
  margin: 0 auto;
  padding: 10px 8px 4px;
}
.eco-game-line {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 1.42rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: underline;
  letter-spacing: 0.2px;
  line-height: 1.35;
}
.eco-game-line:hover {
  color: var(--primary-dark);
}

/* Math symbol harmonization — render Σ in same font as surrounding text
   so it doesn't look like a different typeface next to the words. */
.math-it {
  font-family: inherit;
  font-style: italic;
  margin-right: 0.18em;
}

/* Wider/clearer gallery when used inside .card padding */
.card .gallery { margin-top: 0.5rem; }

/* ============================================================
   HOMEPAGE COVER — shift crop window to keep left edge visible
   ============================================================ */
.section-thumb img.section-thumb-shift-left {
  object-position: left center;
}

/* ============================================================
   PDF CARD GRID — document thumbnails
   ============================================================ */
.pdf-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin: 1rem 0 0.5rem;
}
.pdf-card-grid--two { grid-template-columns: repeat(2, minmax(200px, 1fr)); max-width: 520px; }
.pdf-card-grid--centered { justify-content: center; max-width: 240px; }

.pdf-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
}
.pdf-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}
.pdf-card--compact { max-width: 100%; }

.pdf-card-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}
.pdf-card-thumb--small { aspect-ratio: 4 / 3; max-height: 160px; }
.pdf-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.pdf-card:hover .pdf-card-thumb img { transform: scale(1.04); }

.pdf-card-body {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
}
.pdf-card-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.pdf-card-badge--final {
  background: var(--primary-dark);
}
.pdf-card-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdf-card:hover .pdf-card-name { color: var(--primary-dark); }

/* ============================================================
   E-BOOK VIEWER — page-by-page image reader
   ============================================================ */
.ebook-card {
  padding: 22px 24px;
}
.ebook {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  user-select: none;
}
.ebook-stage {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  min-height: 420px;
}
.ebook-stage img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.ebook-nav {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.ebook-nav:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: scale(1.08);
}
.ebook-nav:disabled {
  background: var(--primary-light);
  cursor: not-allowed;
  opacity: 0.6;
}
.ebook-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 16px;
  color: var(--text-faint);
  font-size: 0.9rem;
}
.ebook-meta kbd {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-body);
  font-size: 0.85rem;
}
.ebook-return {
  background: var(--primary);
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}
.ebook-return:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}
.ebook-return:active {
  transform: scale(0.97);
}
@media (max-width: 700px) {
  .ebook { gap: 0.5rem; }
  .ebook-stage { padding: 8px; min-height: 280px; }
  .ebook-stage img { max-height: 60vh; }
  .ebook-nav { width: 38px; height: 38px; font-size: 14px; }
  .ebook-meta { flex-direction: column; gap: 0.4rem; }
}

/* ============================================================
   TEAM LIST
   ============================================================ */
.team-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 12px 0 8px;
}
.team-list--single { grid-template-columns: 1fr; max-width: 600px; }
@media (max-width: 700px) { .team-list { grid-template-columns: 1fr; } }

.team-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary-light);
  border-radius: var(--radius-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.team-card--lead {
  background: var(--bg-deep);
  border-left-color: var(--primary);
  box-shadow: 0 2px 8px rgba(74, 159, 212, 0.10);
}
.team-card:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow);
}
.team-avatar {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.team-card--lead .team-avatar {
  background: var(--primary-dark);
}
.team-info { min-width: 0; }
.team-name {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text);
  margin: 0;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.team-flag {
  display: inline-block;
  background: var(--primary-dark);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.team-role { margin: 3px 0 0; font-size: 0.88rem; color: var(--text-faint); }

/* ============================================================
   DOCUMENT VIEWER — in-site reader
   ============================================================ */
.doc-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: docSlideIn 0.3s ease;
}
.doc-viewer[hidden] { display: none; }
@keyframes docSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.doc-viewer-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(74, 159, 212, 0.08);
  flex-shrink: 0;
}
.doc-viewer-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary-dark);
  transition: all 0.2s ease;
}
.doc-viewer-back:hover {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary);
}
.doc-viewer-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-viewer-open {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}
.doc-viewer-open:hover {
  background: var(--primary-light);
  text-decoration: none;
}

.doc-viewer-frame {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.doc-viewer-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
/* For HTML content (docx) */
.doc-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 32px;
  font-family: var(--font-body);
  line-height: 1.85;
  color: var(--text);
  overflow-y: auto;
  height: 100%;
}
.doc-content h3 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin: 1.5rem 0 0.5rem;
}
.doc-content h4 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin: 1.2rem 0 0.4rem;
}
.doc-content p { margin: 0 0 0.8rem; }
.doc-content ul { padding-left: 1.5rem; margin: 0.5rem 0 1rem; }
.doc-content li { margin-bottom: 0.4rem; }

/* CV resume (from textutil docx→html conversion, preserves original formatting) */
.cv-resume {
  background: #fff;
  max-width: 780px;
  padding: 48px 56px;
  font-family: 'Times New Roman', Times, serif;
  color: #1a1a1a;
  line-height: 1.5;
}
.cv-resume p { margin: 0; }
.cv-resume ul { margin: 0; padding-left: 24px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  padding: 18px 24px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-faint);
}
.footer a { color: var(--primary-dark); }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .no-print, .nav-toggle, .doc-viewer { display: none !important; }
  .tab-panel { display: block !important; page-break-after: always; }
  body { background: #fff; }
}

/* ============================================================
   LIGHTBOX — full-screen image viewer
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15, 30, 45, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 80px;
  animation: lbFadeIn 0.2s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  user-select: none;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 0;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.32); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 0;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.32); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-counter {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  font-family: var(--font-body);
}
.lightbox-caption {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  text-align: center;
  font-family: var(--font-body);
}
@media (max-width: 600px) {
  .lightbox { padding: 60px 12px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-nav { width: 40px; height: 40px; font-size: 18px; }
}
