/* Virelia Foster — Scheme · Editorial Dossier */
:root {
  --ink: #171717;
  --ink-soft: #404040;
  --ink-faint: #737373;
  --paper: #f4f2ee;
  --paper-deep: #e8e4dc;
  --white: #ffffff;
  --accent: #1f4e5f;
  --accent-soft: rgba(31, 78, 95, 0.12);
  --line: rgba(23, 23, 23, 0.12);
  --line-strong: rgba(23, 23, 23, 0.2);
  --shadow: 0 20px 50px rgba(23, 23, 23, 0.08);
  --font-display: "Newsreader", "Times New Roman", Georgia, serif;
  --font-body: "Karla", "Segoe UI", sans-serif;
  --gutter: clamp(1.1rem, 4.5vw, 2rem);
  --measure: min(1080px, calc(100% - (var(--gutter) * 2)));
  --header-h: 3.75rem;
  --section-y: clamp(3.75rem, 10vw, 7rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--safe-top) + 0.75rem);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-enter__item,
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: clamp(0.98rem, 0.15vw + 0.94rem, 1.05rem);
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-nav-open {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}

ul,
ol,
h1,
h2,
h3,
p,
figure,
blockquote {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wrap {
  width: var(--measure);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  background: var(--ink);
  color: var(--white);
}

.skip-link:focus {
  top: calc(var(--safe-top) + 0.75rem);
}

/* Header — left-aligned stack */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding-top: var(--safe-top);
  color: var(--white);
  background: transparent;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.site-header.is-scrolled {
  color: var(--ink);
  background: rgba(244, 242, 238, 0.96);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-stack {
  width: var(--measure);
  margin-inline: auto;
  padding-block: 0.7rem 0.55rem;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: calc(var(--header-h) - 1.25rem);
}

.brand-word {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.site-nav {
  display: none;
}

.site-nav a {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.68;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.is-active {
  opacity: 1;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid currentColor;
  opacity: 0.9;
}

.lang-btn {
  min-width: 2rem;
  padding: 0.26rem 0.45rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

.lang-btn.is-active {
  opacity: 1;
  background: var(--white);
  color: var(--ink);
}

.site-header.is-scrolled .lang-btn.is-active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.nav-toggle {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-content: center;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 1.05rem;
  height: 1.5px;
  background: currentColor;
}

body.is-nav-open .nav-toggle-bar:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

body.is-nav-open .nav-toggle-bar:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.mobile-nav {
  display: grid;
  padding: 0.75rem var(--gutter) 1.2rem;
  background: var(--paper);
  color: var(--ink);
  border-top: 1px solid var(--line);
}

.mobile-nav[hidden] {
  display: none !important;
}

.mobile-nav a {
  padding: 0.85rem 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  border-bottom: 1px solid var(--line);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(23, 23, 23, 0.35);
}

.nav-backdrop[hidden] {
  display: none !important;
}

@media (min-width: 1080px) {
  :root {
    --header-h: 5.25rem;
  }

  .header-top {
    min-height: 2.5rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  }

  .site-header.is-scrolled .header-top {
    border-bottom-color: var(--line);
  }

  .site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: min(42rem, 100%);
    margin-top: 0.45rem;
  }

  .nav-toggle,
  .mobile-nav,
  .nav-backdrop {
    display: none !important;
  }
}

/* Hero — full-bleed editorial */
.hero {
  position: relative;
  min-height: min(100vh, 920px);
  min-height: min(100dvh, 920px);
  display: grid;
  align-items: center;
  padding-top: calc(var(--header-h) + var(--safe-top));
  overflow: hidden;
  color: var(--white);
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 18, 22, 0.82) 0%, rgba(15, 18, 22, 0.45) 48%, rgba(15, 18, 22, 0.2) 100%),
    linear-gradient(0deg, rgba(15, 18, 22, 0.75) 0%, transparent 48%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: var(--measure);
  margin-inline: auto;
  padding: 1.5rem 0 2rem;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.9rem;
}

.hero-title {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35em;
  white-space: nowrap;
  margin-bottom: 0.85rem;
  line-height: 0.95;
}

.hero-given,
.hero-family {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 9vw, 5.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.hero-family {
  font-style: italic;
  font-weight: 500;
}

.hero-role {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.9rem;
  opacity: 0.9;
}

.hero-lede {
  max-width: 34rem;
  margin-bottom: 1.6rem;
  opacity: 0.88;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.65rem 1.3rem;
  background: var(--white);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.25s var(--ease);
}

.hero-cta:hover {
  transform: translateY(-2px);
}

.hero-enter__item {
  opacity: 0;
  transform: translateY(16px);
  animation: heroIn 0.8s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 85ms + 60ms);
}

@keyframes heroIn {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Meta bar */
.meta-bar {
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.meta-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.7rem;
  padding: 1rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.meta-item:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.meta-k {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.meta-v {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

@media (min-width: 800px) {
  .meta-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .meta-item {
    border-bottom: 0;
    padding: 1.15rem 1rem;
  }

  .meta-item:not(:last-child) {
    border-right: 1px solid var(--line);
  }

  .meta-item:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
}

/* Sections */
.section {
  padding: var(--section-y) 0;
}

.section-head {
  margin-bottom: clamp(1.6rem, 4vw, 2.4rem);
  max-width: 40rem;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.55rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.2vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--ink);
}

.section-dek {
  margin-top: 0.7rem;
  color: var(--ink-faint);
}

/* About */
.about-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.about-body + .about-body {
  margin-top: 0.85rem;
}

.about-photo {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--paper-deep);
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 3.5rem;
  }
}

/* Education rail */
.section--edu {
  background: var(--white);
}

.edu-rail {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.edu-row {
  display: grid;
  gap: 0.75rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s var(--ease);
}

.edu-row:hover {
  background: rgba(31, 78, 95, 0.04);
}

.edu-year {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.edu-copy {
  display: grid;
  gap: 0.45rem;
}

.edu-copy h3,
.fold-trigger h3 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--ink);
  margin: 0;
}

.edu-meta {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.92rem;
}

@media (min-width: 800px) {
  .edu-row {
    grid-template-columns: 8.5rem 1fr;
    gap: 2rem;
    padding: 2rem 0;
  }
}

/* Path steps */
.section--path {
  background: var(--paper);
}

.step-rail {
  display: grid;
  gap: 1.25rem;
}

.step {
  display: grid;
  gap: 0.85rem;
  padding: 1.4rem 0 1.5rem;
  border-top: 1px solid var(--line);
  transition: background 0.25s var(--ease);
}

.step:last-child {
  border-bottom: 1px solid var(--line);
}

.step:hover {
  background: rgba(31, 78, 95, 0.04);
}

.step-num {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
}

.step-year {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.35rem;
}

.step-body h3,
.step-body .fold-trigger h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--ink);
  margin: 0 0 0.15rem;
}

.step-body .fold-trigger {
  margin-bottom: 0.55rem;
}

.step-body .fold-panel p + p,
.fold-panel p + p {
  margin-top: 0.65rem;
}

/* Fold panels */
.fold-trigger {
  width: 100%;
  display: grid;
  gap: 0.35rem;
  padding: 0;
}

.fold-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.fold-panel {
  display: grid;
  gap: 0.45rem;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.45s var(--ease), opacity 0.35s var(--ease), margin 0.35s var(--ease);
}

.fold.is-open .fold-panel {
  max-height: 40rem;
  opacity: 1;
  margin-top: 0.15rem;
}

.fold:not(.is-open) .fold-trigger h3 {
  color: var(--ink-soft);
}

@media (min-width: 880px) {
  .step {
    grid-template-columns: 4.5rem 1fr;
    gap: 1.75rem;
    padding: 1.85rem 0;
  }
}

/* Timeline — ledger table */
.section--timeline {
  background: var(--ink);
  color: #d4d4d4;
}

.section--timeline .section-label {
  color: #9db8c2;
}

.section--timeline .section-title {
  color: var(--white);
}

.ledger {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.ledger-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.ledger-hit {
  width: 100%;
  display: grid;
  gap: 0.35rem;
  padding: 1.05rem 0;
  color: inherit;
  transition: background 0.25s var(--ease), padding 0.25s var(--ease);
}

.ledger-hit:focus-visible {
  outline: 2px solid #9db8c2;
  outline-offset: 2px;
}

.ledger-row.is-active .ledger-hit {
  background: rgba(255, 255, 255, 0.06);
  padding-left: 0.85rem;
  box-shadow: inset 3px 0 0 #9db8c2;
}

.ledger-when {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9db8c2;
}

.ledger-body {
  display: block;
  font-size: 1rem;
  color: rgba(245, 245, 245, 0.72);
  line-height: 1.55;
  transition: color 0.25s var(--ease), font-size 0.25s var(--ease);
}

.ledger-row.is-active .ledger-body {
  color: #f5f5f5;
  font-size: 1.05rem;
}

@media (min-width: 760px) {
  .ledger-hit {
    grid-template-columns: minmax(11rem, 0.35fr) 1fr;
    gap: 1.5rem;
    align-items: baseline;
    padding: 1.2rem 0;
  }

  .ledger-row.is-active .ledger-hit {
    padding-left: 1rem;
  }
}

/* Certificates — text first */
.section--certs {
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cert-text {
  display: grid;
  gap: 1.75rem;
  align-items: start;
}

.cert-text-copy {
  max-width: 34rem;
}

.cert-text-copy .section-title {
  margin-bottom: 1.35rem;
}

.cert-text-name {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.65rem;
}

.cert-text-body {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 0.85rem;
}

.cert-text-note {
  font-size: 0.82rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.cert-text-media {
  margin: 0;
  width: 100%;
  max-width: 18rem;
  border: 1px solid var(--line);
  background: var(--paper);
}

.cert-zoom {
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
}

.cert-zoom:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.cert-text-media img {
  width: 100%;
  display: block;
  aspect-ratio: 1280 / 998;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.cert-zoom:hover img {
  transform: scale(1.03);
}

@media (min-width: 880px) {
  .cert-text {
    grid-template-columns: minmax(0, 1.2fr) minmax(14rem, 0.55fr);
    gap: 3rem;
    align-items: end;
  }

  .cert-text-media {
    max-width: 16.5rem;
    justify-self: end;
  }
}

/* Signature — centered panel */
.section--close {
  padding: 0;
}

.close-panel {
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(31, 78, 95, 0.14), transparent 60%),
    var(--white);
  border-top: 1px solid var(--line);
}

.close-inner {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: clamp(3rem, 9vw, 5.5rem) 0;
  gap: 0.85rem;
}

.close-avatar {
  width: 10.5rem;
  height: 10.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--paper);
  box-shadow: var(--shadow);
  margin-bottom: 0.6rem;
  background: var(--paper-deep);
}

.close-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
}

.close-heading {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--ink);
  letter-spacing: -0.02em;
}

.close-quote {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.8vw, 1.7rem);
  font-style: italic;
  line-height: 1.45;
  color: var(--ink);
  max-width: 36rem;
  margin-top: 0.35rem;
}

/* Footer */
.site-footer {
  padding: 2.5rem 0 calc(2rem + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--white);
}

.footer-shell {
  display: grid;
  gap: 1.5rem;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--ink);
}

