/* === RESET === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === TOKENS === */
:root {
  --bg: #ffffff;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --subtle: #aeaeb2;
  --border: #d2d2d7;
  --surface: #f5f5f7;
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Fira Code", "Fira Mono", monospace;
  --media-gutter: clamp(20px, 5vw, 80px);
  --page-gutter: clamp(72px, 6vw, 96px);
  --photo-safe-left: clamp(132px, 11vw, 176px);
}

@media (max-width: 768px) {
  :root {
    --media-gutter: 20px;
    --page-gutter: 20px;
    --photo-safe-left: 20px;
  }
}

/* === BASE === */
html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.47059;
}

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

/* === NAV === */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(28px, 3vw, 48px) clamp(28px, 3vw, 48px) 12px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

nav.scrolled {
  border-bottom-color: transparent;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: clamp(70px, 5.8vw, 86px);
}

.nav-logo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 8px rgba(255, 255, 255, 0.28));
}

.nav-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(24px, 3vw, 44px);
  min-width: 0;
  margin-left: clamp(18px, 3vw, 36px);
  list-style: none;
  isolation: isolate;
  --nav-liquid-x: 0px;
  --nav-liquid-width: 0px;
}

.nav-links a {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 16px;
  opacity: 0.98;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.28);
  transition: opacity 0.2s, color 0.2s;
}

.nav-links a:hover {
  opacity: 1;
}

.nav-links li:not(.nav-liquid-indicator) {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.nav-liquid-indicator {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 0;
  display: block;
  width: var(--nav-liquid-width);
  height: 34px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 8px 24px rgba(0, 0, 0, 0.05);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(var(--nav-liquid-x), -50%, 0) scale(0.92);
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.18s ease;
}

@supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .nav-liquid-indicator {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

.nav-links.has-liquid-target .nav-liquid-indicator {
  opacity: 1;
  transform: translate3d(var(--nav-liquid-x), -50%, 0) scale(1);
}

/* === HERO === */
#hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-top: 68px;
}

/* Full-bleed background video, played under a strong white veil so the hero
   reads white/light across the whole clip (which includes dark, colour and
   text scenes) rather than only its black frames. The footage stays present
   as a subtle moving background; the dark hero text stays legible. */
.hero-bg-video {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg);
}

.hero-bg-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.74),
    rgba(255, 255, 255, 0.82) 55%,
    rgba(255, 255, 255, 0.9)
  );
}

.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(40px, 6vw, 100px) var(--media-gutter) clamp(52px, 7vw, 100px) var(--photo-safe-left);
}

.hero-meta {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(20px, 2.5vw, 36px);
}

.hero-name {
  font-size: clamp(76px, 12.5vw, 210px);
  font-weight: 700;
  letter-spacing: -0.048em;
  line-height: 0.87;
  color: var(--fg);
  margin-bottom: clamp(28px, 3.5vw, 52px);
}

.hero-tagline {
  font-size: clamp(19px, 2.2vw, 27px);
  font-weight: 300;
  color: var(--muted);
  line-height: 1.4;
  letter-spacing: -0.01em;
  max-width: 520px;
}

.hero-foot {
  padding: 18px var(--media-gutter) 18px var(--photo-safe-left);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-foot-hint {
  font-size: 12px;
  color: var(--subtle);
  letter-spacing: 0.04em;
}

.hero-foot-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--subtle);
}

/* === SECTION BASE === */
.section {
  padding: clamp(72px, 10vw, 160px) var(--media-gutter) clamp(72px, 10vw, 160px) var(--page-gutter);
  border-top: 1px solid var(--border);
}

.section > * {
  max-width: 1200px;
  margin-inline: auto;
}

#photography > *,
#design-stage > * {
  max-width: none;
}

#photography,
#design-stage {
  padding-right: var(--media-gutter);
  padding-left: var(--photo-safe-left);
}

#photography > .section-label,
#photography > .section-title,
#photography .portfolio-block-header,
#design-stage .portfolio-block-header {
  margin-left: 0;
}

