:root {
  --paper: #ffffff;
  --mist: #f2f3f4;
  --ink: #000000;
  --text: #4a4a4c;
  --muted: #8b8b8e;
  --line: #e6e7e9;

  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fs-small: 0.875rem;   /* 14 */
  --fs-body: 1.0625rem;   /* 17 */
  --fs-lead: 1.375rem;    /* 22 */
  --fs-h2: 2rem;          /* 32 */
  --fs-display: clamp(2.5rem, 6vw, 4.5rem);

  --radius-frame: 28px;
  --radius-card: 22px;
  --radius-media: 14px;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 45rem; /* 720px: about 95 characters of Helvetica a line */
  --nav-h: 76px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 110px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { color: var(--ink); font-weight: 500; letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
p { margin: 0 0 0.9em; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* ---------- Frame + nav ---------- */

.frame {
  max-width: var(--wrap);
  margin: 16px auto 0;
  padding: var(--nav-h) 0 8px;
  background: var(--mist);
  border-radius: var(--radius-frame);
  margin-inline: max(16px, calc((100% - var(--wrap)) / 2));
}

.nav {
  position: fixed;
  top: 16px;
  left: max(16px, calc((100% - var(--wrap)) / 2));
  right: max(16px, calc((100% - var(--wrap)) / 2));
  height: var(--nav-h);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 28px;
  border-radius: var(--radius-frame);
  transition: box-shadow .4s var(--ease);
  background: color-mix(in srgb, var(--mist) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav.is-floating { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .25); }

.nav__name {
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  letter-spacing: -0.01em;
}

.nav__links { display: flex; gap: 1.5rem; }
.nav__links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  position: relative;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav__links a:hover::after,
.nav__links a[aria-current="true"]::after { transform: scaleX(1); }

.nav__toggle { display: none; }

/* ---------- About (white card inside the frame) ---------- */

.about {
  margin: 0 8px;
  padding: clamp(32px, 6vw, 64px) clamp(20px, 6vw, 56px) clamp(32px, 5vw, 56px);
  background: var(--paper);
  border-radius: var(--radius-card);
}

.about__head { display: flex; align-items: center; gap: 1.6rem; margin-bottom: 2.6rem; }

.avatar {
  flex: none;
  width: 128px; height: 128px;
  border-radius: 50%;
  background: var(--mist);
  color: var(--muted);
  display: grid; place-items: center;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  object-fit: cover;
  object-position: 50% 30%;
}

.about__name { font-size: 1.75rem; }

.about__role { margin: 0.15rem 0 0; color: var(--text); font-size: var(--fs-body); }

.roles {
  display: inline-grid;
  height: 1.6em;
  overflow: hidden;
  vertical-align: top;
}
.roles > span {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(70%);
  transition: opacity .5s var(--ease), transform .6s var(--ease);
}
.roles > span.is-active { opacity: 1; transform: none; }
.roles > span.is-leaving { opacity: 0; transform: translateY(-70%); }

.about__bio { max-width: var(--measure); }

/* Education and Tools: stacked on phones, side by side on wider screens */
.creds { display: grid; gap: 2.2rem; margin-top: 2.2rem; }
@media (min-width: 761px) {
  .creds { grid-template-columns: max-content minmax(0, 22rem); column-gap: clamp(48px, 6vw, 88px); justify-content: start; }
}

.block-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1rem;
  margin-bottom: 0.8rem;
}
.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Years column is as wide as the longest years, with the same space on both sides of the divider */
.edu__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); row-gap: 1.1rem; max-width: var(--measure); }
.edu__list li { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: baseline; }
.edu__years { padding-right: 1rem; }
.edu__years {
  color: var(--muted);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
.edu__list li > div { padding-left: 1rem; border-left: 1px solid var(--line); }
.edu__degree { margin: 0; color: var(--ink); font-weight: 500; line-height: 1.4; }
.edu__school {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.3rem 0 0;
  color: var(--text);
  font-size: 0.9375rem;
}
.logo-dot {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--mist);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 500;
}
.logo-dot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--paper); }
/* The TAU mark is wide, so it sits inside the circle instead of filling it */
.logo-dot img.logo-dot__tau { object-fit: contain; padding: 2px; }

.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; max-width: 22rem; }
.pills li {
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
  line-height: 1;
  padding: 0.55em 0.8em;
  border-radius: 999px;
}

