/* =========================================================
   Yuri Korolev — Portfolio
   Sticky nav · forest hero with scroll-fill · white body
   Outfit · no monospace · strict horizontal grid
   ========================================================= */

:root {
  /* palette */
  --black: #141311;
  --white: #ffffff;
  --mute: #6b6b6b;
  --line: #e6e6e6;
  --green: #1b512d;
  --green-light: #a9cba0;
  --green-tint: #e9f0e5;     /* faint hint of green for the values band */
  --preview-frame: #23271f;  /* dark gray with a slight green tint — hover backdrop */
  --preview-cta: #2f352b;    /* a touch lighter so the View circle reads on the frame */

  /* layout */
  --gutter: clamp(24px, 5vw, 80px);
  --nav-w: 240px;            /* left lane reserved for the sticky nav */

  /* type */
  --font: "Outfit", system-ui, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, figure { margin: 0; }
ul { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- shared ---------- */
.label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
}

/* every band shares the same left lane (cleared for the nav) */
.section {
  padding: clamp(80px, 12vh, 160px) var(--gutter);
  padding-left: calc(var(--gutter) + var(--nav-w));
}

/* =========================================================
   STICKY NAV
   ========================================================= */
.nav {
  position: fixed;
  top: var(--gutter);
  left: var(--gutter);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.nav__brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--black);
  transition: color 0.4s ease;
}

/* =========================================================
   BRAND WORDMARK — caps "YURI"; surname wipes open on hover
   ("YURI" → "YURI KOROLEV"). The rest lives in an inline-grid
   track animated 0fr→1fr (exact content width, no magic number)
   + an opacity fade. Shared by all three brand variants.
   ========================================================= */
.nav__brand,
.topnav__brand,
.resume__brand {
  white-space: nowrap;
  letter-spacing: 0.02em;   /* caps read better with a hair of tracking */
}

.brand-rest {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  vertical-align: bottom;
  transition: max-width 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.nav__brand:hover .brand-rest,
.nav__brand:focus-visible .brand-rest,
.topnav__brand:hover .brand-rest,
.topnav__brand:focus-visible .brand-rest,
.resume__brand:hover .brand-rest,
.resume__brand:focus-visible .brand-rest {
  max-width: 7em;     /* comfortably past "KOROLEV"; box shrink-wraps to content */
  opacity: 1;
}

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

.nav__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 18px;
  font-weight: 500;
}

.nav__list a {
  width: fit-content;
  color: var(--mute);
  opacity: 0.75;
  transition: color 0.4s ease, opacity 0.35s ease, transform 0.35s ease;
}
.nav__list a:hover { transform: translateX(5px); opacity: 1; }
.nav__list a.is-active { color: var(--black); opacity: 1; }

/* while the forest hero owns the background, flip the nav to sage */
body.is-hero .nav__brand { color: var(--green-light); }
body.is-hero .nav__list a { color: var(--green-light); opacity: 0.4; }
body.is-hero .nav__list a.is-active { color: var(--green-light); opacity: 1; }

/* the full link list is always visible on desktop — the toggle is mobile-only */
.nav__toggle { display: none; }

/* =========================================================
   HERO — forest band, centered intro
   ========================================================= */
.hero {
  /* sticky behind the page; the white body scrolls up and over it (parallax overlap) */
  position: sticky;
  top: 0;
  z-index: 0;
  min-height: 100vh;
  height: 100vh;
  background: var(--green);
  color: var(--green-light);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  padding: var(--gutter);
  padding-left: calc(var(--gutter) + var(--nav-w));
  overflow: hidden;
}

/* the body + footer must paint ABOVE the positioned (sticky) hero, with an opaque
   background, so they cover it as they scroll up */
main,
.footer {
  position: relative;
  z-index: 1;
  background: var(--white);
}

