/* ================================================================
   Khamphone Saypaseuth — CV / Portfolio
   Editorial-institutional aesthetic: warm paper, deep ink navy,
   restrained gold. Fraunces display / Public Sans body / Plex Mono.
   ================================================================ */

:root {
  --paper:    #f6f3ec;
  --paper-2:  #efeadf;
  --ink:      #1b2a3a;
  --ink-deep: #14202d;
  --ink-2:    #46586c;
  --gold:     #b0852c;
  --gold-2:   #d9b25f;
  --line:     rgba(27, 42, 58, 0.14);
  --line-light: rgba(246, 243, 236, 0.16);
  --serif: "Fraunces", Georgia, serif;
  --sans:  "Public Sans", -apple-system, sans-serif;
  --mono:  "IBM Plex Mono", monospace;
  --maxw: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* subtle paper grain */
  background-image:
    radial-gradient(rgba(27,42,58,0.035) 1px, transparent 1px);
  background-size: 22px 22px;
}

.mono { font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem; }

::selection { background: var(--gold-2); color: var(--ink-deep); }

/* ---------------- Reveal on scroll ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------------- Nav ---------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.nav-brand span { color: var(--gold); }
.nav-links { display: flex; gap: 1.9rem; align-items: center; }
.nav-links a {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  border: 1px solid var(--ink);
  padding: 0.42rem 1.05rem;
  border-radius: 999px;
  color: var(--ink) !important;
  transition: background 0.2s, color 0.2s !important;
}
.nav-cta:hover { background: var(--ink); color: var(--paper) !important; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 6px 0; transition: transform 0.25s; }

/* ---------------- Hero ---------------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3rem;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 3.5rem;
  align-items: center;
}
.kicker {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 1.4rem;
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 2.2rem;
  height: 1px;
  background: var(--gold);
  vertical-align: middle;
  margin-right: 0.8rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 6.5vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.hero h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}
.hero-role {
  margin-top: 1.5rem;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
  max-width: 34rem;
}
.hero-lede {
  margin-top: 1rem;
  color: var(--ink-2);
  max-width: 34rem;
}
.hero-actions { margin-top: 2.2rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}
.btn-solid {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 10px 24px -12px rgba(20, 32, 45, 0.55);
}
.btn-solid:hover { transform: translateY(-2px); background: var(--ink-deep); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* photo */
.hero-photo { position: relative; justify-self: end; width: min(340px, 80vw); }
.photo-frame {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(20, 32, 45, 0.45);
}
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
  pointer-events: none;
}
.photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  transform: scale(1.14);
  transform-origin: 50% 18%;
}
.hero-photo::before {
  content: "";
  position: absolute;
  inset: 1.1rem -1.1rem -1.1rem 1.1rem;
  border: 1px solid var(--gold);
  border-radius: 4px;
  z-index: -1;
}
.photo-plate {
  position: absolute;
  bottom: -0.9rem;
  left: -1.4rem;
  background: var(--ink);
  color: var(--gold-2);
  padding: 0.55rem 1rem;
  border-radius: 3px;
  box-shadow: 0 12px 24px -10px rgba(20,32,45,0.5);
}

/* stats */
.hero-stats {
  margin-top: 4rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: 1.4rem 1rem;
  text-align: center;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; }
.stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 2.3rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
}
.stat span {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}

/* ---------------- Donor strip ---------------- */
.donor-strip {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.2rem 1.5rem 0.5rem;
  text-align: center;
}
.donor-label { color: var(--ink-2); display: block; margin-bottom: 1.1rem; }
.donor-names {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem 2.6rem;
}
.donor-names .dl {
  width: auto;
  opacity: 0.7;
  transition: opacity 0.25s;
}
.donor-names .dl:hover { opacity: 1; }
.dl-wide { height: 26px; }
.dl-mid  { height: 44px; }
.dl-box  { height: 46px; }
.dl-tall { height: 58px; }
.donor-giz {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  opacity: 0.7;
  transition: opacity 0.25s;
}
.donor-giz:hover { opacity: 1; }

