/* Colour tokens are RGB triples so Tailwind opacity modifiers (bg-ink/90) keep working. */
:root {
  --nav-h: 4.5rem;
  --c-ink: 255 255 255;
  --c-panel: 246 244 240;
  --c-lift: 236 232 226;
  --c-paper: 17 17 17;
  --c-mist: 85 81 76;
  --c-mute: 122 117 110;
  --c-champagne: 140 107 63;
  --c-danger: 164 52 44;
}
/* Light text on photos and video: hero, interlude, video modals, header over the hero. */
.theme-dark {
  --c-ink: 9 9 9;
  --c-panel: 21 21 21;
  --c-lift: 29 29 29;
  --c-paper: 243 240 234;
  --c-mist: 167 163 157;
  --c-mute: 119 115 110;
  --c-champagne: 195 174 139;
  --c-danger: 231 199 194;
  color: rgb(var(--c-paper));
}
html { scroll-padding-top: var(--nav-h); scroll-behavior: smooth; }
body {
  background: rgb(var(--c-ink));
  color: rgb(var(--c-paper));
  font-family: Manrope, "Helvetica Neue", Arial, sans-serif;
  overflow-x: clip;
}
body.scroll-lock { overflow: hidden; }
::selection { background: rgb(var(--c-champagne)); color: #fff; }
:focus-visible {
  outline: 2px solid rgb(var(--c-champagne));
  outline-offset: 3px;
}
.label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgb(var(--c-champagne));
}
.display {
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 0.9;
}
#site-header { transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease; }
.nav-blur {
  background: rgb(var(--c-ink) / 0.86);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgb(var(--c-paper) / 0.08);
}
.hero {
  min-height: 100svh;
  min-height: 100dvh;
}
.hero-frame { overflow: hidden; }
.hero-media {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}
.hero-fit-cover .hero-media {
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.06);
}
.hero-fit-contain {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--nav-h);
}
.hero-fit-contain .hero-media {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  mask-composite: intersect;
}
.hero-fill-solid .hero-media {
  -webkit-mask-image: none;
  mask-image: none;
}
.hero-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(32px) saturate(1.1);
  transform: scale(1.2);
}
.site-brand-text {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
  color: rgb(var(--c-paper));
  text-decoration: none;
}
.site-logo { display: block; height: 2.75rem; width: auto; max-width: 13rem; object-fit: contain; }.hero-logo { display: block; width: min(34rem, 82vw); height: auto; max-height: 14rem; object-fit: contain; object-position: left center; }
.vignette {
  background:
    linear-gradient(180deg, rgba(9,9,9,0.2) 0%, rgba(9,9,9,0.15) 40%, rgba(9,9,9,0.82) 100%),
    radial-gradient(120% 80% at 70% 30%, transparent 0%, rgba(9,9,9,0.55) 100%);
}
.mask-line { overflow: hidden; }
/* About collage: justified rows, each photo keeps its own aspect ratio (--ar) and every row has one height. */
.about-collage {
  --row-h: 120px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.about-collage::after { content: ""; flex: 999 1 0px; }
.about-collage-item {
  position: relative;
  flex: var(--ar) 1 calc(var(--ar) * var(--row-h));
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: rgb(var(--c-lift));
}
.about-collage-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ar);
  object-fit: cover;
  transition: transform 0.8s ease;
}
.about-collage-item:hover img { transform: scale(1.04); }
.about-collage-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem 0.75rem 0.65rem;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.about-collage-item:hover .about-collage-caption,
.about-collage-item:focus-within .about-collage-caption { opacity: 1; }
@media (hover: none) { .about-collage-caption { opacity: 1; } }
@media (min-width: 640px) { .about-collage { --row-h: 180px; gap: 0.75rem; } }
@media (min-width: 1024px) { .about-collage { --row-h: 230px; } }
.project-media img,
.frame-media img {
  transition: transform 0.8s ease, filter 0.8s ease;
}
@media (hover: hover) and (pointer: fine) {
  .project-card:hover .project-media img,
  .showreel-frame:hover .frame-media img {
    transform: scale(1.045);
    filter: brightness(0.72);
  }
  .project-card:hover .project-title { transform: translateY(-4px); }
}
.project-title { transition: transform 0.5s ease; }
.portofolio-tile img {
  transition: transform 0.8s ease;
}
/* z-index 0 keeps the slides' own stacking below the tile overlay, caption and click area. */
.portofolio-slides { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #000; }
/* The incoming slide fades in on top while the outgoing one stays fully visible underneath. */
.portofolio-tile .portofolio-slide {
  z-index: 0;
  opacity: 0;
  transition: opacity 1.6s cubic-bezier(0.4, 0, 0.2, 1);
  backface-visibility: hidden;
}
.portofolio-tile .portofolio-slide.is-prev { z-index: 1; opacity: 1; transition: none; }
.portofolio-tile .portofolio-slide.is-current { z-index: 2; opacity: 1; }
/* Same animation name on both classes, so the zoom keeps running while a slide fades out. */
[data-slideshow] .portofolio-slide.is-current,
[data-slideshow] .portofolio-slide.is-prev {
  animation: portofolio-zoom var(--slide-life, 7s) linear forwards;
  animation-play-state: paused;
  will-change: opacity, transform;
}
[data-slideshow].is-playing .portofolio-slide.is-current,
[data-slideshow].is-playing .portofolio-slide.is-prev { animation-play-state: running; }
@keyframes portofolio-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  .portofolio-tile .portofolio-slide { transition: none; }
  [data-slideshow] .portofolio-slide.is-current,
  [data-slideshow] .portofolio-slide.is-prev { animation: none; }
}
.portofolio-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: #fff;
  font-size: 0.84rem;
  letter-spacing: 0;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 1;
}
.portofolio-label span {
  display: inline-block;
  max-width: 90%;
  padding: 0.7rem 0.85rem 0.7rem calc(0.85rem + 0.28em);
  background: rgba(9, 9, 9, 0.46);
  letter-spacing: 0.28em;
}
.portofolio-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 46% 22% at 50% 50%, rgba(9, 9, 9, 0.62), transparent 72%),
    linear-gradient(180deg, rgba(9, 9, 9, 0.16), transparent 20%, transparent 78%, rgba(9, 9, 9, 0.28));
  pointer-events: none;
}
.portofolio-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.portofolio-tile.is-active {
  box-shadow: inset 0 0 0 2px rgb(var(--c-champagne));
}
.portofolio-gallery {
  display: grid;
  grid-template-rows: 0fr;
  background: rgb(var(--c-ink));
  scroll-margin-top: var(--nav-h);
  transition: grid-template-rows 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.portofolio-gallery.is-open { grid-template-rows: 1fr; }
.portofolio-gallery[hidden] { display: none; }
.portofolio-gallery-clip { min-height: 0; overflow: hidden; }
.portofolio-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2;
  display: inline-flex;
  width: 3.25rem;
  height: 3.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(var(--c-paper) / 0.5);
  border-radius: 999px;
  background: rgb(var(--c-ink) / 0.8);
  color: rgb(var(--c-paper));
  backdrop-filter: blur(6px);
}
.portofolio-close:hover { border-color: rgb(var(--c-champagne)); color: rgb(var(--c-champagne)); }
.gallery-card img { transition: transform 0.7s ease, filter 0.7s ease; }
@keyframes gallery-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
.portofolio-gallery.is-open [data-gallery-panel].is-shown .gallery-card {
  animation: gallery-rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.portofolio-gallery.is-open [data-gallery-panel].is-shown .gallery-card:nth-child(2) { animation-delay: 0.06s; }
.portofolio-gallery.is-open [data-gallery-panel].is-shown .gallery-card:nth-child(3) { animation-delay: 0.12s; }
.portofolio-gallery.is-open [data-gallery-panel].is-shown .gallery-card:nth-child(4) { animation-delay: 0.18s; }
.portofolio-gallery.is-open [data-gallery-panel].is-shown .gallery-card:nth-child(5) { animation-delay: 0.24s; }
.portofolio-gallery.is-open [data-gallery-panel].is-shown .gallery-card:nth-child(6) { animation-delay: 0.3s; }
.portofolio-gallery.is-open [data-gallery-panel].is-shown .gallery-card:nth-child(n + 7) { animation-delay: 0.36s; }
.gallery-switch {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 1.1rem 1.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}
.gallery-back {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(var(--c-paper) / 0.3);
  border-radius: 999px;
  color: rgb(var(--c-paper));
}
.gallery-back:hover { border-color: rgb(var(--c-champagne)); color: rgb(var(--c-champagne)); }
.gallery-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: rgb(var(--c-lift));
  cursor: pointer;
  scroll-margin-top: var(--nav-h);
}
.gallery-tile img { transition: transform 0.8s ease, filter 0.8s ease; }
.gallery-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 9, 0.28);
  transition: background 0.5s ease;
}
.gallery-tile-title {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 18px rgba(0, 0, 0, 0.7);
}
.gallery-tile:focus-visible { outline-offset: -3px; }
@media (max-width: 1023px) {
  .gallery-tile { aspect-ratio: 16 / 9; background: #000; }
  .gallery-card .aspect-video { background: #000; }
  .gallery-tile img.object-cover,
  .gallery-card img.object-cover { object-fit: contain; }
}
@media (min-width: 768px) {
  .gallery-tile-title { font-size: 0.95rem; }
}
@media (hover: hover) and (pointer: fine) {
  .portofolio-tile:hover img,
  .gallery-card:hover img,
  .gallery-tile:hover img { transform: scale(1.045); }
  .gallery-card:hover img { filter: brightness(0.78); }
  .gallery-tile:hover::after { background: rgba(9, 9, 9, 0.12); }
}
@media (min-width: 768px) {
  .portofolio-label {
    font-size: 0.95rem;
  }
  .portofolio-label span {
    letter-spacing: 0.38em;
    padding-left: calc(0.85rem + 0.38em);
  }
}
.play-ring {
  width: 4.5rem;
  height: 4.5rem;
  border: 1px solid rgba(243, 240, 234, 0.7);
  background: rgba(9, 9, 9, 0.28);
  backdrop-filter: blur(6px);
}
.media-fallback {
  background:
    linear-gradient(160deg, #1D1D1D, #090909 70%);
}
.cursor-play {
  position: fixed;
  width: 4.25rem;
  height: 4.25rem;
  margin: -2.125rem 0 0 -2.125rem;
  border: 1px solid rgba(243, 240, 234, 0.75);
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 40;
  color: #F3F0EA;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  background: rgba(9, 9, 9, 0.35);
}
.field {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgb(var(--c-paper) / 0.2);
  color: rgb(var(--c-paper));
  padding: 0.9rem 0;
  font-size: 0.95rem;
  border-radius: 0;
}
.field:focus { outline: none; border-bottom-color: rgb(var(--c-champagne)); }
select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, rgb(var(--c-champagne)) 50%), linear-gradient(135deg, rgb(var(--c-champagne)) 50%, transparent 50%); background-position: calc(100% - 14px) 1.15rem, calc(100% - 8px) 1.15rem; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
select.field option { background: rgb(var(--c-ink)); color: rgb(var(--c-paper)); }
textarea.field { min-height: 8rem; resize: vertical; }
.error-text { color: rgb(var(--c-danger)); font-size: 0.8rem; }
#float-whatsapp[hidden] { display: none; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(9, 9, 9, 0.78);
  display: none;
}
.overlay.is-open { display: flex; }
.sheet {
  width: min(1080px, calc(100% - 1.5rem));
  max-height: 90vh;
  overflow: auto;
  background: rgb(var(--c-ink));
  color: rgb(var(--c-paper));
  border: 1px solid rgb(var(--c-paper) / 0.14);
}
.video-sheet {
  --video-bar: 3.5rem;
  width: min(1180px, calc(100vw - 1.5rem), calc((100vh - 2rem - var(--video-bar)) * 16 / 9));
  width: min(1180px, calc(100vw - 1.5rem), calc((100dvh - 2rem - var(--video-bar)) * 16 / 9));
  max-height: none;
  overflow: hidden;
  margin: auto;
}
.video-sheet-bar { height: var(--video-bar); flex-shrink: 0; }
.video-sheet .aspect-video { position: relative; }
.video-sheet .aspect-video iframe,
.video-sheet .aspect-video video { display: block; width: 100%; height: 100%; border: 0; }
/*
 * Touch devices (phones and tablets) get Drive's touch player, which stacks the video and its
 * controls and breaks inside a 16:9 strip; narrow windows have the same problem. Both use a
 * full-screen modal where the Drive frame fills everything under the title bar.
 */
@media (max-width: 1023px), (pointer: coarse) {
  #gallery-modal.overlay,
  #showreel-modal.overlay { padding: 0; }
  .video-sheet {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    border: 0;
    background: #000;
  }
  .video-sheet-bar {
    height: calc(var(--video-bar) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }
  .video-sheet .aspect-video {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 0;
    aspect-ratio: auto;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom);
  }
  /* --video-ratio (width / height) is set from the Drive thumbnail when a tile opens the modal. */
  .video-sheet .aspect-video > iframe,
  .video-sheet .aspect-video > video {
    width: min(100%, calc((100dvh - var(--video-bar) - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * var(--video-ratio, 1.7778)));
    height: auto;
    max-height: 100%;
    aspect-ratio: var(--video-ratio, 1.7778);
  }
  .video-sheet .aspect-video > iframe[src*="drive.google.com"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - env(safe-area-inset-bottom));
    max-height: none;
    aspect-ratio: auto;
  }
}
/* On phones Drive's controls are oversized and can't be styled cross-origin: render the frame larger and scale it down. */
@media (max-width: 767px) {
  .video-sheet .aspect-video > iframe[src*="drive.google.com"] {
    --drive-scale: 1.45;
    width: calc(100% * var(--drive-scale));
    height: calc((100% - env(safe-area-inset-bottom)) * var(--drive-scale));
    transform: scale(calc(1 / var(--drive-scale)));
    transform-origin: 0 0;
  }
}
.grain {
  background-image: radial-gradient(rgb(var(--c-paper) / 0.04) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .hero-media { transform: none !important; }
}
