@import '../tokens.css?v=a555c920';

/* ── Work index (homepage trial) ───────────────────────────────────────
 * The list that sits beneath the HELLO eye instead of the featured deck.
 * Two columns: a sticky, viewport-tall column on the left carrying the
 * current project's title and the studio's discipline list (every
 * discipline is always printed; the ones this project used are inked,
 * the rest are ghosted), and a column of viewport-tall media rows on
 * the right, one per project. Scrolling the rows past the viewport's
 * midline swaps which title is inked and which disciplines light up —
 * see js/page/home-work-list.js. Under 768px the side column goes and
 * each row becomes a card: media with the title beneath.
 *
 * The eye stays on the peel-stack mechanics from home-featured.css: its
 * plate pins for the slot's dwell while the lid shuts. The seam to the
 * index is "the void" (Greg, 8 Sep 2026: the closed eye should drop into
 * black and the black open onto the first card — 2001, not a curtain):
 *   1. last fifth of the dwell — .void-fade (black, inside the plate)
 *      rises to full over the shut eye;
 *   2. the plate's 100dvh travel — the plate is hidden (.is-void-gone;
 *      it is black anyway) and .void-lids, black and pinned over the
 *      index for exactly that travel, splits on the centre line: two
 *      flat halves pull straight up and straight down, shutter-style
 *      (Greg: a curtain opening top and bottom, not an eye — the lens
 *      version read as an orifice), until the first card fills the
 *      viewport.
 * The index overlaps the plate's travel (margin-top −100dvh) and the
 * first row pins for it (a 2-viewport lead slot with a sticky row), so
 * the card is composed and still while the lids open; then the page is
 * an ordinary document. Progress for both phases is set by
 * js/page/home-work-list.js from the hero slot's geometry — the same
 * basis hero-eye.js uses for the lid — so the three stay in step. */

/* The stack must paint ABOVE the index while the plate travels, and
 * must not swallow pointer events over the index once it has gone. */
.home-list .peel-stack {
  z-index: 1;
  pointer-events: none;
}

.home-list .peel-panel {
  pointer-events: auto;
}

/* Header: the deck kept the chrome transparent so media owned the
 * viewport. Over the index the header sits on the page surface again
 * (initHomeHeroHeader drops .is-over-hero once the eye has gone by). */
.home-list .header:not(.is-over-hero) {
  background: var(--color-surface-page);
}

/* Masthead: on desktop the brand stays put over the list instead of
 * hiding on scroll-down (Greg: "more editorial"). The void driver sets
 * .is-list on the body once the shutters have opened; the site-wide
 * reveal logic still runs, this just overrides its hide. Phones keep
 * the hide/reveal — the cards want the whole screen. */
@media (min-width: 769px) {
  .home-list.is-list .header.is-hidden {
    transform: translateY(0);
  }
}

/* ── The void ───────────────────────────────────────────────────────── */
/* The dark plane (theme-agnostic, like the peel shadow bands): the void
 * is the same black in both themes. */
.void-fade {
  position: absolute;
  inset: 0;
  z-index: 5; /* over the eye stage and its chrome (z 1–2) */
  background: var(--color-plane-dark);
  opacity: 0;
  pointer-events: none;
}

.peel-panel--hero.is-void-gone {
  visibility: hidden;
}

.void-slot {
  position: relative;
  z-index: 2; /* above the sticky side column and rows */
  height: 200dvh;          /* 100 pinned (the plate's travel) + 100 to leave */
  margin-bottom: -200dvh;  /* takes no space: the grid starts where it starts */
  margin-inline: calc(-1 * var(--page-gutter)); /* full bleed, scrollbar-safe */
  pointer-events: none;
}

.void-lids {
  --void-open: 0; /* 0 shut … 1 open, set per frame by the driver */
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: hidden;
  pointer-events: auto; /* eats clicks on the card while it is still covered */
}

/* The two halves. Transforms only, so the split rides the compositor. */
.void-lids::before,
.void-lids::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--color-plane-dark);
}

.void-lids::before {
  top: 0;
  transform: translateY(calc(-100% * var(--void-open)));
}

.void-lids::after {
  bottom: 0;
  transform: translateY(calc(100% * var(--void-open)));
}

