/* Troy Silva — Portfolio Site
   Design tokens per ~/Vault/03 Areas/Marketing Consulting Practice/Brand Guideline.md
   Base: near-black. Accent: blue. Type: Yeseva One (display) + Josefin Sans (body/nav).
   Visual system: seamless glass — rounded, semi-transparent, blurred panels floating
   on one continuous background. No hard divider lines anywhere.
   Forbidden: numbered list/step markers, pill/badge UI, left-border accent bars. */

@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300;400;500;600;700&family=Yeseva+One&display=swap');

/* Native cross-document view transitions: when a poster-card image and a
   case-hero share the same view-transition-name (set inline per page),
   the browser morphs one into the other on navigation instead of a hard
   cut — the card visually grows into the full-screen hero. Chrome/Edge
   support this today; Safari/Firefox just navigate normally (no error,
   graceful fallback, nothing else on the page needs to change for it). */
@view-transition {
  navigation: auto;
}

:root {
  --bg: #0E0E0E;
  --bg-raised: #1A1A1A;
  --text: #F5F3EF;
  --text-muted: #9B968D;
  --accent: #4C7FFF;

  /* Glass panel system */
  --radius: 28px;
  --radius-sm: 18px;
  --glass-bg: rgba(255, 255, 255, 0.055);
  --glass-bg-strong: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-blur: 22px;

  --display: 'Yeseva One', serif;
  --sans: 'Josefin Sans', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  /* Ambient wash — on pages with a hero photo, --hero-glow is set on <body>
     and this radial tint carries that color down through the whole page
     instead of it being a local hero-only effect. Falls back to flat --bg
     on pages with no photo. */
  background:
    radial-gradient(ellipse 90% 50% at 70% 0%, var(--hero-glow, transparent) 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Full-page photo background (About, Contact) — the photo IS the page
   surface, not a boxed hero at the top. A fixed dark wash keeps every
   glass panel's text legible no matter what's in the shot. Overrides
   the plain body background above via the added class. */
body.photo-bg {
  background-image:
    linear-gradient(180deg, rgba(6,6,6,0.6) 0%, rgba(6,6,6,0.8) 100%),
    var(--page-img);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

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

::selection { background: var(--accent); color: var(--text); }

/* ---------- Reusable glass panel ---------- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

/* ---------- Nav — floating glass bar, no bottom rule ---------- */
.site-nav {
  position: sticky;
  top: clamp(0.75rem, 2vw, 1.25rem);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  margin: clamp(0.75rem, 2vw, 1.25rem) clamp(1rem, 4vw, 2rem) 0;
  padding: 0.9rem clamp(1.25rem, 3vw, 2rem);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-left: auto;
}

.nav-back {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}

.nav-back:hover,
.nav-back:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
}

.nav-back svg { width: 16px; height: 16px; fill: none; stroke: var(--text); stroke-width: 2; }

.nav-links a {
  cursor: pointer;
  transition: color 200ms ease, opacity 200ms ease;
}

.nav-toggle {
  display: none;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  margin-left: auto;
  border-radius: 50%;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible,
.site-nav.open .nav-toggle {
  border-color: var(--accent);
  background: var(--accent);
}

.nav-toggle svg { width: 16px; height: 16px; fill: none; stroke: var(--text); stroke-width: 2; }

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a[aria-current="page"] {
  color: var(--accent);
}

/* ---------- Focus states (accessibility) ---------- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 6vw, 4rem);
  overflow: hidden;
}

/* Homepage-only hero: the photo lives in this block and scrolls away
   naturally with the page (no background-attachment: fixed) — it fades
   into the flat body background at its own bottom edge, then the ambient
   --hero-glow radial wash on <body> carries the color the rest of the
   way down. Distinct from .photo-bg, which pins one photo behind the
   whole page — used on every page except the homepage. */
.hero-photo-scroll {
  position: relative;
  background-image:
    linear-gradient(to bottom, transparent 0%, transparent 55%, var(--bg) 100%),
    var(--hero-img);
  background-size: cover;
  background-position: center 22%;
  background-repeat: no-repeat;
}

.hero-photo-scroll .content {
  position: relative;
  z-index: 1;
}

/* Text sits directly on top of a full-bleed photo here (unlike .hero.has-photo,
   which keeps text on a solid-color side away from the image) — legibility
   can't depend on where the subject happens to land, since that shifts with
   crop/aspect ratio and whenever the hero photo is swapped. A shadow keeps
   it readable regardless of what's behind it. */
.hero-photo-scroll .content h1,
.hero-photo-scroll .content .role-line {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.75), 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Photo-led hero: photo held to the right, a gradient sampled from the
   photo's own bottom color fills the left side so it reads as one
   continuous surface rather than a photo dropped in a box. Set
   --hero-img and --hero-sample inline once the file + sampled color exist. */
.hero.has-photo {
  justify-content: center;
  align-items: stretch;
  padding: 0;
}

.hero.has-photo .hero-fill {
  /* Ambient color now comes from the body-level radial wash (--hero-glow) —
     this layer just needs to exist for stacking, no gradient of its own. */
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero.has-photo .hero-photo {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(56%, 900px);
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.hero.has-photo .hero-photo::before {
  /* feather the left edge of the photo into the gradient fill — wide and
     slow on purpose, a short fade still reads as a hard edge once real
     photo texture/noise starts against a perfectly flat color. */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    var(--hero-sample, var(--bg)) 0%,
    var(--hero-sample, var(--bg)) 8%,
    transparent 68%);
}

.hero.has-photo .hero-photo::after {
  /* fade the bottom of the photo into the page background — no hard cutoff */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, transparent 62%, var(--bg) 100%);
}

.hero.has-photo .hero-content {
  position: relative;
  z-index: 2;
  max-width: min(50%, 640px);
  padding: clamp(1.5rem, 6vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 768px) {
  .hero.has-photo { flex-direction: column; }
  .hero.has-photo .hero-photo { position: relative; width: 100%; height: 55vh; }
  .hero.has-photo .hero-content { max-width: 100%; }
}

.hero h1,
.hero-photo-scroll h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.75rem, 8vw, 6rem);
  line-height: 1.02;
  margin: 0 0 1.25rem;
  max-width: 16ch;
}

.hero .role-line {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--text-muted);
  max-width: 42ch;
  line-height: 1.6;
  font-weight: 300;
}

.hero .role-line strong {
  color: var(--text);
  font-weight: 500;
}

/* ---------- Stat tiles — one glass panel housing all four ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(2rem, 5vw, 3rem);
  margin: clamp(0.6rem, 1.5vw, 1rem) clamp(1.25rem, 6vw, 4rem);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

.stat .num {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat .label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .site-nav {
    position: relative;
    flex-wrap: nowrap;
  }
  .wordmark { white-space: nowrap; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    /* position:fixed rather than absolute inside the sticky nav — cleaner
       stacking, doesn't get clipped by any ancestor. JS sets `top` to sit
       just under the pill. Same glass material as the rest of the site;
       the actual bleed-through bug lived in body.photo-bg's
       background-attachment, fixed separately above. */
    position: fixed;
    left: clamp(1rem, 4vw, 2rem);
    right: clamp(1rem, 4vw, 2rem);
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
    margin-left: 0;
    padding: 1.25rem clamp(1.25rem, 6vw, 2rem);
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    overflow: hidden;
    isolation: isolate;
  }

  /* backdrop-filter can't reliably blur content behind a fixed overlay on
     this browser (confirmed: works with nothing else fixed on the page,
     silently no-ops once body's own fixed background photo is added — a
     known cross-layer compositing gap, not something a positioning change
     fixes). So don't depend on it seeing through to live content at all:
     paint a pre-blurred copy of the SAME fixed photo as this element's own
     content instead, using plain filter:blur (blurring an element's own
     paint, not sampling through it, which doesn't have that bug). Matching
     background-attachment:fixed + size:cover + position:center means this
     crop lines up exactly with the real photo directly behind it, so it
     reads as "seeing through," not as a separate image. Sized oversized
     and clipped by the parent's overflow:hidden so the blur has room to
     breathe without fading out at the card's own edges. Pages with no
     --page-img (the homepage) fall back to `none` — genuine backdrop-filter
     already works fine there, since nothing else on that page is fixed. */
  .nav-links::before {
    content: '';
    position: absolute;
    inset: -40px;
    z-index: -1;
    background-image:
      linear-gradient(180deg, rgba(6,6,6,0.65), rgba(6,6,6,0.8)),
      var(--page-img, none);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: blur(24px) saturate(160%);
  }

  .site-nav.open .nav-links { display: flex; }
}

