/* ==========================================================================
   CIMTT — site theme v2 (loaded after style.css by every migrated page)
   Direction: the QSky visual language (deep navy surfaces, drifting light
   beams, rise/reveal motion, wide-tracked eyebrows) on the CIMTT teal/indigo
   palette, set in Chivo. Content and markup structure are untouched; every
   rule is scoped to body.v2 so the other pages keep their current look.
   ========================================================================== */

@font-face {
  font-family: "Chivo";
  src: url("../fonts/Chivo-Variable.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Chivo";
  src: url("../fonts/Chivo-Italic-Variable.ttf") format("truetype");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

body.v2 {
  --ff-sans:    "Chivo", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ff-display: "Chivo", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --navy-900: #050f2b;
  --navy-800: #0b1d3a;
  --navy-700: #12295a;
  --teal:     #0ea5b7;
  --teal-soft:#5fd4e2;
  --indigo:   #6366f1;
  --indigo-soft:#9a9cff;
  --grad:     linear-gradient(90deg, var(--teal) 0%, var(--indigo) 100%);
  --line-dark: rgba(255,255,255,.12);
  --ease:     cubic-bezier(.2,.7,.2,1);

  --r-sm: 6px; --r-md: 14px; --r-lg: 20px; --r-pill: 999px;
  --shadow-lg: 0 30px 60px -24px rgba(5,15,43,.35), 0 8px 20px -10px rgba(5,15,43,.15);
}

/* ---------- Type ---------- */
.v2 h1, .v2 h2, .v2 h3, .v2 h4 { letter-spacing: -.02em; }
.v2 h1 { font-weight: 800; line-height: 1.04; font-size: clamp(2.2rem, 4.6vw + .6rem, 4.1rem); }
.v2 h2 { font-weight: 700; line-height: 1.1; font-size: clamp(1.8rem, 2.4vw + .8rem, 2.8rem); }
.v2 h3 { font-weight: 700; }
.v2 p  { line-height: 1.65; }
.v2 .eyebrow {
  font-weight: 600; font-size: .74rem; letter-spacing: .18em;
  color: var(--accent-deep);
}
.v2 .section { padding: clamp(4rem, 9vw, 7.5rem) 0; }

/* Section headings get a short gradient rule underneath. */
.v2 .section-head { text-align: center; margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.v2 .section-head h2 { margin-bottom: 0; }
.v2 .section-head::after {
  content: ""; display: block; width: 64px; height: 3px; margin: 18px auto 0;
  border-radius: 2px; background: var(--grad);
}

/* ---------- Header: glass, transparent while over the hero ---------- */
.v2 .site-header {
  background: rgba(247,249,252,.78);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  transition: background .35s var(--ease), border-color .35s var(--ease), transform .25s ease;
}
.v2 .brand-logo-light { display: none; }
.v2 .nav-links a { font-weight: 500; border-radius: var(--r-pill); }
.v2 .nav-links a.is-current { background: rgba(14,165,183,.10); }
.v2 .lang-switch { border-radius: var(--r-pill); }
.v2 .lang-switch button.is-active { background: var(--navy-800); }
.v2 .dropdown { border-radius: 12px; padding: .5rem; }
.v2 .dropdown a { border-radius: 8px; }

@media (min-width: 880px) {
  /* Fixed rather than sticky so the hero starts at y=0 underneath it: no
     gap between header and hero whatever the header's real height. */
  .v2 .site-header { position: fixed; left: 0; right: 0; top: 0; }
  .v2 .site-header:not(.is-scrolled) {
    background: transparent; border-bottom-color: transparent;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .v2 .site-header:not(.is-scrolled) .brand-logo-dark  { display: none; }
  .v2 .site-header:not(.is-scrolled) .brand-logo-light { display: block; }
  .v2 .site-header:not(.is-scrolled) .nav-links a { color: rgba(255,255,255,.86); }
  .v2 .site-header:not(.is-scrolled) .nav-links a:hover { color: #fff; background: rgba(255,255,255,.10); }
  .v2 .site-header:not(.is-scrolled) .nav-links a.is-current { color: #fff; background: rgba(255,255,255,.14); }
  .v2 .site-header:not(.is-scrolled) .dropdown a { color: var(--ink-2); }
  .v2 .site-header:not(.is-scrolled) .dropdown a:hover { color: var(--ink); }
  .v2 .site-header:not(.is-scrolled) .lang-switch { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.25); }
  .v2 .site-header:not(.is-scrolled) .lang-switch button { color: rgba(255,255,255,.75); }
  .v2 .site-header:not(.is-scrolled) .lang-switch button.is-active { background: #fff; color: var(--navy-800); }
}

/* ---------- Hero ---------- */
.v2 .hero {
  height: clamp(560px, 100svh, 960px);
  background: var(--navy-900);
  color: #fff;
}
.v2 .hero-image { overflow: hidden; will-change: transform; }
.v2 .hero-image img {
  object-position: center 35%;
  transform-origin: center;
  animation: kenburns 24s var(--ease) forwards;
}
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08); } }

.v2 .hero-overlay {
  background:
    linear-gradient(180deg, rgba(5,15,43,.55) 0%, rgba(5,15,43,.25) 35%, rgba(5,15,43,.72) 72%, rgba(5,15,43,.96) 100%);
}
/* drifting light beams, as on qsky.cimtt.cl */
.v2 .hero-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.v2 .beam {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
  animation: drift 16s ease-in-out infinite alternate;
}
.v2 .beam-teal   { width: 55vw; height: 55vw; left: -18vw; bottom: -20vw; background: radial-gradient(circle, rgba(14,165,183,.85) 0%, rgba(14,165,183,0) 65%); }
.v2 .beam-indigo { width: 50vw; height: 32vw; right: -16vw; top: 8vw;  background: radial-gradient(ellipse, rgba(99,102,241,.8) 0%, rgba(99,102,241,0) 65%); animation-delay: -8s; }
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(4vw,-3vw,0) scale(1.12); } }

.v2 .hero-overlay .container { inset: auto 0 clamp(88px, 16vh, 150px) 0; z-index: 2; }
.v2 .hero .eyebrow { color: var(--teal-soft); margin-bottom: 1.2rem; }
.v2 .hero-overlay h1 {
  color: #fff; margin: 0; text-shadow: 0 2px 30px rgba(5,15,43,.45);
  font-size: clamp(2rem, 3.4vw + .4rem, 4rem); line-height: 1.06;
  max-width: min(20ch, 100%);
  overflow-wrap: normal; word-break: normal; hyphens: manual;   /* whole words only */
}
@media (max-width: 640px) { .v2 .hero-overlay h1 { font-size: clamp(1.7rem, 6.2vw, 2.4rem); max-width: 100%; } }
.v2 .hero-bar { display: block; width: 96px; height: 3px; margin-top: 28px; border-radius: 2px; background: var(--grad); }

/* staged entrance */
.v2 .hero .eyebrow, .v2 .hero h1, .v2 .hero-bar {
  opacity: 0; transform: translateY(28px); animation: rise .9s var(--ease) forwards;
}
.v2 .hero .eyebrow { animation-delay: .15s; }
.v2 .hero h1       { animation-delay: .32s; }
.v2 .hero-bar      { animation-delay: .6s; transform-origin: left; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.v2 .scroll-hint {
  position: absolute; left: 50%; bottom: 26px; z-index: 3; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(255,255,255,.65); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  opacity: 0; animation: rise .9s var(--ease) 1.1s forwards;
}
.v2 .scroll-hint:hover { color: #fff; }
.v2 .scroll-hint i { width: 1px; height: 38px; background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0)); animation: hint 1.8s ease-in-out infinite; }
@keyframes hint {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- Reveal (QSky timing; delays set by theme.js) ---------- */
.v2 .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.v2 .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Mission + stats ---------- */
.v2 .split-2 { gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; }
.v2 .stats { gap: 1.25rem; margin-top: 2.4rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.v2 .stat .stat-num {
  font: 800 clamp(2.4rem, 3.4vw, 3.2rem)/1 var(--ff-display); letter-spacing: -.03em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.v2 .stat .stat-lbl { margin-top: .45rem; font-size: .86rem; letter-spacing: .02em; }
.v2 .v2-photo { border-radius: var(--r-lg); box-shadow: var(--shadow-lg); background: #fff; }
.v2 .v2-photo img { transition: transform .8s var(--ease); }
.v2 .v2-photo:hover img { transform: scale(1.03); }
.v2 .v2-photo.logo-plate { padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid var(--line); box-shadow: var(--shadow-md); }

/* ---------- Research-line cards ---------- */
.v2 .rcards { gap: 1.6rem; }
.v2 .rcard {
  border-radius: var(--r-md); border-color: var(--line);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s;
}
.v2 .rcard:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(14,165,183,.35); }
.v2 .rcard-media { overflow: hidden; border-radius: var(--r-md) var(--r-md) 0 0; }
.v2 .rcard-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,15,43,0) 55%, rgba(5,15,43,.45) 100%);
}
.v2 .rcard-media img { transition: transform .9s var(--ease); }
.v2 .rcard:hover .rcard-media img { transform: scale(1.06); }
.v2 .rcard-icon {
  bottom: 14px; left: 14px; width: 42px; height: 42px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: none;
}
.v2 .rcard-body { padding: 1.5rem 1.5rem 1.6rem; }
.v2 .rcard-body h3 { font-size: 1.08rem; line-height: 1.3; }

/* ---------- Dark sections (projects, multimedia) ---------- */
.v2 .section-dark {
  position: relative; isolation: isolate; overflow: hidden;
  background: radial-gradient(1200px 700px at 15% 0%, var(--navy-700), var(--navy-900) 70%);
  color: rgba(255,255,255,.78);
}
.v2 .section-dark h2, .v2 .section-dark h3 { color: #fff; }
.v2 .section-dark .eyebrow { color: var(--teal-soft); }
.v2 .section-dark .card {
  background: rgba(255,255,255,.05); border: 1px solid var(--line-dark);
  border-radius: var(--r-md); padding: 1.8rem;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform .45s var(--ease), border-color .3s, background .3s;
}
.v2 .section-dark .card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--grad); transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease);
}
.v2 .section-dark .card:hover { transform: translateY(-5px); border-color: rgba(95,212,226,.45); background: rgba(255,255,255,.08); box-shadow: none; }
.v2 .section-dark .card:hover::before { transform: scaleX(1); }
.v2 .section-dark .card p { color: rgba(255,255,255,.72); }
.v2 .section-dark .profile-flag {
  display: inline-block; align-self: flex-start;
  padding: .3rem .7rem; border-radius: var(--r-pill);
  background: rgba(14,165,183,.18); color: var(--teal-soft); font-size: .72rem; letter-spacing: .12em;
}
.v2 .section-dark .card-link { color: var(--teal-soft); }
.v2 .section-dark .card-link:hover { color: #fff; }
.v2 .video-frame {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  border-radius: var(--r-lg); border: 1px solid var(--line-dark);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.7);
}
.v2 .video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Gallery ---------- */
.v2 .gallery { gap: .9rem; }
.v2 .gallery img, .v2 .gallery .gallery-pdf { border-radius: 12px; border-color: var(--line); }
.v2 .gallery .gallery-item { overflow: hidden; border-radius: 12px; }
.v2 .gallery .gallery-item img { transition: transform .8s var(--ease), filter .4s; }
.v2 .gallery .gallery-item:hover img { transform: scale(1.06); }

