:root {
  --bg: #050505;
  --line: rgba(255, 255, 255, 0.14);
  --fg: #f4f2ee;
  --fg-dim: rgba(244, 242, 238, 0.55);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 68px;
  --footer-h: 46px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg);
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 17px;
  letter-spacing: 0.5px;
}
.brand__name {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 22px;
  letter-spacing: 0.3px;
}

.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav__link {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  text-decoration: none;
  color: var(--fg-dim);
  transition: color 0.3s var(--ease);
}
.site-nav__link:hover { color: var(--fg); }
.site-nav__cta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  text-decoration: none;
  color: var(--fg);
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 100px;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
.site-nav__cta:hover { background: var(--fg); color: #000; }

/* ---------- Hero + Grid ---------- */
.hero {
  position: relative;
  height: calc(100vh - var(--header-h));
  min-height: 520px;
  display: flex;
  flex-direction: column;
}
.hero__meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.hero__meta a { color: var(--fg); text-decoration: none; }
.hero__meta a:hover { text-decoration: underline; }

.grid {
  position: relative;
  z-index: 10;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--line);          /* gap lines */
  transition: grid-template-columns 0.75s var(--ease),
              grid-template-rows 0.75s var(--ease);
}

.cell {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  display: grid;
  place-items: center;
  cursor: pointer;
  min-width: 0;
  min-height: 0;
}

/* media layer */
.cell__media {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s var(--ease);
  pointer-events: none;
  /* no transform here on purpose: a resting transform forces the video onto a
     GPU layer that gets rescaled (grainy on retina). Fade only = crisp video. */
}
.cell__media video,
.cell__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cell__media::after {            /* very light veil to blend with the grid */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.12));
}

/* label */
.cell__label {
  position: relative;
  z-index: 2;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.4rem, 2.6vw, 2.4rem);
  letter-spacing: 0.4px;
  color: var(--fg);
  text-align: center;
  padding: 0 12px;
  transition: opacity 0.6s var(--ease);
}

.cell__index {
  position: absolute;
  top: 16px; left: 18px;
  z-index: 2;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--fg-dim);
  transition: opacity 0.5s var(--ease);
}
.cell__meta {
  position: absolute;
  bottom: 16px; left: 18px; right: 18px;
  z-index: 2;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg-dim);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

/* play button — only used on touch/mobile (hidden on desktop) */
.cell__play {
  display: none;
  position: absolute;
  z-index: 2;
  top: calc(50% + 2.4rem);
  left: 50%;
  transform: translate(-50%, 0);
  width: 46px; height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transition: opacity 0.4s var(--ease);
}
.cell__play::before {          /* triangle */
  content: "";
  position: absolute;
  top: 50%; left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent var(--fg);
}

/* an opened cell keeps its video on screen and stays text-free.
   is-active = currently hovered, is-revealed = has been opened before */
.cell.is-active .cell__media,
.cell.is-revealed .cell__media { opacity: 1; }

.cell.is-active .cell__label,
.cell.is-revealed .cell__label {
  opacity: 0;
}
.cell.is-active .cell__index,
.cell.is-revealed .cell__index { opacity: 0; }
.cell.is-active .cell__meta,
.cell.is-revealed .cell__meta { opacity: 0; }

/* dim the still-closed cells while something is active — opacity only, so the
   text keeps rendering crisp (no blur/transform layer that goes low-res on retina) */
.grid.has-active .cell:not(.is-active):not(.is-revealed) .cell__label {
  opacity: 0.4;
}

/* ==================================================================
   SECTIONS
   ================================================================== */
.section {
  padding: clamp(80px, 12vh, 150px) 28px;
  border-top: 1px solid var(--line);
}
section[id], .hero { scroll-margin-top: var(--header-h); }
.section__label {
  display: block;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 48px;
}

/* reveal-on-scroll (opacity + gentle lift; ends with no transform = crisp text) */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
  max-width: 1400px;
}
.about__statement {
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 3.5rem);
  line-height: 1.18;
  letter-spacing: 0.2px;
}
.about__statement em { font-style: italic; }
.about__body { color: var(--fg-dim); }
.about__body p {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 20px;
  max-width: 42ch;
}
.about__stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  margin-top: 44px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.about__stats li { display: flex; flex-direction: column; gap: 6px; }
.about__stats strong {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 500;
  font-size: 2.6rem;
  color: var(--fg);
  line-height: 1;
}
.about__stats span {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ---------- Services ---------- */
.services__list { list-style: none; }
.service {
  display: grid;
  grid-template-columns: 64px 1fr 1.1fr;
  gap: 24px;
  align-items: baseline;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  transition: padding-left 0.5s var(--ease);
}
.services__list .service:last-child { border-bottom: 1px solid var(--line); }
.service:hover { padding-left: 14px; }
.service__no {
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--fg-dim);
}
.service__title {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.1;
}
.service__desc {
  color: var(--fg-dim);
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 44ch;
}

/* ---------- Showcase / cases ---------- */
.cases {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 56px) clamp(20px, 3vw, 40px);
}
.case { display: block; }
.case__media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}
.case__media video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.6s var(--ease);
  opacity: 0.9;
}
.case:hover .case__media video { opacity: 1; }
.case__info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}
.case__title {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}
.case__meta {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-align: right;
}