.section-label {
  font-size: clamp(36px, 5.5vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.06;
  color: var(--text);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(21px, 2.2vw, 30px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--muted);
  margin-bottom: clamp(48px, 7vw, 80px);
}

/* === PROJECTS === */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.project-card {
  background: var(--bg);
  padding: clamp(28px, 3.5vw, 48px) clamp(24px, 3vw, 44px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 0.2s;
}

.project-card:hover {
  background: var(--surface);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--subtle);
  letter-spacing: 0.04em;
}

.project-category {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.project-name {
  font-size: clamp(21px, 2.2vw, 29px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--fg);
}

.project-desc {
  font-size: clamp(14px, 1.2vw, 16px);
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
  letter-spacing: -0.005em;
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--subtle);
  margin-top: 4px;
}

.project-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--subtle);
  flex-shrink: 0;
}

.project-status.live::before   { background: #30d158; }
.project-status.active::before { background: #0071e3; }
.project-status.running::before { background: #ff9f0a; }

/* === FILM === */
#film {
  padding: clamp(60px, 8vw, 120px) var(--media-gutter) clamp(60px, 8vw, 120px) var(--page-gutter);
  border-top: 1px solid var(--border);
}

.film-statement {
  font-size: clamp(26px, 4.5vw, 60px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.14;
  max-width: 900px;
  color: var(--fg);
}

.film-statement .dim {
  color: var(--muted);
}

/* === ASK AI === */
#ask-ai {
  background: var(--fg);
  color: var(--bg);
  padding: clamp(72px, 10vw, 140px) var(--media-gutter) clamp(72px, 10vw, 140px) var(--page-gutter);
}

#ask-ai .section-label {
  color: rgba(255, 255, 255, 0.45);
}

#ask-ai .section-title {
  color: var(--bg);
}

.ai-intro {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 36px;
  max-width: 580px;
  line-height: 1.65;
  letter-spacing: -0.01em;
}

.ai-profile-block {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 40px;
}

.ai-profile-block pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.62);
  white-space: pre-wrap;
  word-break: break-word;
  padding-right: 80px;
}

.copy-profile-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: var(--font);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.copy-profile-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
}

.copy-profile-btn.copied {
  background: rgba(48, 209, 88, 0.18);
  border-color: rgba(48, 209, 88, 0.38);
  color: #30d158;
}

.prompts-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 14px;
}

.ai-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.prompt-btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 980px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-family: var(--font);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  user-select: none;
}

.prompt-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  color: rgba(255, 255, 255, 0.95);
}

.prompt-btn.copied {
  background: rgba(48, 209, 88, 0.14);
  border-color: rgba(48, 209, 88, 0.34);
  color: #30d158;
}

.ai-note {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: -0.005em;
}