/* ---------- Diploma CTA ---------- */
.v2 .btn { border-radius: var(--r-pill); font-weight: 600; padding: .9rem 1.5rem; transition: transform .25s var(--ease), box-shadow .25s, background .25s; }
.v2 .btn-primary { background: var(--navy-800); box-shadow: 0 14px 30px -14px rgba(11,29,58,.7); }
.v2 .btn-primary:hover { background: var(--accent-deep); transform: translateY(-2px); }

/* ---------- Footer: dark close, matching the hero ---------- */
.v2 .site-footer { background: var(--navy-900); color: rgba(255,255,255,.7); border-top: 0; margin-top: 0; }
.v2 .site-footer h4 { color: #fff; }
.v2 .site-footer a { color: rgba(255,255,255,.72); }
.v2 .site-footer a:hover { color: var(--teal-soft); }
.v2 .site-footer p { color: rgba(255,255,255,.62); }
.v2 .footer-meta { border-top-color: var(--line-dark); color: rgba(255,255,255,.5); }

/* ---------- Mobile ---------- */
@media (max-width: 879px) {
  .v2 .hero { height: clamp(520px, 88svh, 760px); }
  .v2 .hero-overlay .container { inset: auto 0 72px 0; }
  .v2 .hero-content { max-width: 100%; }
  .v2 .scroll-hint { display: none; }
}
@media (max-width: 640px) {
  /* minmax(0,1fr): tracks may shrink below their content so the row never
     pushes the page wider than the phone. */
  .v2 .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
  .v2 .stat { min-width: 0; padding: .9rem .7rem; }
  .v2 .stat .stat-num { font-size: 1.8rem; }
  .v2 .stat .stat-lbl { font-size: .78rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .v2 .hero-image img, .v2 .beam, .v2 .scroll-hint i { animation: none; }
  .v2 .hero .eyebrow, .v2 .hero h1, .v2 .hero-bar, .v2 .scroll-hint { animation: none; opacity: 1; transform: none; }
  .v2 .reveal { opacity: 1; transform: none; transition: none; }
}

/* card links already carry their own ↗ */
.v2 .card-link::after { content: none; }

/* ---------- Static backgrounds + scroll fades (built by theme.js) ----------
   One fixed, full-viewport layer per section sits behind the page; the
   sections themselves go transparent. theme.js drives the layers' opacity
   (each fades in over the previous as its section arrives) and fades each
   section's content in at the top of the viewport and out at the bottom. */
.v2 .site-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.v2 .bgl { position: absolute; inset: 0; overflow: hidden; isolation: isolate; }   /* own stacking context: beams stay inside their layer */
.v2 .bgl-light { background: var(--bg); }
.v2 .bgl-alt   { background: var(--bg-soft); }
.v2 .bgl-dark  { background: radial-gradient(1200px 700px at 15% 0%, var(--navy-700), var(--navy-900) 70%); }
.v2 .bgl-dark .beam { opacity: .35; }
.v2 .bgl-dark .beam-teal   { left: auto; right: -20vw; bottom: -30vw; }
.v2 .bgl-dark .beam-indigo { right: auto; left: -14vw; top: -18vw; }
.v2 .bgl-hero { background: var(--navy-900); }
.v2 .bgl-hero img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%;
  animation: kenburns 24s var(--ease) forwards;
}
.v2 .bgl-hero .bgl-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,15,43,.55) 0%, rgba(5,15,43,.25) 35%, rgba(5,15,43,.72) 72%, rgba(5,15,43,.96) 100%);
}
.v2 .bgl-hero .beam { z-index: 1; }

