/* ==========================================================================
   Geoff Nori - Master Stylesheet
   Vanilla CSS replica of the geoffnori.com Squarespace site.
   Type sizes follow Squarespace's fluid formula: 1rem + (size - 1) * 1.2vw,
   so everything matches the live site at 1440px and scales with the viewport.
   ========================================================================== */

:root {
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --color-black: #000000;
  --color-white: #ffffff;
  --color-light: #f4f4f3;
  --color-accent: #24d2ff;

  /* Fluid type scale (values measured from the live site at 1440px) */
  --fs-h1: calc(1rem + 4.667vw);        /* 83.2px  */
  --fs-h2: calc(1rem + 2.45vw);         /* 51.28px */
  --fs-h3: calc(1rem + 1.778vw);        /* 41.6px  */
  --fs-h4: calc(1rem + 1.167vw);        /* 32.8px  */
  --fs-body: calc(1rem + 0.2333vw);     /* 19.36px */
  --fs-large: calc(1rem + 0.4667vw);    /* 22.72px */
  --fs-marquee: calc(1rem + 3.5vw);     /* 66.4px  */
  --fs-marquee-xl: calc(1rem + 8.167vw);/* 133.6px */
  /* XL marquee SVG box height (main.js: top 0.95em + bottom 0.35em) */
  --marquee-xl-box: calc(var(--fs-marquee-xl) * 1.3);
  /* How far the media below rises into the XL marquee box. Shared by the
     Design + Music Production sections so the text is cut equally. */
  --marquee-xl-overlap: 5.1vw;
  --fs-pagination: calc(1rem + 1.867vw);/* 42.88px */

  --gutter: 4vw;
  --header-height: 88px;

  /* Squarespace "soft corners" section divider: 5vw wide x 6vw tall */
  --corner: 5vw 6vw;
  --corner-h: 6vw;
}

@media (max-width: 767px) {
  :root {
    --gutter: 6vw;
    --header-height: 84px;

    /* Squarespace uses separate mobile type sizes (measured at 390px) */
    --fs-h1: 9.7vw;
    --fs-h2: 8.4vw;
    --fs-h3: 7vw;
    --fs-h4: 5.6vw;
    --fs-body: 1.05rem;
    --fs-large: 1.15rem;
    --fs-marquee: 10.5vw;
    --fs-marquee-xl: 16vw;
  }
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
  background-color: var(--color-light);
  color: var(--color-black);
  overflow-x: hidden;
}

img, video, iframe {
  display: block;
  max-width: 100%;
}

img, video {
  height: auto;
}

a {
  color: inherit;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.05em;
}

h1 { font-size: var(--fs-h1); line-height: 1.008; }
h2 { font-size: var(--fs-h2); line-height: 1.1; }
h3 { font-size: var(--fs-h3); line-height: 1.15; }
h4 { font-size: var(--fs-h4); line-height: 1.152; }

/* Space Grotesk has no italic, so the browser slants it — same as the live site */
em { font-style: italic; }

strong { font-weight: 700; }

p a { text-decoration: underline; }

.container {
  width: 100%;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Section shapes (soft corners) */
.corners-top {
  border-top-left-radius: var(--corner);
  border-top-right-radius: var(--corner);
}

.corners-bottom {
  border-bottom-left-radius: var(--corner);
  border-bottom-right-radius: var(--corner);
}

/* A panel that overlaps the section above so its rounded corners reveal it */
.pull-up {
  position: relative;
  z-index: 2;
  margin-top: calc(-1 * var(--corner-h));
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  color: var(--color-black);
}

.header--light {
  color: var(--color-white);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--gutter);
}

.site-logo {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.2;
  text-decoration: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2vw;
}

.nav-link {
  font-size: var(--fs-body);
  line-height: 1.5;
  padding: 0.1em 0;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background-size: 100% 1px;
}

/* Mobile menu */
.mobile-toggle {
  display: none;
  position: relative;
  z-index: 102;
  width: 36px;
  height: 36px;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
}

