/* ============================================================
   HOME — Cinematic scroll with fixed video background
   The video is ALWAYS behind everything. Content panels in
   cream/beige slide over it as you scroll. The video scrubs
   and parallaxes (scale + drift) so it feels alive.
   ============================================================ */

/* ── Film grain ──────────────────────────────────────────── */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.038;
  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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: grain 0.18s steps(1) infinite;
  will-change: background-position;
}

@keyframes grain {
  0%   { background-position: 0 0; }
  25%  { background-position: -30px -20px; }
  50%  { background-position: 20px 30px; }
  75%  { background-position: -10px 40px; }
  100% { background-position: 30px -10px; }
}

/* ============================================================
   FIXED VIDEO BACKGROUND
   Lives below z-index 1. Everything else stacks above.
   ============================================================ */
.sf-video-bg {
  position: fixed;
  inset: -1px;  /* 1px past viewport — kills subpixel compositing seam */
  z-index: 0;
  overflow: hidden;
  background: #e8e0d4;  /* warm cream fallback — matches wash, not black */
}

#sf-video {
  /* Slightly taller than 100vh so parallax translation has headroom */
  position: absolute;
  top: -8%;
  left: 0;
  width: 100%;
  height: 116%;
  object-fit: cover;
  object-position: center center;
  will-change: transform;
  display: block;
}

/* Edge vignette — darkens perimeter, keeps centre bright and visible */
.sf-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 110% 100% at 50% 50%,
    transparent 38%,
    rgba(12, 11, 10, 0.55) 100%
  );
}

/* ============================================================
   NAV — dark glass while over hero, cream when in sections
   (toggled by JS)
   ============================================================ */
.nav.over-hero {
  background: rgba(14, 13, 12, 0.72) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom-color: rgba(242, 237, 228, 0.10) !important;
}

.nav.over-hero .nav-logo,
.nav.over-hero .nav-center a {
  color: rgba(242, 237, 228, 0.65);
}

.nav.over-hero .nav-logo img {
  filter: brightness(0) invert(1) opacity(0.75);
}

.nav.over-hero .nav-center a:hover,
.nav.over-hero .nav-center a.active {
  color: rgba(242, 237, 228, 1);
}

.nav.over-hero .nav-hamburger span {
  background: rgba(242, 237, 228, 0.9);
}

/* ============================================================
   CREAM WASH — sits between video (z:0) and scroll content (z:2)
   Cream tint keeps the beige aesthetic while video plays through.
   ============================================================ */
.sf-cream-wash {
  position: fixed;
  inset: 0;
  z-index: 1;
  /* Warm cream tint — warms the video without killing it */
  background: rgba(238, 230, 212, 0.18);
  pointer-events: none;
}

/* ============================================================
   SCROLL FILM — wrapper
   ============================================================ */
#scroll-film {
  position: relative;
  z-index: 2;        /* stacks above cream wash (z:1) and video (z:0) */
}

/* ── Shared panel base ───────────────────────────────────── */
.sf-panel {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Inherits global dark-on-light tokens — panels are warm parchment, not dark glass */
}

.sf-panel-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--nav-h) + clamp(4rem, 8vh, 7rem)) var(--pad-x) clamp(4rem, 8vh, 7rem);
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vh, 3.5rem);
  height: 100%;
  /* Semi-transparent cream — video shows through, text on dark-on-cream */
  background: rgba(240, 233, 218, 0.50);
  /* Boost text-dim contrast: at 50% panel opacity video bleeds through, #5c5449 too light */
  --text-dim: #2e2a26;
}

/* ── Label row ───────────────────────────────────────────── */
.sf-label-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  opacity: 0;
  transform: translateX(-30px);
}

.sf-chapter-label {
  font-family: var(--font-meta);
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.sf-label-line {
  flex: 1;
  height: 1px;
  background: var(--border-mid);
  transform-origin: left;
  transform: scaleX(0);
}

/* ── Ghost watermark title ───────────────────────────────── */
.sf-ghost-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(9rem, 20vw, 20rem);
  color: transparent;
  -webkit-text-stroke: 1px rgba(28, 26, 23, 0.07);
  text-stroke:         1px rgba(28, 26, 23, 0.07);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  line-height: 1;
}

.sf-ghost-small   { font-size: clamp(6rem, 14vw, 14rem); }
.sf-ghost-contact { font-size: clamp(7rem, 16vw, 18rem); }

/* ── Section headings ────────────────────────────────────── */
.sf-section-heading {
  font-size: clamp(3rem, 6.5vw, 7.5rem);
  line-height: 0.88;
  letter-spacing: 0.02em;
  color: var(--text);
}

/* ── Shared CTA link ─────────────────────────────────────── */
.sf-section-cta {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-meta);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  border-bottom: 1px solid rgba(28, 26, 23, 0.4);
  padding-bottom: 0.4rem;
  align-self: flex-start;
  transition: color .25s, border-color .25s, gap .25s;
  opacity: 0;
}