.v2.is-stacked .hero, .v2.is-stacked .section, .v2.is-stacked .section-alt, .v2.is-stacked .section-dark { background: transparent; }
.v2.is-stacked .hero-image, .v2.is-stacked .hero-fx { display: none; }
.v2.is-stacked .hero-overlay { background: transparent; }
.v2.is-stacked .hero-overlay .container,
.v2.is-stacked .section > .container { will-change: opacity, transform; }
.v2.is-stacked .site-footer { position: relative; z-index: 1; }

/* ---------- Inner pages: page-hero as a dark navy band ---------- */
.v2 .page-hero {
  background: radial-gradient(1200px 700px at 15% 0%, var(--navy-700), var(--navy-900) 70%);
  border-bottom: 0; color: rgba(255,255,255,.78);
  padding: calc(var(--header-h) + clamp(3rem, 7vw, 5.5rem)) 0 clamp(3rem, 6vw, 4.5rem);
}
.v2 .page-hero h1 { color: #fff; max-width: 22ch; overflow-wrap: normal; hyphens: manual; }
.v2 .page-hero .eyebrow { color: var(--teal-soft); }
.v2 .page-hero .lede { color: rgba(255,255,255,.78); }
.v2 .page-hero .crumbs, .v2 .page-hero .crumbs a { color: rgba(255,255,255,.55); }
.v2 .page-hero .crumbs a:hover { color: #fff; }
.v2 .page-hero .crumbs > span[aria-current] { color: rgba(255,255,255,.85); }
.v2 .page-hero .container::after {
  content: ""; display: block; width: 96px; height: 3px; margin-top: 28px; border-radius: 2px; background: var(--grad);
}
.v2 .page-hero { overflow: hidden; isolation: isolate; }
.v2 .page-hero::before, .v2 .page-hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: .35;
  animation: drift 16s ease-in-out infinite alternate;
}
.v2 .page-hero::before { width: 55vw; height: 55vw; right: -20vw; bottom: -30vw; background: radial-gradient(circle, rgba(14,165,183,.85) 0%, rgba(14,165,183,0) 65%); }
.v2 .page-hero::after  { width: 50vw; height: 32vw; left: -14vw; top: -18vw; background: radial-gradient(ellipse, rgba(99,102,241,.8) 0%, rgba(99,102,241,0) 65%); animation-delay: -8s; }
.v2 .page-hero > .container { position: relative; z-index: 1; will-change: opacity, transform; }
.v2.is-stacked .page-hero { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .v2 .page-hero::before, .v2 .page-hero::after { animation: none; } }
@media (max-width: 879px) { .v2 .page-hero { padding-top: clamp(2.5rem, 7vw, 4rem); } }

/* Shared components on inner pages: same radii/hover as the home cards. */
.v2 .card, .v2 .contact-card, .v2 .module, .v2 .profile, .v2 .stat { border-radius: var(--r-md); }
.v2 .card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: rgba(14,165,183,.35); }
.v2 .card-link::after { content: none; }
.v2 .profile-flag { letter-spacing: .12em; font-size: .72rem; }

