/* ============ People: home cards, quick view, profile pages ============ */

/* ---------- Home: people cards ---------- */
.people-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.pcard::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, var(--teal), var(--blue), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 3;
}
.pcard:hover,
.pcard:focus-within { transform: translateY(-6px); box-shadow: 0 24px 50px rgba(7, 28, 51, 0.18); }
.pcard:hover::before,
.pcard:focus-within::before { opacity: 1; }

.pcard-media {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: var(--navy-deep);
}
.pcard-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.pcard:hover .pcard-media img { transform: scale(1.06); }
.pcard-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 28, 51, 0.88) 0%, rgba(7, 28, 51, 0.15) 55%, transparent 100%);
}
.pcard-title {
  position: absolute;
  left: 1.6rem;
  right: 1.6rem;
  bottom: 1.3rem;
  z-index: 2;
  color: var(--white);
}
.pcard-title h3 { color: var(--white); font-size: 1.9rem; margin: 0 0 0.25rem; }
.pcard-title .pcard-role {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--teal-soft);
}
.pcard-body { padding: 1.5rem 1.6rem 1.7rem; display: flex; flex-direction: column; gap: 1.1rem; flex: 1; }
.pcard-flc { margin: 0; font-size: 0.8rem; color: var(--teal-text); font-weight: 600; }
.pcard-intro { margin: 0; color: var(--muted); font-size: 0.95rem; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--navy);
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.pcard:hover .chips li { background: var(--navy); color: var(--white); border-color: var(--navy); }

.pcard-actions { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: var(--white); }
.pill-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
}
.pill-link:hover, .pill-link:focus-visible { background: var(--tint); text-decoration: underline; }

/* ---------- Quick view dialog ---------- */
.qv {
  width: min(680px, calc(100% - 32px));
  max-height: min(86vh, 760px);
  border: 0;
  border-radius: 18px;
  padding: 0;
  overflow: auto;
  color: var(--ink);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
}
.qv::backdrop { background: rgba(4, 18, 31, 0.7); backdrop-filter: blur(5px); }
.qv[open] { animation: qv-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes qv-in { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }
.qv-head {
  position: relative;
  padding: 1.8rem 2rem 1.4rem;
  color: var(--white);
  background: linear-gradient(120deg, var(--navy-deep), var(--navy) 70%, #0e4a73);
}
.qv-head h3 { color: var(--white); font-size: 1.8rem; margin: 0 0 0.2rem; }
.qv-head p { margin: 0; color: var(--teal-soft); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.qv-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.qv-close:hover { background: rgba(255, 255, 255, 0.22); }
.qv-body { padding: 1.6rem 2rem 2rem; }
.qv-foot { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.4rem; }

/* ---------- Timeline (shared) ---------- */
.timeline {
  --tl: 0;
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 2.2rem;
}
.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  width: 2px;
  border-radius: 2px;
}
.timeline::before { bottom: 6px; background: var(--line); }
.timeline::after {
  height: calc((100% - 12px) * var(--tl));
  background: linear-gradient(to bottom, var(--teal), var(--blue));
  transition: height 0.15s linear;
}
.timeline li { position: relative; padding-bottom: 1.5rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -2.2rem;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--line);
  transition: border-color 0.3s, transform 0.3s, background 0.3s;
}
.timeline li.is-on::before { border-color: var(--teal); background: var(--teal); transform: scale(1.1); }
.tl-year {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal-text);
  margin-bottom: 0.15rem;
}
.tl-text { margin: 0; color: var(--ink); font-size: 0.97rem; }