.mobile-toggle span {
  position: absolute;
  left: 0;
  width: 36px;
  height: 1px;
  background: currentColor;
  transition: transform 0.25s ease, top 0.25s ease;
}

.mobile-toggle span:nth-child(1) { top: 12px; }
.mobile-toggle span:nth-child(2) { top: 23px; }

.menu-open .mobile-toggle span:nth-child(1) { top: 18px; transform: rotate(45deg); }
.menu-open .mobile-toggle span:nth-child(2) { top: 18px; transform: rotate(-45deg); }

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 101;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4vw;
  background: var(--color-light);
  color: var(--color-black);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay a {
  font-size: 8.5vw;
  line-height: 1.6;
  text-decoration: none;
}

.menu-open .mobile-nav-overlay {
  opacity: 1;
  visibility: visible;
}

/* Keep the toggle visible (dark) while the light overlay is open */
.menu-open .site-header {
  position: fixed;
  z-index: 102;
  color: var(--color-black);
}

@media (max-width: 767px) {
  .nav-menu { display: none; }
  .mobile-toggle { display: block; }
  .site-logo { font-size: 1.1rem; }
}

/* ==========================================================================
   Buttons (solid, square)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 323px;
  height: 68px;
  padding: 0 48px;
  background: var(--color-black);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 0.1s linear;
}

.btn:hover {
  opacity: 0.8;
}

@media (max-width: 767px) {
  .btn {
    width: 100%;
    min-width: 0;
    height: 58px;
  }
}

/* ==========================================================================
   Wave marquee (SVG text on a path, animated by main.js)
   ========================================================================== */
.marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
}

.marquee svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.marquee text {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.05em;
  fill: currentColor;
  white-space: pre;
}

.marquee--fade {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
}

/* Fallback before JS runs / without JS */
.marquee-fallback {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.05em;
  white-space: nowrap;
  text-align: center;
}

.marquee.is-ready .marquee-fallback { display: none; }

/* ==========================================================================
   Homepage
   ========================================================================== */

/* Hero */
.hero-section {
  padding-top: calc(var(--header-height) + 20px);
  padding-bottom: 2vw;
  text-align: center;
}

.hero-avatar {
  width: clamp(100px, 8.5vw, 145px);
  height: auto;
  margin: 0 auto 24px;
}

.hero-greeting,
.hero-subtitle {
  max-width: 657px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(2.35rem, 1.35rem + 3.4vw, 4.65rem);
  line-height: 1.06;
  letter-spacing: -0.05em;
  max-width: 1300px;
  margin: 20px auto 28px;
  text-wrap: balance;
}

.hero-title-br {
  display: block;
}

.hero-marquee {
  margin-top: 1.5vw;
}

.hero-marquee .marquee text { font-size: var(--fs-marquee); }

@media (max-width: 767px) {
  .hero-section {
    padding-top: calc(var(--header-height) + 16px);
  }
  .hero-avatar {
    width: 96px;
    margin: 0 auto 18px;
  }
  .hero-title {
    font-size: clamp(1.85rem, 7.5vw, 2.35rem);
    margin: 16px auto 22px;
  }
  .hero-title-br {
    display: inline;
  }
}

/* What I Do (cyan panel) */
.section-explanation {
  background: var(--color-accent);
  padding: max(16vw, 72px) 0 max(8.5vw, 72px);
}

.explanation-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  column-gap: 0;
}

.explanation-grid h2 {
  grid-column: 1 / 9;
  align-self: start;
  margin-top: -6px;
}

.explanation-copy {
  grid-column: 13 / 25;
}

.explanation-copy p + p {
  margin-top: 0.8em;
}

@media (max-width: 767px) {
  .explanation-grid { display: block; }
  .explanation-grid h2 { margin: 0 0 2.2em; }
}

/* Design Production */
.section-design-production {
  padding: 4vw 0 11vw;
  overflow: hidden;
}

.section-design-production .marquee text,
.section-music-production .marquee text {
  font-size: var(--fs-marquee-xl);
}

.design-prod-layout {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  position: relative;
}

