/* === FONT SETUP === */
@font-face {
  font-family: 'Neue Haas Unica';
  src: url('fonts/Neue-Haas-Unica-W04-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Neue Haas Unica';
  src: url('fonts/Neue-Haas-Unica-W06-Heavy.woff') format('woff');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Pierpont';
  src: url('fonts/Pierpont-Regular.woff2') format('woff');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Pierpont';
  src: url('fonts/Pierpont-Italic.woff2') format('woff');
  font-weight: 400;
  font-style: italic;
}

/* === BASE === */
:root {
  /* DARK THEME (default) */
  --bg: #0f0f10;
  --text: #ffffff;
  --muted: #cccccc;   /* subtitles, descriptions */
  --muted-2: #c6c6c6; /* longer body text */
  --muted-3: #adadad; /* credits */

  --header-h: clamp(56px, 8vw, 88px);
  --header-gap: 8px;
}

/* LIGHT THEME overrides */
:root[data-theme="light"] {
  --bg: #f0f0ef;
  --text: #0f0f10;
  --muted: #464646;
  --muted-2: #565656;
  --muted-3: #5d5d5d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

/* === HEADER === */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* brand | toggle | nav */
  align-items: center;
  height: var(--header-h);
  padding: 0 20px;
  position: fixed;
  top: 0; left: 0; right: 0;
  background: transparent;
  z-index: 1000;
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 400;
  font-size: clamp(14px, 1.5vw, 20px);
  line-height: clamp(18px, 2vw, 24px);
}

.brand { justify-self: start; }

.main-nav {
  display: flex;
  justify-content: flex-end;
  gap: clamp(20px, 5vw, 64px); /* fluid spacing */
}

.bw-toggle {
  justify-self: center;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 2px solid currentColor;
  padding: 6px 10px;
  border-radius: 8px;
  letter-spacing: 0.01em;
  cursor: pointer;
}
.bw-toggle:hover { opacity: 0.6; }

.nav-link {
  color: var(--text);
  text-decoration: none;
  text-transform: none;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}
.nav-link:hover { opacity: 0.7; }
.nav-link.active { font-style: italic; }

/* === HERO === */
.hero {
  position: relative;
  z-index: 101;
  margin-top: calc(var(--header-h) + var(--header-gap));
  margin-bottom: 15px;
  padding-left: 20px;
}

/* FIX: scales down on narrow screens; can wrap if needed */
.hero-title {
  position: relative; /* Allows the arrow to position relative to the title */
  display: inline-block; /* Keeps the title compact for arrow positioning */
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 10.5vw, 206px);
  line-height: 1;
  margin: 0;
  white-space: normal; /* allow wrap instead of cutting off */
}

/* === GRID / PROJECTS === */
.container {
  margin: 0 auto 60px;
  padding: 0;
  width: 100%;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 5px;
  row-gap: px;
  padding: 20px;
  position: relative;
  z-index: 1; /* below header & hero */
}

.project { display: block; color: inherit; text-decoration: none; }

.project video {
  width: 100%;
  height: auto;
  display: block;
}

.project-title {
  margin: 6px 0 0;
  text-align: center;
  font-family: 'Pierpont', serif;
  font-weight: 400;
  font-size: 21px;
  line-height: 24px;
  text-transform: uppercase;  /* force all caps */
}

.project-desc {
  margin: 0 0 2px; /* was 6px, now 2px */
  text-align: center;
  font-family: 'Pierpont', serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.3;
  font-style: italic;
  color: var(--muted-2);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero {
    margin-top: calc(var(--header-h) + var(--header-gap));
  }

  .hero-title {
    font-size: clamp(24px, 12vw, 120px); /* extra guard on very small screens */
    white-space: normal;
  }

  .grid {
    grid-template-columns: 1fr; /* single thumbnail per row (phones) */
  }
}

/* Tablet range: prefer 2 columns on most iPads / tablets.
   Matches portrait tablets and a sensible landscape range so it works across devices.
   Placed after the mobile (1-column) rule so it overrides when both match. */