.ai-note a {
  color: rgba(255, 255, 255, 0.42);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.ai-note a:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* === HOME CTA (mirrors the project-page closing CTA, light theme) === */
.home-cta {
  padding: clamp(80px, 12vw, 160px) var(--media-gutter) clamp(80px, 12vw, 160px) var(--page-gutter);
  border-top: 1px solid var(--border);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(28px, 4vw, 44px);
}

.home-cta-title {
  max-width: 760px;
  font-size: clamp(32px, 5.5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--fg);
}

.home-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 16px 32px;
  border-radius: 980px;
  background: var(--fg);
  color: var(--bg);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.home-cta-btn:hover {
  transform: translateY(-2px);
  background: #000000;
}

/* === FOOTER === */
footer {
  background: var(--fg);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: clamp(32px, 5vw, 56px) clamp(20px, 5vw, 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.back-to-top {
  position: fixed;
  right: clamp(18px, 3vw, 36px);
  bottom: clamp(18px, 3vw, 36px);
  z-index: 120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: none;
  background: none;
  color: #ffffff;
  cursor: pointer;
  /* Difference blend flips the arrow against whatever sits behind it, so it
     stays visible on the light sections and on the dark footer alike. */
  mix-blend-mode: difference;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 0.75;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.footer-copy {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.34);
  letter-spacing: -0.01em;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.62);
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.footer-links a:hover {
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.footer-links svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* === ANIMATIONS === */
.fade-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.65s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.projects-grid .project-card:nth-child(odd)  { transition-delay: 0s; }
.projects-grid .project-card:nth-child(even) { transition-delay: 0.08s; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid .project-card:nth-child(even) {
    transition-delay: 0s;
  }
}

@media (max-width: 640px) {
  footer {
    gap: 12px;
    padding: 32px clamp(20px, 5vw, 80px);
  }
  .footer-links {
    gap: 22px;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .hero-foot-count {
    display: none;
  }

  .nav-links {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-logo {
    width: 62px;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links li {
    flex-shrink: 0;
  }

  .nav-links a {
    font-size: 14px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
  }

  .back-to-top svg {
    width: 28px;
    height: 28px;
  }

  .ai-profile-block pre {
    padding-right: 0;
    font-size: 12px;
  }

  .copy-profile-btn {
    position: static;
    margin-top: 16px;
    display: inline-block;
  }
}

/* === PORTFOLIO BLOCKS === */
.portfolio-block {
  margin-bottom: clamp(48px, 7vw, 80px);
}

.portfolio-block-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: clamp(20px, 2.4vw, 30px);
}

/* Subcategory name — now a legible heading, not a micro eyebrow */
.portfolio-block-tag {
  font-size: clamp(23px, 2.7vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--fg);
}

.portfolio-block-title {
  font-size: clamp(15px, 1.35vw, 18px);
  color: var(--muted);
  letter-spacing: -0.01em;
  line-height: 1.45;
  max-width: 62ch;
}

/* === DESIGN SUBMENU === */
/* Tighten the gap under the section subtitle so the submenu sits close to it */
#design .section-title {
  margin-bottom: clamp(24px, 3.5vw, 40px);
}

.design-submenu {
  position: sticky;
  top: clamp(58px, 7vw, 76px);
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 clamp(44px, 6vw, 68px);
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}

.design-submenu-link {
  padding: 8px 17px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: clamp(13px, 1.15vw, 15px);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.design-submenu-link:hover {
  color: var(--fg);
  background: transparent;
}

.design-submenu-link.active {
  color: var(--fg);
  font-weight: 700;
  background: transparent;
}

/* JS extends the submenu's sticky range across the full Design category,
   whose full-width subsections are separate layout panels. The measured
   custom properties preserve the native desktop position and mobile width. */
.design-submenu.is-design-fixed {
  position: fixed;
  top: var(--design-submenu-top, var(--app-header-h, 68px));
  left: var(--design-submenu-left, 0);
  width: var(--design-submenu-width, fit-content);
  max-width: var(--design-submenu-width, 100%);
  margin: 0;
  z-index: 42;
}

.design-submenu-placeholder {
  display: none;
  width: 100%;
}

.design-submenu-placeholder.is-active {
  display: block;
}

/* Clear the fixed nav + sticky submenu when jumping to a block */
#design .portfolio-block,
#design-stage,
.design-continuation .portfolio-block {
  scroll-margin-top: calc(var(--app-header-h, 84px) + var(--design-subnav-h, 96px) + 24px);
}

@media (max-width: 768px) {
  .design-submenu {
    top: calc(var(--mobile-header-h, var(--app-header-h, 104px)) + 6px);
    gap: 2px;
    padding: 4px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .design-submenu::-webkit-scrollbar {
    display: none;
  }
  .design-submenu-link {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 11.5px;
    line-height: 1;
  }
  #design .portfolio-block,
  #design-stage,
  .design-continuation .portfolio-block {
    scroll-margin-top: calc(var(--mobile-header-h, var(--app-header-h, 104px)) + var(--design-subnav-h, 42px) + 18px);
  }
}

/* === IMAGE COMPARISON === */
.image-comparison {
  --comparison-position: 50%;
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.image-comparison img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.image-comparison-base {
  position: absolute;
  inset: 0;
}

.image-comparison-after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 var(--comparison-position));
}

.image-comparison-label {
  position: absolute;
  top: 16px;
  z-index: 3;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.image-comparison-label--before { left: 16px; }
.image-comparison-label--after { right: 16px; }

.image-comparison-range {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: col-resize;
}

.image-comparison-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--comparison-position);
  z-index: 4;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  transform: translateX(-50%);
}

.image-comparison-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.56);
  color: #fff;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(8px);
}

.image-comparison-handle svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.image-comparison:focus-within .image-comparison-handle {
  outline: 3px solid var(--text);
  outline-offset: 4px;
}

@media (max-width: 600px) {
  .image-comparison-label { top: 10px; }
  .image-comparison-label--before { left: 10px; }
  .image-comparison-label--after { right: 10px; }
  .image-comparison-handle { width: 40px; height: 40px; }
}

/* === PHOTO GRID === */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

.photo-grid--wide {
  grid-template-columns: repeat(3, 1fr);
}

.photo-grid--design {
  grid-template-columns: repeat(4, 1fr);
}

.album-projects-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.album-projects-grid > .photo-cell {
  aspect-ratio: 1 / 1;
  background: transparent;
}

.album-projects-grid > img,
.album-projects-grid > .photo-cell > img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  background: transparent;
  object-fit: contain;
  padding: clamp(6px, 0.8vw, 12px);
}

.photo-grid--tall {
  grid-template-columns: repeat(4, 1fr);
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  cursor: pointer;
  display: block;
  transition: opacity 0.25s;
}

.photo-grid--tall img {
  aspect-ratio: 3/4;
}

.photo-grid--design img {
  aspect-ratio: 4/3;
  background: var(--surface);
  object-fit: contain;
  padding: 16px;
}

.photo-grid img:hover {
  opacity: 0.8;
}

/* === LOGO GRID === */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.logo-grid img {
  background: var(--bg);
  padding: 28px 20px;
  width: 100%;
  height: 88px;
  object-fit: contain;
  transition: background 0.2s;
  cursor: default;
}

.logo-grid img:hover {
  background: var(--surface);
}

/* === VIDEO GRID === */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}

.video-wrap {
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
}

.video-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* === LIGHTBOX === */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

#lb-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  user-select: none;
  display: block;
}