.footer-role {
  margin-top: 0.2rem;
  font-size: 0.9rem;
}

.footer-sign {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  justify-content: space-between;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.footer-copy {
  font-size: 0.76rem;
  color: var(--ink-faint);
}

.footer-nav {
  display: flex;
  gap: 1rem;
}

.footer-nav a {
  font-size: 0.76rem;
  font-weight: 600;
}

.footer-nav a:hover {
  color: var(--accent);
}

/* Reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Page progress dots */
.page-progress {
  display: none;
}

@media (min-width: 1180px) {
  .page-progress {
    position: fixed;
    top: 50%;
    right: max(0.85rem, var(--safe-right));
    z-index: 45;
    display: grid;
    gap: 0.7rem;
    transform: translateY(-50%);
  }

  .page-progress a {
    width: 0.7rem;
    height: 0.7rem;
    display: grid;
    place-items: center;
  }

  .page-progress span {
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.35;
    box-shadow: 0 0 0 2px var(--paper);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  }

  .page-progress a:hover span,
  .page-progress a.is-active span {
    opacity: 1;
    transform: scale(1.35);
  }
}

/* Back to top */
.to-top {
  position: fixed;
  right: max(1rem, var(--safe-right));
  bottom: max(1rem, var(--safe-bottom));
  z-index: 46;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: rgba(244, 242, 238, 0.94);
  color: var(--ink);
  font-size: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.to-top[hidden] {
  display: none !important;
}

.to-top:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}

.to-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Certificate lightbox */
.lightbox[hidden] {
  display: none !important;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: max(1rem, var(--safe-top)) max(1rem, var(--safe-right)) max(1rem, var(--safe-bottom)) max(1rem, var(--safe-left));
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 23, 0.72);
  cursor: zoom-out;
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(90vh, 90dvh);
  overflow: auto;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.lightbox-dialog img {
  width: 100%;
  height: auto;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  background: rgba(244, 242, 238, 0.92);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  border: 1px solid var(--line);
}

.lightbox-close:hover {
  color: var(--accent);
}

body.is-lightbox-open {
  overflow: hidden;
}
