/* =====================================================================
   Shir Shaked — styles
   Measurements follow design-reference/layouts-15.11.pdf (1366 px wide).
   Every size is written as  calc(N * var(--u))  where N is the value in
   the design, so the whole page scales with the window like the PDF.
   ===================================================================== */

:root {
  --ink: #212121;
  --bg: #F7F7F7;

  --display: "neue-haas-grotesk-display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text: "narkiss-yair-variable", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* reading text (project descriptions) and small Neue Haas: the Text cut, made for small sizes */
  --body: "neue-haas-grotesk-text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text-weight: 300;      /* Narkiss Yair Light */
  --text-tracking: -.06em; /* Illustrator tracking -60 */

  /* 1 design pixel. Scales with the window width, within limits. */
  --u: clamp(.75px, calc(100vw / 1366), 1.6px);

  --gutter: calc(33 * var(--u));       /* left edge of the big type */
  --marquee-h: calc(39 * var(--u));    /* bottom marquee band */
  --line: max(1.5px, calc(1.5 * var(--u))); /* thickness of the divider lines */
}

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

html, body { margin: 0; }

/* no visible scrollbar, so lines run to the very edge of the screen */
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-weight: var(--text-weight);
  letter-spacing: 0;               /* reading text: tracking 0 */
  font-size: calc(19 * var(--u));
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1.5px dashed var(--ink); outline-offset: 4px; }

/* ---------- Flag label (the little ribbon) ---------- */
.flag {
  --notch: calc(7 * var(--u));
  position: absolute;
  display: inline-block;
  padding: calc(3 * var(--u)) calc(var(--notch) + 5 * var(--u)) calc(2 * var(--u));
  font-size: max(11px, calc(var(--flag-size, 12) * var(--u)));
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--ink);
  pointer-events: none;
  isolation: isolate;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .6, 1);
}
/* outline = ink shape with a background shape 0.8px inside it */
.flag::before, .flag::after {
  content: ""; position: absolute; z-index: -1;
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--notch)) 50%, 100% 100%, 0 100%, var(--notch) 50%);
}
.flag::before { inset: 0; background: var(--ink); }
/* outline thickness (it disappeared at 0.8px); the sides are doubled because the notches are diagonal */
.flag { --flag-line: max(1.4px, calc(1.4 * var(--u))); }
.flag::after  { inset: var(--flag-line) calc(var(--flag-line) * 2); background: var(--bg); }
.has-flag:hover .flag,
.has-flag:focus-visible .flag { opacity: 1; transform: none; }

/* ---------- Header ---------- */
/* menu and marquee keep Narkiss tracking -60 */
.header, .marquee { letter-spacing: var(--text-tracking); }
/* The header stays on screen. Once the page scrolls it gets a background
   and the chair shrinks (.is-compact, set in js/main.js). */
@property --w { syntax: "<length>"; inherits: true; initial-value: 73px; }
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 5;
  height: 0;
}
.header::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  /* plain background, no line, no fade (Shir tried both and didn't like them) */
  height: var(--header-compact);
  background: var(--bg);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.header.is-compact::before { opacity: 1; }
/* line under the compact header: drawn from the centre outwards (scaleX set in js/main.js) */
.header__line {
  display: none;            /* the drawn line (Shir didn't like it); kept in case she wants it back */
  position: absolute;
  left: 0; right: 0;
  top: var(--header-compact);
  height: var(--line);
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: center;
  pointer-events: none;
  will-change: transform;
}
:root { --header-compact: calc(64 * var(--u)); --media-w: 760; --about-w: clamp(320px, 25vw, 520px); }
/* Project images rectangle: 5:3, 760 x 456 at most. On shorter screens it gets smaller
   (same size for every project) so the whole block and its arrows fit above the marquee.
   --peek = extra room kept under the arrows (SITE.look.peek): 0 = the image as big as fits;
   about 130 shows the line and the top of the next title. */
:root {
  --peek: 0;
  --media-h: max(calc(300 * var(--u)),
                 min(calc(var(--media-w) * 3 / 5 * var(--u)),
                     calc(100vh - var(--marquee-h) - (144 + 128 + 37 + 16 + var(--peek)) * var(--u))));
  --media-wpx: calc(var(--media-h) * 5 / 3);
}

.chair-btn {
  --w: calc(73 * var(--u));
  position: absolute;
  left: calc(24 * var(--u)); top: calc(13 * var(--u));
  transition: --w .35s cubic-bezier(.4, 0, .2, 1), top .35s cubic-bezier(.4, 0, .2, 1);
}
.header.is-compact .chair-btn { --w: calc(33 * var(--u)); top: calc(6 * var(--u)); }
.chair {
  display: block;
  width: var(--w);
  height: calc(var(--w) * 240 / 156);
  background: var(--ink);
  -webkit-mask: url(../assets/chair/chair-sprite.png) 0 0 / calc(var(--w) * 57) 100% no-repeat;
          mask: url(../assets/chair/chair-sprite.png) 0 0 / calc(var(--w) * 57) 100% no-repeat;
  animation: chair var(--chair-dur, 3.4s) steps(57) infinite;
}
.chair-btn:hover .chair { animation-duration: .9s; }
@keyframes chair {
  to { -webkit-mask-position: calc(var(--w) * -57) 0; mask-position: calc(var(--w) * -57) 0; }
}