.lb-close {
  position: fixed;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 36px;
  cursor: pointer;
  line-height: 1;
  padding: 8px 12px;
  transition: color 0.2s;
  font-family: var(--font);
}

.lb-close:hover {
  color: #fff;
}

.lb-prev,
.lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 52px;
  cursor: pointer;
  padding: 16px 20px;
  line-height: 1;
  transition: color 0.2s;
  user-select: none;
  font-family: var(--font);
}

.lb-prev { left: 0; }
.lb-next { right: 0; }

.lb-prev:hover,
.lb-next:hover {
  color: rgba(255, 255, 255, 0.85);
}

.lb-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  font-family: var(--mono);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* === RESPONSIVE, CREATIVE === */
@media (max-width: 1024px) {
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .photo-grid--tall {
    grid-template-columns: repeat(4, 1fr);
  }
  .logo-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .photo-grid,
  .photo-grid--wide,
  .photo-grid--design {
    grid-template-columns: repeat(2, 1fr);
  }
  .photo-grid--tall {
    grid-template-columns: repeat(3, 1fr);
  }
  .video-grid {
    grid-template-columns: 1fr;
  }
  .logo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .portfolio-block-header {
    flex-direction: column;
    gap: 4px;
  }
  .album-projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .photo-grid,
  .photo-grid--wide,
  .photo-grid--design {
    grid-template-columns: repeat(2, 1fr);
  }
  .photo-grid--tall {
    grid-template-columns: repeat(2, 1fr);
  }
  .logo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .album-projects-grid {
    grid-template-columns: 1fr;
  }
  .lb-prev,
  .lb-next {
    font-size: 36px;
    padding: 10px 14px;
  }
}

/* === PHOTO STRIP (horizontal filmstrip carousel) === */
.photo-strip {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  position: relative;
  /* Fade right edge to hint more content is scrollable */
  mask-image: linear-gradient(to right, black 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 75%, transparent 100%);
}
.photo-strip::-webkit-scrollbar { display: none; }
.photo-strip.is-dragging { cursor: grabbing; }
.photo-strip.is-dragging img { pointer-events: none; }
/* Remove fade once fully scrolled to end */
.photo-strip.at-end {
  mask-image: linear-gradient(to right, transparent 0%, black 5%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%);
}
/* Show both-side fade while scrolled in the middle */
.photo-strip.scrolled:not(.at-end) {
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 75%, transparent 100%);
}