.btn {
  display: inline-block;
  margin-top: 2.2rem;
  padding: 0.9em 1.5em;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 18px -10px rgba(0, 0, 0, .18);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 24px -12px rgba(0, 0, 0, .25); }

.brands { margin-top: 4rem; }
.brands__title { color: var(--ink); font-weight: 500; margin-bottom: 1.4rem; }

/* A scrollable strip: it drifts on its own (main.js) and can be swiped or dragged */
.marquee {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  width: max-content;
  gap: 2.6rem;
}
.marquee::-webkit-scrollbar { display: none; }
/* Client logos; --h is set per logo so they read at the same visual size */
.marquee__track { align-items: center; }
.marquee__track img {
  height: var(--h, 28px);
  width: auto;
  max-width: none;
  mix-blend-mode: multiply; /* drops the white box behind logos without transparency */
}

/* ---------- Sections ---------- */

main { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.section { padding-top: clamp(96px, 14vw, 180px); }

.section__head { max-width: var(--measure); margin-bottom: 28px; }
.section__head h2 { font-size: var(--fs-h2); margin-bottom: 0.6rem; }
.section__head p { margin: 0; }

.media {
  width: 100%;
  border-radius: var(--radius-media);
  background: var(--mist);
}

/* ---------- Case studies: three project cards; a card opens its story underneath ---------- */

.cases { display: grid; gap: 28px 20px; }
@media (min-width: 761px) {
  .cases { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .case { grid-column: 1 / -1; }
}
@media (min-width: 981px) {
  .cases--design { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px 14px; }
  .cases--design .case-card__title { font-size: 1.0625rem; }
}
/* On phones each story opens right under its own card */
@media (max-width: 760px) {
  /* (scoped so these win over the base two-column rules further down the file) */
  .gallery .gallery__pair, .case .case__more-list { grid-template-columns: 1fr; }
  
  /* Case studies on phones ------------------------------------------------ */
  
  /* Alternatives: a swipeable row of large rectangles */
  #work .gallery__grid--row {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 84%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  #work .gallery__grid--row::-webkit-scrollbar { display: none; }
  #work .gallery__grid--row .gallery__tile { aspect-ratio: 16 / 9; scroll-snap-align: start; }
  
  /* Presentation slides: rectangles, two per row */
  #work .gallery__grid:not(.gallery__grid--row) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #work .gallery__grid:not(.gallery__grid--row) .gallery__tile,
  #work .gallery__split--tall > .gallery__tile { aspect-ratio: 16 / 9; }
  
  /* Teaser under its images: Wolt (slides, two per row) and Tirat Zvi (two squares) */
  #work .gallery__split--tall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #work .gallery__split:not(.gallery__split--tall) { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
  #work .gallery__split > .gallery__label:first-child { grid-column: 1 / -1; grid-row: auto; order: 0; }
  #work .gallery__split > .gallery__tile { order: 1; }
  #work .gallery__split > .gallery__label:nth-child(2) { grid-column: 1 / -1; grid-row: auto; order: 2; margin-top: 18px; }
  #work .gallery__split > .gallery__label:nth-child(2) { text-align: center; }
  #work .gallery__split > .teaser { grid-column: 1 / -1; grid-row: auto; order: 3; width: 55%; justify-self: center; }
  .gallery__strip--stack .gallery__strip-cell.is-portrait { width: 62%; justify-self: center; }
  .gallery__strip--stack .gallery__strip-cell.is-portrait .gallery__label { text-align: center; }
  #work .gallery__split .teaser button { height: auto; aspect-ratio: 9 / 16; }

  /* Three alternatives in a row are too small on a phone: one per row, as wide rectangles */
  .gallery .gallery__grid--row:not(.gallery__grid--wide) { grid-template-columns: 1fr; }
  .gallery .gallery__grid--row:not(.gallery__grid--wide) .gallery__tile { aspect-ratio: 16 / 9; }

  /* Rows of photos at their own proportions (e.g. the event): squares, two per row.
     The columns and shapes are set inline in JS, hence !important */
  .gallery__strip:not(.gallery__strip--stack) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .gallery__strip:not(.gallery__strip--stack) .gallery__tile { aspect-ratio: 1 !important; }

  /* Swipe sideways, one at a time, with the next one peeking in (like the teasers) */
  .cases__row,
  .section .films {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 84%;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .cases__row::-webkit-scrollbar,
  .films::-webkit-scrollbar { display: none; }
  .cases__row .case-card,
  .films .film { scroll-snap-align: start; }
  .gallery__strip--stack { grid-template-columns: 1fr !important; }
  .case-card:nth-of-type(1) { order: 1; } .case:nth-of-type(1) { order: 2; }
  .case-card:nth-of-type(2) { order: 3; } .case:nth-of-type(2) { order: 4; }
  .case-card:nth-of-type(3) { order: 5; } .case:nth-of-type(3) { order: 6; }
  .case-card:nth-of-type(4) { order: 7; } .case:nth-of-type(4) { order: 8; }
  .case-card:nth-of-type(5) { order: 9; } .case:nth-of-type(5) { order: 10; }
}

@media (min-width: 761px) {
  .cases__row { display: contents; } /* desktop: the row wrapper is invisible to the grid */
}

.case-card {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 10px 10px 18px;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--mist);
  transition: background .3s var(--ease);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.case-card__media {
  display: block;
  aspect-ratio: 1;
  margin-bottom: 14px;
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--mist);
  transition: opacity .4s var(--ease);
}
/* --focus picks which part of the image stays in view when it's cropped to a square */
.case-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); transition: transform .8s var(--ease); }
.case-card:hover .case-card__media img { transform: scale(1.02); }
.case-card__meta,
.case-card__title { padding-inline: 8px; }
.case-card__meta { color: var(--muted); font-size: var(--fs-small); }
.case-card__title {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 500;
  text-decoration: underline 1px transparent;
  text-underline-offset: 5px;
  transition: text-decoration-color .3s var(--ease);
}
.case-card[aria-expanded="true"] .case-card__title { text-decoration-color: currentColor; }
/* While one project is open, the others step back */
.cases.has-open .case-card[aria-expanded="false"] .case-card__media { opacity: .45; }
.cases.has-open .case-card[aria-expanded="false"]:hover .case-card__media { opacity: 1; }