.design-prod-text {
  grid-column: 1 / 13;
  margin-top: 2.8vw;
}

.design-prod-text p {
  margin: 1.1em 0 1.6em;
}

.design-prod-text p + p {
  margin-top: -0.6em;
}

/* Nori for Elementor callout */
.design-prod-callout {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 2em;
  padding: 22px 24px 22px 28px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  color: var(--color-black);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.design-prod-callout::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.design-prod-callout:hover,
.design-prod-callout:focus-visible {
  border-color: var(--color-black);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.45);
}

.design-prod-callout:hover::before,
.design-prod-callout:focus-visible::before {
  width: 8px;
}

.design-prod-callout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.design-prod-callout-logos {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.design-prod-callout-logos .callout-logo-svg {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.design-prod-callout:hover .design-prod-callout-logos .callout-logo-svg {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.design-prod-callout-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
}

.design-prod-callout-title {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.design-prod-callout-copy {
  font-size: 0.95em;
  line-height: 1.5;
}

.design-prod-callout-link {
  margin-top: 4px;
  font-family: var(--font-heading);
  font-weight: 500;
}

.design-prod-callout-link span {
  display: inline-block;
  transition: transform 0.3s ease;
}

.design-prod-callout:hover .design-prod-callout-link span {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .design-prod-callout,
  .design-prod-callout::before,
  .design-prod-callout-link span { transition: none; }
  .design-prod-callout:hover,
  .design-prod-callout:focus-visible { transform: none; }
}

.design-prod-media {
  grid-column: 15 / 25;
  position: relative;
  z-index: 1;
  /* Overlaps the "Design Production" marquee like the live site */
  margin-top: calc(-1 * var(--marquee-xl-overlap));
}

.design-prod-media img {
  width: 100%;
  aspect-ratio: 546 / 818;
  object-fit: cover;
}

@media (max-width: 767px) {
  .section-design-production { padding: 18vw 0; }
  .design-prod-layout { display: block; }
  .design-prod-text { margin-top: 4vw; }
  .design-prod-media { margin-top: 12vw; }
  .design-prod-media img { aspect-ratio: auto; }
}

/* Music Production */
.section-music-production {
  position: relative;
  z-index: 2;
  overflow: hidden;
  color: var(--color-white);
  text-align: center;
  padding: 14vw 0 6vw;
  background: var(--color-black);
}

.music-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-content {
  position: relative;
}

.section-music-production .marquee {
  position: absolute;
  left: 0;
  right: 0;
  /* Bottom of the marquee box sits --marquee-xl-overlap below the video
     embed's top edge, matching the Design Production overlap */
  top: calc(var(--marquee-xl-overlap) - var(--marquee-xl-box));
}

.blend-difference {
  mix-blend-mode: difference;
}

.music-embed {
  position: relative;
  width: 546px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  background: var(--color-black);
}

.music-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.music-content h2 {
  max-width: 657px;
  margin: 53px auto 31px;
  color: var(--color-black);
}

@media (max-width: 767px) {
  .section-music-production { padding: 30vw 0 12vw; }
  .section-music-production .marquee { top: 4vw; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--color-black);
  color: var(--color-accent);
  padding: 82px 0 136px;
}

/* Tuck the footer behind a rounded panel so the corners show black */
.site-footer.under-panel {
  margin-top: calc(-1 * var(--corner-h));
  padding-top: calc(82px + var(--corner-h));
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

.footer-inner h2 {
  font-size: var(--fs-h2);
}

.footer-email {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

@media (max-width: 767px) {
  .site-footer { padding: 64px 0 80px; }
  .site-footer.under-panel { padding-top: calc(64px + var(--corner-h)); }
  .footer-inner { flex-direction: column; }
  .footer-inner h2 { font-size: 2rem; }
}

/* ==========================================================================
   Portfolio index (/design-and-development) — Full Bleed Interactive Grid
   ========================================================================== */
.portfolio-top {
  background: var(--color-white);
  height: calc(var(--header-height) + var(--corner-h) + 24px);
}

.portfolio-panel {
  position: relative;
  z-index: 2;
  background: var(--color-light);
  overflow: hidden;
}

/* Portfolio filter */
.portfolio-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: clamp(32px, 4vw, 56px) var(--gutter) 32px;
}

.filter-btn {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-black);
  background: transparent;
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-btn span {
  opacity: 0.5;
  margin-left: 4px;
}

.filter-btn:hover {
  border-color: var(--color-black);
}

.filter-btn.is-active {
  background: var(--color-black);
  border-color: var(--color-black);
  color: var(--color-white);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.project-square[hidden] {
  display: none;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(0, 0, 0, 0.08);
  width: 100%;
}

.project-square {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: block;
  text-decoration: none;
  background: var(--color-light);
  transition: background-color 0.35s ease;
}

.project-square-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.project-square-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-square-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.15) 35%, rgba(0, 0, 0, 0.88) 100%);
  opacity: 0;
  transition: opacity 0.45s ease;
}

.project-square:hover .project-square-img {
  opacity: 1;
  transform: scale(1.06);
}

.project-square:hover .project-square-overlay {
  opacity: 1;
}

.project-square-info {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(26px, 3.2vw, 48px);
  pointer-events: none;
}

.project-square-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-square-role {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: clamp(0.72rem, 0.75vw, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-black);
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 5px 13px;
  border-radius: 999px;
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

.project-square:hover .project-square-role {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.project-square-num {
  font-family: var(--font-heading);
  font-size: clamp(0.85rem, 0.9vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.05em;
  color: rgba(0, 0, 0, 0.35);
  transition: color 0.35s ease;
}

.project-square:hover .project-square-num {
  color: rgba(255, 255, 255, 0.65);
}

.project-square-bottom {
  display: flex;
  flex-direction: column;
}

.project-square-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 1.85vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--color-black);
  margin-bottom: 8px;
  transition: color 0.35s ease;
}

.project-square:hover .project-square-title {
  color: var(--color-white);
}

.project-square-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: clamp(0.85rem, 0.95vw, 1rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
}

.project-square:hover .project-square-action {
  opacity: 1;
  transform: translateY(0);
  color: var(--color-white);
}

.project-square-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}

.project-square:hover .project-square-arrow {
  transform: translateX(4px);
}

@media (max-width: 1199px) and (min-width: 641px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (hover: none) {
  .project-square-img {
    opacity: 1;
    transform: none;
  }
  .project-square-overlay {
    opacity: 1;
  }
  .project-square-role {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .project-square-num {
    color: rgba(255, 255, 255, 0.75);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  }
  .project-square-title {
    color: var(--color-white);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  }
  .project-square-action {
    opacity: 1;
    transform: translateY(0);
    color: var(--color-white);
  }
}

@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-square {
    aspect-ratio: 4 / 3;
  }
  .project-square-img {
    opacity: 1;
    transform: none;
  }
  .project-square-overlay {
    opacity: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 36%, rgba(0, 0, 0, 0.9) 100%);
  }
  .project-square-role {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .project-square-num {
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  }
  .project-square-title {
    color: var(--color-white);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    font-size: clamp(1.35rem, 5.5vw, 1.85rem);
    margin-bottom: 6px;
  }
  .project-square-action {
    opacity: 1;
    transform: translateY(0);
    color: var(--color-white);
  }
  .project-square-arrow {
    stroke: var(--color-accent);
  }
  .project-square-info {
    padding: 22px;
  }
}

/* ==========================================================================
   Project case study
   ========================================================================== */
.project-hero {
  position: relative;
  color: var(--color-black);
  padding: calc(var(--header-height) + 54px) 0 calc(8vw + var(--corner-h));
  background: var(--color-black);
  overflow: hidden;
}

.project-hero--dark {
  color: var(--color-white);
}

.project-hero-bg {
  position: absolute;
  top: -30px;
  left: -30px;
  right: -30px;
  bottom: -30px;
  width: calc(100% + 60px);
  height: calc(100% + 60px);
  object-fit: cover;
  filter: blur(28px);
  -webkit-filter: blur(28px);
  transform: scale(1.08);
  pointer-events: none;
}

.project-hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--color-white);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
}

/* Per-project overlay strength (set in build.py hero_overlay) */
.overlay-55 { opacity: 0.55; }
.overlay-60 { opacity: 0.6; }
.overlay-68 { opacity: 0.68; }
.overlay-85 { opacity: 0.85; }

.underline { text-decoration: underline; }

.project-hero--dark .project-hero-overlay {
  background: var(--color-black);
}

.project-hero--dark .project-title,
.project-hero--dark .meta-value,
.project-hero--dark .project-details,
.project-hero:not(.project-hero--dark) .project-title,
.project-hero:not(.project-hero--dark) .meta-value,
.project-hero:not(.project-hero--dark) .project-details {
  text-shadow: none;
}

.project-hero-content {
  position: relative;
}

.project-title {
  max-width: 50%;
  margin-bottom: 90px;
}

.project-meta-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
}

