/* ── Design tokens ──────────────────────────────────────────── */

:root {
  --ambient-bg:  #0a0a0a;
  --black:       #0a0a0a;
  --surface:     #111111;
  --surface-2:   #181818;
  --border:      rgba(255, 255, 255, 0.06);
  --border-mid:  rgba(255, 255, 255, 0.11);
  --text:        #f2f0ed;
  --text-2:      rgba(242, 240, 237, 0.56);
  --text-3:      rgba(242, 240, 237, 0.3);
  --red:         #e53030;
  --red-hover:   #c72424;
  --red-dim:     rgba(229, 48, 48, 0.1);
  --font:        "Inter", system-ui, -apple-system, sans-serif;
  --mono:        "Roboto Mono", ui-monospace, monospace;
  --max:         72rem;
  --pad:         clamp(1.5rem, 4vw, 2.5rem);
  --radius:      2px;
}

/* ── Reset ──────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--ambient-bg);
  transition: background-color 1.15s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  body {
    transition: none;
  }
}

/* Subtle film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

strong {
  font-weight: 600;
  color: var(--text);
}

/* ── Header ─────────────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(16px) saturate(1.1);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 3.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-header__name {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.site-header__name:hover { color: var(--red); }

.site-header__mark {
  height: 1.125rem;
  width: auto;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.site-header__name:hover .site-header__mark { opacity: 1; }

/* resume.html uses site-header__brand, support it */
.site-header__brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-right: auto;
}

.site-header__role {
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 400;
}

/* Contacts hidden on small screens */
.site-header__contacts {
  display: none;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

@media (min-width: 720px) {
  .site-header__contacts { display: flex; }
}

.site-header__email-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.site-header__contacts a,
.site-header__email-wrap a {
  font-size: 0.8125rem;
  color: var(--text-2);
}

.site-header__contacts a:hover { color: var(--red); }

.site-header__nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.site-header__nav a {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  font-weight: 500;
}

.site-header__nav a:hover { color: var(--red); }

.site-header__sep {
  color: var(--border-mid);
  user-select: none;
}

/* Copy button */
.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  border-radius: var(--radius);
  line-height: 0;
}

.btn-copy svg { width: 11px; height: 11px; display: block; }
.btn-copy:hover { color: var(--red); }
.btn-copy:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* page-bg legacy: hide if present */
.page-bg { display: none !important; }

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 0.85rem 1.75rem;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s, transform 0.2s, border-color 0.15s;
}

.btn--primary {
  background: var(--red);
  color: #fff;
}

.btn--primary:hover {
  background: var(--red-hover);
  color: #fff;
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-mid);
}

.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
}

/* ── Main layout ────────────────────────────────────────────── */

/* resume/case pages need top-padding for the fixed header */
main { padding-top: 3.5rem; }

body.page--home main { padding-top: 0; }

body:not(.page--home) main {
  position: relative;
}

body:not(.page--home) main::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../brand/ornament.svg') center 10% / min(100%, 50rem) no-repeat;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: soft-light;
}

body:not(.page--home) main > * {
  position: relative;
  z-index: 1;
}

/* ── Hero ───────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  --hero-ornament-local-x: 50%;
  --hero-ornament-local-y: 50%;
}

/* Belarusian geometric ornament — behind the text column */
.hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 25%;
  width: 48%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: url('../brand/ornament.svg') center / contain no-repeat;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: soft-light;
}

/* Ambient coal-red fill — ornament always faintly visible as dark-red reflection */
.hero::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 25%;
  width: 48%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: hsl(4, 88%, 28%);
  -webkit-mask-image: url('../brand/ornament.svg');
  mask-image: url('../brand/ornament.svg');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  opacity: 0.09;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
}

/* Canvas ember layer — replaces ::after, masked to ornament paths */
.hero__embers {
  position: absolute;
  top: 50%;
  left: 25%;
  width: 48%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  display: block;
  -webkit-mask-image: url('../brand/ornament.svg');
  mask-image: url('../brand/ornament.svg');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  mix-blend-mode: screen;
}

@media (min-width: 960px) {
  .hero::before,
  .hero::after {
    left: 25%;
    width: 42%;
  }

  .hero__embers {
    left: 25%;
    width: 42%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__embers {
    display: none;
  }
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

@media (min-width: 960px) {
  .hero__inner { grid-template-columns: 1fr 1fr; }
}

.hero__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(3.5rem + 4.5rem) var(--pad) 5rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 960px) {
  .hero__text {
    padding: calc(3.5rem + 5.5rem) var(--pad) 6rem;
  }
}

.hero__label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  opacity: 0.85;
  margin: 0 0 1.5rem;
}

.hero__title {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: var(--text);
  margin: 0 0 1.5rem;
}