/* ---------- Work index — each entry its own glass card ---------- */
.work-index {
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 6vw, 4rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 2vw, 1.25rem);
}

.work-entry {
  display: block;
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 3vw, 2rem);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 200ms ease;
}

.work-entry:hover,
.work-entry:focus-visible {
  background: var(--glass-bg-strong);
}

.work-entry .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.work-entry h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 4.25rem);
  margin: 0;
  transition: color 200ms ease;
}

.work-entry:hover h2,
.work-entry:focus-visible h2 { color: var(--accent); }

.work-entry .meta {
  text-align: right;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: nowrap;
}

.work-entry .meta .type { color: var(--text); }

/* ---------- Poster grid — Netflix-style: vertical image cards, title
   overlaid on a scrim, hover zoom. Used on the homepage Work section. ---------- */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1rem, 3vw, 1.75rem);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 6vw, 4rem);
}

.poster-card {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--glass-border);
}

.poster-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms ease;
}

.poster-card:hover img,
.poster-card:focus-visible img {
  transform: scale(1.06);
}

.poster-card .scrim {
  position: absolute;
  inset: auto 0 0 0;
  height: 65%;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  pointer-events: none;
}

.poster-card .info {
  position: absolute;
  left: 1.15rem;
  right: 1.15rem;
  bottom: 1.15rem;
}