.crumbs {
  position: absolute;
  left: 50%; top: calc(12 * var(--u));
  transform: translateX(-50%);
  white-space: nowrap;
  line-height: calc(24 * var(--u));
}
/* "//  Shir Shaked  >  Books  //": clear space around every sign */
.crumbs { display: flex; align-items: baseline; }
.crumbs .slash { margin: 0 .55em; }
.crumbs .slash:first-child { margin-left: 0; }
.crumbs .slash:last-child  { margin-right: 0; }
.crumbs .name {
  font-family: var(--body);
  font-weight: 400;            /* Roman 55 */
  letter-spacing: 0;
  font-size: calc(var(--crumb-size, 16) * var(--u));
}
.crumbs .slash { font-size: calc(var(--crumb-size, 16) * var(--u)); }

.header-right {
  position: absolute;
  right: calc(35 * var(--u)); top: calc(15 * var(--u));
  display: flex; align-items: center;
  gap: calc(34 * var(--u));          /* extra space before the menu, so the fish doesn't read as a 4th link */
}
.nav {
  display: flex; gap: calc(18 * var(--u));
  line-height: calc(24 * var(--u));
}
/* icon row: colour button + fish (+ star later) */
.icons { display: flex; align-items: center; gap: calc(20 * var(--u)); }
.colour-btn { position: relative; display: block; width: calc(22 * var(--u)); height: calc(22 * var(--u)); }
.colour-btn svg { display: block; width: 100%; height: 100%; overflow: visible; transition: transform .45s cubic-bezier(.3, 1.6, .6, 1); }
.colour-btn .cb-bg { fill: var(--bg); }
.colour-btn .cb-ink { fill: var(--ink); }
.colour-btn .cb-ring { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.colour-btn:hover svg { transform: rotate(180deg); }
.colour-btn .flag { left: 50%; top: calc(32 * var(--u)); transform: translate(-50%, -4px); }
.colour-btn:hover .flag, .colour-btn:focus-visible .flag { transform: translate(-50%, 0); }

/* menu as a stack, one word under another (look.menu = "stack"); icons sit level with the first word */
[data-menu="stack"] { --header-compact: calc(84 * var(--u)); }
[data-menu="stack"] .header-right { align-items: flex-start; }
[data-menu="stack"] .nav { flex-direction: column; gap: 0; line-height: calc(20 * var(--u)); }
[data-menu="stack"] .nav a, [data-menu="stack"] .nav button { align-self: flex-start; text-align: left; }
[data-menu="stack"] #aboutOpen { margin-left: 0; order: -1; }   /* stacked: About me first (Shir) */
[data-menu="stack"] .icons { margin-top: calc(-1 * var(--u)); }

/* the star in the icon row (look.starPlace = "icons"); the corner star hides then */
.star-icon { position: relative; display: none; width: calc(21 * var(--u)); height: calc(22.5 * var(--u)); }
.star-icon svg { display: block; width: 100%; height: 100%; fill: var(--ink); overflow: visible; transition: transform .35s cubic-bezier(.3, 1.6, .6, 1); }
.star-icon:hover svg { transform: scale(1.15) rotate(8deg); }
.star-icon .flag { left: 50%; top: calc(32 * var(--u)); transform: translate(-50%, -4px); }
.star-icon:hover .flag, .star-icon:focus-visible .flag { transform: translate(-50%, 0); }
[data-star="icons"] .star-icon { display: block; }
[data-star="icons"] .star { display: none; }

/* optical correction: the open top-left of the "A" makes the gap before "About me" look bigger */
#aboutOpen { margin-left: calc(-1.5 * var(--u)); }
.nav a, .nav button { position: relative; }
.nav a::after, .nav button::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 1px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s;
}
.nav a:hover::after, .nav button:hover::after { transform: scaleX(1); }
/* the letter roll replaces the underline (js/main.js, initRoll) */
.nav a::after, .nav button::after { display: none; }

/* ---------- Menu / breadcrumb hover (js/main.js, initRoll) ----------
   » slides in left of the word, and the letters roll: each one leaves upward while a copy
   rises into its place, one after another, left to right. Quick but soft (ease-in-out,
   short travel), and each letter's window is cropped tight to the letter, so nothing is
   seen arriving or leaving outside the word. Tune: --roll-* below. */