.hero__lead {
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--text-2);
  margin: 0 0 2.5rem;
  max-width: 34rem;
}

.hero__lead strong { color: var(--text); }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Photo: full-height right column on desktop */
.hero__figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  height: 72vw;
  max-height: 520px;
}

@media (min-width: 960px) {
  .hero__figure {
    height: auto;
    max-height: none;
    align-self: stretch;
  }
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  filter: contrast(1.05) brightness(0.9);
  display: block;
}

/* Red crop-mark line at the top of the photo */
.hero__figure::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--red);
  z-index: 2;
}

/* Entrance animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__label   { animation: fadeUp 0.8s  cubic-bezier(0.16, 1, 0.3, 1) 0.05s both; }
  .hero__title   { animation: fadeUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both; }
  .hero__lead    { animation: fadeUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.2s  both; }
  .hero__actions { animation: fadeUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both; }
  .hero__figure  { animation: fadeUp 1s    cubic-bezier(0.16, 1, 0.3, 1) 0.1s  both; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__label,
  .hero__title,
  .hero__lead,
  .hero__actions,
  .hero__figure { animation: none !important; }
}

/* ── Sections ────────────────────────────────────────────────── */

.section {
  border-top: 1px solid var(--border);
  padding: clamp(3rem, 7vw, 5.5rem) var(--pad);
  max-width: var(--max);
  margin: 0 auto;
}

.section__inner {
  display: grid;
  gap: 1rem 3rem;
}

@media (min-width: 720px) {
  .section__inner {
    grid-template-columns: 9rem 1fr;
    align-items: start;
  }
}

.section__head { padding-top: 0.25rem; }

.label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  opacity: 0.7;
  display: block;
}

.section__title {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 1rem;
}

.section__lede {
  font-size: 1rem;
  line-height: 1.72;
  color: var(--text-2);
  margin: 0;
  max-width: 40rem;
}

.section__lede strong { color: var(--text); }

/* ── Work section ────────────────────────────────────────────── */

.section--work {
  max-width: none;
  padding: 0;
  border-top: none;
}

.work-header {
  border-top: 1px solid var(--border);
  padding: clamp(3rem, 7vw, 5.5rem) var(--pad) 2.5rem;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 0.75rem 3rem;
}

@media (min-width: 720px) {
  .work-header {
    grid-template-columns: 9rem 1fr;
    align-items: baseline;
  }
}

.work-header .label { padding-top: 0.3rem; }
.work-header .section__title { margin: 0; }

.work-subhead {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.25rem var(--pad) 0.75rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  border-top: 1px solid var(--border);
}

.work-subhead:first-of-type {
  padding-top: 0;
  border-top: none;
}

/* Editorial grid: default 3 columns; --duo = 2 columns for paired case groups */
.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--border);
  max-width: var(--max);
  margin: 0 auto;
}

@media (min-width: 720px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }

  .work-grid--duo {
    grid-template-columns: repeat(2, 1fr);
  }
}

.work-item {
  padding: 2.5rem var(--pad) 3.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

@media (min-width: 720px) {
  .work-item {
    border-top: none;
    border-left: 1px solid var(--border);
    padding: 2.5rem 2rem 3.5rem;
  }

  .work-item:first-child {
    border-left: none;
    padding-left: 0;
  }

  .work-item:last-child { padding-right: 0; }

  .work-grid--duo .work-item:nth-child(odd) {
    border-left: none;
    padding-left: 0;
  }

  .work-grid--duo .work-item:nth-child(even) {
    padding-right: 0;
  }
}

.work-item__n {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--red);
  opacity: 0.62;
  margin-bottom: 1.25rem;
  display: block;
}

.work-item__body h3 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
  margin: 0 0 0.85rem;
}

.work-item__body p {
  font-size: 0.9375rem;
  color: var(--text-2);
  line-height: 1.68;
  margin: 0 0 0.85rem;
}

.work-item__body strong { color: var(--text); }

.work-item__body ul {
  margin: 0 0 1.5rem;
  padding-left: 1rem;
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
}

.work-item__body li { margin-bottom: 0.3rem; }

.work-item__link {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 600;
  margin-top: auto;
  padding-top: 1rem;
  opacity: 0.68;
  transition: opacity 0.15s;
}

.work-item__link:hover { opacity: 1; color: var(--red); }

/* ── Reveal animation ────────────────────────────────────────── */

.js-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-reveal.is-visible {
  opacity: 1;
  transform: none;
}

.work-grid .js-reveal:nth-child(2) { transition-delay: 0.08s; }
.work-grid .js-reveal:nth-child(3) { transition-delay: 0.16s; }
.work-grid .js-reveal:nth-child(4) { transition-delay: 0.24s; }
.work-grid .js-reveal:nth-child(5) { transition-delay: 0.32s; }
.work-grid .js-reveal:nth-child(6) { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .js-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .work-grid .js-reveal { transition-delay: 0s !important; }
}