.strip-track {
  display: flex;
  gap: 3px;
  width: max-content;
}
.strip-track img {
  height: clamp(240px, 30vw, 460px);
  width: auto;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  cursor: zoom-in;
  -webkit-user-drag: none;
  transition: opacity 0.25s ease;
}
.photo-strip--uniform .strip-track img {
  width: clamp(240px, 30vw, 460px);
}
.strip-track img:hover { opacity: 0.88; }

/* === DORME FRONT / BACK PACKSHOT PAIRS === */
.packshot-pair {
  --packshot-size: clamp(240px, 30vw, 460px);
  position: relative;
  flex: 0 0 var(--packshot-size);
  width: var(--packshot-size);
  height: var(--packshot-size);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #000;
  color: #fff;
  cursor: pointer;
  touch-action: pan-x;
  -webkit-tap-highlight-color: transparent;
}

.strip-track .packshot-pair img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.strip-track .packshot-pair .packshot-back {
  opacity: 0;
}

.packshot-pair.is-flipped .packshot-front {
  opacity: 0;
}

.packshot-pair.is-flipped .packshot-back {
  opacity: 1;
}

.packshot-side {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  min-width: 38px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.72);
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}

.packshot-side-back {
  display: none;
}

.packshot-pair.is-flipped .packshot-side-front {
  display: none;
}

.packshot-pair.is-flipped .packshot-side-back {
  display: inline;
}

.packshot-pair:focus-visible {
  outline: 1px solid #fff;
  outline-offset: -2px;
}

.photo-strip.is-dragging .packshot-pair {
  cursor: grabbing;
}

@media (hover: hover) and (pointer: fine) {
  .packshot-pair:hover .packshot-front,
  .packshot-pair:focus-visible .packshot-front {
    opacity: 0;
  }

  .packshot-pair:hover .packshot-back,
  .packshot-pair:focus-visible .packshot-back {
    opacity: 1;
  }

  .packshot-pair:hover .packshot-side-front,
  .packshot-pair:focus-visible .packshot-side-front {
    display: none;
  }

  .packshot-pair:hover .packshot-side-back,
  .packshot-pair:focus-visible .packshot-side-back {
    display: inline;
  }
}

@media (max-width: 768px) {
  .packshot-pair {
    --packshot-size: clamp(180px, 48vw, 320px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .strip-track .packshot-pair img {
    transition: none;
  }
}

/* === HOVER-SWAP ITEMS (merch) === */
.swap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-bottom: 3px;
}
.swap-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}
.swap-item {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  display: block;
}
.swap-item > img {
  width: 100%;
  display: block;
  object-fit: cover;
}
.swap-item .swap-front {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface);
  z-index: 1;
  transition: opacity 0.42s ease;
}
.swap-item:hover .swap-front { opacity: 0; }

/* === LOGO HOVER-SWAP (black → color) === */
.logo-swap-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  width: 100%;
}
.logo-swap-item {
  position: relative;
  flex: 0 0 calc((100% - 42px) / 4);
  aspect-ratio: 1 / 1;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.22s ease, background-color 0.22s ease;
}
.logo-swap-item img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(54%, 170px);
  height: auto;
  max-height: 42%;
  object-fit: contain;
  padding: 0;
  display: block;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 0.22s ease, transform 0.3s ease;
}
.logo-swap-item--wide img {
  width: min(64%, 190px);
  max-height: 44%;
}
.logo-swap-item--crepe img {
  width: min(52%, 160px);
  max-height: 40%;
}
.logo-swap-item--compact img {
  width: min(46%, 145px);
  max-height: 38%;
}
.logo-swap-item .swap-front {
  background: transparent;
  z-index: 1;
}
.logo-swap-label {
  position: absolute;
  left: clamp(14px, 1.5vw, 20px);
  bottom: clamp(12px, 1.4vw, 18px);
  z-index: 2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  transition: color 0.25s ease;
}
.logo-swap-item:hover .swap-front,
.logo-swap-item:focus-visible .swap-front {
  opacity: 0;
}
.logo-swap-item:hover,
.logo-swap-item:focus-visible {
  border-color: var(--fg);
  background: var(--surface);
}
.logo-swap-item:hover img,
.logo-swap-item:focus-visible img {
  transform: translate(-50%, -50%) scale(1.035);
}
.logo-swap-item:hover .logo-swap-label,
.logo-swap-item:focus-visible .logo-swap-label {
  color: var(--fg);
}