/* ---------- Clients marquee ---------- */
.clients { overflow: hidden; }
.marquee {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track {
  display: inline-flex;
  align-items: center;
  gap: 40px;
  white-space: nowrap;
  animation: marquee 34s linear infinite;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: var(--fg);
}
.marquee__track span:nth-child(even) { color: var(--fg-dim); font-size: 0.6em; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Testimonial ---------- */
.quote { text-align: center; }
.quote blockquote { max-width: 20ch; margin: 0 auto; }
.quote p {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.8rem, 4.4vw, 3.4rem);
  line-height: 1.28;
  max-width: 24ch;
  margin: 0 auto 28px;
}
.quote cite {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* ---------- Contact ---------- */
.contact { text-align: left; }
.contact__headline {
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 6rem);
  line-height: 1.05;
  letter-spacing: 0.2px;
  margin-bottom: 40px;
}
.contact__headline em { font-style: italic; }
.contact__mail {
  display: inline-block;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  transition: border-color 0.4s var(--ease);
}
.contact__mail:hover { border-color: var(--fg); }
.contact__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 48px;
}
.contact__socials a {
  font-size: 12px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.contact__socials a:hover { color: var(--fg); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.site-footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer__nav { display: flex; gap: 24px; }
.site-footer__nav a {
  font-size: 12px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.site-footer__nav a:hover { color: var(--fg); }
.site-footer__row--base {
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* ---------- Intro / loading: clapperboard ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #030303;
  display: grid;
  place-items: center;
  gap: 34px;
  grid-auto-flow: row;
  align-content: center;
  transition: opacity 0.7s ease 0.45s;
}
/* on exit the loader fades while the clapperboard zooms into the stick */
.intro.is-done {
  opacity: 0;
  pointer-events: none;
}
.intro.is-done .clap {
  transform: scale(9);
  opacity: 0;
}

.clap {
  position: relative;
  width: clamp(264px, 82vw, 372px);
  transform-origin: 50% 9%;   /* the clap stick — focal point of the zoom */
  animation: clapIn 0.6s var(--ease) both;
  transition: transform 1.05s cubic-bezier(0.66, 0, 0.34, 1), opacity 0.85s ease 0.2s;
}
@keyframes clapIn {
  from { opacity: 0; transform: translateY(18px) scale(0.95); }
  to   { opacity: 1; transform: none; }
}

/* diagonal black/white stripes shared by stick + jaw */
.clap__stripes {
  height: 100%;
  border-radius: 3px;
  background: repeating-linear-gradient(118deg,
              #f4f2ee 0 20px, #0c0c0c 20px 40px);
}

/* the moving clap stick — hinged at the left, snaps shut */
.clap__stick {
  height: 34px;
  margin-bottom: 5px;
  transform-origin: 8% 100%;
  transform: rotate(-30deg);
  animation: clapClose 0.72s cubic-bezier(0.7, 0, 0.2, 1) 0.75s forwards;
}
.clap__stick .clap__stripes { border: 1px solid rgba(255,255,255,0.28); }
@keyframes clapClose {
  0%   { transform: rotate(-30deg); }
  72%  { transform: rotate(3.5deg); }   /* snap past + tiny overshoot */
  100% { transform: rotate(0deg); }
}

/* the slate body */
.clap__board {
  position: relative;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 5px;
  background: #0a0a0a;
  overflow: hidden;
}
.clap__jaw { height: 14px; }              /* static striped top edge */
.clap__rows { padding: 20px 20px 18px; }
.clap__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.clap__row:first-child { border-top: none; }
.clap__row b { color: var(--fg); font-weight: 500; }
.clap__row--title {
  padding: 2px 0 12px;
  gap: 12px;
  justify-content: flex-start;
}
.clap__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 16px;
  color: var(--fg);
  letter-spacing: 0;
}
.clap__prod {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.75rem;
  letter-spacing: 0.3px;
  text-transform: none;
  color: var(--fg);
}
.clap__row--sub { font-size: 10px; letter-spacing: 1.4px; }

/* white flash at the moment the stick snaps shut */
.clap__flash {
  position: absolute;
  inset: -10px;
  border-radius: 8px;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  animation: clapFlash 0.5s ease 1.16s both;
}
@keyframes clapFlash {
  0%, 100% { opacity: 0; }
  16%      { opacity: 0.5; }
}

.intro__loading {
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--fg-dim);
  animation: loadingPulse 1.4s ease-in-out infinite;
}
@keyframes loadingPulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.9; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { height: auto; min-height: 0; }
  .grid {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: none !important;
    grid-auto-rows: 42vh;
    flex: none;
  }
  .cell__label { font-size: clamp(1.3rem, 5vw, 2rem); }

  /* nav: keep only the Contact button on small screens */
  .site-nav__link { display: none; }

  /* section layouts stack */
  .about__grid { grid-template-columns: 1fr; }
  .service {
    grid-template-columns: 40px 1fr;
    row-gap: 10px;
  }
  .service__desc { grid-column: 2; }
  .cases { grid-template-columns: 1fr; }

  /* Touch has no hover. Default = a black tile with just the title.
     Tap to play the video; leaving a played tile fades it back to a dark
     frame with the title over it. (JS toggles .has-played / .is-playing) */
  .cell__media::after { transition: background 0.6s var(--ease); }

  /* a tile that has been played keeps its (frozen) video on screen */
  .cell.has-played .cell__media { opacity: 1; }

  /* played but not the active one: darken the frozen video, keep the title */
  .cell.has-played:not(.is-playing) .cell__media::after {
    background: rgba(0, 0, 0, 0.64);
  }

  /* the tile currently playing: clean video, title hidden */
  .cell.is-playing .cell__media::after {
    background: linear-gradient(180deg, rgba(0,0,0,0.04), rgba(0,0,0,0.12));
  }
  .cell.is-playing .cell__label { opacity: 0; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr !important; grid-auto-rows: 48vh; }
  .brand__name { display: none; }
  .section { padding: 72px 20px; }
  .hero__meta { flex-wrap: wrap; gap: 8px 16px; }
  .hero__meta .hero__hint { display: none; }
  .case__info { flex-direction: column; gap: 4px; }
  .case__meta { text-align: left; }
  .site-footer__row { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