.poster-card .type {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.poster-card h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin: 0 0 0.4rem;
  line-height: 1.1;
}

.poster-card .result {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------- Section headings ---------- */
.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  margin: 0 0 1.25rem;
}

.prose {
  max-width: 62ch;
  line-height: 1.75;
  color: var(--text-muted);
  font-size: 1rem;
}

.prose strong { color: var(--text); font-weight: 500; }

/* ---------- Case study page — every block a glass panel, gap instead of rule ---------- */
.case-header {
  margin: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 6vw, 4rem) 0;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 4vw, 2.5rem);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

.case-header h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 7vw, 5rem);
  margin: 0 0 0.75rem;
}

.case-header .role-descriptor {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.case-header .dates {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.case-section {
  margin: clamp(0.6rem, 1.5vw, 1rem) clamp(1.25rem, 6vw, 4rem);
  padding: clamp(2rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

/* ---------- Case-study hero — full-bleed photo, simple overlaid text ---------- */
.case-hero {
  position: relative;
  min-height: 62vh;
  margin: clamp(0.75rem, 2vw, 1.25rem) clamp(1.25rem, 6vw, 4rem) 0;
  border-radius: var(--radius);
  overflow: hidden;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center 30%;
  display: flex;
  align-items: flex-end;
}

.case-hero .scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.25) 45%, transparent 75%);
  pointer-events: none;
}

.case-hero .info {
  position: relative;
  z-index: 1;
  padding: clamp(1.75rem, 4vw, 3rem);
}

.case-hero .type {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.case-hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 7vw, 5rem);
  margin: 0 0 0.5rem;
  line-height: 1;
}

.case-hero .dates {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Filmstrip — horizontal scroll instead of a tall vertical wall
   of images. Snap-scroll, no scrollbar chrome, works with touch/trackpad. ---------- */
.filmstrip {
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 clamp(1.25rem, 6vw, 4rem) 0.5rem;
  /* scroll-snap-align:start on the tiles otherwise fights the container's
     own padding — Chrome/Safari treat the snap "start" as the padding
     edge and refuse to rest the scroll position anywhere the first tile
     isn't flush against it, so the left/right inset visibly collapses to
     0 the instant the page loads (confirmed: forcing scrollLeft=0 snaps
     straight back). scroll-padding-inline reserves that space from the
     snap area itself instead, so the inset actually holds. */
  scroll-padding-inline: clamp(1.25rem, 6vw, 4rem);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filmstrip::-webkit-scrollbar { display: none; }

.filmstrip .photo-tile {
  flex: 0 0 clamp(220px, 26vw, 320px);
  scroll-snap-align: start;
  aspect-ratio: 4 / 5;
}

/* Video tiles run bigger than photo tiles — sized separately so this
   doesn't also inflate every photo filmstrip on the site. Vertical
   (Instagram) tiles get their own narrower basis so a mixed row doesn't
   let a 9:16 card tower over its 16:9 neighbors. */
.filmstrip .lite-embed {
  flex: 0 0 clamp(320px, 42vw, 560px);
  scroll-snap-align: start;
}

.filmstrip .lite-embed[style*="9 / 16"],
.filmstrip .lite-embed[style*="9/16"] {
  flex-basis: clamp(200px, 24vw, 300px);
}

/* ---------- Media placeholders (swap for real assets) ---------- */
.media-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar, 4 / 5);
  background:
    repeating-linear-gradient(135deg, var(--bg-raised), var(--bg-raised) 10px, var(--bg) 10px, var(--bg) 20px);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 0.85rem;
}

