:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6b6b6b;
  --tile-a: #ececec;
  --tile-b: #dcdcdc;
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --nav-h: 60px;
  --footer-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  /* Stops mobile Safari from silently boosting text size for
     readability — several places on this site (like the splash name)
     compute an exact pixel font-size in JS and rely on it rendering
     as-is, not auto-inflated on top. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ---------- Nav ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--bg);
  z-index: 100;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 24px;
}

.site-header nav a {
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.site-header nav a.active {
  font-weight: 700;
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  border-bottom: none !important;
  transition: opacity 0.2s ease;
}

.logo-mark:hover {
  opacity: 0.6;
}

.logo-mark svg,
.logo-mark img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-top: 1px solid #ececec;
  z-index: 90;
}

.nav-toggle {
  display: none;
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--fg);
}

/* ---------- Portfolio grid ---------- */

main.grid {
  column-count: 4;
  column-gap: 3px;
  padding: calc(var(--nav-h) + 3px) 3px calc(var(--footer-h) + 24px);
}

.grid-item {
  display: block;
  position: relative;
  break-inside: avoid;
  margin-bottom: 3px;
  overflow: hidden;
}

.placeholder-img {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--tile-a), var(--tile-b));
  transition: transform 0.4s ease;
}

.grid-item:hover .placeholder-img {
  transform: scale(1.03);
}

.grid-item .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
  background: linear-gradient(to top, rgba(253, 253, 245, 0.92), rgba(253, 253, 245, 0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.grid-item:hover .caption {
  opacity: 1;
  transform: translateY(0);
}

.caption .format {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

/* aspect ratios for masonry variety */
.grid-item.r-tall .placeholder-img { aspect-ratio: 4 / 5; }
.grid-item.r-square .placeholder-img { aspect-ratio: 1 / 1; }
.grid-item.r-wide .placeholder-img { aspect-ratio: 4 / 3; }
.grid-item.r-story .placeholder-img { aspect-ratio: 9 / 16; }

/* ---------- Creative Direction / Stylist collage ---------- */

.cd-intro {
  padding: calc(var(--nav-h) + 40px) 24px 20px;
  max-width: 640px;
}

.cd-intro h1 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 16px;
}

.cd-intro p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}

.collage {
  display: flex;
  align-items: flex-start;
  padding: var(--nav-h) 0 calc(var(--footer-h) + 24px);
}

/* Columns are built in JS (see main.js) rather than with CSS
   column-count: both Chromium and WebKit have a real bug where a
   multi-column layout's later columns can be left completely
   unpainted once content (like these photos) finishes loading after
   the first layout pass. Plain flex columns don't have that failure
   mode. */
.collage-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
}

.collage-item {
  display: block;
  width: 100%;
  position: relative;
  break-inside: avoid;
  margin: 0;
  background: var(--bg);
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

/* Tiles start "covered" — moving the mouse over one uncovers it for
   good. Until every tile in the collage has been uncovered at least
   once, hovering doesn't zoom (that's the normal, "done" behaviour). */
.collage-item .placeholder-img {
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
  transform-origin: center;
  position: relative;
  z-index: 1;
  display: block;
}

.collage-item.revealed .placeholder-img {
  opacity: 1;
}

.collage.all-revealed .collage-item:hover .placeholder-img {
  transform: scale(1.12);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.28);
  z-index: 5;
}

/* Randomly assigned each visit (see main.js) so the collage's shape
   is never the same layout twice — needs object-fit since these crop
   a real photo rather than just sizing an empty placeholder box. */
.collage-item.r-tall .placeholder-img { aspect-ratio: 4 / 5; width: 100%; height: 100%; object-fit: cover; }
.collage-item.r-square .placeholder-img { aspect-ratio: 1 / 1; width: 100%; height: 100%; object-fit: cover; }
.collage-item.r-wide .placeholder-img { aspect-ratio: 4 / 3; width: 100%; height: 100%; object-fit: cover; }
.collage-item.r-wide-lg .placeholder-img { aspect-ratio: 16 / 9; width: 100%; height: 100%; object-fit: cover; }
.collage-item.r-story .placeholder-img { aspect-ratio: 9 / 16; width: 100%; height: 100%; object-fit: cover; }