/* ---------------- Sections ---------------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5.5rem 1.5rem 4.5rem;
}
.section-head { margin-bottom: 3rem; position: relative; }
.sec-no {
  color: var(--gold);
  display: block;
  margin-bottom: 0.6rem;
}
.sec-no::after {
  content: "";
  display: inline-block;
  width: 3rem;
  height: 1px;
  background: var(--gold);
  vertical-align: middle;
  margin-left: 0.8rem;
}
.section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  letter-spacing: -0.01em;
}
.section-sub { margin-top: 0.9rem; color: var(--ink-2); max-width: 40rem; }

/* full-bleed variants */
.section-dark, .section-alt { max-width: none; padding-left: 0; padding-right: 0; }
.section-dark > *, .section-alt > * {
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.section-dark {
  background: var(--ink-deep);
  color: var(--paper);
  background-image: radial-gradient(rgba(246,243,236,0.05) 1px, transparent 1px);
  background-size: 22px 22px;
}
.section-dark h2 { color: var(--paper); }
.section-dark .section-sub { color: rgba(246,243,236,0.65); }
.section-alt { background: var(--paper-2); }

/* ---------------- Profile ---------------- */
.profile-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 3.5rem;
}
.lead {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1.5;
  margin-bottom: 1.4rem;
}
.lead strong { font-weight: 500; color: var(--ink); }
.profile-main p + p { margin-top: 1.1rem; color: var(--ink-2); }
.profile-side { display: flex; flex-direction: column; gap: 1.4rem; }
.side-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem 1.6rem;
  background: rgba(255,255,255,0.45);
}
.side-card h3 { color: var(--gold); margin-bottom: 0.9rem; }
.side-card ul { list-style: none; }
.side-card li {
  padding: 0.34rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.92rem;
}
.side-card li:last-child { border-bottom: 0; }
.lang-list li { display: flex; justify-content: space-between; align-items: baseline; }
.lang-list em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

/* ---------------- Portfolio ---------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
}
.project-card {
  position: relative;
  text-align: left;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  background: rgba(246,243,236,0.04);
  padding: 1.6rem 1.5rem 1.4rem;
  color: var(--paper);
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: transform 0.25s ease, background 0.25s, border-color 0.25s;
}
.project-card:hover {
  transform: translateY(-4px);
  background: rgba(246,243,236,0.08);
  border-color: rgba(217,178,95,0.5);
}
.pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem; }
.pc-funder {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-2);
  border: 1px solid rgba(217,178,95,0.4);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.project-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.15;
}
.pc-client {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(246,243,236,0.55);
}
.pc-desc {
  font-size: 0.92rem;
  color: rgba(246,243,236,0.75);
  flex: 1;
}
.pc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line-light);
  padding-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(246,243,236,0.6);
}
.pc-foot .pc-view { color: var(--gold-2); }
.pc-live {
  display: inline-block;
  color: var(--gold-2);
  text-decoration: none;
  border: 1px solid rgba(217, 178, 95, 0.5);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
}
.pc-live:hover {
  background: var(--gold-2);
  border-color: var(--gold-2);
  color: var(--ink-deep);
  transform: translateY(-1px);
}
.project-card.no-gallery { cursor: default; }
.project-card.no-gallery .pc-view { display: none; }
.project-card.no-gallery.no-live .pc-foot { display: none; }

/* ---------------- Timeline ---------------- */
.timeline { position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.2rem;
  padding: 0 0 2.6rem 2.2rem;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--gold);
}
.tl-when {
  color: var(--gold);
  font-size: 0.72rem;
  padding-top: 0.25rem;
  white-space: nowrap;
}
.tl-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.3rem;
  line-height: 1.25;
}
.tl-note { font-family: var(--sans); font-size: 0.85rem; font-weight: 400; color: var(--ink-2); }
.tl-org {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-2);
  margin: 0.35rem 0 0.7rem;
}
.tl-body p:not(.tl-org) { color: var(--ink-2); font-size: 0.95rem; max-width: 46rem; }