.hero__title {
  max-width: 1100px;
  font-size: clamp(40px, 7vw, 104px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
/* each line is a clip mask; its inner span is what the load tween slides up.
   the padding/negative-margin pair keeps descenders from clipping at rest. */
.hero__line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.hero__line > span { display: block; }
.hero__line--sub > span { color: var(--green-light); opacity: 0.72; }

.hero__foot {
  position: absolute;
  bottom: var(--gutter);
  left: calc(var(--gutter) + var(--nav-w));
  right: var(--gutter);
  display: flex;
  justify-content: space-between;
}
.hero__foot .label { color: var(--green-light); opacity: 0.6; }

/* gentle, slow scroll affordance (guidance, not decoration) */
.scroll-cue {
  display: inline-block;
  animation: scroll-bob 2.4s ease-in-out infinite;
}
@keyframes scroll-bob {
  0%, 100% { transform: translateY(0); opacity: 0.65; }
  50%      { transform: translateY(4px); opacity: 1; }
}

/* =========================================================
   PAGE-LOAD CHOREOGRAPHY — pre-paint state (JS clears .preload)
   Hide via opacity only; GSAP solely owns the transforms it
   animates, so no CSS-vs-GSAP transform desync.
   ========================================================= */
.preload .hero__title,
.preload .nav,
.preload .hero__foot { opacity: 0; }

/* =========================================================
   VALUES — faint green band + scroll word fill
   ========================================================= */
/* the section becomes a full-height white stage; the band sits centered in it
   so an equal white bar frames the green above and below while it's pinned */
.fill {
  min-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
}

.fill__band {
  width: 100%;
  background: var(--green-tint);
  padding: clamp(56px, 9vh, 120px) var(--gutter);
  padding-left: calc(var(--gutter) + var(--nav-w));
}

.fill__text {
  max-width: 1180px;
  font-size: clamp(26px, 3.5vw, 50px);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.03em;
  color: var(--green);
}

/* each word starts faint, fills to forest green on scroll */
.fill__text .w {
  opacity: 0.18;
  will-change: opacity;
}

/* =========================================================
   BACKGROUND — education prose + work experience blocks
   ========================================================= */
.bg__lead {
  max-width: 820px;
  font-size: clamp(19px, 2.1vw, 28px);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.02em;
  margin-bottom: clamp(56px, 9vh, 120px);
}

.bg__lead a,
.role__desc a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--mute);
  transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.bg__lead a:hover,
.role__desc a:hover {
  color: var(--green);
  text-decoration-color: var(--green);
}

.bg__roles { position: relative; }

.role + .role { margin-top: clamp(48px, 8vh, 104px); }

.role__logo {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
  overflow: hidden;
}
.role__logo img { width: 60%; height: auto; }

.role__company {
  display: block;
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--mute);
}

.role__title {
  font-size: clamp(30px, 4.4vw, 56px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 4px 0 16px;
}

.role__meta {
  display: block;
  font-size: 14px;
  color: var(--mute);
  margin-bottom: 18px;
}

.role__desc {
  max-width: 580px;
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.55;
  color: var(--mute);
}

/* floats in the right whitespace, vertically centred on the roles block; JS owns
   the transform for the scroll parallax (margin centres it so transform stays free) */
.bg__resume {
  position: absolute;
  top: 50%;
  right: 0;
  margin-top: -92px; /* half the 184px button */
  will-change: transform;
}

/* =========================================================
   PROJECTS — cursor-follow previews
   ========================================================= */
.projects { position: relative; }

.project__row {
  display: grid;
  grid-template-columns: 64px 1fr 1fr 80px;
  align-items: center;
  gap: 24px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  transition: opacity 0.4s ease;
}
.project:last-child .project__row { border-bottom: 1px solid var(--line); }

.project__index { font-size: 13px; color: var(--mute); }

.project__name {
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.project__meta { font-size: 16px; color: var(--mute); }

.project__year {
  font-size: 13px;
  color: var(--mute);
  text-align: right;
}

.project-list:hover .project__row { opacity: 0.4; }
.project-list:hover .project__row:hover { opacity: 1; }
.project__row:hover .project__name { transform: translateX(16px); }

/* floating preview — a fixed window the cursor drags around (position set by JS).
   The frame is a solid dark backdrop; the screenshot is inset inside it and a
   "View" circle sits centered on top. The window wipes open via clip-path. */
.preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 340px;
  height: 420px;
  margin: 0;
  padding: 16px;
  background: var(--preview-frame);
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
  /* JS owns the translate; clip-path handles the reveal so transform stays free */
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, clip-path;
}
.preview.is-visible { clip-path: inset(0 0 0 0); }

/* inner stage: fills the padded content box and clips the sliding layers */
.preview__stage {
  position: absolute;
  inset: 16px;
  overflow: hidden;
}

/* each layer fills the stage and slides on the y-axis (JS owns yPercent) */
.preview__layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  will-change: transform;
}

/* the image is shown whole (no crop): it sits centered in the stage and any
   leftover space falls back to the dark frame. A small counter-parallax drifts
   it inside that space. */
.preview__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  will-change: transform;
}

/* circular "View" button overlaid on the screenshot, centered in the frame */
.preview__cta {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--preview-cta);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  z-index: 3;
}

/* =========================================================
   ABOUT
   ========================================================= */