:root {
  --roll-dur: .38s;        /* one letter's move */
  --roll-step: 18ms;       /* delay between letters */
  /* each letter's window is cropped to the font's ink (--roll-top / --roll-bottom, measured in js/main.js) */
}
.roll { position: relative; display: inline-block; white-space: pre; }
/* at rest: the plain word. While rolling: the letters (laid exactly over it) */
.roll__letters { position: absolute; left: 0; top: 0; display: inline-flex; visibility: hidden; }
.roll.is-live .roll__letters { visibility: visible; }
.roll.is-live .roll__plain { visibility: hidden; }
.rl {
  position: relative;
  display: inline-block;
  width: var(--lw, auto);
  clip-path: inset(var(--roll-top, 0px) 0 var(--roll-bottom, 0px) 0);
}
.rl__a, .rl__b {
  display: block;
  transition: transform var(--roll-dur) cubic-bezier(.45, .05, .25, 1);
  transition-delay: calc(var(--i, 0) * var(--roll-step));
}
.rl__b { position: absolute; left: 0; top: 0; transform: translateY(100%); }   /* one line down */
.roll.is-on .rl__a { transform: translateY(-100%); }
.roll.is-on .rl__b { transform: none; }
.roll__arrow {
  position: absolute;
  right: 100%;
  margin-right: .3em;
  opacity: 0;
  transform: translateX(-.5em);
  transition: opacity .25s, transform .35s cubic-bezier(.3, 1.6, .6, 1);
  pointer-events: none;
}
.roll.is-on .roll__arrow { opacity: 1; transform: none; }
.crumbs .roll__arrow, .rw .roll__arrow { display: none; }   /* no room by the //; more info / close have their own » « */
@media (prefers-reduced-motion: reduce) { .rl__a, .rl__b, .roll__arrow { transition: none; } }

.eye {
  position: relative;
  display: block;
  width: calc(51 * var(--u)); height: calc(23 * var(--u));
}
.eye svg { display: block; width: 100%; height: 100%; fill: var(--ink); overflow: visible; }
.eye .pupil { transition: transform .08s linear; }
.eye .flag { left: 50%; top: calc(30 * var(--u)); transform: translate(-50%, -4px); }
.eye:hover .flag, .eye:focus-visible .flag { transform: translate(-50%, 0); }

/* ---------- Home: category list ---------- */
.categories {
  --top: calc(205 * var(--u));   /* space between the header and the first line */
  --row: calc(115.75 * var(--u));
  padding-top: var(--top);
  padding-bottom: calc(var(--marquee-h) + 40 * var(--u));
}
.cat {
  display: flex;
  align-items: baseline;
  height: var(--row);
  padding-left: var(--gutter);
  padding-top: var(--line);         /* the line itself is drawn by ::before, under the picture trail */
  position: relative;
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(99 * var(--u));
  line-height: var(--row);
  letter-spacing: -.01em;
  overflow: hidden;
}
.cat:last-child { padding-bottom: var(--line); }
/* the lines between categories: their own layer, so the picture trail (js/preview.js) can pass
   over them while the names stay on top */
.cat::before, .cat:last-child::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: var(--line);
  background: var(--ink);
  z-index: 0;
}
.cat:last-child::after { top: auto; bottom: 0; }
.cat__inner { position: relative; z-index: 2; }
.cat__arrow {
  font-family: var(--text);
  font-size: .287em;
  margin-left: .6em;
  position: relative; top: -.75em;
  transition: transform .3s cubic-bezier(.3, 1.6, .6, 1);
}
.cat:hover .cat__arrow, .cat:focus-visible .cat__arrow { transform: translateX(.4em); }

/* ---------- Category hover: a trail of the work inside (js/preview.js) ----------
   Square crops pop out at the pointer and overlap into a tail; each one is cut away after a
   moment. They lean the way the pointer moves and land straight with a bounce. They pass over
   the lines between categories but under the names, and stop at an invisible wall at the end
   of the name: a picture that hits it squashes against it, like the About "hit the wall". */
.trail { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.trail__pic {
  position: absolute;
  background: center / cover no-repeat;
  transform: translate(-50%, -50%);
  animation: trail-in .38s cubic-bezier(.3, 1.7, .5, 1) both;
}
.trail__pic.is-hit { animation: trail-in .38s cubic-bezier(.3, 1.7, .5, 1) both, trail-hit .3s cubic-bezier(.3, 1.6, .6, 1) both; }
@keyframes trail-in {
  from { transform: translate(-50%, -50%) rotate(var(--r0, 0deg)) scale(.35); }
  to   { transform: translate(-50%, -50%); }
}
/* squash against the wall (its left edge stays on the wall) */
@keyframes trail-hit {
  from { scale: .72 1.12; transform-origin: 0 50%; }
  to   { scale: 1 1;      transform-origin: 0 50%; }
}

/* ---------- Star ---------- */
.star {
  position: fixed;
  right: calc(20 * var(--u));
  bottom: calc(var(--marquee-h) + 13 * var(--u));
  width: calc(73 * var(--star, 1) * var(--u)); height: calc(78 * var(--star, 1) * var(--u));
  z-index: 4;
  transition: transform .35s cubic-bezier(.3, 1.6, .6, 1);
}
.star svg { display: block; width: 100%; height: 100%; fill: var(--ink); }
.star:hover { transform: scale(1.12) rotate(8deg); }

/* ---------- Marquee ---------- */
.marquee {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--marquee-h);
  border-top: var(--line) solid var(--ink);
  background: var(--bg);
  overflow: hidden;
  z-index: 3;
  font-size: calc(24.92 * var(--u));
  line-height: calc(var(--marquee-h) - 3px);
  white-space: nowrap;
}
.marquee__track {
  display: inline-flex;
  animation: marquee var(--marquee-dur, 30s) linear infinite;
}
.marquee:hover .marquee__track,
.marquee:focus-visible .marquee__track { animation-play-state: paused; }
.marquee__item { display: inline-flex; align-items: center; padding-left: calc(9 * var(--u)); }
.marquee__item::after {
  content: ""; width: calc(5.2 * var(--u)); height: calc(5.2 * var(--u)); border-radius: 50%;
  background: currentColor; margin-left: calc(9 * var(--u)); margin-top: calc(3 * var(--u));
}
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee .flag {
  position: fixed;
  left: 0; top: 0;
  transform: translate(-50%, -6px);
}
.marquee:hover .flag { transform: translate(-50%, 0); }