/* ---------------- Skills ---------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}
.skill-card {
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.4rem 1.4rem 1.5rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.skill-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -18px rgba(20,32,45,0.35);
}
.skill-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.08rem;
  margin-bottom: 0.6rem;
  color: var(--ink);
}
.skill-card h3::after {
  content: "";
  display: block;
  width: 1.8rem;
  height: 2px;
  background: var(--gold);
  margin-top: 0.5rem;
}
.skill-card p { font-size: 0.87rem; color: var(--ink-2); line-height: 1.7; }

/* ---------------- Education ---------------- */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.col-title {
  color: var(--gold);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.8rem;
  margin-bottom: 1.6rem;
}
.edu-item { margin-bottom: 1.7rem; }
.edu-when { color: var(--ink-2); }
.edu-item h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  margin: 0.25rem 0 0.15rem;
}
.edu-item p { font-size: 0.9rem; color: var(--ink-2); }

/* ---------------- Referees ---------------- */
.ref-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}
.ref-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem 1.5rem 1.4rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.ref-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -18px rgba(20, 32, 45, 0.35);
}
.ref-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
}
.ref-role {
  color: var(--gold);
  margin: 0.4rem 0 0.9rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed var(--line);
}
.ref-contacts { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.88rem; }
.ref-contacts a { color: var(--ink); text-decoration: none; word-break: break-all; }
.ref-contacts a:hover { color: var(--gold); text-decoration: underline; }
.ref-contacts span { color: var(--ink-2); }

/* ---------------- Company landing page ---------------- */
.landing {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.landing-main {
  flex: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  position: relative;
}
.landing-main h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}
.landing-main h1 em { font-style: italic; font-weight: 300; color: var(--gold); }
.landing-sub {
  margin: 1.4rem auto 0;
  max-width: 44rem;
  color: var(--ink-2);
  font-size: 1.08rem;
}
.landing .kicker::before { display: none; }
.landing .kicker { letter-spacing: 0.26em; }
.landing-pillars {
  margin: 3.2rem auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  max-width: 56rem;
  width: 100%;
}
.pillar {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.3rem 1.2rem;
  background: rgba(255, 255, 255, 0.5);
}
.pillar h3 { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; margin-bottom: 0.4rem; }
.pillar p { font-size: 0.85rem; color: var(--ink-2); line-height: 1.6; }
.landing-actions {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.landing-foot {
  border-top: 1px solid var(--line);
  padding: 1.4rem 1.5rem;
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.landing-foot a { color: var(--ink-2); text-decoration: none; }
.landing-foot a:hover { color: var(--gold); }

/* PIN modal */
.pin-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}
.pin-modal.open { display: flex; }
.pin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 22, 30, 0.7);
  backdrop-filter: blur(5px);
}
.pin-box {
  position: relative;
  background: var(--paper);
  border-radius: 10px;
  padding: 2.4rem 2.6rem 2.2rem;
  text-align: center;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.55);
  animation: lbIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 92vw;
}
.pin-box h3 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; }
.pin-box p { color: var(--ink-2); font-size: 0.9rem; margin-top: 0.4rem; }
.pin-input {
  margin: 1.5rem auto 0;
  display: block;
  width: 11rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 1.7rem;
  letter-spacing: 0.6em;
  padding: 0.6rem 0 0.6rem 0.6em;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, transform 0.1s;
}
.pin-input:focus { border-color: var(--gold); }
.pin-box.error .pin-input {
  border-color: #b3392f;
  animation: pinShake 0.4s;
}
.pin-error {
  color: #b3392f;
  font-size: 0.82rem;
  margin-top: 0.7rem;
  visibility: hidden;
}
.pin-box.error .pin-error { visibility: visible; }
@keyframes pinShake {
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}
.pin-actions { margin-top: 1.5rem; display: flex; gap: 0.8rem; justify-content: center; }