/* Videos placed directly in the collage, mixed in with the photos —
   shown at their own real aspect ratio (set in JS from videoWidth/
   videoHeight, the same way photos use their natural size), muted and
   looping on their own the whole time, no click/hover needed. */
.collage-item.is-video-tile .placeholder-img {
  display: block;
  width: 100%;
}

/* Tiles that reveal a video on hover instead of just zooming the photo. */
.collage-item.has-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 6;
}

.collage-item.has-video:hover video {
  opacity: 1;
  transform: scale(1.12);
}

/* Lightbox with project info — opens on click, not on hover,
   since several tiles repeat the same project. */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

#lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 10, 0.55);
}

#lightbox-content {
  position: relative;
  z-index: 1;
  width: min(60vw, 440px);
  transform: scale(0.94);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#lightbox.open #lightbox-content {
  transform: scale(1);
}

#lightbox-media {
  display: block;
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: linear-gradient(135deg, var(--tile-a), var(--tile-b));
}

#lightbox-caption {
  background: var(--bg);
  padding: 12px 16px;
}

#lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 2;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
}

.lightbox-close-label {
  display: none;
}

#lightbox-brand {
  display: block;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#lightbox-project {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 3px;
}

#lightbox-services {
  display: block;
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------- Social Management: Instagram profile mockups ---------- */

.ig-profiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: calc(var(--nav-h) + 40px) 40px calc(var(--footer-h) + 24px);
  gap: 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.ig-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.ig-profile.revealed {
  opacity: 1;
  transform: translateY(0);
}

.ig-avatar-link {
  display: block;
  border-bottom: none !important;
}

.ig-avatar {
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--tile-a), var(--tile-b));
  margin-bottom: 14px;
}

.ig-handle-link {
  color: inherit;
  border-bottom: none !important;
}

.ig-handle {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.ig-bio {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 24px;
  text-align: center;
}

.ig-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 100%;
}

.ig-post {
  display: block;
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, var(--tile-a), var(--tile-b));
  transition: opacity 0.2s ease;
  overflow: hidden;
  border: none;
  padding: 0;
  cursor: pointer;
}

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

.ig-post:hover {
  opacity: 0.85;
}

@media (max-width: 860px) {
  .ig-profiles {
    grid-template-columns: 1fr;
    max-width: 420px;
    gap: 56px;
  }
}

/* ---------- Splash / landing screen ---------- */

/* Landing/cover screen for the home page — the video loops continuously
   and replaces the site nav entirely while it's up. A click anywhere
   dismisses it and reveals the real home page underneath. */
#splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  /* Matches the clip's own off-white background exactly (sampled from
     its corners) so its edges disappear into the page instead of
     reading as a separate card floating on top. */
  background: rgb(251, 252, 251);
  overflow: hidden;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#splash.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.splash-lock {
  overflow: hidden;
}

.splash-click {
  position: absolute;
  top: 43%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  margin: 0;
  font-size: clamp(11px, 1.1vw, 15px);
  font-weight: 400;
  text-transform: lowercase;
  color: #fff;
  pointer-events: none;
}

.splash-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 26px 32px;
  font-size: clamp(14px, 1.5vw, 19px);
  font-weight: 400;
  text-transform: lowercase;
  color: var(--fg);
}

/* Centered clip sitting above the name band, comfortably clear of it
   (not overlapping) — behind the top row, in front of nothing else. */
.splash-video {
  position: absolute;
  top: 43%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.splash-video video {
  display: block;
  max-width: min(36vw, 550px);
  max-height: 65vh;
  width: auto;
  height: auto;
}

.splash-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  margin: 0;
  font-size: 15.5vw;
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--fg);
  text-align: center;
  white-space: nowrap;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  transform: scaleY(1.12);
  transform-origin: bottom center;
}