@media (min-width: 761px) {
  .cases.has-open {
    grid-template-columns: minmax(0, 1fr) minmax(0, 16rem);
    grid-template-rows: repeat(var(--k), min-content) auto auto;
    gap: 12px 20px;
  }
  .cases.has-open .case-card[aria-expanded="true"] { grid-column: 1; grid-row: 1 / span var(--span); }
  .cases.has-open .case-card[aria-expanded="true"] .case-card__media { aspect-ratio: 16 / 9; margin-bottom: 16px; animation: settle .5s var(--ease); }
  .cases.has-open .case-card[aria-expanded="true"] .case-card__meta { font-size: 1rem; }
  .cases.has-open .case-card[aria-expanded="true"] .case-card__title { font-size: 1.75rem; text-decoration-color: transparent; }

  .cases.has-open .case-card[aria-expanded="false"] {
    grid-column: 2;
    grid-row: var(--row);
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    padding: 8px;
    border-radius: 16px;
  }
  .cases.has-open .case-card[aria-expanded="false"] .case-card__media { grid-row: 1 / span 2; width: 64px; margin: 0; border-radius: 10px; opacity: 1; }
  .cases.has-open .case-card[aria-expanded="false"] .case-card__meta,
  .cases.has-open .case-card[aria-expanded="false"] .case-card__title { grid-column: 2; padding-inline: 0; }
  .cases.has-open .case-card[aria-expanded="false"] .case-card__title { font-size: 1rem; }
  .cases.has-open .case-card[aria-expanded="false"]:hover { background: #e9eaec; }

  .cases.has-open .case { grid-row: var(--row); }

  /* Design & copy side cards: one line each, the two lines close together */
  .cases.has-open .case-card[aria-expanded="false"] .long { display: none; }
  .cases.has-open .case-card[aria-expanded="false"] .short { display: inline; }
  .cases.has-open .case-card[aria-expanded="false"] .case-card__meta,
  .cases.has-open .case-card[aria-expanded="false"] .case-card__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cases.has-open .case-card[aria-expanded="false"] .case-card__meta { align-self: end; }
  .cases.has-open .case-card[aria-expanded="false"] .case-card__title { align-self: start; }

  /* Case studies: the two side cards stand upright (image over text) and together
     match the height of the open card exactly */
  .cases:not(.cases--design).has-open { grid-template-rows: repeat(var(--k), minmax(0, 1fr)) auto; }
  .cases:not(.cases--design).has-open .case-card[aria-expanded="true"] { grid-row: 1 / span var(--k); }
  .cases:not(.cases--design).has-open .case { grid-row: auto; }
  .cases:not(.cases--design).has-open .case-card[aria-expanded="false"] {
    grid-template-columns: none;
    grid-template-rows: minmax(0, 1fr) auto auto;
    align-items: stretch;
    padding: 10px 10px 14px;
    border-radius: var(--radius-card);
  }
  .cases:not(.cases--design).has-open .case-card[aria-expanded="false"] .case-card__media {
    position: relative;
    grid-row: auto;
    width: auto;
    min-height: 0;
    aspect-ratio: auto;
    margin: 0 0 10px;
    border-radius: var(--radius-media);
  }
  .cases:not(.cases--design).has-open .case-card[aria-expanded="false"] .case-card__media img { position: absolute; inset: 0; }
  .cases:not(.cases--design).has-open .case-card[aria-expanded="false"] .case-card__meta,
  .cases:not(.cases--design).has-open .case-card[aria-expanded="false"] .case-card__title { grid-column: auto; padding-inline: 6px; align-self: auto; }
}
.case-card .short { display: none; }

.case { padding-top: 32px; border-top: 1px solid var(--line); }

/* Show less: closes the open project */
.case__less {
  margin-top: 24px;
  padding: 0.7em 1.2em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 500 0.9375rem var(--font);
  line-height: 1;
  cursor: pointer;
  transition: border-color .25s var(--ease);
}
.case__less:hover { border-color: var(--ink); }

/* End of a story: the other projects as small cards */
.case__more {
  display: grid;
  gap: 10px;
  margin-top: clamp(40px, 6vw, 56px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.case__more-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.case-mini {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px;
  border: 0;
  border-radius: 18px;
  background: var(--mist);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .3s var(--ease);
}
.case-mini:hover { background: #e9eaec; }
.case-mini img { width: 96px; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.case-mini__text { display: grid; gap: 2px; }
.case-mini__title { color: var(--ink); font-size: 1.0625rem; font-weight: 500; }
.case:not([hidden]) { animation: settle .5s var(--ease); }


.case__text { margin-bottom: 28px; }
.case__text p { max-width: var(--measure); }
.case__meta { color: var(--muted); margin-bottom: 0.35rem; }
.case__text h3 { font-size: 1.75rem; margin-bottom: 1.2rem; }
.case__role { color: var(--muted); font-size: var(--fs-small); margin-top: 1.4rem; }

/* ---------- Gallery: one large image, then a grid of squares ---------- */

.gallery { display: grid; gap: clamp(28px, 4vw, 40px); }
.gallery__group { display: grid; gap: 10px; margin: 0; }
.gallery .gallery__label {
  margin: 0;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
}
.gallery__teaser { width: clamp(200px, 24vw, 260px); }
.gallery__teaser .gallery__label { margin: 0 0 10px; }

.gallery__lead,
.gallery__tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--mist);
  cursor: zoom-in;
}
.gallery__lead { border-radius: var(--radius-media); }
.gallery__lead img { width: 100%; height: auto; }

/* Squares per row follow the screen: 3 on phones, up to 5 on wide screens */
.gallery__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(96px, 19vw, 190px), 1fr)); gap: 12px; }
@media (min-width: 761px) {
  .gallery__grid[style*="--cols"] { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
}
.gallery__tile { aspect-ratio: 1; border-radius: 10px; }

/* Alternatives as squares with the teaser beside them; the 9:16 column is
   9/16 as wide as a square, so the teaser comes out exactly as tall */
.gallery__split {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr)) minmax(0, 0.5625fr);
  align-items: end;
  gap: 10px;
}
.gallery__split > .gallery__label:first-child { grid-column: 1 / -2; }
.gallery__split > .gallery__label:nth-child(2) { grid-column: -2 / -1; }
.gallery__split .teaser { margin: 0; }
.gallery__split .teaser button { border-radius: 10px; }