.meta-col-left {
  grid-column: 1 / 11;
}

.meta-col-right {
  grid-column: 12 / 25;
}

.meta-item + .meta-item {
  margin-top: 94px;
}

/* At-a-glance facts: compact two-column grid */
.meta-glance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px 32px;
  align-content: start;
}

.meta-glance .meta-item + .meta-item { margin-top: 0; }
.meta-item--wide { grid-column: 1 / -1; }

.meta-label {
  margin-bottom: 11px;
}

.meta-value {
  font-size: var(--fs-large);
  font-weight: 700;
}

.project-details > * + * {
  margin-top: 0.95em;
}

/* External project links */
.meta-link {
  display: inline-block;
  font-size: var(--fs-large);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  margin-right: 1.4em;
}

.meta-link:hover {
  opacity: 0.75;
}

.project-links-cta {
  margin-top: 6vw;
  padding: 5vw 0 1vw;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  text-align: center;
}

.project-links-cta p {
  max-width: 640px;
  margin: 0.6em auto 0;
  font-size: var(--fs-large);
}

.project-links-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.btn--outline {
  background: transparent;
  color: var(--color-black);
  box-shadow: inset 0 0 0 1.5px var(--color-black);
}

@media (max-width: 767px) {
  .project-links-cta { margin-top: 14vw; padding-top: 12vw; }
}