@media
  (min-width: 600px) and (max-width: 1100px) and (orientation: portrait),
  (min-width: 820px) and (max-width: 1200px) and (orientation: landscape),
  (min-aspect-ratio: 3/4) and (max-aspect-ratio: 4/3) and (min-width: 600px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 8px;
  }
}

/* keep desktop default (3 columns) for larger viewports */
/* ...existing code... */

/* ===== CONTACT PAGE ===== */
.contact-page {
  position: relative;
  min-height: 100vh;
  /* remove extra top padding so CONTACT matches WORK position */
  padding-top: 0;
  overflow: hidden;
}

/* Fullscreen background video (placed behind everything) */
.bg-video {
  position: fixed;
  inset: 0;               /* top:0; right:0; bottom:0; left:0; */
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -1;            /* behind page content */
  pointer-events: none;   /* don't catch clicks */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;

  /* Dim the video so white text is easier to read */
  filter: brightness(0.80) saturate(0.95);
  transition: filter 240ms ease;
}

/* Ensure page regions sit on top of the background video */
main,
.site-footer,
.contact-page,
.about-clients,
.hero {
  position: relative;
  z-index: 1;
}



/* Fullscreen background video (behind everything) */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;               /* was -1; 0 is safer across browsers */
  pointer-events: none;

  /* while loading or if video fails, show the poster image */
  background: url("images/bg-poster.jpg") center / cover no-repeat;

  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  filter: brightness(0.80) saturate(0.95);
  transition: filter 240ms ease;
}

/* Hide video for users who prefer reduced motion and use poster fallback */
@media (prefers-reduced-motion: reduce) {
  .bg-video { display: none; }
  body { background-image: url("images/bg-poster.jpg"); background-size: cover; background-position: center; }
}

/* Overlay content */
.contact-overlay {
  position: relative;
  z-index: 1;
  max-width: none;           /* allow full width */
  margin: 0 0 48px 0;        /* remove auto centering */
  padding-left: 20px;        /* match header left padding */
  padding-right: 20px;       /* keep some right padding */
  display: block;
}

/* Title (not used if using .hero/.hero-title) */
.contact-title {
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 700;
  text-transform: lowercase;
  margin: 0 0 24px 0;
  line-height: 1;
  font-size: clamp(28px, 6vw, 56px);
}

/* Section labels */
.contact-label {
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 700;
  text-transform: none;
  margin: 24px 0 8px;
  font-size: clamp(18px, 3vw, 24px);
  line-height: 1.1;
}

/* Subheads */
.contact-sub {
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 400;
  margin: 12px 0 6px;
  font-size: clamp(16px, 2.6vw, 20px);
  line-height: 1.2;
}

/* Body text */
.contact-overlay p {
  margin: 0 0 18px 0;
  font-size: 1em;
  color: var(--muted-2);
}

/* Links */
.contact-overlay a {
  color: var(--text);
  text-decoration: none; /* was underline */
  word-break: break-all;
}
.contact-overlay a:hover {
  opacity: 0.8;
}

/* Two columns on desktop, one on mobile */
.contact-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px; /* add horizontal gap between columns */
  width: 100%;
  max-width: none;  /* remove centering width cap */
  margin: 0;        /* kill auto-centering */
  position: relative;
}
@media (max-width: 820px) {
  .contact-cols { grid-template-columns: 1fr; }
}

/* Spacing blocks */
.contact-block { margin-top: 22px; }

/* CONTACT hero placed exactly like WORK on index */
.contact-page .hero {
  margin-top: calc(var(--header-h) + var(--header-gap));
  margin-bottom: 15px;
  padding-left: 20px; /* flush with GEORG BUNGARD */
}

/* Left-align content under CONTACT */
.contact-left {
  max-width: none;
  margin: 0;
  padding-left: 0 !important;           /* no extra left padding */
  padding-right: 24px;
}

/* Two columns under CONTACT */
.contact-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px;
  width: 100%;
  max-width: 1100px;         /* optional: limit max width if desired */
  margin: 0;                 /* remove auto centering */
  position: relative;
}