/* Teaser on the right, as tall as two rows of squares beside it.
   A 9:16 column 1.125x as wide as a square matches two rows. */
.gallery__split--tall {
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr)) minmax(0, 1.125fr);
  align-items: stretch;
}
.gallery__split--tall > .gallery__label:first-child { grid-column: 1 / -2; grid-row: 1; align-self: end; }
.gallery__split--tall > .gallery__label:nth-child(2) { grid-column: -2 / -1; grid-row: 1; align-self: end; }
.gallery__split--tall > .teaser { grid-column: -2 / -1; grid-row: 2 / span 2; }
.gallery__split--tall .teaser button { height: 100%; aspect-ratio: auto; }

/* Items at their own proportions, side by side at one height (columns set in JS) */
.gallery__strip { display: grid; gap: 10px; align-items: end; }
.gallery__strip-label { grid-column: 1 / -1; }
.gallery__strip-cell { display: grid; gap: 10px; margin: 0; }
.gallery__strip .gallery__tile { border-radius: 10px; }

/* Two labeled items side by side (e.g. renewed logo + presentation) */
.gallery__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.gallery__lead video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery__pair .gallery__lead img { aspect-ratio: 16 / 9; object-fit: cover; }

/* Alternatives: one row; two (or one) of them as wide rectangles */
.gallery__grid--row { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.gallery__grid--wide .gallery__tile { aspect-ratio: 16 / 9; }
.gallery__tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), opacity .3s; }
.gallery__tile:hover img { transform: scale(1.04); }
.gallery__tile .play,
.gallery__lead .play { cursor: pointer; }