@media (max-width: 768px) {
  .swap-grid { grid-template-columns: repeat(2, 1fr); }
  .logo-swap-grid {
    gap: 12px;
  }
  .logo-swap-item {
    flex-basis: calc((100% - 12px) / 2);
  }
  .logo-swap-item img {
    width: min(58%, 150px);
    max-height: 40%;
  }
  .logo-swap-item--wide img {
    width: min(67%, 166px);
  }
  .logo-swap-item--crepe img {
    width: min(56%, 145px);
  }
  .logo-swap-item--compact img {
    width: min(48%, 126px);
    max-height: 36%;
  }
  .strip-track img { height: clamp(180px, 48vw, 320px); }
}
@media (max-width: 480px) {
  .swap-grid--2 { grid-template-columns: 1fr; }
  .logo-swap-grid { gap: 10px; }
  .logo-swap-item { flex-basis: calc((100% - 10px) / 2); }
  .logo-swap-label {
    left: 12px;
    bottom: 12px;
    font-size: 8px;
  }
}

/* === SCROLL PROGRESS BAR === */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--fg);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 999;
  pointer-events: none;
  will-change: transform;
}

/* === HERO ENTRANCE === */
.hero-meta,
.hero-name,
.hero-tagline {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-meta    { transition-delay: 0.05s; }
.hero-name    { transition-delay: 0.15s; }
.hero-tagline { transition-delay: 0.3s;  }

.hero-foot {
  opacity: 0;
  transition: opacity 0.65s ease;
  transition-delay: 0.5s;
}

body.page-loaded .hero-meta,
body.page-loaded .hero-name,
body.page-loaded .hero-tagline {
  opacity: 1;
  transform: translateY(0);
}
body.page-loaded .hero-foot {
  opacity: 1;
}

/* === NAV ACTIVE STATE === */
.nav-links a.active {
  opacity: 1;
}

/* === PROJECT CARD, CURSOR + NAME ARROW === */
.project-card {
  cursor: pointer;
}
.project-name::after {
  content: ' →';
  display: inline;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-weight: 400;
  font-size: 0.8em;
  color: var(--muted);
}
.project-card:hover .project-name::after {
  opacity: 1;
}

/* === PHOTO CELL (zoom-on-hover container) === */
.photo-cell {
  overflow: hidden;
  display: block;
  line-height: 0;
}
.photo-cell img {
  transition: transform 0.55s cubic-bezier(0.25, 0.1, 0.25, 1),
              opacity 0.25s ease;
  will-change: transform;
}
.photo-cell img:hover {
  transform: scale(1.05);
  opacity: 1 !important;
}

/* === LIGHTBOX IMAGE CROSSFADE === */
#lb-img {
  transition: opacity 0.18s ease;
}
#lb-img.lb-fading {
  opacity: 0;
}

/* === LIGHTBOX NAV ARROWS, LARGER HIT AREA === */
.lb-prev,
.lb-next {
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === SECTION, LABEL ANIMATES BEFORE TITLE === */
.section-label.fade-up  { transition-delay: 0s;     }
.section-title.fade-up  { transition-delay: 0.12s;  }

/* === PORTFOLIO BLOCK STAGGER === */
.portfolio-block.fade-up:nth-child(2) { transition-delay: 0s;     }
.portfolio-block.fade-up:nth-child(3) { transition-delay: 0.07s;  }
.portfolio-block.fade-up:nth-child(4) { transition-delay: 0.14s;  }
.portfolio-block.fade-up:nth-child(5) { transition-delay: 0.21s;  }

/* === VIDEO WRAP, SMOOTH IFRAME LOAD === */
.video-wrap {
  position: relative;
}
.video-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--fg);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.video-wrap.loading::before {
  opacity: 0.06;
}

/* === REDUCE MOTION, RESPECT SYSTEM PREFERENCE === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-meta,
  .hero-name,
  .hero-tagline,
  .hero-foot {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .fade-up {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* === UTILITY === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