/* ── Footer ──────────────────────────────────────────────────── */

.site-footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
  padding: 4rem var(--pad) 5.5rem;
  text-align: center;
  max-width: var(--max);
  margin: 0 auto;
}

/* Belarusian geometric ornament — footer texture */
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../brand/ornament.svg') center / 48% no-repeat;
  opacity: 0.09;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

/* Personal mark — tree of life symbol */
.footer__mark {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin: 0 auto 2.5rem;
}

.footer__mark img {
  height: 2rem;
  width: auto;
  display: block;
  object-fit: contain;
  opacity: 0.65;
  transition: opacity 0.3s;
}

.footer__mark:hover img {
  opacity: 0.95;
  animation: footer-logo-fire-breathe 1.15s ease-in-out infinite alternate;
}

@keyframes footer-logo-fire-breathe {
  0% {
    filter:
      drop-shadow(0 3px 8px rgba(255, 85, 40, 0.45))
      drop-shadow(0 0 14px rgba(215, 55, 28, 0.35));
  }

  100% {
    filter:
      drop-shadow(0 5px 14px rgba(255, 125, 65, 0.72))
      drop-shadow(0 0 26px rgba(235, 75, 38, 0.55))
      drop-shadow(0 -3px 18px rgba(255, 195, 110, 0.4));
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer__mark:hover img {
    animation: none;
    opacity: 0.9;
  }
}

.footer__location {
  position: relative;
  z-index: 1;
  font-size: 0.875rem;
  color: var(--text-3);
  letter-spacing: 0.03em;
  margin: 0 0 2.5rem;
}

.footer__lang { opacity: 0.65; }

.footer__quote {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: none;
}

.footer__quote p {
  font-size: 1rem;
  line-height: 1.88;
  color: var(--text-2);
  font-style: italic;
  margin: 0 0 0.75rem;
}

.footer__quote cite {
  font-size: 0.8rem;
  font-style: normal;
  color: var(--text-3);
}

/* ── Resume page ─────────────────────────────────────────────── */

.resume-page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.resume-page__masthead {
  display: grid;
  gap: 1.5rem;
  padding-bottom: 1.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-mid);
  text-align: left;
}

@media (min-width: 640px) {
  .resume-page__masthead {
    grid-template-columns: 1fr auto;
    align-items: flex-start;
    gap: 2rem;
  }
}

.resume-page h1 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
  color: var(--text);
  line-height: 1.15;
}

.resume-page__role {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 0.85rem;
}

.resume-page .resume-meta {
  font-size: 0.875rem;
  color: var(--text-3);
  margin: 0;
  line-height: 1.65;
}

.resume-meta__sep {
  margin: 0 0.35rem;
  opacity: 0.45;
}

.resume-page .resume-meta a {
  color: var(--text-2);
}

.resume-page .resume-meta a:hover {
  color: var(--red);
}

.resume-actions--masthead {
  margin: 0;
  justify-content: flex-start;
}

@media (min-width: 640px) {
  .resume-actions--masthead {
    justify-content: flex-end;
    flex-direction: column;
    align-items: stretch;
  }
}

.resume-page__content {
  text-align: left;
}

.resume-section {
  margin-bottom: 2.25rem;
}

.resume-section:last-child {
  margin-bottom: 0;
}

.resume-page h2 {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-mid);
  color: var(--text-3);
}

.resume-lead {
  margin: 0;
  font-size: 1rem;
  line-height: 1.72;
  color: var(--text-2);
}

.resume-cta {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.resume-cta a {
  color: var(--red);
  font-weight: 600;
}

.resume-cta a:hover {
  color: var(--text);
}

.resume-inline {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-2);
}

.resume-page__bullets--compact li {
  margin-bottom: 0.4rem;
}

.resume-page__bullets {
  margin: 0;
  padding-left: 1.15rem;
  list-style: disc;
}

.resume-page__bullets li {
  margin: 0 0 0.5rem;
  padding-left: 0.15rem;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.62;
}

.resume-page__bullets li:last-child {
  margin-bottom: 0;
}

.resume-page__bullets--tight li {
  margin-bottom: 0.35rem;
}

.resume-page p {
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.resume-job-meta {
  margin: -0.15rem 0 0.85rem;
  font-size: 0.875rem;
  color: var(--text-3);
}

.resume-page .job-title {
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
  line-height: 1.35;
}

.job-title--secondary {
  margin-top: 1.35rem;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

.resume-note {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-3);
}

.resume-note--inline {
  margin: 0.35rem 0 1.1rem;
  max-width: 38rem;
}

.resume-period-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 1.35rem 0 0.5rem;
}