/* ---------- Social-First feed ---------- */

main {
  padding-top: calc(var(--nav-h) + 20px);
  padding-bottom: calc(var(--footer-h) + 24px);
}

.client-row {
  margin: 0 0 64px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* Deliberately opacity-only (no transform): a transform here would give
   the row its own stacking context, trapping a hovered video-thumb's
   z-index inside it instead of letting it stack above the next row. */
.client-row.revealed {
  opacity: 1;
}

.client-row h2 {
  font-size: clamp(34px, 6vw, 68px);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  text-align: left;
  margin: 0 0 16px;
  padding: 0 20px;
}

/* A smaller note next to a client name — e.g. which campaign a
   one-off project was for, when it wasn't an ongoing client. Same
   typeface as the heading, just much smaller and muted. */
.client-row h2 .client-row-note {
  display: inline-block;
  font-size: clamp(11px, 1.4vw, 16px);
  font-weight: 500;
  letter-spacing: 0.01em;
  vertical-align: middle;
  color: var(--muted);
  margin-left: 14px;
}

/* Breaks the strip out of any centered/padded ancestor so it spans the
   full viewport edge-to-edge, independent of that ancestor's own width. */
.video-strip-wrap {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
}

/* Space between a project's vertical clips and its horizontal ones,
   now that there's no "Social-First Film" label doing that job. */
.video-strip-wrap + .video-strip-wrap {
  margin-top: 32px;
}

.video-strip {
  display: flex;
  gap: var(--strip-gap);
  --strip-gap: 6px;
  --visible: 6;
  --start: 0;
  /* Shifting by one clip means moving by its own width plus the gap
     after it — not a flat 100%/--visible — otherwise the gaps eat into
     the container's width and the last clip in view runs off the right
     edge, getting clipped by this wrapper's overflow:hidden. */
  transform: translateX(calc(-1 * var(--start) *
    ((100% - (var(--visible) - 1) * var(--strip-gap)) / var(--visible) + var(--strip-gap))));
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Exactly --visible clips fill the screen width at a time (gaps
   included in the math above); the rest sit off-strip until an arrow
   rotates the window over to reveal them. */
.video-thumb {
  position: relative;
  flex: 0 0 calc((100% - (var(--visible, 6) - 1) * var(--strip-gap)) / var(--visible, 6));
  aspect-ratio: 9 / 16;
  overflow: hidden;
  cursor: pointer;
  background: var(--tile-a);
}

/* Horizontal-format clips (e.g. website "new arrivals" content) use a
   landscape frame instead of the default vertical/story one. */
.video-strip.horizontal .video-thumb {
  aspect-ratio: 16 / 9;
}

.video-thumb .thumb-poster {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--tile-a), var(--tile-b));
}

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

/* Floating "more content" controls, superimposed over the strip's own
   edges — just an arrow glyph, no button chrome. The right one rotates
   the strip 3 clips at a time (or whatever's left) toward the right and
   hides itself once nothing more is left to reveal; the left one
   appears as soon as the strip has been rotated at all, and rotates
   back toward the start the same way. */
.strip-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  padding: 0;
  color: #fff;
  font-family: Didot, 'Bodoni MT', 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 27px;
  line-height: 1;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  filter: drop-shadow(0 1px 5px rgba(0, 0, 0, 0.7));
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.strip-arrow:hover {
  transform: translateY(-50%) scale(1.15);
}

.strip-arrow.next {
  right: 8px;
}

.strip-arrow.prev {
  left: 8px;
}

.strip-arrow.hidden {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 900px) {
  .video-strip {
    --visible: 4;
  }
}

@media (max-width: 560px) {
  .video-strip {
    --visible: 2;
  }
}

/* ---------- Contact page ---------- */

.contact-wrap {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  padding: calc(var(--nav-h) + 16px) 48px calc(var(--footer-h) + 40px);
}