.about__lead {
  font-size: clamp(19px, 2.1vw, 28px);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.02em;
  max-width: 820px;
  margin-bottom: clamp(48px, 8vh, 96px);
}

.about__cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(32px, 5vw, 80px);
  max-width: 880px;
}

.about__col-head {
  font-size: clamp(21px, 2.2vw, 28px);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}

.about__list,
.about__certs { display: flex; flex-direction: column; gap: 20px; }
.about__list { font-size: 16px; }
.about__certs li { display: flex; flex-direction: column; gap: 3px; }
.about__cert-name { font-size: 16px; letter-spacing: -0.01em; }
.about__cert-org { font-size: 13px; color: var(--mute); }

/* =========================================================
   MAGNETIC BUTTON — round, fill-on-hover, follows the cursor
   ========================================================= */
.btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 184px;
  height: 184px;
  border-radius: 50%;
  background: var(--green);
  color: var(--green-light);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  flex-shrink: 0;
  will-change: transform;
}
.btn__fill {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--green-light);
  border-radius: 50%;
  transform: translateY(101%);
  transition: transform 0.55s cubic-bezier(0.62, 0.05, 0.01, 0.99);
}
.btn:hover .btn__fill { transform: translateY(0); }
.btn__label { position: relative; z-index: 1; transition: color 0.35s ease; }
.btn:hover .btn__label { color: var(--green); }
.btn--sm { width: 116px; height: 116px; font-size: 15px; }

.footer__cta {
  flex-shrink: 0;
  will-change: transform;
}

.projects__more {
  display: flex;
  justify-content: center;
  padding-top: clamp(48px, 7vh, 96px);
}

/* =========================================================
   FOOTER — "Let's work together" (white, fullscreen)
   ========================================================= */
.footer {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(48px, 9vh, 120px) var(--gutter);
  padding-left: calc(var(--gutter) + var(--nav-w));
}

.footer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line);
}

.footer__head {
  font-size: clamp(48px, 9vw, 128px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.04em;
}
.footer__head span { display: block; }

.footer__email {
  display: inline-block;
  width: fit-content;
  margin-top: 56px;
  font-size: clamp(24px, 3.5vw, 44px);
  font-weight: 500;
  letter-spacing: -0.02em;
  background-image: linear-gradient(var(--black), var(--black));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.footer__email:hover { background-size: 100% 1px; }

.footer__contacts { display: flex; flex-direction: column; gap: 18px; margin-top: 56px; }
.footer__contacts .footer__email { margin-top: 0; }

.footer__meta {
  margin-top: auto;
  padding-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  font-size: 15px;
}
.footer__meta-col { display: flex; flex-direction: column; gap: 10px; }
.footer__meta-col .label { color: var(--mute); }
.footer__meta-col:last-child { align-items: flex-end; text-align: right; }
.footer__social-row { display: flex; gap: 18px; }
.footer__social-row a { transition: color 0.3s ease; }
.footer__social-row a:hover { color: var(--green); }

/* =========================================================
   PROJECTS PAGE — simple top nav + grid
   ========================================================= */
body.page-archive { --nav-w: 0px; }

/* floating header — transparent, brand top-left (like the home page),
   magnetic button top-right; no white bar framing the page */
.topnav {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--gutter);
  background: transparent;
  pointer-events: none;          /* the bar itself never eats clicks… */
}
.topnav > * { pointer-events: auto; }   /* …only the brand + button do */
.topnav__brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--black);
  padding-top: 4px;              /* optical-center the small brand against the round button */
}

.archive {
  padding: calc(var(--gutter) + clamp(44px, 6vh, 72px)) var(--gutter) clamp(60px, 9vh, 120px);
}
.archive__head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding-bottom: 40px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--line);
}
.archive__title {
  font-size: clamp(40px, 7vw, 92px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(32px, 4vw, 64px);
}
.card__link { display: block; }
.card__media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--green-tint);
  margin-bottom: 20px;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.card:hover .card__media img { transform: scale(1.04); }
.card__row { display: flex; align-items: baseline; justify-content: space-between; }
.card__name { font-size: clamp(22px, 2.4vw, 30px); font-weight: 500; letter-spacing: -0.02em; }
.card__year { font-size: 14px; color: var(--mute); }
.card__meta { display: block; margin-top: 4px; font-size: 15px; color: var(--mute); }

/* =========================================================
   RESUME PAGE — side nav + embedded PDF
   ========================================================= */
.resume { display: flex; min-height: 100vh; }

.resume__aside {
  width: clamp(220px, 24vw, 320px);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-right: 1px solid var(--line);
}