.void-lids.is-open {
  visibility: hidden;
}

/* Header ink over the black (the eye's own white-ink flip ends as the lid
 * shuts; this carries it through the void). Gated off the open menu. */
body:not(.menu-open).is-void-dark .header .brand {
  color: var(--color-text-on-image);
}

body:not(.menu-open).is-void-dark .header .menu-icon-bar {
  background: var(--color-text-on-image);
}

/* Menu anchor: one viewport below the index's top (the shutters are open
 * there) plus its own scroll-margin, so the jump lands exactly on the
 * first card, fully revealed. */
.wl-anchor {
  position: absolute;
  left: 0;
  top: calc(100dvh + var(--header-height, 72px) + var(--space-8));
  width: 1px;
  height: 1px;
}

.work-index {
  --wl-row-h: 100dvh;
  position: relative;
  z-index: 0;
  margin-top: -100dvh;
  padding-bottom: var(--space-20);
}

.work-index-inner {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 5fr);
  column-gap: var(--space-10);
  align-items: start;
}

@media (max-width: 1199px) {
  .work-index-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* ── Sticky side column ─────────────────────────────────────────────── */
.wl-side {
  position: sticky;
  top: 0;
  height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-10);
  padding-bottom: var(--page-gutter);
}

/* Every title occupies the same grid cell, so the block is as tall as
 * the longest one and nothing reflows as they crossfade. */
.wl-titles {
  display: grid;
  margin: 0;
}

.wl-title {
  grid-area: 1 / 1;
  align-self: end;
  margin: 0;
  font-size: var(--font-size-display-l);
  line-height: var(--line-height-display-l);
  letter-spacing: var(--letter-spacing-display-l);
  font-weight: var(--font-weight-display-l);
  color: var(--color-text-heading);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-medium) var(--ease-smooth);
}

.wl-title.is-active {
  opacity: 1;
  pointer-events: auto;
}

.wl-title a {
  color: inherit;
  text-decoration: none;
}

.wl-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-8);
}

.wl-services ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Ghosted by opacity rather than a lighter token so the list reads the
 * same way on the dark surface — always the primary ink, mostly gone. */
.wl-service {
  font-size: var(--font-size-body-large);
  line-height: var(--line-height-body-large);
  letter-spacing: var(--letter-spacing-body-large);
  font-weight: var(--font-weight-body-large);
  color: var(--color-text-primary);
  opacity: 0.14;
  white-space: nowrap;
  transition: opacity var(--duration-medium) var(--ease-smooth);
}

.wl-service.is-active {
  opacity: 1;
}

/* ── Media rows ─────────────────────────────────────────────────────── */
.wl-rows {
  display: flex;
  flex-direction: column;
}

/* Lead slot: one viewport of pin (the plate's travel) plus the row's
 * own height so it releases and scrolls away like the rest. */
.wl-lead {
  height: calc(100dvh + var(--wl-row-h));
}

.wl-lead .wl-row {
  position: sticky;
  top: 0;
}

.wl-row {
  display: block;
  height: var(--wl-row-h);
  box-sizing: border-box;
  padding-block: var(--page-gutter);
  color: inherit;
  text-decoration: none;
}

.wl-row-media {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-sharp);
  background: var(--color-surface-tertiary);
}

.wl-row-media img,
.wl-row-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Embedded animation (Superframe): the frame fills the box and ignores the
 * pointer so the row keeps hover and click. The box wears the dark plane
 * (the animation's paper is the site's one black, in either theme) so
 * nothing flashes before the frame paints. */
.wl-row-media--paper {
  background: var(--color-plane-dark);
}

.wl-row-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: none;
}

/* "Coming soon" rows: not links. A click prints the notice over the media
 * for a moment (js/page/home-work-list.js toggles .is-soon). White ink is
 * media-locked like the panel type: the notice only ever sits on the
 * animation's black paper, in either theme. */
.wl-row--soon {
  cursor: pointer;
}

.wl-soon {
  position: absolute;
  left: var(--space-6);
  bottom: var(--space-6);
  margin: 0;
  font-size: var(--font-size-small);
  line-height: var(--line-height-small);
  letter-spacing: var(--letter-spacing-small);
  font-weight: var(--font-weight-small);
  color: var(--color-text-on-image);
  opacity: 0;
  transform: translateY(var(--space-1));
  transition: opacity var(--duration-medium) var(--ease-smooth),
              transform var(--duration-medium) var(--ease-smooth);
  pointer-events: none;
}