.sf-section-cta:hover {
  color: #b8622e;
  border-color: #b8622e;
  gap: 1.5rem;
}

.sf-cta-arrow svg {
  transition: transform .3s ease;
}

.sf-section-cta:hover .sf-cta-arrow svg {
  transform: translateX(5px);
}

/* ── Shared image clip (clip-path reveal) ────────────────── */
.sf-img-clip {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.sf-img-inner {
  position: absolute;
  inset: -8%;
  background-size: cover;
  background-position: center;
  will-change: transform;
}

/* ============================================================
   PANEL 1 — HERO
   Transparent so the fixed video shows through fully.
   ============================================================ */
.sf-hero {
  /* NO background — video is behind everything */
  background: transparent;
  min-height: 100vh;
  height: 100vh;
  position: relative;
  /* Gradient at the BOTTOM bleeds hero into the next (cream) section */
  padding-bottom: 0;
}

/* Subtle bottom vignette — visually anchors hero content, separates from next panel */
.sf-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 18vh;
  background: linear-gradient(to bottom, transparent 0%, rgba(28, 26, 23, 0.18) 100%);
  pointer-events: none;
  z-index: 3;
}

/* ── Hero text ───────────────────────────────────────────── */
.sf-hero-content {
  position: absolute;
  bottom: clamp(5rem, 11vh, 9rem);
  left: var(--pad-x);
  right: var(--pad-x);
  z-index: 4;   /* above bottom-fade gradient */
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sf-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-meta);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: rgba(242, 237, 228, 0.9);
  text-shadow: 0 1px 20px rgba(4, 3, 2, 0.8);
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(22px);
}

.sf-eyebrow-line {
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  background: var(--accent-gold);
  flex-shrink: 0;
}

.sf-hero-title {
  font-size: clamp(4rem, 9vw, 11rem);
  line-height: 0.86;
  letter-spacing: -0.01em;
  color: #f0ebe0;    /* cream — maximum contrast on dark video */
  /* Subtle text shadow ensures readability at all video frames */
  text-shadow:
    0 2px 80px rgba(4, 3, 2, 0.90),
    0 0 140px rgba(4, 3, 2, 0.70);
}

.sf-title-clip {
  overflow: hidden;
  display: block;
}

.sf-title-indent {
  padding-left: clamp(2.5rem, 7vw, 10rem);
}

.sf-tl {
  display: block;
  opacity: 0;
  transform: translateY(108%);
}

/* Rust accent on the last line */
.sf-title-clip:last-child .sf-tl {
  color: #b8622e;
}

.sf-hero-meta {
  font-family: var(--font-meta);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: #e07c3a;
  text-shadow: 0 1px 20px rgba(4, 3, 2, 0.85);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(18px);
}

/* Scroll cue */
.sf-scroll-cue {
  position: absolute;
  bottom: 2.8rem;
  right: var(--pad-x);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  opacity: 0;
}

.sf-scroll-cue span {
  font-family: var(--font-meta);
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: rgba(242, 237, 228, 0.8);
  text-shadow: 0 1px 14px rgba(4, 3, 2, 0.75);
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.sf-scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(242, 237, 228, 0.7), transparent);
  animation: sf-scroll-pulse 1.9s ease-in-out infinite;
  transform-origin: top;
}

@keyframes sf-scroll-pulse {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Video progress bar — bottom edge */
.sf-video-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(242, 237, 228, 0.1);
  z-index: 5;
}

.sf-video-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gold);
  transition: width 0.04s linear;
}

/* ============================================================
   PANEL 2 — PORTFOLIO
   Solid cream slides over the video. Top gradient = smooth join.
   ============================================================ */
.sf-portfolio {
  background: transparent;
  min-height: 100vh;
  padding-bottom: clamp(5rem, 10vh, 8rem);
}

/* Cream curtain that smoothly covers the video as you enter */
.sf-portfolio::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;          /* no extra height — hero::after does the blend */
  pointer-events: none;
}

.sf-portfolio-split {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: clamp(2rem, 4vw, 5rem);
  align-items: start;
  flex: 1;
}

/* ── Project list ────────────────────────────────────────── */
.sf-portfolio-list {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.sf-portfolio-list .sf-section-heading {
  margin-bottom: clamp(2rem, 4vh, 3.5rem);
}

.sf-proj-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem 2.5rem;
  padding: 1.3rem 0;
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  cursor: none;
  opacity: 0;
  transform: translateX(-45px);
  transition: border-color .25s;
}

.sf-proj-row:last-child { border-bottom: 1px solid var(--border); }
.sf-proj-row:hover { border-color: var(--accent-blue); }