.col-left {
  grid-column: 1 / 2;
  padding-right: 0;
  margin-left: 0;
}

.col-right {
  grid-column: 2 / 3;
  margin-left: 0;
}

/* Responsive: stack columns on mobile */
@media (max-width: 900px) {
  .contact-two-col {
    grid-template-columns: 1fr;
    gap: 32px 0;
    max-width: none;
  }
  .col-right {
    margin-left: 0;
    padding-top: 32px;
  }
}

/* CONTACT form styles */
.contact-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 24px;
}
.contact-form label {
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 400;
  color: var(--text);
  font-size: 0.9em;
}
.contact-form input,
.contact-form textarea {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: 'Pierpont', serif;
  font-size: 1em;
  line-height: 1.4;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
}

/* ===== PROJECT PAGE ===== */
.project-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(var(--header-h) + var(--header-gap, 8px)) 24px 80px;
  color: var(--text);
}

.project-hero { margin-bottom: 30px; }

.project-title {
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 700;
  line-height: 2;
  margin: 8px 0 2px;
  font-size: clamp(28px, 6vw, 72px);
  text-transform: uppercase;
}

.project-page-title {
  margin: 8px 15px 10px;
  font-family: 'Pierpont', serif;
  font-size: clamp(16px, 2.6vw, 20px);
  line-height: 1.2;
  color: var(--muted-2);
}

.project-sub {
  margin: 8px 15px 10px;
  font-family: 'Pierpont', serif;
  font-size: clamp(16px, 2.6vw, 20px);
  line-height: 1.2;
  color: var(--muted-2);
}

.project-blurb {
  margin: 8px 15px 10px;
  font-family: 'Pierpont', serif;
  font-size: clamp(16px, 2.2vw, 18px);
  line-height: 1.45;
  color: var(--muted-2);
  max-width: 70ch;
}

.project-credits {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0; /* remove side margins so it aligns with title/desc */
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 4px 24px;
  font-family: 'Pierpont', serif;
  font-size: clamp(15px, 2.1vw, 17px);
  color: var(--muted-2);
}


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

/* Project video embeds */
/* Video fills the same column as the text */
.video-embed {
  position: relative;
  width: 100%;
  margin: 24px 0;      /* align with the column's left edge */
  background: #000;
  overflow: hidden;
}

.project-videos .video-embed {
  width: 100%;          /* or 100% if you want full column */
  height: auto;
  max-width: 1100px;   /* cap it if needed */
  margin: 24px auto;

  height: auto;
}

.project-videos .video-embed iframe,
.project-videos .video-embed iframe[src*="youtube.com"],
.project-videos .video-embed iframe[src*="youtu.be"] {
  display: block;
  max-width: 100%;
  height: auto;        /* scale height automatically */
  border: 0;

  width: 100%;
  height: auto;

  height: auto;
}


/* Back link */
.project-back {
  margin-top: 24px;
  font-family: 'Neue Haas Unica', sans-serif;
}
.project-back a {
  color: var(--muted-2);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.35);
}
.project-back a:hover {
  opacity: 0.8;
  border-bottom-color: rgba(255,255,255,0.6);
}

/* === FIX: project links should not inherit nav font sizes === */
.project {
  display: block;
  color: inherit;
  text-decoration: none;
}
.project h3,
.project p {
  font-size: 21px;
  line-height: 24px;
  font-family: 'Pierpont', serif;
  font-weight: 400;
}
.project p {
  font-style: italic;
  color: var(--muted);
}

@media (max-width: 768px) {
  .project-page .project-title,
  .project-page .project-sub,
  .project-page .project-blurb,
  .project-page .project-credits,
  .project-page .project-back {
    width: 100%;
    max-width: none;
  }
}

/* Contact page â€œdisabledâ€ b/w toggle */
.bw-toggle.disabled {
  opacity: 0.4;          /* greyed out */
  cursor: not-allowed;
  pointer-events: none;  /* prevent clicks */
}
.bw-toggle.disabled .bw-label {
  text-decoration: line-through; /* strike only text, not the box */
}