/* Researcher cards: air between the top edge and the round photo. */
.v2 .profile > .profile-photo.round { margin: 1.6rem auto 0; }

/* ---------- Researcher profile pages (/people/<slug>/, generated by the portal) ---------- */
.v2 .profile { position: relative; }
.v2 .profile.has-page { cursor: pointer; transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s; }
.v2 .profile.has-page:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: rgba(14,165,183,.35); }
.v2 .pp-cardlink { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.v2 .profile.has-page .profile-links { position: relative; z-index: 3; }   /* external links stay clickable */

/* Cover stays readable but visible: light tint at the top, darker only behind the name block. */
.v2 .pp-hero.has-cover { background-image: linear-gradient(180deg, rgba(5,15,43,.55) 0%, rgba(5,15,43,.18) 20%, rgba(5,15,43,.30) 50%, rgba(5,15,43,.62) 100%), var(--pp-cover); background-size: cover; background-position: center; }
.v2 .pp-hero.has-cover h1, .v2 .pp-hero.has-cover .lede, .v2 .pp-hero.has-cover .crumbs { text-shadow: 0 2px 18px rgba(5,15,43,.6); }
.v2 .pp-hero.has-cover::before, .v2 .pp-hero.has-cover::after { opacity: .2; }
.v2 .pp-hero .container::after { content: none; }
.v2 .pp-id { display: flex; align-items: center; gap: clamp(1.2rem, 3vw, 2.4rem); margin-top: 1rem; }
.v2 .pp-photo { width: clamp(120px, 14vw, 180px); height: clamp(120px, 14vw, 180px); border-radius: 50%; object-fit: cover; flex: none; border: 4px solid rgba(255,255,255,.85); box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); }
.v2 .pp-id-text h1 { margin: 0 0 .3em; font-size: clamp(1.9rem, 3.4vw, 3rem); }
.v2 .pp-id-text .lede { margin: 0; }
.v2 .pp-links { display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin: 1rem 0 0; }
.v2 .pp-links a { display: inline-block; padding: .35rem .8rem; border-radius: var(--r-pill); border: 1px solid rgba(255,255,255,.28); color: #fff; font-size: .85rem; font-weight: 600; transition: background .25s, border-color .25s; }
.v2 .pp-links a:hover { background: rgba(255,255,255,.12); border-color: #fff; }
@media (max-width: 640px) { .v2 .pp-id { flex-direction: column; align-items: flex-start; } }

.v2 .pp-grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
@media (min-width: 960px) { .v2 .pp-grid { grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); align-items: start; } }
.v2 .pp-h2 { font-size: 1.35rem; margin: 0 0 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.v2 .pp-main > .reveal + .reveal { margin-top: 2.6rem; }
.v2 .pp-bio { color: var(--ink-2); max-width: 70ch; }
.v2 .pp-bio p, .v2 .pp-article p { margin: 0 0 1em; }
.v2 .pp-bio a, .v2 .pp-article a { text-decoration: underline; text-underline-offset: 2px; }
.v2 .pp-pubs { list-style: none; margin: 0; padding: 0; counter-reset: pub; }
.v2 .pp-pubs li { position: relative; padding: .8rem 0 .8rem 1.5rem; border-bottom: 1px solid var(--line); font-size: .93rem; }
.v2 .pp-pubs li::before { content: ""; position: absolute; left: .45rem; top: 1.35rem; width: .42rem; height: .42rem; border-radius: 50%; background: var(--accent-deep); }
.v2 .pp-pubs strong { display: block; font-weight: 600; color: var(--ink); }
.v2 .pp-pubs span { display: block; color: var(--ink-3); font-size: .86rem; margin-top: .2rem; }
.v2 .muted { color: var(--ink-3); }

.v2 .pp-wall { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.v2 .pp-post { display: flex; flex-direction: column; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; color: inherit; transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s; }
.v2 .pp-post:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(14,165,183,.35); color: inherit; }
.v2 .pp-post-media { display: block; aspect-ratio: 16/10; background: var(--bg-soft); overflow: hidden; }
.v2 .pp-post-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.v2 .pp-post:hover .pp-post-media img { transform: scale(1.06); }
.v2 .pp-post-media-empty { background: linear-gradient(135deg, rgba(14,165,183,.18), rgba(99,102,241,.18)); }
.v2 .pp-post-body { display: flex; flex-direction: column; gap: .4rem; padding: 1.1rem 1.2rem 1.2rem; flex: 1; }
.v2 .pp-post-body time { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-deep); font-weight: 600; }
.v2 .pp-post-body strong { font-family: var(--ff-display); font-size: 1.08rem; line-height: 1.3; color: var(--ink); }
.v2 .pp-post-body p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.v2 .pp-more { margin-top: auto; padding-top: .6rem; font-weight: 600; font-size: .88rem; color: var(--accent-deep); }

.v2 .pp-byline { display: inline-flex; align-items: center; gap: .7rem; margin-top: 1.2rem; color: rgba(255,255,255,.8); }
.v2 .pp-byline img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.7); }
.v2 .pp-byline span { font-weight: 600; color: #fff; }
.v2 .pp-byline time { font-size: .85rem; }
.v2 .pp-byline:hover span { color: var(--teal-soft); }
.v2 .pp-article { max-width: 74ch; margin: 0 auto; color: var(--ink-2); font-size: 1.05rem; line-height: 1.7; }
.v2 .pp-article h1, .v2 .pp-article h2, .v2 .pp-article h3 { margin: 1.6em 0 .6em; }
.v2 .pp-article h1 { font-size: 1.9rem; } .v2 .pp-article h2 { font-size: 1.5rem; } .v2 .pp-article h3 { font-size: 1.2rem; }
.v2 .pp-article img { border-radius: 12px; margin: 1.2rem 0; box-shadow: var(--shadow-md); }
.v2 .pp-article blockquote { margin: 1.2rem 0; padding: .6rem 1.2rem; border-left: 3px solid var(--accent); background: var(--bg-soft); border-radius: 0 10px 10px 0; }
.v2 .pp-article pre { background: var(--navy-900); color: #e6ecff; padding: 1rem 1.2rem; border-radius: 12px; overflow: auto; font-size: .9rem; }
.v2 .pp-article code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.v2 .pp-article :not(pre) > code { background: var(--bg-soft); padding: .1em .4em; border-radius: 5px; }
.v2 .pp-article table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .95rem; }
.v2 .pp-article th, .v2 .pp-article td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; }
.v2 .pp-back { max-width: 74ch; margin: 2.5rem auto 0; font-weight: 600; }