.sf-proj-thumb-inline {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity .45s ease;
  filter: brightness(0.72) saturate(0.65);
  z-index: 0;
}

/* inline row thumb intentionally hidden — right-column JS crossfade handles preview */

.sf-proj-info {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.sf-proj-num {
  font-family: var(--font-meta);
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  flex-shrink: 0;
}

.sf-proj-name {
  font-size: clamp(1.4rem, 2.5vw, 2.4rem);
  color: var(--text);
  line-height: 1;
  letter-spacing: 0.05em;
  transition: color .2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-proj-row:hover .sf-proj-name { color: var(--accent-blue); }

.sf-proj-cat {
  position: relative;
  z-index: 1;
  font-family: var(--font-meta);
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
  margin-left: auto;
}

.sf-proj-year {
  position: relative;
  z-index: 1;
  font-family: var(--font-meta);
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Hero image right column ─────────────────────────────── */
.sf-portfolio-hero-img {
  position: relative;
  z-index: 2;
  height: clamp(380px, 60vh, 680px);
  align-self: start;
  opacity: 0;
  outline: 1px solid rgba(28, 26, 23, 0.12);
}

/* ============================================================
   PANEL 3 — PICTURES
   ============================================================ */
.sf-pictures {
  background: transparent;
  min-height: 100vh;
  padding-bottom: clamp(5rem, 10vh, 8rem);
}

.sf-pictures-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.sf-pic-strip {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr 1.35fr 1fr;
  gap: clamp(0.5rem, 1.2vw, 1.2rem);
  align-items: end;
  flex: 1;
}

.sf-pic-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(65px);
}

.sf-pic-item--tall .sf-pic-clip { aspect-ratio: 2 / 3; }
.sf-pic-item--wide .sf-pic-clip { aspect-ratio: 4 / 3; }

.sf-pic-clip {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  position: relative;
  outline: 1px solid rgba(28, 26, 23, 0.12);
}

.sf-pic-img {
  position: absolute;
  inset: -10%;
  background-size: cover;
  background-position: center;
  filter: saturate(0.8);
  transition: filter .5s ease, transform .6s ease;
  will-change: transform;
}

.sf-pic-item:hover .sf-pic-img {
  filter: saturate(1.05);
  transform: scale(1.05);
}

.sf-pic-caption {
  font-family: var(--font-meta);
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ============================================================
   PANEL 4 — ABOUT
   ============================================================ */
.sf-about {
  background: transparent;
  min-height: 100vh;
  padding-bottom: clamp(5rem, 10vh, 8rem);
}

.sf-about-split {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(3rem, 6vw, 7rem);
  align-items: center;
  flex: 1;
}

.sf-about-img-wrap {
  position: relative;
  height: clamp(420px, 65vh, 700px);
  opacity: 0;
}

.sf-about-img-wrap .sf-img-clip {
  height: 100%;
  clip-path: inset(0 100% 0 0);
  outline: 1px solid rgba(28, 26, 23, 0.12);
}

.sf-stat-card {
  position: absolute;
  z-index: 5;
  background: rgba(240, 233, 218, 0.94);
  border: 1px solid rgba(28, 26, 23, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem 1.4rem;
  opacity: 0;
  transform: translateY(20px);
}

.sf-stat-card--tl { top: clamp(1rem,3%,2rem);   left:  clamp(-1rem,-6%,-1.5rem); }
.sf-stat-card--br { bottom: clamp(1rem,5%,2.5rem); right: clamp(-1rem,-6%,-1.5rem); }

.sf-stat-num {
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: var(--accent-gold);
  line-height: 1;
  letter-spacing: 0.04em;
}

.sf-stat-label {
  font-size: 0.64rem;
  letter-spacing: 0.20em;
  color: var(--text-dim);
  text-transform: uppercase;
  line-height: 1.5;
  margin-top: 0.35rem;
}

.sf-about-text {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sf-about-text .sf-ghost-small {
  position: absolute;
  top: -2rem;
  left: -1rem;
  opacity: 0.5;
}

.sf-about-text .sf-section-heading {
  opacity: 0;
  transform: translateY(42px);
}

.sf-about-bio {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  opacity: 0;
  transform: translateY(30px);
}

.sf-about-bio p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-dim);
}

.sf-about-bio em { color: var(--text); font-style: normal; }

.sf-about-quote {
  border-left: 2px solid var(--accent-blue);
  padding-left: 1.5rem;
  opacity: 0;
  transform: translateX(-22px);
}

.sf-about-quote,
.sf-about-quote p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-dim);
  font-style: italic;
}

.sf-about-quote cite {
  display: block;
  font-family: var(--font-meta);
  font-weight: 400;
  font-style: normal;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 0.5rem;
}

/* ============================================================
   PANEL 5 — CONTACT
   ============================================================ */
.sf-contact {
  background: transparent;
  min-height: 100vh;
}

.sf-contact .sf-panel-inner {
  justify-content: center;
}

.sf-contact-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(2rem, 4vh, 3rem);
}