/* Keep layout width stable when scrollbar appears */
html { scrollbar-gutter: stable both-edges; }

/* ===== ABOUT PAGE LAYOUT ===== */
.about-page {
  position: relative;
  min-height: 100vh;
  padding-top: 0;         /* no extra top padding */
  overflow: hidden;
}

/* About page section labels: match PROJECT ONE style */
.about-label {
  font-family: 'Pierpont', serif;
  font-weight: 400;
  font-size: 21px;
  line-height: 24px;
  text-transform: uppercase;
  margin: 24px 0 12px;
  text-align: left;
}


/* Reuse the exact hero spacing/padding as other pages */
.about-page .hero {
  margin-top: calc(var(--header-h) + var(--header-gap));
  margin-bottom: 15px;
  padding-left: 20px;     /* flush with brand */
}

/* Big all-caps clients block that fills the screen visually */
.about-clients {
  padding-left: 20px;
  padding-right: 24px;
  width: 100%;
  min-height: auto;
  display: flex;
  align-items: flex-start; /* text starts immediately under ABOUT */
}

.clients-big {
  width: 100%;
  text-transform: uppercase;
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 400;
  /* large, fluid type across the screen */
  font-size: clamp(22px, 4.6vw, 40px);
  line-height: 1.00;
  letter-spacing: 0.01em;
  /* let the paragraph flow full width */
  max-width: none;
}

.clients-big2 {
  width: 100%;
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 400;
  /* large, fluid type across the screen */
  font-size: clamp(22px, 4.6vw, 40px);
  line-height: 1.00;
  letter-spacing: 0.01em;
  /* let the paragraph flow full width */
  max-width: none;
}
/* Bottom three columns */
.about-meta {
  padding: 70px 24px 40px 20px; /* match left with header */
}
.about-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 40px;
  width: 100%;
}
.about-col p {
  margin: 0 0 8px;
  font-family: 'Pierpont', serif;
  font-size: clamp(15px, 2.1vw, 18px);
  line-height: 1.4;
  color: var(--text);
}
.about-col .contact-label {
  margin-top: 0; /* first label snug to the grid */
}

/* Responsive stacking for small screens */
@media (max-width: 980px) {
  .clients-big { font-size: clamp(20px, 5.8vw, 56px); }
  .about-meta-grid { grid-template-columns: 1fr; }
}


/* === MOBILE COMPACT STYLES === */
@media (max-width: 480px) {
  .bw-toggle {
    font-size: 12px;       /* smaller text */
    padding: 4px 8px;      /* tighter padding */
    border-radius: 6px;    /* slightly smaller radius */
  }

  .bw-label {
    font-size: inherit;    /* match parent */
    letter-spacing: 0;     /* no extra spacing */
  }

  .main-nav {
    gap: clamp(12px, 3vw, 18px); /* closer spacing between work/about/contact */
  }
}

/* Wrapper keeps a fixed footprint so layout never shifts */
.slashes-wrap {
  position: relative;
  display: inline-block;
  width: 1.6em;            /* tweak if needed */
  height: 1em;             /* aligns with text line height */
  vertical-align: baseline; /* align with surrounding text */
  overflow: visible;        /* let the flip extend if needed */
}

/* Both symbols are stacked on top of each other */
.slashes {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: opacity 1s ease-in-out; /* 1s crossfade */
  will-change: opacity, transform;
}

/* Wrapper keeps a fixed footprint so layout never shifts */
.slashes-wrap {
  position: relative;
  display: inline-block;
  width: 1.3em;            /* tweak if needed */
  height: 1em;             /* aligns with text line height */
  vertical-align: baseline; /* align with surrounding text */
  overflow: visible;        /* let the flip extend if needed */
}

/* Both symbols are stacked on top of each other */
.slashes {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: opacity 1s ease-in-out; /* 1s crossfade */
  will-change: opacity, transform;
}



/* A = normal //, visible initially */
.slashes-a {
  opacity: 1;
  transform: none;
}