.play {
  position: absolute;
  left: 16px; bottom: 16px;
  padding: 0.55em 1em;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  font: 500 var(--fs-small) var(--font);
}

.placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  border: 1px dashed #c9cacd;
  background: repeating-linear-gradient(135deg, transparent 0 12px, rgba(0, 0, 0, .018) 12px 24px), var(--paper);
  color: var(--muted);
  font-size: var(--fs-small);
  text-align: center;
}

/* ---------- Teasers: row of vertical phones ---------- */

.reel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(200px, 24vw, 260px);
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding-bottom: 16px;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scrollbar-width: thin;
}
.teaser { margin: 0; scroll-snap-align: start; }
.teaser button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  background: var(--mist);
  cursor: pointer;
  aspect-ratio: 9 / 16;
}
.teaser video { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.teaser button:hover video { transform: scale(1.02); }
.teaser figcaption { margin-top: 0.8rem; font-size: var(--fs-small); color: var(--muted); }
.teaser figcaption strong { display: block; color: var(--ink); font-weight: 500; font-size: 1rem; }

/* ---------- Design & copy: tabs + vertical gallery ---------- */



/* ---------- Video production ---------- */

.films { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.film { margin: 0; }
.film__poster {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-media);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--mist);
  cursor: pointer;
}
.film__poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.film__poster:hover img { transform: scale(1.02); }
.film figcaption,
.script figcaption { margin-top: 0.8rem; font-size: var(--fs-small); color: var(--muted); }
.film figcaption strong,
.script figcaption strong { display: block; color: var(--ink); font-weight: 500; font-size: 1rem; }


/* ---------- Screenwriting: covers that open the PDF ---------- */

.scripts {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(130px, 38vw, 170px);
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  margin-inline: calc(var(--gutter) * -1);
  padding: 0 var(--gutter) 8px;
  scrollbar-width: none;
}
.scripts::-webkit-scrollbar { display: none; }
.script { scroll-snap-align: start; }
.script { margin: 0; }
.script__cover {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 692 / 1000; /* the shape of the cover image */
  background: var(--mist);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 18px 32px -22px rgba(0, 0, 0, .35);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.script__cover:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 26px 40px -24px rgba(0, 0, 0, .4); }
.script__cover img { width: 100%; height: 100%; object-fit: cover; }
.script__cover--soon {
  display: grid;
  place-items: center;
  border: 1px dashed #c9cacd;
  box-shadow: none;
  color: var(--muted);
  font-size: var(--fs-small);
  cursor: default;
}
.script__cover--soon:hover { transform: none; box-shadow: none; }

/* ---------- Contact + footer ---------- */

/* The email is ~10.4em wide in Helvetica: it gets the largest size that still fits on one
   line, and the heading above keeps the desktop ratio to it (about 0.45) */