.resume-period-label:first-of-type {
  margin-top: 0.65rem;
}

.resume-page .resume-section--mapbox .resume-page__bullets {
  margin-bottom: 0.35rem;
}

.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* ── Case pages ──────────────────────────────────────────────── */

.case-page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

.case-page__back {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 2.5rem;
  font-weight: 600;
}

.case-page__back:hover { color: var(--red); }

.case-page h1 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.5vw, 2.15rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.case-page__subtitle {
  font-size: 1rem;
  color: var(--text-2);
  margin: 0 0 1.25rem;
  line-height: 1.65;
}

.case-page--with-hero-video {
  max-width: min(52rem, 100%);
}

.case-page__video-wrap {
  margin: 0 0 2.75rem;
}

.case-page__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}

.case-page__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.case-page__video-caption {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--text-3);
  line-height: 1.5;
}

.case-page__video-caption a {
  color: var(--red);
  font-weight: 500;
}

.case-page__video-caption a:hover {
  color: var(--text);
}

.case-figure {
  margin: 2rem 0;
}

.case-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.page--home .hero__img {
  cursor: zoom-in;
}

.case-figure--tall {
  max-height: min(90vh, 56rem);
  overflow-y: auto;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.case-figure--tall img {
  width: 100%;
  max-width: 100%;
  border: none;
}

.case-figure__caption {
  margin: 0.55rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-2);
  line-height: 1.55;
}

.case-figure-grid {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}

@media (min-width: 640px) {
  .case-figure-grid--triple {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
  }
}

.case-figure-grid .case-figure {
  margin: 0;
}

.case-figure-grid .case-figure img {
  width: 100%;
  height: auto;
}

.case-prose a {
  color: var(--red);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.case-prose a:hover {
  color: var(--text);
}

.case-prose h2 {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 3rem 0 0.85rem;
}

.case-prose p,
.case-prose ul {
  margin: 0 0 1rem;
  color: var(--text-2);
  font-size: 0.9875rem;
  line-height: 1.72;
}

.case-prose ul { padding-left: 1.25rem; }
.case-prose li { margin-bottom: 0.35rem; }

.case-prose--refs {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
}

.case-prose--refs li {
  margin-bottom: 0.65rem;
  padding-left: 0;
}

.case-prose--refs a {
  font-weight: 500;
}

.case-prose--refs a:hover {
  color: var(--text);
}

/* ── Lightbox (image modal) ─────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  background: rgba(5, 5, 5, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.lightbox.lightbox--open {
  opacity: 1;
  visibility: visible;
}

.lightbox__panel {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 112rem);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: min(78vh, 1200px);
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--border-mid);
}

.lightbox__caption {
  margin: 0;
  max-width: 42rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-2);
  text-align: center;
}

.lightbox__caption:empty {
  display: none;
}

.lightbox__counter {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.lightbox__close {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(15, 15, 15, 0.95);
  color: var(--text-2);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.lightbox__close:hover {
  color: var(--text);
  border-color: var(--border-mid);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.75rem;
  height: 3.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(15, 15, 15, 0.92);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.lightbox__nav:hover {
  color: var(--red);
  border-color: var(--border-mid);
}

.lightbox__nav:disabled,
.lightbox__nav[hidden] {
  display: none;
}

.lightbox__prev {
  left: 0;
}

@media (min-width: 900px) {
  .lightbox__prev {
    left: -3.25rem;
  }

  .lightbox__next {
    right: -3.25rem;
  }
}

.lightbox__next {
  right: 0;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox {
    transition: none;
  }
}

/* ── Print ───────────────────────────────────────────────────── */

@media print {
  .case-page__video-wrap {
    display: none;
  }

  .lightbox {
    display: none !important;
  }

  .case-figure--tall {
    max-height: none;
    overflow: visible;
  }

  body {
    background: #fff;
    color: #111;
    font-size: 11pt;
  }

  body::after { display: none; }

  .site-header,
  .resume-actions { display: none !important; }

  main { padding-top: 0 !important; }

  .resume-page { max-width: none; padding: 0; }

  a { color: #333; text-decoration: none; }

  .resume-page h1 { color: #111; }

  .resume-page h2 {
    color: #555;
    border-bottom-color: #ddd;
  }

  .resume-page p,
  .resume-page li,
  .resume-lead,
  .resume-inline,
  .resume-page__role { color: #333; }

  .resume-cta a { color: #b01010; }

  .resume-page .job-title { color: #111; }

  .resume-job-meta,
  .resume-note,
  .resume-period-label { color: #444; }

  .resume-page__masthead {
    border-bottom-color: #ddd;
  }
}