/* B = flipped //, start hidden; baseline nudge to match font rendering */
.slashes-b {
  opacity: 0;
  transform: scaleY(-1) translateY(-0.1em); /* adjust -0.1em to perfect baseline */
  transform-origin: 50% 50%;
}

/* When wrapper has .is-flipped, crossfade the two */
.slashes-wrap.is-flipped .slashes-a { opacity: 0; }
.slashes-wrap.is-flipped .slashes-b { opacity: 1; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .slashes { transition: none; }
}

/* === FOOTER === */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 18px 8px 18px;
  font-size: 0.95em;
  z-index: 99;
  pointer-events: none; /* Prevents overlap issues */
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 400;
  font-size: 10px;
  line-height: 24px;
}

.footer-left {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  pointer-events: auto;
}

.footer-link {
  color: var(--text); /* fully white */
  font-size: 10px;
  font-weight: bold;
  text-decoration: none;
  letter-spacing: 0.02em;
  line-height: 24px;
}

.footer-link:hover {
  color: var(--text);
  opacity: 0.8;
}

.footer-right {
  pointer-events: auto;
}

.footer-note {
  color: var(--muted-3); /* keep muted */
  font-size: 10px;
  font-weight: normal;
  letter-spacing: 0.01em;
  line-height: 24px;
}

/* Keep footer items on one line and prevent wrapping */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  flex-wrap: nowrap;    /* prevent whole items from wrapping to next line */
}

/* Left group (links) should be inline and not force a line break */
.footer-left {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 1;       /* allow it to shrink before wrapping */
}

.footer-link {
  display: inline-block; /* avoid default block behaviour that can stack */
  margin: 0;
}

/* Right group (note) should not wrap either */
.footer-right {
  flex-shrink: 0;        /* keep it intact; left side will shrink first */
}

/* Small screens: reduce gaps / padding to avoid overflow */
@media (max-width: 420px) {
  .site-footer { gap: 8px; padding: 14px 12px; font-size: 14px; }
  .footer-left { gap: 8px; }
}

.contact-overlay {
  /* make contact overlay use the same left gutter as the header/hero */
  padding-left: 20px;    /* <- match your header/hero gutter (adjust if header uses a different value) */
  padding-right: 20px;
  margin-left: 0;
  max-width: none;       /* allow full-width flow but keep gutter */
}

/* ensure left column children don't introduce extra offset */
.col-left,
.col-left > * {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* === Lazy thumb reveal === */
.project {
  opacity: 1;
  transform: none;
}
.project.is-visible {
  opacity: 1;
  transform: none;
}

/* Optionally save paint for offscreen content (Chromium/Firefox) */
@supports (content-visibility: auto) {
  .project { content-visibility: auto; contain-intrinsic-size: 360px 640px; }
}

/* Keep videos tidy and stable */
.project video.thumb-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9; /* or match your real aspect */
}

/* Respect reduced motion (script toggles .reduce-motion on <html>) */
.reduce-motion .project {
  transition: none !important;
  transform: none !important;
  opacity: 1 !important;
}

/* (Optional) Sticky header robustness on iOS if needed */
.site-header { background: transparent; z-index: 1000; } /* keep it on top, still transparent */
.hero { z-index: 10; } /* ok to keep this */

/* Thumbnail video safety net */
.thumb-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: url("images/poster01.jpg") center / cover no-repeat; /* fallback if poster is hidden */
}

/* === Project Page Headings === */
.project-page-title {
  font-family: "Pierpont", serif;   /* same font family as your site */
  font-size: 1.2rem;                /* bigger than thumbnail titles */
  line-height: 1.3;
  margin: 0 0 0.25em 0;
  font-weight: 400;                 /* regular weight */
}

.project-page-desc {
  font-family: "Pierpont", serif;
  font-size: 1.2rem;                /* slightly larger than grid desc */
  font-style: italic;
  margin: 0 0 1em 0;
  color: inherit;                   /* follow theme */
}