.wl-row--soon.is-soon .wl-soon {
  opacity: 1;
  transform: translateY(0);
}

.wl-title-soon {
  cursor: pointer;
}

.wl-row-media img.is-contain {
  object-fit: contain;
}

/* The row's own title is for the card layout and the link's accessible
 * name; on the two-column layout the side column speaks for it. */
.wl-row-title {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Contact on the list's grid ─────────────────────────────────────── */
/* The form used to run the full page width after the two-column rows and
 * read as an appendix. Same geometry as a row: intro in the side column,
 * pinned like the titles; the form in the media column. Phones keep the
 * stacked module. */
@media (min-width: 769px) {
  .home-list .contact {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 5fr);
    column-gap: var(--space-10);
    align-items: start;
  }

  .home-list .contact-intro {
    position: sticky;
    top: calc(var(--header-height, 72px) + var(--space-8));
  }
}

@media (min-width: 769px) and (max-width: 1199px) {
  .home-list .contact {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* ── Cards (≤768px) ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .work-index {
    --wl-row-h: 80dvh;
  }

  .work-index-inner {
    display: block;
  }

  .wl-side {
    display: none;
  }

  .wl-rows {
    gap: var(--space-16);
  }

  /* The first card pins with the same air above it as the gap between
   * cards; the lead slot grows by that offset so it still releases exactly
   * as the void finishes opening. */
  .wl-lead {
    height: calc(100dvh + var(--wl-row-h) + var(--space-16));
  }

  .wl-lead .wl-row {
    top: var(--space-16);
  }

  .wl-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding-block: 0;
  }

  .wl-row-media {
    flex: 1 1 auto;
    min-height: 0;
  }

  .wl-row-title {
    position: static;
    width: auto; height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    font-size: var(--font-size-display-m);
    line-height: var(--line-height-display-m);
    letter-spacing: var(--letter-spacing-display-m);
    font-weight: var(--font-weight-display-m);
    color: var(--color-text-heading);
  }
}

/* ── Motion switch (hero, bottom band) ──────────────────────────────── */
/* Sits on the email's baseline at the right gutter, but a step down from
 * it (Greg: it read as equal to the address): caption size, ink dimmed to
 * a tertiary weight, full strength only under the pointer or focus. The
 * white is media-locked like the address — it prints over the tunnel.
 * Compact boxes stack it centred above the email, in the band the subline
 * leaves clear. */
.hero-eye-motion {
  position: absolute;
  right: var(--page-gutter);
  bottom: var(--space-5);
  z-index: 2;
  margin: 0;
  font-size: var(--font-size-caption);
  line-height: var(--line-height-caption);
  letter-spacing: var(--letter-spacing-caption);
  font-weight: var(--font-weight-caption);
}

.hero-eye-motion-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--color-text-on-image);
  opacity: 0.55;
  cursor: pointer;
  transition: opacity var(--duration-instant) var(--ease-smooth);
}

.hero-eye-motion-btn:hover,
.hero-eye-motion-btn:focus-visible {
  opacity: 1;
  text-decoration: underline;
  outline: none;
}

@media (max-width: 768px) {
  .hero-eye-motion {
    left: 0;
    right: 0;
    bottom: calc(var(--space-5) + var(--line-height-small) + var(--space-1));
    text-align: center;
  }
}

/* ── Reduced motion: no overlap, no pin, no void — a plain document. ──
 * Keyed off data-motion="reduce" on the root, which the page's head script
 * sets from the visitor's switch or, failing that, the OS setting. */
:root[data-motion="reduce"] .work-index {
  margin-top: 0;
}

:root[data-motion="reduce"] .void-fade,
:root[data-motion="reduce"] .void-slot {
  display: none;
}

:root[data-motion="reduce"] .wl-lead {
  height: auto;
}

:root[data-motion="reduce"] .wl-lead .wl-row {
  position: static;
}

:root[data-motion="reduce"] .wl-title,
:root[data-motion="reduce"] .wl-service {
  transition: none;
}
