/* JJ Studios — one stylesheet for every page. */

:root {
  --bg: #fff;
  --ink: #0c0c0c;
  --muted: #8b8b88;
  --green: #12936b;
  --pad: 16px;                           /* page side margin; 5vw on desktop, see below */
  --text-l: clamp(19px, 1.85vw, 28px);   /* nav, footer */
  --text-m: clamp(15px, 1.2vw, 18px);    /* intro, credit */
  --text-s: 12px;                        /* captions, controls */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --move: 720ms;
}

/* Desktop: generous side margins that everything on the page lines up to. */
@media (min-width: 900px) { :root { --pad: 5vw; } }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 var(--pad);
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: var(--text-m);
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
p { margin: 0; }

:focus-visible { outline: 1.5px solid var(--green); outline-offset: 4px; }
::selection { background: var(--green); color: #fff; }

.skip {
  position: absolute; left: var(--pad); top: -60px;
  padding: 8px 12px; background: var(--ink); color: #fff; font-size: 13px; z-index: 10;
}
.skip:focus { top: 8px; }

/* Arrows are drawn in em units (1 unit = 0.01em) so their stroke always
   tracks the type next to them. Geist Regular stems are ≈ 0.084em; a lone
   stroke reads heavier than a letter stem, so arrows are drawn a step lighter. */
.arrow {
  display: inline-block; overflow: visible;
  fill: none; stroke: currentColor; stroke-width: 6.8;
  stroke-linecap: butt; stroke-linejoin: miter;
}
/* ↗ after mixed-case text: sits just above the baseline, centred on the cap height. */
.arrow-out { width: .56em; height: .56em; margin-left: .2em; vertical-align: .075em; }
/* → after capitals: centred on the middle of the cap height. */
.arrow-next { width: .9em; height: .5em; margin-left: .3em; vertical-align: .105em; }

/* ---------- header ---------- */

.site-head {
  display: grid;
  grid-template-columns: 38.2% 1fr;
  align-items: start;
  padding-top: clamp(16px, 1.5vw, 24px);
}

.brand { justify-self: start; }
.brand-name {
  display: block;
  font-family: "Futura 100", "Futura", "Jost", "Century Gothic", sans-serif;
  font-weight: 500;
  font-size: var(--text-l);
  line-height: 1;
  letter-spacing: -.01em;
  color: var(--green);
}
/* Logo hover: a soft focus pull. Letters drift out of focus one after another,
   like a lens racking, and snap back sharp when the pointer leaves. */
.brand-letters span { transition: filter .28s ease-out, opacity .28s ease-out; }
@media (hover: hover) {
  .brand-name:hover .brand-letters span {
    filter: blur(.04em);
    opacity: .86;
    transition: filter .6s var(--ease), opacity .6s var(--ease);
    transition-delay: calc(var(--i) * 28ms);
  }
}

/* The founders' names: a quiet caption under the logo, each one a link. */
.brand-credit {
  margin-top: .6em;
  font-size: clamp(12px, .9vw, 13.5px);
  line-height: 1.2;
  color: var(--muted);
}
.brand-credit a:hover, .brand-credit a:focus-visible {
  color: var(--ink);
  text-decoration: underline; text-decoration-thickness: max(1px, .07em); text-underline-offset: .22em;
}

.site-nav {
  display: grid;
  grid-template-columns: 35% 1fr auto;
  font-size: var(--text-l);
  line-height: 1;
}
.site-nav a { justify-self: start; }
.site-nav > a:last-of-type { justify-self: end; }
.nav-social { display: none; }   /* phone menu only */

/* Hover underline: drawn under the words only (not the arrow), at a weight
   tied to the type, a little lighter than the letter stems, never a hairline. */
.site-nav a:hover, .site-foot a:hover, .all-work a:hover,
.site-nav a:focus-visible, .site-foot a:focus-visible, .all-work a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: .06em;
  text-underline-offset: .2em;
  text-decoration-skip-ink: none;
}

/* Menu button: phones only (see the small-screens block). */
.menu-btn {
  display: none; place-items: center;
  width: 44px; height: 44px; margin: -11px -10px 0 0; padding: 0;
  border: 0; background: none; color: var(--ink); cursor: pointer;
}
.menu-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; }

/* ---------- intro ---------- */

.intro {
  margin-top: clamp(64px, 8.2vw, 128px);
  max-width: 44em;
  line-height: 1.22;
  text-wrap: pretty;
}

/* ---------- work: controls + stage ---------- */

.home-work { margin-top: clamp(44px, 4.6vw, 72px); }