/* === Consistent width & alignment for project content === */
.project-content {
  max-width: 960px;      /* same width as your video embed container */
  margin: 0 auto;        /* center horizontally */
  padding: 0 1rem;       /* small side padding for narrow screens */
  box-sizing: border-box;
}

/* Ensure video embed follows same width rules */
.project-videos .video-embed iframe,
.project-videos .video-embed iframe[src*="youtube.com"],
.project-videos .video-embed iframe[src*="youtu.be"] {
  width: 100%;
  height: auto;
    /* keeps video proportionate */

  width: 100%;
  height: auto;

  height: auto;
}

/* === Project meta two-column header (above video) === */
.project-meta {
  display: grid;
  grid-template-columns: 1fr 1fr; /* left = title/desc, right = credits */
  gap: 8px 48px;
  align-items: start;
  margin: 0 0 px 0;  /* space before video */
}

/* Make sure left column text hugs the same left edge as the video */
.project-meta .project-page-title,
.project-meta .project-page-desc {
  margin: 0;              /* remove inherited side margins */
  text-align: left;
}

/* Credits align to the same column edge */
.project-credits.meta-right {
  margin: 0;              /* kill previous 10px top & 15px sides */
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr; /* single column list on desktop for clean rag */
  gap: 8px;
}

/* Optional: slightly larger sizing for the page header */
.project-page-title {
  font-family: "Pierpont", serif;
  font-weight: 400;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.25;
}
.project-page-desc {
  font-family: "Pierpont", serif;
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.3;
  color: var(--muted-2);
}

/* Stack on mobile */
@media (max-width: 820px) {
  .project-meta {
    grid-template-columns: 1fr;
    gap: 8px 0;
  }
  .meta-right { margin-top: 6px; }
}

/* === Project meta two-column layout === */
.project-meta {
  display: grid;
  grid-template-columns: 1fr 1fr; /* left = title/desc, right = credits */
  gap: 16px 48px;
  align-items: start;
  margin-bottom: 32px; /* space before video */
  max-width: 960px;    /* match video width */
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.project-meta p {
  font-family: "Neue Haas Unica", serif;
  font-size: clamp(18px, 2vw, 20px);
  line-height: 1.4;
  margin: 0 0 0.5em 0;
  color: var(--text);
}

.project-title {
  font-weight: 700; /* bold title */
  margin-bottom: 0.5em;
}

.project-desc {
  font-style: italic;
  margin-top: 0.5em;
}

/* Stack columns on smaller screens */
@media (max-width: 768px) {
  .project-meta {
    grid-template-columns: 1fr;
    gap: 16px 0;
  }
}

/* === FINAL: project meta 2-col header aligned with video === */
.project-meta {
  /* same centered column as the video */
  max-width: 960px;
  margin: 0 auto 24px;
  padding: 0 1rem;
  box-sizing: border-box;

  /* two equal columns: right column starts at container center */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 48px;
  align-items: start;
  justify-items: start; /* left-align both columns' contents */
}

/* left column text flush-left; right column also left-aligned */
.meta-left, .meta-right { text-align: left; }

/* type matching your index thumbnails, with a spacer line */
.meta-title {
  font-family: "Pierpont", serif;
  font-weight: 700;
  font-size: 21px;
  line-height: 1.3;
  margin: 0 0 0.75em 0; /* empty line under the title */
  text-transform: none;
}
.meta-desc {
  font-family: "Pierpont", serif;
  font-style: italic;
  font-size: 21px;
  line-height: 1.3;
  margin: 0; /* description sits after the spacer above */
}

/* credits block */
.meta-right p {
  margin: 0 0 0.5em 0;
  font-family: "Pierpont", serif;
  font-size: 21px;
  line-height: 1.4;
}

/* stack on small screens */
@media (max-width: 820px) {
  .project-meta { grid-template-columns: 1fr; gap: 12px 0; }
}

/* === Smaller project page meta text === */
.project-meta .meta-title {
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.3;
}

.project-meta .meta-desc {
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.3;
}

.project-meta .meta-right p {
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.4;
}

/* === Index thumbnail captions: tighter + smaller === */
.grid .project-title {
  font-size: 18px;
  line-height: 1.3;
  margin: 4px 0 2px; /* smaller gap above & below */
}

.grid .project-desc {
  font-size: 18px;
  line-height: 1.3;
  margin: 0 0 8px;   /* was 6px, now 2px */
}

/* === Tighter spacing between credits on project page === */
.project-credits,
.meta-right p {
  gap: 2px 24px; /* smaller vertical gap, keep horizontal */
}

.meta-right p {
  margin-bottom: 2px; /* reduce spacing between lines */
}

/* === Project page credits use Neue Haas instead of Pierpont === */
.project-meta .meta-right p,
.project-credits,
.project-credits li {
  font-family: "Neue Haas Unica", sans-serif;
  font-weight: 400;
}


/* === Auto aspect for project iframes === */
.project-videos .video-embed.ratio-box { position: relative; }
.project-videos .video-embed.ratio-box iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Aspect-ratio box so layout is stable even before video attaches */
.thumb-clip {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;           /* or set with a custom var per card */
  overflow: hidden;
  background: #191919;            /* the neutral grey you saw */
}

/* The video starts transparent; we fade it in when ready */
.thumb-video {
  position: absolute; 
  inset: 0;
  width: 100%; 
  height: 100%;
  object-fit: cover;
  opacity: 1; /* Show immediately, no fade */
  z-index: 2;
}

/* When the first frame is decoded (loadeddata/canplay), reveal */
.thumb-video.is-ready { opacity: 1; }


/* === THUMBNAIL VIDEO STYLES === */
.thumb-clip {
  position: relative;
  aspect-ratio: 16/9;
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px var(--bg); /* Inner shadow creates frame */
  overflow: hidden;
}

.thumb-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  z-index: 2;
}