/* ---------- About panel ---------- */
.dim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .35);
  opacity: 0; pointer-events: none;
  transition: opacity .35s;
  z-index: 20;
}
.about {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--about-w);
  padding: calc(40 * var(--u)) calc(34 * var(--u));
  background: var(--ink);
  color: var(--bg);
  font-size: max(16px, calc(18 * var(--u)));
  line-height: 1.45;
  letter-spacing: 0;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .45s cubic-bezier(.7, 0, .2, 1);
  z-index: 21;
}
.about-open .about { transform: none; }
.about-open .dim { opacity: 1; pointer-events: auto; }
.about__close { display: block; white-space: pre; }
.about__close .arr { display: inline-block; transition: transform .3s cubic-bezier(.3, 1.6, .6, 1); }
.about__close:hover .arr, .about__close:focus-visible .arr { transform: translateX(.35em); }
.about__body { margin-top: calc(70 * var(--u)); }
.about__body p { margin: 0; }
.about__contact { margin-top: 1.45em; }
.about__contact a { display: block; width: fit-content; }
.about__contact a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Intro ---------- */
.intro { display: none; }
.has-intro body { overflow: hidden; }
.has-intro .intro {
  display: flex;
  position: fixed; inset: 0;
  z-index: 100;
  align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity .4s ease;
  cursor: pointer;
}
.intro__video {
  width: min(560px, 80vw);
  height: auto;
  mix-blend-mode: multiply; /* the video's white becomes the page grey */
}
.intro.is-done { opacity: 0; pointer-events: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .chair, .marquee__track { animation: none !important; }
  * { transition-duration: .01ms !important; }
}

/* ---------- Custom cursor (js/cursor.js) ---------- */
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor-arrow, .cursor-trail {
  position: fixed; left: 0; top: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  will-change: transform;
}
.cursor-visible .cursor-arrow, .cursor-visible .cursor-trail { opacity: 1; }
.cursor-arrow { width: var(--arrow-w, 24px); height: calc(var(--arrow-w, 24px) * 40 / 41); margin: -0.4px 0 0 -0.8px; }
.cursor-arrow svg { display: block; width: 100%; height: 100%; fill: var(--ink); }
/* over the right half of a gallery image: the arrow is mirrored to point forward (tip stays on the pointer) */
.cursor-next .cursor-arrow svg { transform: translateX(-100%) scaleX(-1); }
.cursor-trail {
  width: var(--size, 10px); height: var(--size, 10px);
  margin: calc(var(--size, 10px) / -2) 0 0 calc(var(--size, 10px) / -2);
}
.cursor-blob { width: 100%; height: 100%; border-radius: 50%; background: var(--ink); }
.cursor-blob.is-cube { border-radius: 0; }
/* inside the dark About panel the cursor turns light */
.about:hover ~ .cursor-arrow svg { fill: var(--bg); }
.about:hover ~ .cursor-trail .cursor-blob { background: var(--bg); }

/* ---------- Cursor tuning panel (?tune) ---------- */
.tune {
  position: fixed; right: 16px; bottom: calc(var(--marquee-h) + 16px);
  z-index: 999;
  width: 270px;
  padding: 14px 16px 12px;
  background: var(--bg);
  border: 1.5px solid var(--ink);
  font-size: 14px;
  letter-spacing: 0;
  font-weight: 400;
}
.tune__title { font-weight: 600; margin-bottom: 8px; }
.tune__row { display: grid; grid-template-columns: 82px 1fr 34px; align-items: center; gap: 8px; margin: 6px 0; }
.tune__row output { text-align: right; font-variant-numeric: tabular-nums; }
.tune input[type=range] { width: 100%; accent-color: var(--ink); }
.tune__shape { display: flex; gap: 6px; }
.tune button { border: 1px solid var(--ink); padding: 2px 10px; }
.tune button.is-on { background: var(--ink); color: var(--bg); }
.tune__reset { margin-top: 6px; }
.cursor-blob { transition: box-shadow .15s; }
.cursor-blob.is-outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.about:hover ~ .cursor-trail .cursor-blob.is-outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bg); }
.tune__sub { margin: 10px 0 6px; }
.tune__modes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.tune__modes button { padding: 2px 8px; }
.tune__title--2 { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--ink); }
.tune__row { grid-template-columns: 100px 1fr 34px; }
.tune__hint { opacity: .6; font-size: 12px; margin: 2px 0 6px; }
.tune { width: 290px; max-height: calc(100vh - var(--marquee-h) - 32px); overflow-y: auto; }