.contact {
  --mail: clamp(1.25rem, calc((100vw - 2 * var(--gutter)) / 10.6), 4.5rem);
  padding-bottom: clamp(80px, 10vw, 140px);
}
.contact h2 { font-size: clamp(1.125rem, calc(var(--mail) * 0.45), var(--fs-h2)); margin-bottom: 1.4rem; }
.contact__mail {
  display: inline-block;
  font-size: var(--mail);
  white-space: nowrap;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size .5s var(--ease);
}
.contact__mail:hover { background-size: 100% 2px; }
.contact__list { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; }
.contact__list a { text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.contact__list a:hover { border-color: var(--ink); }

.foot {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: var(--fs-small);
  border-top: 1px solid var(--line);
}
.foot a { text-decoration: none; }

/* ---------- Viewer (images, videos, scripts) ---------- */

.viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  --stage-h: calc(100dvh - 110px);
}
.viewer::backdrop { background: rgba(242, 243, 244, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.viewer[open] { display: grid; grid-template-rows: auto 1fr; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; } }

.viewer__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px var(--gutter);
  color: var(--muted);
  font-size: var(--fs-small);
}
.viewer__close {
  font: 500 var(--fs-small) var(--font);
  padding: 0.55em 1.1em;
  border-radius: 999px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.viewer__stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0 clamp(16px, 7vw, 96px) 24px;
}
.viewer__stage > * { animation: settle .45s var(--ease); }
@keyframes settle { from { opacity: 0; transform: scale(.985); } }

.viewer__stage img {
  max-width: 100%;
  max-height: var(--stage-h);
  border-radius: var(--radius-media);
  object-fit: contain;
}
/* Videos keep their own shape (set from the item) before the file loads */
.viewer__stage video {
  height: var(--stage-h);
  max-width: 100%;
  width: auto;
  border-radius: var(--radius-media);
  background: #000;
}
.viewer__stage video.is-wide { width: min(100%, var(--stage-h) * 16 / 9); height: auto; }
.viewer__stage iframe {
  width: min(100%, 860px);
  height: var(--stage-h);
  border: 0;
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .4);
}

.viewer__stage iframe.is-youtube {
  width: min(100%, var(--stage-h) * 16 / 9);
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-media);
  background: #000;
  box-shadow: none;
}

.viewer__nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: 400 1.75rem/1 var(--font);
  padding-bottom: 4px;
  cursor: pointer;
  transition: border-color .25s var(--ease);
}
.viewer__nav:hover { border-color: var(--ink); }
.viewer__nav--prev { left: clamp(8px, 2vw, 28px); }
.viewer__nav--next { right: clamp(8px, 2vw, 28px); }
.viewer__nav[hidden] { display: none; }

/* ---------- Reveal (one gentle settle per image) ---------- */

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .9s var(--ease), transform 1s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

.js .about { animation: arrive .9s var(--ease) both; }
@keyframes arrive { from { opacity: 0; } }

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

@media (max-width: 980px) {
  :root { --nav-h: 68px; }
  .nav { padding: 0 20px; }
  .nav__toggle {
    display: grid;
    gap: 6px;
    padding: 8px 4px;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .nav__toggle span { display: block; width: 26px; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease), opacity .3s; }
  .nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

  .nav__links {
    position: absolute;
    top: calc(100% + 8px); left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 20px;
    background: var(--mist);
    border-radius: var(--radius-card);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
  }
  .nav__links.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__links a { padding: 12px 0; font-size: 1.125rem; }
  .nav__links a::after { display: none; }

}

@media (max-width: 520px) {
  .about__head { gap: 1.1rem; }
  .avatar { width: 96px; height: 96px; font-size: 1.2rem; }
  .about__name { font-size: 1.5rem; }
  .nav__name { font-size: 1.25rem; }
  .gallery__group, .gallery__grid { gap: 6px; }
  .gallery__split { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
  .gallery__split > .gallery__label:first-child { grid-column: 1 / -1; order: 0; }
  .gallery__split > .gallery__tile { order: 1; }
  .gallery__split > .gallery__label:nth-child(2) { grid-column: 1 / -1; order: 2; margin-top: 18px; }
  .gallery__split > .teaser { grid-column: 1 / -1; order: 3; width: 55%; }
  .gallery__split--tall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery__split--tall > .gallery__label:first-child,
  .gallery__split--tall > .gallery__label:nth-child(2) { grid-row: auto; }
  .gallery__split--tall > .teaser { grid-row: auto; }
  .gallery__split--tall .teaser button { height: auto; aspect-ratio: 9 / 16; }
  .gallery__tile { border-radius: 6px; }
  .gallery__tile .play { left: 6px; bottom: 6px; font-size: 0.75rem; padding: 0.4em 0.7em; }
  .viewer { --stage-h: calc(100dvh - 170px); }
  .viewer__stage { padding: 0 8px 76px; }
  .viewer__nav { top: auto; bottom: 18px; translate: none; width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