@media (max-width: 960px) {
  .ref-grid { grid-template-columns: repeat(2, 1fr); }
  .landing-pillars { grid-template-columns: 1fr; max-width: 26rem; }
}
@media (max-width: 680px) {
  .ref-grid { grid-template-columns: 1fr; }
}

/* ---------------- Contact ---------------- */
.contact {
  background: var(--ink-deep);
  color: var(--paper);
  background-image: radial-gradient(rgba(246,243,236,0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 5.5rem 1.5rem 3rem;
  text-align: center;
}
.kicker-light { color: var(--gold-2); }
.contact h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.1;
}
.contact h2 em { font-style: italic; font-weight: 300; color: var(--gold-2); }
.contact-links {
  margin: 3rem auto 0;
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.contact-link {
  display: block;
  min-width: 230px;
  text-decoration: none;
  color: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: 8px;
  padding: 1.1rem 1.6rem;
  font-size: 1rem;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.contact-link span {
  display: block;
  color: var(--gold-2);
  margin-bottom: 0.35rem;
}
a.contact-link:hover {
  border-color: var(--gold-2);
  background: rgba(217,178,95,0.08);
  transform: translateY(-2px);
}
.contact-foot {
  margin-top: 4rem;
  color: rgba(246,243,236,0.4);
}

/* ---------------- Lightbox ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}
.lightbox.open { display: block; }
.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 22, 30, 0.88);
  backdrop-filter: blur(6px);
}
.lb-panel {
  position: relative;
  max-width: 1080px;
  margin: 3.5vh auto;
  height: 93vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.6);
  animation: lbIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes lbIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.lb-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.3rem 1.6rem 1rem;
  border-bottom: 1px solid var(--line);
}
.lb-head h3 { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; }
.lb-head p { color: var(--ink-2); margin-top: 0.2rem; }
.lb-close {
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.2s, color 0.2s;
}
.lb-close:hover { background: var(--ink); color: var(--paper); }
.lb-body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}
.lb-grid, .lb-stage { flex: 1; min-height: 0; }
.lb-panel.mode-grid .lb-stage { display: none; }
.lb-panel.mode-grid .lb-back { display: none; }
.lb-panel.mode-zoom .lb-grid { display: none; }

/* --- masonry thumbnail grid --- */
.lb-grid {
  background: var(--paper-2);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  grid-auto-rows: 10px;      /* masonry row unit — JS sets each tile's span */
  grid-auto-flow: dense;
  gap: 0.9rem;
  align-content: start;
}
.lb-thumb {
  position: relative;
  border: 0;
  padding: 0;
  cursor: zoom-in;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(27, 42, 58, 0.06);
  box-shadow: 0 8px 20px -12px rgba(20, 32, 45, 0.35);
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  animation: thumbIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: box-shadow 0.28s;
}
.lb-thumb.wide { grid-column: span 2; }
.lb-thumb.flip { transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s; }
@keyframes thumbIn {
  to { opacity: 1; transform: none; }
}
.lb-thumb img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.lb-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(27, 42, 58, 0.12);
  transition: box-shadow 0.28s;
  pointer-events: none;
}
.lb-thumb:hover {
  box-shadow: 0 18px 34px -14px rgba(20, 32, 45, 0.45);
}
.lb-thumb:hover img { transform: scale(1.09) rotate(0.4deg); }
.lb-thumb:hover::after { box-shadow: inset 0 0 0 2px var(--gold-2); }
.lb-thumb .lb-thumb-no {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--paper);
  background: rgba(20, 32, 45, 0.72);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  pointer-events: none;
}

/* --- zoom stage --- */
.lb-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--paper-2);
  padding: 1rem 3.6rem;
  overflow: hidden;
}
.lb-stage figure { height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  box-shadow: 0 16px 40px -16px rgba(20,32,45,0.4);
  cursor: zoom-in;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.lb-stage img.zoomed {
  cursor: zoom-out;
  transform: scale(2.2);
}
.lb-head-actions { display: flex; align-items: center; gap: 0.6rem; }
.lb-hbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.lb-hbtn:hover { background: var(--ink); color: var(--paper); }
.lb-panel.mode-zoom .lb-shuffle { display: none; }
.lb-empty {
  text-align: center;
  color: var(--ink-2);
  font-size: 0.95rem;
  padding: 2rem;
}
.lb-empty code {
  font-family: var(--mono);
  font-size: 0.8rem;
  background: rgba(27,42,58,0.07);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  z-index: 2;
  transition: background 0.2s, color 0.2s;
}
.lb-arrow:hover { background: var(--ink); color: var(--paper); }
.lb-prev { left: 0.7rem; }
.lb-next { right: 0.7rem; }
.lb-arrow[disabled] { opacity: 0.25; cursor: default; }
.lb-arrow[disabled]:hover { background: var(--paper); color: var(--ink); }
.lb-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.6rem;
  border-top: 1px solid var(--line);
}
.lb-foot .mono { color: var(--ink-2); }
.lb-live {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
}
.lb-live:hover { text-decoration: underline; }
.lb-live.hidden { display: none; }