.sf-contact-headline {
  font-size: clamp(4.5rem, 12vw, 13rem);
  line-height: 0.87;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.sf-tl-word {
  display: block;
  overflow: hidden;
}

.sf-tl-accent { color: #b8622e; }

.sf-email-link {
  display: inline-block;
  font-family: var(--font-meta);
  font-weight: 400;
  font-size: clamp(0.9rem, 2vw, 1.4rem);
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-mid);
  padding-bottom: 0.4rem;
  transition: color .25s, border-color .25s;
  opacity: 0;
  transform: translateY(22px);
}

.sf-email-link:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}


.sf-contact-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 2.2rem;
  border: 1px solid var(--border-mid);
  font-family: var(--font-meta);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  transition: background .3s, border-color .3s, color .3s, gap .25s;
  opacity: 0;
  transform: translateY(20px);
}

.sf-contact-cta:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
  gap: 1.3rem;
}

/* ============================================================
   FOOTER — needs position + solid bg to sit above the cream wash
   ============================================================ */
.sf-footer {
  position: relative;
  z-index: 3;
  background: rgba(235, 228, 212, 0.97);
  border-top: 1px solid rgba(28, 26, 23, 0.10);
  color: var(--text-dim);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sf-portfolio-split { grid-template-columns: 1fr; }
  .sf-portfolio-hero-img { height: clamp(280px,45vw,380px); }
  .sf-about-split { grid-template-columns: 1fr; gap: 2.5rem; }
  .sf-about-img-wrap { height: clamp(280px,55vw,380px); }
  .sf-stat-card--tl { left: 0; }
  .sf-stat-card--br { right: 0; }
  .sf-pic-strip { grid-template-columns: 1fr 1fr 1fr; }
  .sf-pic-item:nth-child(4),
  .sf-pic-item:nth-child(5) { display: none; }
  .sf-contact-headline { font-size: clamp(4rem,16vw,10rem); }
}

@media (max-width: 600px) {
  #sf-video { top: -4%; height: 108%; }
  .sf-hero-title { font-size: clamp(2.25rem,9.5vw,4rem); }
  .sf-title-indent { padding-left: clamp(1rem,5vw,3rem); }
  .sf-portfolio-hero-img { display: none; }
  .sf-proj-row { grid-template-columns: 1fr; gap: 0.35rem; padding: 1.1rem 0 1.3rem; }
  .sf-proj-info { flex-wrap: wrap; row-gap: 0.15rem; }
  .sf-proj-name { white-space: normal; overflow: visible; text-overflow: clip; }
  .sf-proj-year { justify-self: start; margin-top: 0.15rem; }

  /* No hover on touch — show each row's thumbnail permanently instead,
     same darkened treatment the desktop hover state already uses. */
  .sf-proj-row { min-height: 5.5rem; }
  .sf-proj-thumb-inline { opacity: 1; }
  .sf-pic-strip { grid-template-columns: 1fr 1fr; }
  .sf-pic-item:nth-child(4),
  .sf-pic-item:nth-child(5) { display: none; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .grain-overlay { animation: none; }
  .sf-scroll-line { animation: none; opacity: 1; }
  .sf-tl,
  .sf-eyebrow,
  .sf-hero-meta,
  .sf-scroll-cue,
  .sf-label-row,
  .sf-proj-row,
  .sf-portfolio-hero-img,
  .sf-pic-item,
  .sf-about-img-wrap,
  .sf-stat-card,
  .sf-about-text .sf-section-heading,
  .sf-about-bio,
  .sf-about-quote,
  .sf-email-link,
  .sf-contact-cta,
  .sf-section-cta {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}

/* ============================================================
   PROJECT MODAL — full preview on click, same pattern as
   pages/portfolio.html's modal (kept in sync, see BRAIN.md)
   ============================================================ */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  --text: #f0ebe0;
  --text-dim: #6b6560;
}

.project-modal.open {
  opacity: 1;
  pointer-events: all;
}

.modal-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: 1100px;
  width: 90%;
  padding: 0;
  position: relative;
}

.modal-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.modal-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  background: #000;
}

.modal-embed {
  width: 100%;
  height: 100%;
  display: none;
  border: none;
  background: #000;
}

.modal-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
}

.modal-num {
  font-size: 0.55rem;
  letter-spacing: 0.35em;
  color: var(--text-dim);
}

.modal-title {
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 0.9;
  color: var(--text);
}

.modal-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.modal-meta span {
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.modal-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.8;
  font-style: italic;
}

.modal-close {
  position: absolute;
  top: -2rem;
  right: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  transition: color 0.2s;
  padding: 0.5rem;
}

.modal-close:hover { color: var(--text); }

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