/* The two icons sit right on top of the posters, like a toolbar for them. */
.controls { display: flex; gap: 2px; margin: 0 0 4px -8px; }
.control {
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 0; background: none; cursor: pointer;
  color: var(--ink);
}
.control svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.1;
  stroke-linecap: round; stroke-linejoin: round;
}
.control:hover { color: var(--green); }
.control[aria-pressed="true"] { color: var(--green); }
.control[aria-pressed="true"] svg { fill: currentColor; fill-opacity: .18; }

/* Without JS the stage is a plain grid. */
.stage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  align-items: start;
  gap: 36px 20px;
}

.card { display: block; min-width: 0; }
.card-img { position: relative; display: block; overflow: hidden; background: #f1f1ef; }
.card-img img { display: block; width: 100%; height: auto; }

/* Gallery posters: on hover, home.js cuts through these stacked frames. No fades. */
.card-img .card-frame {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  visibility: hidden;
}
.card-img .card-frame.is-on { visibility: visible; }

/* One line under the poster: only the title shortens, type and year always show in full. */
.card-cap {
  display: flex; margin-top: 8px; height: 16px;
  font-size: var(--text-s); line-height: 16px; white-space: nowrap;
}
.card-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card-meta { flex: none; white-space: pre; color: var(--muted); }
/* Hover speaks the same language as every other link on the page:
   the title gets an instant underline; type and year stay quiet. */
.card:hover .card-title, .card:focus-visible .card-title {
  text-decoration: underline;
  text-decoration-thickness: max(1px, .07em);
  text-underline-offset: .22em;
}

/* JS-driven layout: every card is absolutely placed and animated with transforms. */
.stage.is-live { display: block; position: relative; padding: 0; height: var(--stage-h, auto); }
.stage.is-live .card {
  position: absolute; left: 0; top: 0;
  width: var(--w);
  transform: translate3d(var(--x), var(--y), 0);
  will-change: transform;
}
.stage.is-live .card-img { height: var(--h); }
.stage.is-live .card-img img { height: 100%; object-fit: cover; }

.stage.is-animated { transition: height var(--move) var(--ease); }
.stage.is-animated .card {
  transition: transform var(--move) var(--ease), width var(--move) var(--ease), opacity .6s ease;
  transition-delay: var(--d, 0ms);
}
.stage.is-animated .card-img { transition: height var(--move) var(--ease); transition-delay: var(--d, 0ms); }

.stage.is-intro .card { opacity: 0; }

/* ---------- see all + footer ---------- */

.all-work {
  margin: clamp(72px, 9vw, 136px) 0 clamp(88px, 11vw, 168px);
  text-align: center;
  font-size: clamp(20px, 2vw, 30px);
  letter-spacing: .005em;
  text-transform: uppercase;
}

.site-foot {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  padding-bottom: clamp(28px, 3vw, 48px);
  font-size: var(--text-l);
}
.foot-social { display: flex; gap: clamp(24px, 6vw, 96px); }

/* ---------- small screens ---------- */

/* Phones: the three links live behind a menu button that opens a full-screen list. */
@media (max-width: 760px) {
  .site-head { position: relative; z-index: 20; grid-template-columns: 1fr auto; padding-top: 20px; }
  /* A clear step between the logo and the names: big mark, small caption. */
  .brand-name { font-size: 30px; }
  .brand-credit { margin-top: 7px; font-size: 12.5px; }
  .menu-btn { display: grid; margin-top: -7px; }
  .site-nav {
    display: none;
    position: fixed; inset: 0; z-index: -1;      /* behind the logo and button, above the page */
    flex-direction: column; align-items: flex-start; gap: .5em;
    padding: 132px var(--pad) 40px;
    background: var(--bg);
    font-size: 34px;
    overflow-y: auto;
  }
  .menu-is-open .site-nav { display: flex; }
  /* Social links rest at the bottom of the open menu, a size down from the main links. */
  .nav-social { display: flex; gap: 28px; margin-top: auto; font-size: 19px; }
  .nav-social a { padding: 10px 0; }
  .menu-is-open { overflow: hidden; }
  .menu-is-open .menu-open, .menu-close { display: none; }
  .menu-is-open .menu-close { display: inline; }
}

/* Phones: always the organised grid, no layout buttons. */
@media (max-width: 700px) {
  :root { --pad: 20px; }
  .controls { display: none; }

  /* The intro is the opening statement on a phone: larger, evenly broken lines. */
  .intro { margin-top: 56px; font-size: 21px; line-height: 1.22; letter-spacing: -.01em; }
  .intro span { display: block; text-wrap: balance; }
  .intro br { display: none; }

  /* No rule: the jump from the large intro to the first poster is separation enough. */
  .home-work { margin-top: 44px; }

  /* Captions go on two lines: title, then type and year. */
  .card-cap { display: block; height: auto; font-size: 13px; line-height: 17px; }
  .card-title, .card-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card-sep { display: none; }

  /* Comfortable tap areas for the closing links (44px tall) without moving them. */
  .all-work { margin: 62px 0 76px; }
  .all-work a { display: inline-block; padding: 10px 0; }
  .site-foot { padding-bottom: 18px; }
  .site-foot a { display: inline-block; padding: 10px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; }
}

/* =====================================================================
   Inner pages
   Every inner page hangs off the header's two columns: a narrow left
   column (under the logo) for names and labels, a wide right column
   (under the nav) for content.
   ===================================================================== */

.page { margin-top: clamp(64px, 8.2vw, 128px); }
.split { display: grid; grid-template-columns: 38.2% 1fr; }

:root { --line: #e4e4e1; --text-xl: clamp(34px, 4.3vw, 66px); }

/* The page you are on stays underlined in the nav. */
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: .06em;
  text-underline-offset: .2em;
  text-decoration-skip-ink: none;
}

.page-title, .statement {
  margin: 0;
  font-weight: 400;
  font-size: var(--text-xl);
  line-height: 1.04;
  letter-spacing: -.028em;
  text-wrap: balance;
}
.count {
  font-size: .32em; letter-spacing: 0; color: var(--muted);
  vertical-align: top; position: relative; top: .35em; margin-left: .15em;
  font-variant-numeric: tabular-nums;
}

/* ---------- works ---------- */

.works-top { align-items: end; }
.works-tools { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.works-tools .controls { margin: 0 -8px -8px 0; }
.works-jump { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; padding: 0; list-style: none; }
.works-jump a:hover, .works-jump a:focus-visible, .back:hover, .back:focus-visible,
.fact a:hover, .fact a:focus-visible, .lost-links a:hover {
  text-decoration: underline; text-decoration-thickness: max(1px, .06em); text-underline-offset: .2em;
}
.works-jump .count, .fact-list .count { font-size: .68em; top: .1em; margin-left: .1em; }

.works-group { margin-top: clamp(56px, 6.5vw, 104px); scroll-margin-top: 24px; }
.works-top + .works-group { margin-top: clamp(40px, 4.4vw, 72px); }
.group-name {
  margin: 0; align-self: start; position: sticky; top: 20px;
  padding-top: .42em;                      /* sits on the first row's baseline */
  font-weight: 400; font-size: var(--text-l); line-height: 1.1; letter-spacing: -.01em;
}
.group-name .count { font-size: .46em; top: .2em; }

.work-list { margin: 0; padding: 0; list-style: none; }
.work { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 24px; }
.work-title { text-wrap: pretty; }
.work-meta, .work-date { color: var(--muted); }
.work-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.work:hover .work-title, .work:focus-visible .work-title {
  text-decoration: underline; text-decoration-thickness: max(1px, .07em); text-underline-offset: .22em;
}
.work-img { display: block; overflow: hidden; background: #f1f1ef; }
.work-img img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* List view: a plain index, one line per project. */
.works[data-view="list"] .work { padding: .62em 0; border-top: 1px solid var(--line); }
.works[data-view="list"] .work-list li:last-child .work { border-bottom: 1px solid var(--line); }
.works[data-view="list"] .work-img { display: none; }

/* Grid view: the same index as pictures, captions in the home page's voice. */
.works[data-view="grid"] .work-list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 20px;
}
.works[data-view="grid"] .work { display: block; font-size: var(--text-s); line-height: 16px; }
.works[data-view="grid"] .work-name { display: block; margin-top: 8px; }
.works[data-view="grid"] .work-date { display: block; }
.works[data-view="grid"] .group-name { padding-top: 0; margin-top: -.12em; }

/* The thumbnail that rides the pointer in list view. */
.work-preview {
  position: fixed; left: 0; top: 0; z-index: 30; width: min(21vw, 300px);
  pointer-events: none; overflow: hidden; background: #f1f1ef;
}
.work-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- project ---------- */

.project-head { align-items: start; }
.page-title-sub { display: block; margin-top: .5em; font-size: var(--text-l); letter-spacing: -.01em; line-height: 1.1; color: var(--muted); }
.project-meta { margin-top: 1.1em; color: var(--muted); }
.project-text { max-width: 34em; padding-top: .35em; font-size: var(--text-m); line-height: 1.38; }
.project-text p + p { margin-top: .9em; }
.project-text p:first-child { font-size: var(--text-l); line-height: 1.15; letter-spacing: -.01em; }
.project-text p:first-child:not(:only-child) { margin-bottom: 1em; }

.project-film { margin-top: clamp(40px, 5vw, 80px); background: #0c0c0c; }
.project-film iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Film stills: a contact sheet on a six-column grid. */
.stills { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.still, .piece { margin: 0; overflow: hidden; background: #f1f1ef; }
.still img, .piece img { display: block; width: 100%; height: 100%; object-fit: cover; }
.still.is-third { grid-column: span 2; }
.still.is-half { grid-column: span 3; }
.still.is-wide { grid-column: 1 / -1; }

/* Artwork: one piece at a time, each at its own size and side of the page. */
.pieces { display: flex; flex-direction: column; gap: clamp(48px, 8vw, 132px); margin-top: clamp(48px, 6vw, 96px); }
.piece.is-std { width: 54%; }
.piece.is-wide { width: 74%; }
.piece.is-tall { width: 34%; }
.piece.at-left { align-self: flex-start; }
.piece.at-right { align-self: flex-end; }
.piece.at-mid { align-self: flex-start; margin-left: 19.1%; }
.piece.at-mid-right { align-self: flex-end; margin-right: 12%; }

.project-next {
  align-items: baseline;
  margin: clamp(72px, 9vw, 136px) 0 clamp(88px, 11vw, 168px);
  font-size: var(--text-l);
}
.project-next .back { justify-self: start; color: var(--muted); }
.project-next .back:hover { color: var(--ink); }
.project-next .next { justify-self: start; font-size: var(--text-xl); letter-spacing: -.028em; line-height: 1.04; }
.next-label { display: block; margin-bottom: .5em; font-size: var(--text-m); letter-spacing: 0; line-height: 1.2; color: var(--muted); }
.project-next .next:hover { text-decoration: underline; text-decoration-thickness: .05em; text-underline-offset: .14em; }

/* ---------- about / not found ---------- */

.statement { max-width: 17em; }
.statement a { text-decoration: underline; text-decoration-thickness: .045em; text-underline-offset: .12em; }
.statement a:hover, .statement a:focus-visible { color: var(--green); }

.facts { margin: clamp(64px, 8vw, 128px) 0 clamp(88px, 11vw, 168px); }
.fact { padding: clamp(18px, 1.8vw, 28px) 0 clamp(28px, 3.2vw, 52px); border-top: 1px solid var(--line); align-items: baseline; }
.fact dt { color: var(--muted); }
.fact dd { margin: 0; max-width: 24em; font-size: var(--text-l); line-height: 1.16; letter-spacing: -.01em; }
.fact-note { display: block; max-width: 30em; margin-top: 1em; font-size: var(--text-m); line-height: 1.38; letter-spacing: 0; color: var(--muted); }
.fact-list { margin: 0; padding: 0; list-style: none; }
.fact-list li + li { margin-top: .22em; }

.lost-links { margin: clamp(40px, 5vw, 72px) 0 clamp(120px, 20vw, 320px); font-size: var(--text-l); }

/* ---------- inner pages on small screens ---------- */

@media (max-width: 760px) {
  .page { margin-top: 56px; }
  .split { grid-template-columns: 1fr; }

  .works-tools { margin-top: 28px; }
  .works-jump { gap: 2px 16px; font-size: 14px; }
  .works-jump a { display: inline-block; padding: 5px 0; }
  .works-group { margin-top: 64px; }
  .group-name { position: static; padding: 0; margin: 0 0 18px; font-size: 26px; }
  .works[data-view="grid"] .group-name { margin: 0 0 18px; }
  .works[data-view="list"] .work { padding: .8em 0; gap: 16px; }
  .works[data-view="grid"] .work-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; }
  .works[data-view="grid"] .work { font-size: 13px; line-height: 17px; }
  .work-preview { display: none; }

  .project-text { margin-top: 28px; padding-top: 0; }
  .project-film { margin: 36px calc(var(--pad) * -1) 0; }    /* the film runs edge to edge */
  .stills { gap: 12px; margin-top: 12px; }
  .still.is-third { grid-column: span 3; }
  .still.is-half, .still.is-wide { grid-column: 1 / -1; }
  .pieces { gap: 40px; margin-top: 44px; }
  .piece.is-std, .piece.is-wide { width: 100%; margin: 0; }
  .piece.is-tall { width: 72%; margin: 0; }
  .project-next { margin: 72px 0 88px; row-gap: 40px; }
  .project-next .next { order: -1; }

  .facts { margin: 56px 0 72px; }
  .fact { padding: 16px 0 30px; row-gap: 10px; }
  .fact dd { font-size: 21px; }
  .fact-list li + li { margin-top: .5em; }
}
