/* Work, next pass — loaded only by work-next.html, after main.css and
   the-two-reverse.css.

   The hero is the reversed "the two": the page opens on the pink/gray
   picture with the WORK marquee across it, and scrolling pulls the colours
   apart. The projects sit underneath the colours, still and in their final
   place the whole time, so the halves simply uncover them as they part.

   Two layers inside one pinned stage:
     .two__front  the colour layer (panels, shader, marquee), one screen tall
     .projects    the cards, in normal flow, behind it

   The stage is as tall as the projects — taller than the screen on a
   phone, which sticky handles fine: it holds its top under the header for
   the whole scroll travel and the rest simply hangs below the fold. On a
   large screen it can be shorter than the colour layer; the overhang is
   transparent and click-through by the time it reaches the footer. The
   travel comes from a spacer after the stage — padding would buy none
   (HANDOFF gotcha 2). */

/* ── Without the pinned layering ────────────────────────────── */
/* No JS, or reduced motion: nothing would ever move the colours aside, so
   the colour layer is just a one-screen band and the cards follow below it,
   the same as work.html. */
.work-hero {
  height: auto;
}

.work-hero .two__stage {
  position: relative;
  top: auto;
  height: auto;
  overflow: visible;
  display: block;
  /* the-two-reverse.css centres the stage's children for its grid layout.
     Browsers now apply justify-items to block layout too, which would
     shrink-wrap .projects instead of letting it fill the width. */
  place-items: normal;
}

/* The colour layer reaches up behind the site header (it is the header's
   height taller, and pulled up by the same amount), and data-header-through
   tells js/header-tone.js to make the header transparent over it — so the
   header shows the real shader, grain and all, rather than a flat colour. */
.two__front {
  position: relative;
  z-index: 1;
  margin-top: calc(-1 * var(--header-h));
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
  isolation: isolate;
}

/* The 618px under the cards on work.html is a Figma measurement that left a
   near-empty screen above the footer. Here the footer's own top padding
   (120px, 64px on a phone — the same as every other page) is the only gap.
   Two classes, so it beats both .projects rules in main.css. */
.work-hero .projects {
  padding-bottom: 0;
}

/* ── Cards ──────────────────────────────────────────────────── */
/* The Figma card, node 984:1543 ("Frame 107"), at the size the cards
   already are: 560 x 548 at 1440 — 8px padding, a 544 x 420 image, 24px,
   then an 88px label row (8px inset around a 72px title and arrow). That
   adds up to the same 112px below the image as main.css's label, so only
   the surface and the type change. */

/* Equal columns. Without this "ismetozkan.com" sets a min-content floor
   wider than its 1fr track at mid widths and the two cards come out
   different sizes (HANDOFF gotcha 3). */
.work-hero .projects__grid > li {
  min-width: 0;
}

/* Figma draws the 2px gray border inside the frame, so it is an inset ring
   here rather than a border, which would add 4px to each side. The soft
   two-direction gray shadow replaces work.html's dark drop shadow.
   The card is a size container so the title can scale with it (below). */
.work-hero .project {
  container-type: inline-size;
  box-shadow:
    inset 0 0 0 2px var(--gray),
    -2px -2px 6px rgba(238, 234, 230, 0.75),
    2px 2px 6px rgba(238, 234, 230, 0.75);
}

.work-hero .project:hover {
  box-shadow:
    inset 0 0 0 2px var(--gray),
    -4px -4px 12px rgba(238, 234, 230, 0.9),
    4px 4px 12px rgba(238, 234, 230, 0.9);
}

/* Title and arrow sit 8px in from the label's edges, bottom-aligned, 48px
   apart: 24 + 8 = 32 above, 8 below.

   Sized off the card (100cqi = its content width, 544px at 1440), not the
   window, so "ismetozkan.com" — 7.32em wide — always clears the arrow:
   48px type and a 48px gap at full size. As the card narrows the gap gives
   way first, and the type is capped at whatever fits beside the 72px arrow
   (the 16px label inset + 12px minimum gap + 72px, over 7.6em). The plain
   values ahead of each are the fallback for browsers without container
   units. */
.work-hero .project__label {
  align-items: flex-end;
  gap: 48px;
  gap: clamp(12px, calc((100cqi - 400px) / 3), 48px);
  padding: 32px 8px 8px;
}

/* PP Hatton Ultralight 48 / 72, tracking 0.96px. */
.work-hero .project__name {
  min-width: 0;
  font-weight: 200;
  font-size: clamp(24px, 3.33vw, 48px);
  font-size: clamp(18px, calc((100cqi - 100px) / 7.6), 48px);
  letter-spacing: 0.02em;
}

/* Figma frames the GamerStore shot tighter than a plain cover crop: the
   image is 144.83% x 137.75% of the frame, offset -24.61% / -15.13%. */
.work-hero .project__media {
  position: relative;
}

.work-hero .project__img--zoom {
  position: absolute;
  left: -24.61%;
  top: -15.13%;
  width: 144.83%;
  height: 137.75%;
  max-width: none;
  object-fit: cover;
}

@media (max-width: 860px) {
  .work-hero .project__label {
    padding: 16px 8px 0;
  }
}

/* Once the shader is drawing, it carries the parting halves itself (with
   their grain and shading), so the flat panels underneath are not needed —
   left in, they would show through the opening gap. */
.work-hero.has-gl .two__panel {
  display: none;
}

/* ── Pinned, with the cards behind ──────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  /* Pinned under the site header rather than behind it (only the colour
     layer reaches up behind the header, above).
     js/the-two-reverse.js reads this sticky top and the stage height, so
     the scroll timing stays right. */
  .js .work-hero .two__stage {
    position: sticky;
    top: var(--header-h);
  }

  /* The scroll travel for the whole hero: the marquee leaving, the halves
     parting, then a short hold of about 15vh where the opened view sits
     still before the page scrolls on (timeline in js/the-two-reverse.js). */
  .js .work-hero::after {
    content: "";
    display: block;
    height: 214vh;
  }

  /* Lifted out of flow, so the projects start at the top of the stage,
     directly behind it. */
  .js .work-hero .two__front {
    position: absolute;
    top: calc(-1 * var(--header-h));
    margin-top: 0;
    left: 0;
    right: 0;
  }

  /* Once the colours are nearly gone, clicks go through to the cards. Until
     then the colour layer blocks them, so a card hidden under it can't be
     clicked by accident. */
  .js .work-hero.is-parted .two__front {
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 860px) {
  .js .work-hero::after {
    height: 152vh;
  }
}