@media (max-width: 767px) {
  .project-title { max-width: none; margin-bottom: 48px; }
  .project-meta-grid { display: block; }
  .meta-item + .meta-item { margin-top: 40px; }
  .meta-glance { gap: 32px 20px; }
  .meta-col-right { margin-top: 56px; }
}

/* Body panel */
.project-body {
  background: var(--color-light);
  padding: 10vw 0 0;
}

.project-video {
  margin-bottom: 11vw;
}

.project-video video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-black);
}

.video-caption {
  max-width: 768px;
  margin: 44px auto 0;
  text-align: center;
}

.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: max(2.8vw, 16px);
}

.gallery-item img {
  width: 100%;
  cursor: zoom-in;
}

/* Video items sit on the same gray 16:9 panel as the image slides */
.gallery-video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #dddddb;
}

.gallery-video video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 91%;
  height: auto;
  max-height: 91%;
  border-radius: 14px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
  background: #000;
}

.gallery-video--portrait video {
  width: auto;
  height: 91%;
  max-width: 91%;
}

/* Anchors: short captions that break the gallery into chapters.
   Same 24-column split as the hero's label / details columns. */
.gallery-anchor {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  align-items: start;
  padding: 6vw 0 1.2vw;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  margin-top: 3vw;
}

.gallery-anchor:first-child {
  padding-top: 2.5vw;
  margin-top: 0;
}

.gallery-anchor-label {
  grid-column: 1 / 11;
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: var(--fs-large);
}

.gallery-anchor-num {
  font-family: var(--font-heading);
  font-size: var(--fs-large);
  opacity: 0.45;
}

.gallery-anchor-body {
  grid-column: 12 / 25;
  max-width: 760px;
}