/* ================================================================
   Icons & motion graphics
   ================================================================ */

/* ---- solid one-colour icons ---- */
.sk-icon, .cl-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: 0 0 44px;
}
.sk-icon {
  background: rgba(176, 133, 44, 0.12);
  color: var(--gold);
  margin-bottom: 0.9rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
}
.sk-icon svg { width: 22px; height: 22px; }
.skill-card:hover .sk-icon {
  transform: translateY(-3px) scale(1.08);
  background: rgba(176, 133, 44, 0.2);
}
.cl-icon {
  background: rgba(217, 178, 95, 0.14);
  color: var(--gold-2);
}
.cl-icon svg { width: 20px; height: 20px; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
}
.contact-link .cl-text { display: block; }
.contact-link .cl-text .mono { display: block; margin-bottom: 0.3rem; }
a.contact-link:hover .cl-icon { animation: iconNudge 0.5s ease; }
@keyframes iconNudge {
  30% { transform: scale(1.12) rotate(-6deg); }
  60% { transform: scale(1.05) rotate(4deg); }
}

/* ---- animated gold rules (draw in on reveal) ---- */
.kicker::before {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.9s 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in .kicker::before, .reveal.in.kicker::before { transform: scaleX(1); }
.sec-no::after {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.9s 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.section-head.in .sec-no::after { transform: scaleX(1); }
.skill-card h3::after {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.7s 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.skill-card.in h3::after { transform: scaleX(1); }

/* ---- staggered card reveals ---- */
.skills-grid .skill-card:nth-child(4n+2) { transition-delay: 0.08s; }
.skills-grid .skill-card:nth-child(4n+3) { transition-delay: 0.16s; }
.skills-grid .skill-card:nth-child(4n+4) { transition-delay: 0.24s; }
.hero-stats .stat { opacity: 0; transform: translateY(14px); transition: opacity 0.6s, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.hero-stats.in .stat { opacity: 1; transform: none; }
.hero-stats.in .stat:nth-child(2) { transition-delay: 0.08s; }
.hero-stats.in .stat:nth-child(3) { transition-delay: 0.16s; }
.hero-stats.in .stat:nth-child(4) { transition-delay: 0.24s; }
.hero-stats.in .stat:nth-child(5) { transition-delay: 0.32s; }

/* ---- hero floating figures ---- */
.hero { position: relative; }
.hero-deco { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.hero-deco span { position: absolute; display: block; }
.deco-ring {
  width: 340px; height: 340px;
  border: 1px solid rgba(176, 133, 44, 0.35);
  border-radius: 50%;
  top: -60px; right: -80px;
  animation: floatY 14s ease-in-out infinite alternate;
}
.deco-circle {
  width: 90px; height: 90px;
  background: rgba(176, 133, 44, 0.1);
  border-radius: 50%;
  top: 58%; left: 44%;
  animation: floatY 11s 1s ease-in-out infinite alternate-reverse;
}
.deco-square {
  width: 120px; height: 120px;
  border: 1px solid rgba(27, 42, 58, 0.14);
  bottom: 8%; left: -46px;
  transform: rotate(18deg);
  animation: spinSlow 46s linear infinite;
}
.deco-dot {
  width: 14px; height: 14px;
  background: var(--gold-2);
  border-radius: 50%;
  top: 16%; left: 38%;
  animation: floatY 9s 0.5s ease-in-out infinite alternate;
}
@keyframes floatY {
  from { transform: translateY(-14px); }
  to   { transform: translateY(14px); }
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---- scroll hint ---- */
.scroll-hint {
  margin: 2.6rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink-2);
  opacity: 0.75;
}
.scroll-line {
  width: 1px;
  height: 46px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: "";
  position: absolute;
  left: 0;
  top: -30%;
  width: 100%;
  height: 30%;
  background: var(--gold);
  animation: scrollDrop 2s cubic-bezier(0.4, 0, 0.4, 1) infinite;
}
@keyframes scrollDrop {
  0%   { top: -30%; }
  70%, 100% { top: 105%; }
}

/* ---- donor marquee ---- */
.donor-names.marquee {
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow: hidden;
  gap: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.donor-track {
  display: flex;
  align-items: center;
  gap: 3.2rem;
  padding-right: 3.2rem;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.donor-track span { white-space: nowrap; }
.donor-track .dl, .donor-track .donor-giz { flex: 0 0 auto; }
.donor-names.marquee:hover .donor-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---- timeline dot ripple ---- */
.tl-item::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0;
  pointer-events: none;
}
.tl-item.in::after { animation: ripple 1s 0.25s ease-out; }
@keyframes ripple {
  0%   { opacity: 0.8; transform: scale(0.5); }
  100% { opacity: 0; transform: scale(2.2); }
}

/* ---- micro-interactions ---- */
.pc-view { transition: transform 0.25s ease; }
.project-card:hover .pc-view { transform: translateX(5px); }
.nav-links a:not(.nav-cta) { position: relative; }
.nav-links a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1.5px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-links a:not(.nav-cta):hover::after {
  transform: scaleX(1);
  transform-origin: left center;
}
.photo-frame img { transition: transform 4s cubic-bezier(0.22, 1, 0.36, 1); }
.hero-photo:hover .photo-frame img { transform: scale(1.18); }

/* ---- reduced motion: switch decorative animation off ---- */
@media (prefers-reduced-motion: reduce) {
  .hero-deco span, .scroll-line::after, .donor-track, .tl-item.in::after,
  a.contact-link:hover .cl-icon { animation: none; }
  .kicker::before, .sec-no::after, .skill-card h3::after { transform: scaleX(1); transition: none; }
  .hero-stats .stat { opacity: 1; transform: none; transition: none; }
  .donor-names.marquee { flex-wrap: wrap; justify-content: center; -webkit-mask-image: none; mask-image: none; }
  .donor-track { animation: none; width: auto; flex-wrap: wrap; justify-content: center; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 3rem; }
  .hero-photo { justify-self: start; margin-left: 0.5rem; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(4) { border-left: 0; }
  .stat { border-top: 1px solid var(--line); }
  .stat:nth-child(-n+3) { border-top: 0; }
  .profile-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .edu-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 0 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.8rem 1.6rem; }
  .nav-cta { border: 0; padding: 0.8rem 1.6rem; border-radius: 0; }
  .nav-cta:hover { background: none; color: var(--gold) !important; }
  .nav-toggle { display: block; }
  .tl-item { grid-template-columns: 1fr; gap: 0.3rem; padding-left: 1.6rem; }
  .project-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 3rem; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:nth-child(3) { border-top: 1px solid var(--line); }
  .lb-panel { margin: 0; height: 100vh; border-radius: 0; }
  .lb-stage { padding: 0.8rem 3rem; }
  .deco-ring, .deco-square { display: none; }
  .scroll-hint { display: none; }
}