.media-placeholder .cap {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.75rem, 2vw, 1.25rem);
}

@media (max-width: 768px) {
  .media-grid { grid-template-columns: 1fr; }
}

/* ---------- Photo tile (real image — photo-led: image dominant, caption a quiet scrim) ---------- */
.photo-tile {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar, 4 / 5);
  overflow: hidden;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-tile .scrim {
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  pointer-events: none;
}

/* ---------- Lightbox / gallery mode ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 6, 0.94);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease;
}

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

.lightbox img {
  max-width: min(88vw, 1400px);
  max-height: 86vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox .lb-btn,
.video-lightbox .lb-btn {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
  z-index: 1;
}

.lightbox .lb-btn:hover,
.lightbox .lb-btn:focus-visible,
.video-lightbox .lb-btn:hover,
.video-lightbox .lb-btn:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
}

.lightbox .lb-btn svg,
.video-lightbox .lb-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 2; }

.lightbox .lb-close,
.video-lightbox .lb-close { top: clamp(1rem, 3vw, 1.75rem); right: clamp(1rem, 3vw, 1.75rem); }
.lightbox .lb-prev,
.video-lightbox .lb-prev { left: clamp(0.75rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }
.lightbox .lb-next,
.video-lightbox .lb-next { right: clamp(0.75rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }

@media (max-width: 640px) {
  .lightbox .lb-btn,
  .video-lightbox .lb-btn { width: 44px; height: 44px; }
}

/* ---------- Video lightbox — same chrome as the photo lightbox, sized
   for video and aware of both landscape (YouTube) and vertical (Instagram)
   aspect ratios. Cycles through every video on the page, source-agnostic. ---------- */
.video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 6, 0.94);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease;
}

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

.video-lightbox .vl-stage {
  position: relative;
  width: min(90vw, 1200px);
  aspect-ratio: 16 / 9;
  max-height: 86vh;
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.video-lightbox .vl-stage.vertical {
  width: min(90vw, 460px);
  aspect-ratio: 9 / 16;
}

.video-lightbox .vl-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-lightbox .vl-stage .instagram-media {
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

@media (max-width: 640px) {
  .video-lightbox .vl-stage { width: 94vw; }
  .video-lightbox .vl-stage.vertical { width: min(94vw, 400px); }
}

.photo-tile .cap {
  position: absolute;
  left: 0.9rem;
  bottom: 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}

/* ---------- YouTube / Instagram lite-embed (facade — loads on click) ---------- */
.lite-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-raised);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Scrim: real element (not ::before) so it's wiped out along with the rest
   of the facade when JS swaps in the real iframe on click. */
.lite-embed .scrim {
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  pointer-events: none;
}

.lite-embed .play-btn {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms ease, border-color 200ms ease;
}

.lite-embed:hover .play-btn,
.lite-embed:focus-visible .play-btn {
  border-color: var(--accent);
  background: var(--accent);
}

.lite-embed .play-btn svg { width: 20px; height: 20px; fill: var(--text); margin-left: 3px; }

.lite-embed .cap {
  position: absolute;
  bottom: 0.85rem;
  left: 0.85rem;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

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

/* ---------- Credit line ---------- */
.credit-line {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.credit-line strong { color: var(--text); font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer {
  margin: clamp(1rem, 2.5vw, 1.5rem) clamp(1.25rem, 6vw, 4rem) clamp(2rem, 5vw, 3rem);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

.site-footer a {
  cursor: pointer;
  transition: color 200ms ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent);
}

/* ---------- Scroll reveal — applied automatically by site.js via
   IntersectionObserver, no per-element markup needed in the HTML ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