/* =====================================================================
   Category page: project blocks (PDF page 2, "Mother")
   ===================================================================== */
.projects {
  padding-top: calc(144 * var(--u));
  padding-bottom: calc(var(--marquee-h) + 120 * var(--u));
}
.project {
  display: grid;
  /* images column: 760 (the PDF has 671); a bit less empty space on the right */
  grid-template-columns: calc(377 * var(--u)) var(--media-wpx);
  padding-left: calc(48 * var(--u));
  scroll-margin-top: calc(var(--header-compact) + 24 * var(--u));
}
/* divider between projects: full width, same thickness as the home page lines */
.project + .project {
  margin-top: calc(36 * var(--u));
  padding-top: calc(44 * var(--u));
  border-top: var(--line) solid var(--ink);
}
.project p { margin: 0; }

/* left column: title, texts, more info */
.project__side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: start;
  min-height: calc(128 * var(--u) + var(--media-h));   /* bottom of the images area */
  padding-right: calc(40 * var(--u));
  line-height: calc(23 * var(--u));
}
.project__title {
  white-space: nowrap;
  margin: 0 0 0 calc(-6 * var(--u));
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(99 * var(--u));
  line-height: calc(114 * var(--u));
  letter-spacing: -.01em;
}
.project__short { margin-top: calc(10 * var(--u)) !important; max-width: calc(290 * var(--u)); }
/* gap of exactly two text lines, so the left column stays on the same line grid as the long text */
.project__credits { margin-top: calc(var(--body-lead, 22.5) * 2 * var(--u)) !important; }
/* "more info" sits right under the short text (one empty line), on the same line grid */
.project__deeper {
  margin-top: calc(var(--body-lead, 22.5) * var(--u));
  line-height: calc(var(--body-lead, 22.5) * var(--u));
  white-space: pre;
}
.project__deeper .arr {
  display: inline-block;
  transition: transform .3s cubic-bezier(.3, 1.6, .6, 1);
}
.project__deeper:hover .arr, .project__deeper:focus-visible .arr { transform: translateX(.35em); }
/* "[ « close ]": the reverse of "more info »", so its « nudges left */
.lightbox__close .arr { display: inline-block; transition: transform .3s cubic-bezier(.3, 1.6, .6, 1); }
.project__deeper:hover .arr--back, .project__deeper:focus-visible .arr--back,
.lightbox__close:hover .arr--back, .lightbox__close:focus-visible .arr--back { transform: translateX(-.35em); }

/* right column: tags, year, images */
.project__meta {
  min-height: calc(46 * var(--u));   /* keeps the images at the same height even with no tags */
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: calc(40 * var(--u));
  margin-top: calc(41 * var(--u));
  line-height: calc(23 * var(--u));
}
.project__tags { max-width: calc(290 * var(--u)); word-spacing: -.25em; }
.project__tags .tag { white-space: nowrap; word-spacing: normal; }
.project__tags .slash { white-space: pre; }
.project__year { font-weight: 400; letter-spacing: 0; }

.project__media {
  position: relative;
  height: var(--media-h);   /* 5:3, see --media-h */
  margin-top: calc(41 * var(--u));
}
.slide { position: absolute; inset: 0; visibility: hidden; }
.slide.is-on { visibility: visible; }
.slide img, .slide video {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;          /* same rectangle for every project: images fill it */
  object-position: center;
}

.project__media { cursor: zoom-in; }
.project__media:focus-visible { outline: var(--line) solid var(--ink); outline-offset: 4px; }

/* arrows + counter under the images (Narkiss, like the tags) */
.gallery-nav {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: calc(14 * var(--u));
  margin-top: calc(14 * var(--u));
  line-height: calc(23 * var(--u));
  font-variant-numeric: tabular-nums;
}
/* < > on the image (Narkiss). They show while the pointer is over the image (always on touch).
   Drawn in "difference" so they read on light and dark photos alike. */
.gallery-arrow {
  position: absolute;
  z-index: 1;
  top: 50%;
  transform: translateY(-50%);
  padding: calc(18 * var(--u)) calc(16 * var(--u));
  font-size: calc(30 * var(--u));
  line-height: 1;
  color: #fff;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity .2s;
}
.gallery-arrow--prev { left: 0; }
.gallery-arrow--next { right: 0; }
.project__media:hover .gallery-arrow, .gallery-arrow:focus-visible { opacity: 1; }
.gallery-arrow:hover { opacity: .6 !important; }
@media (hover: none) { .gallery-arrow { opacity: 1; } }
[data-gnav="brackets"] .gallery-arrow { display: none; }