.resume__brand { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

.resume__nav { display: flex; flex-direction: column; gap: 6px; font-size: 18px; font-weight: 500; }
.resume__nav a {
  width: fit-content;
  color: var(--mute);
  transition: color 0.35s ease, transform 0.35s ease;
}
.resume__nav a:hover { color: var(--black); transform: translateX(5px); }

.resume__info {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-size: 15px;
}
.resume__block { display: flex; flex-direction: column; gap: 6px; }
.resume__block .label { color: var(--mute); }
.resume__socials { display: flex; flex-direction: column; gap: 4px; }
.resume__block a { transition: color 0.3s ease; }
.resume__block a:hover { color: var(--green); }
.resume__download { font-weight: 500; }

.resume__doc { flex: 1; min-width: 0; background: var(--green-tint); }
.resume__doc iframe { width: 100%; height: 100vh; border: 0; display: block; }

/* =========================================================
   PROJECT DETAIL PAGE — shared template
   ========================================================= */
body.page-detail { --nav-w: 0px; }

.detail {
  padding: calc(var(--gutter) + clamp(44px, 6vh, 72px)) var(--gutter) clamp(60px, 9vh, 120px);
}

.detail__head {
  max-width: 1180px;
  padding-bottom: clamp(36px, 6vh, 72px);
  margin-bottom: clamp(36px, 6vh, 72px);
  border-bottom: 1px solid var(--line);
}

.detail__index {
  display: block;
  font-size: 13px;
  color: var(--mute);
  margin-bottom: 18px;
}

.detail__title {
  font-size: clamp(44px, 9vw, 132px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.detail__tagline {
  max-width: 760px;
  margin-top: 24px;
  font-size: clamp(19px, 2.1vw, 28px);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--black);
}

.detail__facts {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: clamp(28px, 5vw, 72px);
  margin-top: clamp(32px, 5vh, 56px);
}
.fact { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.fact .label { color: var(--mute); }
.fact a {
  width: fit-content;
  transition: color 0.3s ease;
  background-image: linear-gradient(var(--green), var(--green));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
}
.fact a:hover { color: var(--green); background-size: 100% 1px; }
.fact span + span,
.fact a + a { } /* stacked links inherit gap from .fact */
.fact--links { gap: 6px; }
.fact--links .label { margin-bottom: 2px; }

.detail__cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--green-tint);
  margin-bottom: clamp(48px, 8vh, 104px);
}
.detail__cover img { width: 100%; height: 100%; object-fit: cover; }

.detail__body { max-width: 760px; margin-bottom: clamp(48px, 8vh, 104px); }
.detail__lead {
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.detail__lead + .detail__lead { margin-top: 1.2em; }
.detail__placeholder {
  margin-top: 1.6em;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
}

.detail__gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 3vw, 40px);
  margin-bottom: clamp(64px, 11vh, 140px);
}
.detail__gallery figure {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--green-tint);
}
.detail__gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.detail__gallery figure:hover img { transform: scale(1.04); }

.detail__next {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: clamp(40px, 7vh, 80px);
  border-top: 1px solid var(--line);
}
.detail__next .label { color: var(--mute); }
.detail__next-name {
  font-size: clamp(34px, 6vw, 80px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.detail__next:hover .detail__next-name { transform: translateX(16px); }

/* =========================================================
   CASE STUDY — sectioned write-up
   ========================================================= */
.detail__section {
  max-width: 760px;
  margin-bottom: clamp(48px, 8vh, 96px);
}
.detail__eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 18px;
}
.detail__h2 {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: clamp(18px, 2.4vh, 28px);
}
.detail__copy {
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--ink, var(--black));
}
.detail__copy + .detail__copy { margin-top: 1.1em; }
.detail__copy a {
  background-image: linear-gradient(var(--green), var(--green));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: color 0.3s ease;
}
.detail__copy a:hover { color: var(--green); }

/* full-width captioned figure between sections */
.detail__figure {
  margin-bottom: clamp(48px, 8vh, 104px);
}
.detail__figure > img,
.detail__figure > .detail__frame img {
  display: block;
  width: 100%;
  height: auto;
}
.detail__frame {
  overflow: hidden;
  background: var(--green-tint);
}
.detail__caption {
  margin-top: 16px;
  max-width: 620px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--mute);
}

/* =========================================================
   REVEALS
   ========================================================= */