/* ---------- Home deck (desktop, built by theme.js): full-screen panels that fade into each other ---------- */
.v2.is-deck { overflow: hidden; height: 100vh; }
.v2.is-deck .deck-panel {
  position: fixed; inset: 0; z-index: 1;
  display: none; flex-direction: column;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding-top: var(--header-h);
  opacity: 0; transform: translate3d(0, 32px, 0);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.v2.is-deck .deck-panel.is-before { transform: translate3d(0, -32px, 0); }
.v2.is-deck .deck-panel.is-shown  { display: flex; }
.v2.is-deck .deck-panel.is-active { opacity: 1; transform: none; z-index: 2; }
.v2.is-deck .deck-panel > .container { margin: auto; width: 100%; }   /* centred when short, scrolls when tall */
.v2.is-deck .section { padding: calc(var(--header-h) + 1.25rem) 0 2rem; }   /* clears the fixed header */
.v2.is-deck .hero.deck-panel { padding-top: 0; }
.v2.is-deck .hero.deck-panel.is-shown { display: grid; }
.v2.is-deck .site-footer.deck-panel { padding: 3rem 0 2rem; }
.v2.is-deck .site-footer.deck-panel > .container { margin: auto; }
/* dark panels carry their beams themselves (no background stack in deck mode) */
.v2.is-deck .section-dark::before, .v2.is-deck .section-dark::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: .35;
  animation: drift 16s ease-in-out infinite alternate;
}
.v2.is-deck .section-dark::before { width: 55vw; height: 55vw; right: 4vw; bottom: 0; background: radial-gradient(circle, rgba(14,165,183,.85) 0%, rgba(14,165,183,0) 65%); }
.v2.is-deck .section-dark::after  { width: 50vw; height: 32vw; left: -14vw; top: -18vw; background: radial-gradient(ellipse, rgba(99,102,241,.8) 0%, rgba(99,102,241,0) 65%); animation-delay: -8s; }
/* tighter rhythm so a section fits one screen */
.v2.is-deck .section-head { margin-bottom: 1.6rem; }
.v2.is-deck .section-head::after { margin-top: 12px; }
.v2.is-deck h2 { font-size: clamp(1.6rem, 2vw + .6rem, 2.3rem); }
.v2.is-deck .rcards { gap: 1.1rem; }
.v2.is-deck .rcard-media { aspect-ratio: 16/6; }
.v2.is-deck .rcard-body { padding: 1rem 1.2rem 1.1rem; }
.v2.is-deck .rcard-body h3 { font-size: .98rem; }
.v2.is-deck .rcard-body p { font-size: .88rem; }
.v2.is-deck .gallery { gap: .7rem; }
.v2.is-deck .gallery img, .v2.is-deck .gallery .gallery-pdf { height: 140px; }
.v2.is-deck .section-dark .card { padding: 1.3rem 1.5rem; }
.v2.is-deck .video-frame { width: min(960px, calc((100vh - 300px) * 16 / 9)); margin: 0 auto; padding-bottom: 0; height: auto; aspect-ratio: 16 / 9; }
.v2.is-deck .split-2 .home-photo img { max-height: 46vh; object-fit: contain; }