/* ---------- image indicator options (SITE.look.galleryNav, on ?tune) ---------- */
.gallery-bars, .gallery-dots, .gallery-mini { display: none; }
[data-gnav="bars"] .gallery-nav, [data-gnav="dots"] .gallery-nav, [data-gnav="count"] .gallery-nav { display: none; }

/* "bars": one thin line per image along the top edge, like stories; the current one fills while it plays */
[data-gnav="bars"] .gallery-bars {
  display: flex;
  gap: calc(5 * var(--u));
  position: absolute;
  left: 0; right: 0;
  bottom: 100%;
  margin-bottom: calc(6 * var(--u));
}
.gallery-bars button {
  flex: 1;
  height: calc(16 * var(--u));      /* easy to hit; the line itself is thin */
  position: relative;
  padding: 0;
}
.gallery-bars button::before, .gallery-bars button::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--line);
  background: var(--ink);
}
.gallery-bars button::before { opacity: .22; }
.gallery-bars button::after { right: 100%; }
.gallery-bars button.is-past::after, .gallery-bars button.is-on::after { right: 0; }
.gallery-bars.is-run button.is-on::after { animation: bar-fill var(--fill-dur, 4s) linear both; }
@keyframes bar-fill { from { right: 100%; } to { right: 0; } }
.gallery-bars button:hover::before { opacity: .5; }

/* "dots": small circles under the image, centred */
[data-gnav="dots"] .gallery-dots {
  display: flex;
  justify-content: center;
  gap: calc(9 * var(--u));
  margin-top: calc(16 * var(--u));
}
.gallery-dots button {
  width: calc(7 * var(--u)); height: calc(7 * var(--u));
  padding: 0;
  border-radius: 50%;
  background: var(--ink);
  opacity: .22;
}
.gallery-dots button.is-on { opacity: 1; }
.gallery-dots button:hover { opacity: .55; }

/* "count": just 3/13 in the top line, next to the year */
[data-gnav="count"] .gallery-mini {
  display: block;
  margin-left: auto;
  margin-right: calc(-16 * var(--u));
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.gallery-nav button, .lightbox__bar button { white-space: pre; }
.gallery-nav button:hover, .lightbox__bar button:hover { opacity: .55; }

/* "more info": the long text under the images */
/* the long text opens ABOVE the images and pushes them down (smoothly).
   Its first line lines up with the short text on the left:
   short starts 124 below the project top (title 114 + 10); meta ends at 41 + 46 = 87 → 37 */
.project__more {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .5s cubic-bezier(.3, .7, .2, 1);
}
.project.is-open .project__more { grid-template-rows: 1fr; }
.project__more-in { min-height: 0; overflow: hidden; }
.project__long {
  max-width: calc(560 * var(--u));
  padding-top: calc(37 * var(--u));
  opacity: 0;
  transition: opacity .3s;
}
.project.is-open .project__long { opacity: 1; transition: opacity .4s .15s; }
@media (prefers-reduced-motion: reduce) {
  .project__more, .project__long { transition: none !important; }
}

/* ---------- where "more info" opens (SITE.look.moreInfo, on ?tune) ---------- */
.project__more--side { display: none; }

/* "inside": the text takes the images' place, in the same rectangle; nothing else moves */
.project__main { position: relative; }
[data-more="inside"] .project__main > .project__more {
  display: block;
  position: absolute;
  z-index: 2;
  left: 0; right: 0;
  top: calc(128 * var(--u));         /* where the images start (41 + 46 + 41) */
  height: var(--media-h);
  background: var(--bg);
  visibility: hidden;
  transition: none;
}
[data-more="inside"] .project.is-open .project__main > .project__more { visibility: visible; }
[data-more="inside"] .project__main > .project__more .project__more-in { overflow: visible; }
[data-more="inside"] .project__main > .project__more .project__long {
  padding-top: 0;
  margin-top: calc(-4 * var(--u));   /* first line's cap height sits on the image's top edge */
  opacity: 1;
  transition: none;
}
[data-more="inside"] .project.is-open .gallery-bars,
[data-more="inside"] .project.is-open .gallery-nav,
[data-more="inside"] .project.is-open .gallery-dots { visibility: hidden; }

/* "left": the text opens under the short text, in the left column, and pushes "Guided by" down */
[data-more="left"] .project__main > .project__more { display: none; }
[data-more="left"] .project__more--side { display: grid; }
/* the button sits under the text, so "[ close ]" comes after what it closes */
[data-more="left"] .project__more--side { order: 1; }
[data-more="left"] .project__deeper { order: 2; }
[data-more="left"] .project__credits { order: 3; }
[data-more="left"] .project__more--side .project__long {
  padding-top: calc(var(--body-lead, 22.5) * var(--u));
  max-width: none;
}

/* project descriptions in Neue Haas Grotesk; labels (tags, year, go deeper) stay Narkiss */
.project__short, .project__credits, .project__long {
  font-family: var(--body);
  font-weight: 400;
  font-size: calc(var(--body-size, 19) * var(--u));
  letter-spacing: calc(var(--body-track, 0) * .001em);       /* Illustrator tracking units */
  line-height: calc(var(--body-lead, 24) * var(--u)) !important;
}

/* labels inside the reading text ("Guided by:") are Narkiss, like the tags */
.project__label {
  font-family: var(--text);
  font-weight: var(--text-weight);
  font-size: calc(19 * var(--u));
  letter-spacing: 0;
}

/* ---------- full screen viewer ---------- */
.lightbox {
  position: fixed; inset: 0;
  z-index: 60;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--ink);
}
.lightbox[hidden] { display: none; }
.lightbox:focus { outline: none; }
.lightbox-open { overflow: hidden; }
.lightbox__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  padding: calc(28 * var(--u)) calc(48 * var(--u));
  line-height: calc(23 * var(--u));
  font-variant-numeric: tabular-nums;
}
.lightbox__nav { display: flex; gap: calc(14 * var(--u)); }
/* with the small count (look.galleryNav not "brackets"): only "5/13" in bold; browse by clicking
   the image's left/right half or with the arrow keys */