.gallery-anchor-body h4 {
  font-size: var(--fs-h3);
  line-height: 1.15;
  margin-bottom: 0.4em;
}

.gallery-anchor-body p {
  font-size: var(--fs-large);
}

@media (max-width: 767px) {
  .gallery-anchor {
    display: block;
    padding: 14vw 0 3vw;
    margin-top: 6vw;
  }
  .gallery-anchor:first-child { padding-top: 6vw; }
  .gallery-anchor-label { margin-bottom: 16px; }
}

/* ==========================================================================
   Project Pagination (image cards)
   ========================================================================== */
.project-pagination {
  padding: clamp(90px, 11vw, 180px) 0 max(8vw, 80px);
}

.project-pagination-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  margin-bottom: clamp(24px, 2.5vw, 40px);
}

.pagination-all {
  font-family: var(--font-heading);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  white-space: nowrap;
}

.pagination-all:hover { opacity: 0.7; }

.pagination-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2vw, 32px);
}

.pagination-card {
  display: block;
  color: var(--color-black);
  text-decoration: none;
}

.pagination-card-media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.06);
}

.pagination-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.pagination-card:hover .pagination-card-media img,
.pagination-card:focus-visible .pagination-card-media img {
  transform: scale(1.04);
}

.pagination-card-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 18px;
}

.pagination-next .pagination-card-text { align-items: flex-end; text-align: right; }

.pagination-label,
.pagination-meta {
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: 0.02em;
  opacity: 0.6;
}

.pagination-title {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.pagination-card:hover .pagination-title {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

@media (max-width: 767px) {
  .pagination-cards { grid-template-columns: 1fr; gap: 40px; }
  .pagination-next .pagination-card-text { align-items: flex-start; text-align: left; }
}

/* ==========================================================================
   Case study sticky bar (shown once the hero scrolls away)
   ========================================================================== */
.case-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: rgba(244, 244, 243, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
}

.case-bar.is-visible {
  transform: none;
  visibility: visible;
}

.case-bar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 var(--gutter);
  font-family: var(--font-heading);
}

.case-bar-back {
  justify-self: start;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.case-bar-title {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-bar-step {
  justify-self: end;
  display: flex;
  gap: 4px;
}

.case-bar-step a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.case-bar-step a:hover,
.case-bar-back:hover { background: rgba(0, 0, 0, 0.06); }
.case-bar-back { padding: 6px 10px; margin-left: -10px; border-radius: 999px; }

.case-bar-step .pagination-icon {
  width: 9px;
  height: 18px;
}

.case-bar-step .pagination-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
}

.case-bar-progress {
  height: 2px;
  background: transparent;
}

.case-bar-progress span {
  display: block;
  height: 100%;
  background: var(--color-black);
  transform: scaleX(0);
  transform-origin: left;
}

@media (max-width: 767px) {
  .case-bar-inner { grid-template-columns: auto 1fr auto; height: 52px; }
  .case-bar-back { font-size: 0; }
  .case-bar-back span { font-size: 18px; }
  .case-bar-title { font-size: 15px; text-align: center; }
}

.menu-open .case-bar { visibility: hidden; }

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(244, 244, 243, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-top-bar {
  position: absolute;
  top: 1.5rem;
  left: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 210;
  pointer-events: none;
}

.lightbox-counter {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-black);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  pointer-events: auto;
}

.lightbox-close {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-black);
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  pointer-events: auto;
  transition: transform 0.2s ease, background 0.2s ease;
}

.lightbox-close:hover {
  background: var(--color-white);
  transform: scale(1.08);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 210;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--color-black);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}

.lightbox-nav:hover {
  background: var(--color-white);
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(92vw, 1500px);
  max-height: 84vh;
}

.lightbox-img {
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.12);
  transition: opacity 0.14s ease, transform 0.14s ease;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox-img.is-changing {
  opacity: 0.15;
  transform: scale(0.985);
}