/* side dots */
.v2 .deck-nav { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: 12px; }
.v2 .deck-nav button {
  position: relative; width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(11,29,58,.28); transition: transform .25s var(--ease), background .25s;
}
.v2 .deck-nav button:hover { transform: scale(1.3); }
.v2 .deck-nav button.is-active { background: var(--accent-deep); transform: scale(1.5); }
.v2.deck-dark .deck-nav button { background: rgba(255,255,255,.38); }
.v2.deck-dark .deck-nav button.is-active { background: #fff; }
.v2 .deck-nav button::after {
  content: attr(data-label); position: absolute; right: 22px; top: 50%; transform: translateY(-50%) translateX(6px);
  white-space: nowrap; font: 600 .68rem/1 var(--ff-sans); letter-spacing: .14em; text-transform: uppercase;
  color: #fff; background: var(--navy-800); padding: .38rem .6rem; border-radius: 6px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease);
}
.v2 .deck-nav button:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ---------- Blog section on the home + author line on post cards ---------- */
.v2 .pp-post-author { display: inline-flex; align-items: center; gap: .5rem; margin-top: .4rem; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.v2 .pp-post-author img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.v2 .blog-wall { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.v2.is-deck .blog-wall { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.v2.is-deck .blog-wall .pp-post-media { aspect-ratio: 16/8; }
.v2.is-deck .blog-wall .pp-post-body { padding: .9rem 1rem 1rem; gap: .3rem; }
.v2.is-deck .blog-wall .pp-post-body p { font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v2.is-deck .blog-wall .pp-more { display: none; }

/* ---------- Image viewer for post pages (built by theme.js) ---------- */
.v2 .pp-article img { cursor: zoom-in; }
.v2 .pp-lb { position: fixed; inset: 0; z-index: 100000; display: none; align-items: center; justify-content: center; background: rgba(5,15,43,.94); padding: clamp(.75rem, 3vw, 2rem); }
.v2 .pp-lb.is-open { display: flex; }
.v2 .pp-lb figure { margin: 0; max-width: min(96vw, 1400px); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.v2 .pp-lb img { max-width: 100%; max-height: 78vh; width: auto; height: auto; object-fit: contain; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.v2 .pp-lb figcaption { color: rgba(255,255,255,.8); font-size: .92rem; text-align: center; max-width: 70ch; }
.v2 .pp-lb-count { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.7); font-size: .8rem; letter-spacing: .16em; }
.v2 .pp-lb button { position: absolute; border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .2s, transform .2s; }
.v2 .pp-lb button:hover { background: rgba(255,255,255,.22); }
.v2 .pp-lb-close { top: 14px; right: 16px; width: 44px; height: 44px; border-radius: 50%; font-size: 1.4rem; line-height: 1; }
.v2 .pp-lb-prev, .v2 .pp-lb-next { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; font-size: 1.6rem; }
.v2 .pp-lb-prev { left: 16px; } .v2 .pp-lb-next { right: 16px; }
.v2 .pp-lb-prev:hover { transform: translateY(-50%) translateX(-2px); } .v2 .pp-lb-next:hover { transform: translateY(-50%) translateX(2px); }
.v2 .pp-lb[data-count="1"] .pp-lb-prev, .v2 .pp-lb[data-count="1"] .pp-lb-next, .v2 .pp-lb[data-count="1"] .pp-lb-count { display: none; }
@media (max-width: 640px) { .v2 .pp-lb-prev, .v2 .pp-lb-next { width: 42px; height: 42px; top: auto; bottom: 18px; transform: none; } .v2 .pp-lb img { max-height: 70vh; } }
.v2 .pp-pubs .pp-pub-venue em { font-style: italic; }
.v2 .pp-pubs .pp-pub-doi { font-size: .8rem; word-break: break-all; }
.v2 .pp-pubs .pp-pub-doi a { color: var(--accent-deep); }