:root:not([data-gnav="brackets"]) .lightbox__prev,
:root:not([data-gnav="brackets"]) .lightbox__next { display: none; }
:root:not([data-gnav="brackets"]) .lightbox__count { font-weight: 600; font-variant-numeric: tabular-nums; }
.lightbox__close { justify-self: end; }
.lightbox__stage {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 calc(48 * var(--u)) calc(40 * var(--u));
}
.lightbox__stage img, .lightbox__stage video {
  display: block;
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  cursor: pointer;
}

/* all images (in the full-screen viewer): two columns of big 5:3 tiles you scroll through.
   Way in: click the count (it rolls on hover, like the menu); hover: the tile grows a little and the
   others dim, like the Motion Design page. */
.lightbox__count { cursor: pointer; }
.lightbox__count .roll__arrow { display: none; }
.lightbox__title { justify-self: start; }
.lightbox__title .roll__arrow { display: none; }
.lightbox.is-grid .lightbox__prev, .lightbox.is-grid .lightbox__next { visibility: hidden; }
.lightbox__grid {
  flex: 1; min-height: 0;
  display: grid;
  justify-content: center;
  align-content: start;
  gap: calc(14 * var(--u));
  padding: 0 calc(48 * var(--u)) calc(40 * var(--u));
  overflow-y: auto;
  scrollbar-width: none;
  position: relative;
}
.lightbox__grid::-webkit-scrollbar { display: none; }
.lightbox__grid[hidden] { display: none; }
.lightbox__stage[hidden] { display: none; }
.lightbox__tile {
  display: block;
  aspect-ratio: 5 / 3;
  padding: 0;
  transition: transform .3s cubic-bezier(.3, 1.6, .6, 1), opacity .3s;
}
.lightbox__tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lightbox__tile:hover, .lightbox__tile:focus-visible { transform: scale(1.015); position: relative; z-index: 1; }   /* big tiles: just a hint */
@media (prefers-reduced-motion: reduce) { .lightbox__tile { transition: opacity .25s; } }

/* year: optional // marks like the breadcrumb (SITE.look.yearStyle) */
.yr-slash { display: none; font-weight: var(--text-weight); }
.yr-before { margin-right: .55em; }
.yr-after  { margin-left: .55em; }
[data-year="before"] .yr-before,
[data-year="both"] .yr-slash { display: inline; }

/* tuning panel: drag bar + hide */
.tune__bar {
  display: flex; justify-content: space-between; align-items: center;
  margin: -6px -4px 8px; padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
}
.tune__grip { cursor: move; user-select: none; font-weight: 600; touch-action: none; }
.tune.is-collapsed { width: auto; padding: 8px 12px; }
.tune.is-collapsed > :not(.tune__bar) { display: none; }
.tune.is-collapsed .tune__bar { margin: 0; padding: 0; border: 0; gap: 14px; }

/* =====================================================================
   About opens on the HOME page: no dimming; the page gets squeezed
   into the space left of the panel. Letters close up until they touch
   and get narrower (scaleX, like Horizontal Scale in Illustrator).
   Moves on the cube's spring (var(--spring), set in js/main.js).
   ===================================================================== */
:root {
  --squeeze-x: .62;          /* how narrow the letters get (1 = normal) */
  --squeeze-track: -.075em;  /* tracking when squeezed: letters touch */
}
.page-home .dim, .page-category .dim { display: none; }

/* letter by letter: every letter (.ch, built in js/main.js) narrows and closes up,
   the one nearest the panel first (--i = position from the right), ~14 ms apart */