/* Remove the background poster after video loads */
.thumb-clip.video-loaded {
  background-image: none !important;
  background-color: var(--bg) !important;
  box-shadow: none !important;
}

/* Background video fade-in system */
.bg-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
}

.bg-shell .bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease-out; /* Set to 0.8s fade */
  pointer-events: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.bg-shell.ready .bg-video {
  opacity: 1;
}

/* Ensure page content sits above background */
main,
.about-page,
contact-page,
.hero {
  position: relative;
  z-index: 1;
}

/* === CONTACT PAGE ALIGNMENT === */
@media (max-width: 768px) {
  .contact-page .contact-overlay {
    padding-left: 20px; /* Match hero padding */
    padding-right: 20px;
  }
  
  .contact-page .about-clients {
    padding-left: 0; /* Remove any inherited padding */
    padding-right: 0;
  }
  
  .contact-page .clients-big {
    padding-left: 0; /* Remove any inherited padding */
    margin-left: 0;
  }
  
  .contact-page .about-meta-grid {
    padding-left: 0;
    margin-left: 0;
  }
}

/* Also ensure hero alignment is consistent */
@media (max-width: 768px) {
  .hero {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* === TYPEWRITER ANIMATION === */
.typewriter-container {
  position: absolute;
  right: 20px; /* Align with right edge, matching header padding */
  bottom: 8px; /* Align with the baseline of the hero title */
  max-width: 400px; /* Increased from 300px to accommodate longer phrases */
  z-index: 102;
}

.typewriter-text {
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 400;
  font-size: clamp(12px, 1.5vw, 18px); /* Responsive like nav: smaller on mobile */
  line-height: 1.3;
  color: var(--text);
  opacity: 0.7;
  text-align: right;
  white-space: normal; /* Allow text to wrap instead of nowrap */
  overflow: visible; /* Allow text to be visible instead of hidden */
  min-height: 1.3em; /* Prevent layout shift */
  word-wrap: break-word; /* Break long words if needed */
}

/* Blinking cursor */
.typewriter-text::after {
  content: '|';
  animation: blink 1s infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Hide on mobile to avoid clutter */
@media (max-width: 768px) {
  .typewriter-container {
    display: none;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .typewriter-container {
    display: none;
  }
}