@media (max-width: 767px) {
  .lightbox-modal {
    padding: 1rem;
  }
  .lightbox-top-bar {
    top: 1rem;
    left: 1rem;
    right: 1rem;
  }
  .lightbox-nav {
    width: 42px;
    height: 42px;
  }
  .lightbox-prev { left: 0.75rem; }
  .lightbox-next { right: 0.75rem; }
  .lightbox-stage {
    max-height: 78vh;
  }
  .lightbox-img {
    max-height: 78vh;
  }
}

/* 404 */
.not-found {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--header-height) + 48px) 0 96px;
}

.not-found h1 { margin-bottom: 24px; }
.not-found p { margin-bottom: 40px; }

/* ==========================================================================
   Lenis Smooth Scroll
   ========================================================================== */
html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

/* ==========================================================================
   Exit Fade Up Parallax
   ========================================================================== */
.exit-fade-up {
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .exit-fade-up {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Homepage: recent work strip */
.recent-work {
  margin-top: 9vw;
}

.recent-work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.recent-work-all {
  font-family: var(--font-heading);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.recent-work-all:hover {
  opacity: 0.7;
}

@media (max-width: 767px) {
  .recent-work { margin-top: 16vw; }
  .recent-work-head { flex-direction: column; }
}

/* Footer social link */
.footer-links {
  margin-top: 28px;
}

.footer-social {
  font-family: var(--font-heading);
  font-size: var(--fs-large);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* Lightbox caption */
.lightbox-caption {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  width: min(92vw, 900px);
  text-align: center;
  font-size: 15px;
  line-height: 1.4;
}

.lightbox-caption:empty { display: none; }

.lightbox-caption-label {
  font-family: var(--font-heading);
  font-weight: 700;
  margin-right: 0.5em;
}

@media (max-width: 767px) {
  .lightbox-caption { bottom: 1rem; font-size: 14px; }
}

/* ==========================================================================
   About page
   ========================================================================== */
.about-hero {
  background: var(--color-white);
  padding: calc(var(--header-height) + 5vw) 0 calc(var(--corner-h) + 7vw);
}

.about-hero-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  align-items: start;
}

.about-avatar {
  grid-column: 1 / 6;
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
}

.about-intro {
  grid-column: 7 / 23;
}

.about-intro h1 {
  margin-bottom: 0.35em;
}

.about-lead {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1em;
}

.about-intro > p:not(.about-lead) {
  font-size: var(--fs-large);
  max-width: 760px;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 40px;
}

.about-body .gallery-anchor-body h4 {
  font-size: var(--fs-h4);
}

.about-company {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1em;
}

.about-company span {
  font-size: var(--fs-large);
  opacity: 0.55;
  margin-left: 0.4em;
  letter-spacing: 0;
}

.about-role + .about-role {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.about-role-dates {
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: 0.02em;
  opacity: 0.6;
  margin-bottom: 6px;
}

.about-role ul {
  margin-top: 14px;
  padding-left: 1.1em;
}

.about-role li,
.about-work-item p,
.about-tool p:not(.meta-label) {
  font-size: var(--fs-large);
}

.about-role li + li { margin-top: 8px; }

.about-work-item + .about-work-item { margin-top: 32px; }

.about-work-item a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.about-work-item a:hover { opacity: 0.65; }

.about-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 40px;
}

.about-tool .meta-label { margin-bottom: 8px; }

.about-body { padding-bottom: 8vw; }

@media (max-width: 767px) {
  .about-hero { padding: calc(var(--header-height) + 6vw) 0 calc(var(--corner-h) + 14vw); }
  .about-hero-grid { display: block; }
  .about-avatar { width: 40vw; max-width: 160px; margin-bottom: 32px; }
  .about-actions { margin-top: 32px; }
  .about-tools { grid-template-columns: 1fr; gap: 24px; }
  .about-body { padding-bottom: 16vw; }
}

/* Leave room under the lightbox image for its caption */
.lightbox-stage,
.lightbox-img { max-height: 78vh; }

@media (max-width: 767px) {
  .lightbox-stage,
  .lightbox-img { max-height: 70vh; }
}