.reveal { opacity: 0; transform: translateY(24px); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
/* not enough right whitespace to float the resume button — drop it back into flow */
@media (max-width: 1024px) {
  .bg__resume {
    position: static;
    margin-top: 0;
    display: flex;
    justify-content: flex-end;
    padding-top: clamp(48px, 8vh, 96px);
  }
}

@media (max-width: 760px) {
  :root { --nav-w: 0px; }

  .nav {
    flex-direction: row;
    align-items: center;
    gap: 18px;
    right: var(--gutter);
    justify-content: space-between;
  }
  .nav__brand { display: inline-block; }   /* bring the wordmark back next to the toggle */

  /* ---- toggle: "Menu" label + two bars that morph to an X ---- */
  .nav__toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--black);
    cursor: pointer;
    z-index: 2;
    transition: color 0.4s ease;
  }
  .nav__toggle-label { font-size: 14px; font-weight: 500; letter-spacing: 0.02em; }
  .nav__burger { position: relative; width: 22px; height: 12px; }
  .nav__burger i {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .nav__burger i:nth-child(1) { top: 0; }
  .nav__burger i:nth-child(2) { bottom: 0; }

  body.is-hero .nav__toggle { color: var(--green-light); }

  /* ---- full-screen overlay (the link list) ---- */
  .nav__list {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: var(--gutter);
    background: var(--green);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 1;
  }
  .nav__list a,
  body.is-hero .nav__list a {
    color: var(--green-light);
    opacity: 0.55;
    font-size: clamp(34px, 9vw, 50px);
    font-weight: 500;
    letter-spacing: -0.02em;
    padding: 8px 0;
    transform: translateY(14px);
    transition: opacity 0.4s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .nav__list a:hover { transform: translateY(14px); }   /* override desktop translateX */
  .nav__list a.is-active,
  body.is-hero .nav__list a.is-active { color: var(--green-light); opacity: 1; }

  /* ---- open state ---- */
  body.nav-open .nav__brand { position: relative; z-index: 2; color: var(--green-light); }
  body.nav-open .nav__toggle { color: var(--green-light); }
  body.nav-open .nav__burger i:nth-child(1) { transform: translateY(5.25px) rotate(45deg); }
  body.nav-open .nav__burger i:nth-child(2) { transform: translateY(-5.25px) rotate(-45deg); }

  body.nav-open .nav__list { opacity: 1; visibility: visible; pointer-events: auto; }
  body.nav-open .nav__list a { transform: translateY(0); opacity: 0.65; }
  body.nav-open .nav__list a.is-active { opacity: 1; }
  /* stagger the links in as the overlay opens */
  body.nav-open .nav__list a:nth-child(1) { transition-delay: 0.08s; }
  body.nav-open .nav__list a:nth-child(2) { transition-delay: 0.13s; }
  body.nav-open .nav__list a:nth-child(3) { transition-delay: 0.18s; }
  body.nav-open .nav__list a:nth-child(4) { transition-delay: 0.23s; }
  body.nav-open .nav__list a:nth-child(5) { transition-delay: 0.28s; }
  body.nav-open .nav__list a:nth-child(6) { transition-delay: 0.33s; }

  .hero { padding-top: calc(var(--gutter) + 56px); }
  .hero__foot { left: var(--gutter); }

  .project__row {
    grid-template-columns: 36px 1fr;
    grid-template-areas:
      "index name"
      "index meta";
    row-gap: 4px;
    column-gap: 14px;
  }
  .project__index { grid-area: index; }
  .project__name { grid-area: name; }
  .project__meta { grid-area: meta; }
  .project__year { display: none; }

  .about__cols { grid-template-columns: 1fr; gap: 48px; }
  .preview { display: none; }

  .role__logo { width: 56px; height: 56px; font-size: 21px; }
  .role__title { font-size: clamp(26px, 8vw, 40px); }

  .footer__top { flex-direction: column; align-items: flex-start; gap: 32px; }
  .footer__head { font-size: clamp(40px, 13vw, 72px); }
  .footer__meta { grid-template-columns: 1fr; gap: 22px; }
  .footer__meta-col:last-child { align-items: flex-start; text-align: left; }
  .footer__social-row { flex-wrap: wrap; }
  .btn { width: 150px; height: 150px; }
  /* the floating back button stays compact on phones (the 150px is for the footer CTA) */
  .btn--sm { width: 92px; height: 92px; font-size: 13px; }

  .grid { grid-template-columns: 1fr; }

  .detail__facts { grid-template-columns: 1fr 1fr; gap: 24px 32px; }
  .detail__gallery { grid-template-columns: 1fr; }

  .resume { flex-direction: column; }
  .resume__aside {
    position: static;
    height: auto;
    width: 100%;
    gap: 28px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .resume__info { margin-top: 0; }
  .resume__doc iframe { height: 82vh; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .fill__text .w { opacity: 1; }
}