.contact-text {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: none;
}

.contact-text .contact-bio {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0;
}

.contact-text .contact-email {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.contact-text .contact-email-label {
  font-size: 10px;
  line-height: 1.3;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.contact-text a.email {
  align-self: flex-start;
  font-size: 14px;
  line-height: 1.3;
  color: var(--fg);
  border-bottom: 1px solid var(--fg);
}

.contact-social {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 16px;
}

.contact-social a {
  color: var(--fg);
  font-weight: 700;
  font-size: 14px;
}

/* ---------- Project detail page ---------- */

.project-header {
  padding: calc(var(--nav-h) + 40px) 24px 0;
}

.project-header .index {
  font-size: 11px;
  color: var(--muted);
}

.project-header h1 {
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 8px 0 12px;
}

.project-header p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 40px;
}

main.grid.project {
  padding-top: 8px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  main.grid { column-count: 3; }
}

@media (max-width: 720px) {
  main.grid { column-count: 2; }

  /* Keeps its original (larger) size on mobile — the desktop-only
     reduction above doesn't apply here. */
  .splash-click {
    font-size: clamp(13px, 1.4vw, 18px);
  }

  /* Mobile-only: everything shows at once, no scratch-off reveal game
     and no hover-zoom (there's no mouse to hover with) — the fade-in
     and scale transitions that game relies on are turned off outright
     rather than just changed, so nothing animates in "poco a poco". */
  .collage-item .placeholder-img {
    transition: none;
  }
  .collage.all-revealed .collage-item:hover .placeholder-img {
    transform: none;
    box-shadow: none;
  }

  /* Lightbox close button: smaller "✕", same corner position. */
  #lightbox-close {
    font-size: 14px;
    top: 16px;
    right: 16px;
  }

  /* Mobile-only: name stacks as two lines (first name, last name).
     Desktop keeps the single "MARIA SOBAS" line, completely untouched,
     at its own font-size/transform from the base rule above.
     Sizing here is pure CSS (vw + a fixed horizontal stretch), not
     JS-measured — a JS-computed pixel-exact fit kept failing silently
     on real phones in a way this can't, since nothing has to run or
     finish loading for it to apply. It won't be pixel-perfect on every
     screen width, but it lands close on any of them, reliably. */
  .splash-name {
    white-space: normal;
    transform: none;
  }
  .splash-name .name-word {
    display: block;
    font-size: 27vw;
    transform: scaleX(1.08);
    transform-origin: bottom center;
  }

  .splash-video video {
    max-width: 82vw;
    max-height: 56vh;
  }

  /* Big, but stacked as a centered list instead of the desktop's
     three-across row — three words that size, side by side, wouldn't
     fit a phone screen without wrapping awkwardly mid-word. */
  .splash-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 22px 24px;
    font-size: clamp(20px, 6.5vw, 30px);
  }

  /* No photo on mobile — text-only, so the container just grows with
     its content instead of being pinned to a fixed 100vh with a photo
     behind it. */
  .contact-wrap {
    padding-left: 24px;
    padding-right: 24px;
  }

  .site-header nav {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 20px;
    display: none;
  }
  .site-header nav.open { display: flex; }
  .site-header nav a,
  .site-header nav a:hover {
    padding: 12px 0;
    border-bottom-color: transparent;
  }
  .site-header nav a.active {
    font-weight: 700;
    border-bottom-color: transparent;
  }
  .nav-toggle {
    display: block;
    left: 20px;
    right: auto;
    font-size: 15px;
    letter-spacing: 0.02em;
    transform: translateY(-50%);
    font-weight: 700;
  }

  /* Mobile-only: Social-First strips show 3 clips at a glance (smaller,
     but all reachable) and rely on a real finger swipe instead of the
     "<"/"3" arrows, which only make sense as a click target. */
  .video-strip {
    --visible: 3;
  }
  .strip-arrow {
    display: none;
  }
}

@media (max-width: 480px) {
  main.grid { column-count: 1; }
}