/* ---------- Profile page ---------- */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: calc(var(--p, 0) * 100%);
  background: linear-gradient(90deg, var(--teal), var(--blue));
  z-index: 100;
}
.p-hero {
  position: relative;
  color: var(--white);
  background:
    linear-gradient(100deg, rgba(7, 28, 51, 0.95) 0%, rgba(7, 28, 51, 0.8) 55%, rgba(7, 28, 51, 0.5) 100%),
    url("../assets/hero-seahorse.webp") center / cover no-repeat;
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(5.5rem, 10vw, 8rem);
  overflow: hidden;
}
.p-hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}
.p-hero .back-link { margin: 0 0 1.6rem; font-size: 0.88rem; }
.p-hero .back-link a { color: var(--teal-soft); text-decoration: none; }
.p-hero .back-link a:hover { text-decoration: underline; }
.p-hero h1 { color: var(--white); font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1.02; margin: 0 0 0.9rem; }
.p-role {
  display: inline-block;
  margin: 0 0.6rem 0.5rem 0;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--teal);
  color: var(--navy-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.p-flc { display: inline-block; margin: 0 0 1.1rem; font-size: 0.85rem; color: rgba(255, 255, 255, 0.78); }
.p-intro { max-width: 36rem; margin: 0 0 1.8rem; font-size: 1.05rem; color: rgba(255, 255, 255, 0.88); }
.p-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.p-actions .btn-outline { border-color: rgba(255, 255, 255, 0.55); }

.p-hero-photo { position: relative; justify-self: center; width: min(360px, 100%); }
.p-hero-photo::before {
  content: "";
  position: absolute;
  inset: 20px -20px -20px 20px;
  border: 2px solid var(--teal);
  border-radius: 20px;
  opacity: 0.65;
  transition: transform 0.4s ease;
}
.p-hero-photo:hover::before { transform: translate(6px, 6px); }
.frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.25s ease-out;
  background: var(--navy-deep);
}
.frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; display: block; }
.float-chip {
  position: absolute;
  z-index: 2;
  padding: 0.5rem 0.95rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: bob 5s ease-in-out infinite;
}
.float-chip.c1 { left: -22px; bottom: 15%; }
.float-chip.c2 { right: -14px; top: 12%; animation-delay: -2.4s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.p-stats { position: relative; z-index: 2; margin-top: -3.4rem; }
.stat-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.stat-row li {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stat-row li:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(7, 28, 51, 0.14); }
.stat-row strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 1;
  color: var(--navy);
  background: linear-gradient(120deg, var(--navy), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-row span { display: block; margin-top: 0.5rem; font-size: 0.82rem; color: var(--muted); }

.p-subnav {
  position: sticky;
  top: var(--header-h, 68px);
  z-index: 40;
  margin-top: 2.2rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-block: 1px solid var(--line);
}
.p-subnav .container { display: flex; gap: 1.8rem; overflow-x: auto; scrollbar-width: none; }
.p-subnav .container::-webkit-scrollbar { display: none; }
.p-subnav a {
  flex: none;
  padding: 0.95rem 0 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.p-subnav a:hover { color: var(--navy); }
.p-subnav a.is-active { color: var(--navy); border-bottom-color: var(--teal); }

.container.p-content { width: min(100% - 48px, 860px); padding: 1rem 0 4.5rem; }
.p-section { padding-top: 3rem; scroll-margin-top: calc(var(--header-h, 68px) + 56px); }
.p-section > h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin: 0 0 1.2rem; }
.p-section > h2::after { content: ""; display: block; width: 56px; height: 3px; margin-top: 0.7rem; border-radius: 3px; background: linear-gradient(90deg, var(--teal), var(--blue)); }
.p-section p { color: var(--ink); }

.xp-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; counter-reset: xp; }
.xp-grid li {
  position: relative;
  counter-increment: xp;
  padding: 1.2rem 1.2rem 1.2rem 3.6rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.93rem;
  color: var(--ink);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.xp-grid li::before {
  content: counter(xp, decimal-leading-zero);
  position: absolute;
  left: 1.1rem;
  top: 1.15rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal);
}
.xp-grid li:hover { transform: translateY(-4px); border-color: var(--teal); box-shadow: 0 16px 34px rgba(7, 28, 51, 0.12); }

.rec-card {
  position: relative;
  margin: 0;
  padding: 2.2rem 2rem 2rem 2.4rem;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(130deg, var(--navy-deep), var(--navy) 70%, #0e4a73);
  overflow: hidden;
}
.rec-card::before {
  content: "\201C";
  position: absolute;
  top: -0.2rem;
  left: 1rem;
  font-family: var(--serif);
  font-size: 7rem;
  line-height: 1;
  color: var(--teal);
  opacity: 0.35;
}
.rec-card p { position: relative; margin: 0; color: inherit; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.info-card {
  padding: 1.5rem;
  background: var(--tint);
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: 12px;
}
.info-card h3 { font-size: 1.25rem; margin: 0 0 0.6rem; }
.info-card p { margin: 0; font-size: 0.93rem; color: var(--ink); }
.info-card a { font-weight: 600; }

.next-person {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 3.4rem;
  padding: 1.2rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.next-person:hover { transform: translateX(6px); border-color: var(--teal); }
.next-person img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: center 15%; }
.next-person small { display: block; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--teal-text); font-weight: 700; }
.next-person strong { font-family: var(--serif); font-size: 1.5rem; color: var(--navy); }
.next-person .arrow { margin-left: auto; font-size: 1.6rem; color: var(--teal); transition: transform 0.3s; }
.next-person:hover .arrow { transform: translateX(6px); }

/* Directory remarks on a profile page */
.quote-h { font-size: 1.15rem; margin: 2rem 0 0.8rem; color: var(--navy); }
.quote-card {
  margin: 1.2rem 0 0;
  padding: 1.4rem 1.6rem;
  background: var(--tint);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 12px;
}
.quote-card p { margin: 0 0 0.6rem; font-family: var(--serif); font-size: 1.3rem; line-height: 1.4; color: var(--navy); }
.quote-card cite { font-style: normal; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal-text); }

/* ---------- Reveal on scroll (only when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .people-grid { grid-template-columns: 1fr; }
  .p-hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .p-hero-photo { order: -1; width: min(300px, 78%); }
  .float-chip.c1 { left: -10px; }
  .float-chip.c2 { right: -6px; }
}
@media (max-width: 620px) {
  .stat-row { grid-template-columns: 1fr; }
  .stat-row li { display: flex; align-items: center; gap: 1rem; text-align: left; padding: 1rem 1.2rem; }
  .stat-row strong { flex: none; min-width: 5.6rem; font-size: 2rem; white-space: nowrap; padding-right: 0.2rem; }
  .stat-row span { margin: 0; }
  .xp-grid, .info-grid { grid-template-columns: 1fr; }
  .p-stats { margin-top: -2.6rem; }
  .qv-head, .qv-body { padding-inline: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .pcard, .pcard-media img, .frame, .stat-row li, .xp-grid li, .next-person, .next-person .arrow, .p-hero-photo::before { transition: none; }
  .float-chip, .qv[open] { animation: none; }
  .pcard:hover, .pcard:focus-within { transform: none; }
  .pcard:hover .pcard-media img { transform: none; }
}