:root { --letter-step: 14ms; }
.page-home .cat__inner { display: inline-flex; align-items: baseline; }
.page-home .ch {
  display: inline-block;
  width: var(--lw, auto);
  white-space: pre;
  transform-origin: left 70%;
  /* closing mirrors opening: same order, same acceleration, all land together */
  transition: transform var(--hit-dur) var(--hit-ease),
              margin-right var(--hit-dur) var(--hit-ease);
  transition-duration: calc(var(--hit-dur) - var(--i, 0) * var(--letter-step));
  transition-delay: calc(var(--row-d, 0ms) + var(--i, 0) * var(--letter-step));
}
.page-home.about-open .ch {
  transform: scale(var(--squeeze-x), var(--bulge, 1));
  margin-right: calc(var(--lw, 0px) * (var(--squeeze-x) - 1) + var(--squeeze-track));
}
/* option: squeezed letters get taller, like a squashed cartoon */
[data-squeeze-bulge] { --bulge: calc(1 + (1 - var(--squeeze-x)) * .25); }
/* option: rows squeeze one after another (a wave from the top) */
[data-squeeze-wave] .page-home .cat:nth-child(2) { --row-d: 45ms; }
[data-squeeze-wave] .page-home .cat:nth-child(3) { --row-d: 90ms; }
[data-squeeze-wave] .page-home .cat:nth-child(4) { --row-d: 135ms; }
[data-squeeze-wave] .page-home .cat:nth-child(5) { --row-d: 180ms; }

/* header and star make room for the panel */
:is(.page-home, .page-category) :is(.crumbs, .header-right, .star) {
  transition: transform var(--hit-dur) var(--hit-ease), translate var(--hit-dur) var(--hit-ease);
}
/* the panel also leaves with the same motion */
.about { transition: transform var(--hit-dur) var(--hit-ease); }
/* header option "squeeze": moves left and narrows */
[data-squeeze-header="squeeze"] :is(.page-home, .page-category).about-open .crumbs { transform: translateX(calc(-50% - var(--about-w) / 2)) scaleX(var(--squeeze-x)); }
[data-squeeze-header="squeeze"] :is(.page-home, .page-category).about-open .header-right { transform-origin: right center; transform: translateX(calc(-1 * var(--about-w))) scaleX(var(--squeeze-x)); }
/* header option "shift": only moves left */
[data-squeeze-header="shift"] :is(.page-home, .page-category).about-open .crumbs { transform: translateX(calc(-50% - var(--about-w) / 2)); }
[data-squeeze-header="shift"] :is(.page-home, .page-category).about-open .header-right { transform: translateX(calc(-1 * var(--about-w))); }
/* header option "stay": nothing moves (the panel covers the right side of the header) */
:is(.page-home, .page-category).about-open .star   { translate: calc(-1 * var(--about-w)) 0; }
@media (prefers-reduced-motion: reduce) {
  .page-home .ch, .crumbs, .header-right, .star, .projects { transition: none !important; }
}

/* About opening on the home page: speeds up and stops dead at full speed,
   like a ball hitting a wall. The panel (the "wall") arrives at the same moment.
   Closing uses the same motion (Shir: consistent language). */
:root { --hit-ease: cubic-bezier(.5, 0, .9, .6); --hit-dur: .42s; }
.about-open .about { transition: transform var(--hit-dur) var(--hit-ease); }
.page-home.about-open .ch {
  /* letters start one after another but all hit the wall at the same moment:
     a letter that starts later moves faster (shorter duration) */
  transition-duration: calc(var(--hit-dur) - var(--i, 0) * var(--letter-step));   /* total stays --hit-dur, as before */
  transition-timing-function: var(--hit-ease);
}
:is(.page-home, .page-category).about-open :is(.crumbs, .header-right, .star) {
  transition-duration: var(--hit-dur);
  transition-timing-function: var(--hit-ease);
}

/* About opening on a PROJECT page: the whole page (texts and images) narrows
   into the space left of the panel. --page-s is worked out in js/category.js. */
.page-category .projects {
  transform-origin: 0 0;
  transition: transform var(--hit-dur) var(--hit-ease);
}
.page-category.about-open .projects { transform: scaleX(var(--page-s, .8)); }
/* the titles squeeze letter by letter, like the home categories (same .ch rules).
   The title itself undoes the page squeeze, so its letters end up exactly as narrow as on home. */
.page-category .project__title {
  transform-origin: 0 0;
  transition: transform var(--hit-dur) var(--hit-ease);
}
.page-category.about-open .project__title { transform: scaleX(calc(1 / var(--page-s, .8))); }
.page-category .project__title .ch {
  display: inline-block;
  width: var(--lw, auto);
  white-space: pre;
  transform-origin: left 70%;
  transition: transform var(--hit-dur) var(--hit-ease), margin-right var(--hit-dur) var(--hit-ease);
  transition-duration: calc(var(--hit-dur) - var(--i, 0) * var(--letter-step));
  transition-delay: calc(var(--i, 0) * var(--letter-step));
}
.page-category.about-open .project__title .ch {
  transform: scale(var(--squeeze-x), var(--bulge, 1));
  margin-right: calc(var(--lw, 0px) * (var(--squeeze-x) - 1) + var(--squeeze-track));
}
@media (prefers-reduced-motion: reduce) {
  .page-category .project__title, .page-category .project__title .ch { transition: none !important; }
}
