/* ═══════════════════════════════════════════════════════════════════════════
   #seg-hero — fluid-ink statement panel above // selected.work
   Everything is scoped to #seg-hero. No global resets, no html font-size
   override: the standalone version set html{font-size:calc(100vw/172.8)} for
   its 1728 design grid, which would have resized the entire site. That unit
   lives on --u here instead.
   ═══════════════════════════════════════════════════════════════════════════ */

#seg-hero{
  /* --u is the LAYOUT grid (1u = 10px at the 1728 design width). It is clamped:
     unclamped it drove type down to 8.5px at 861px wide, because every size in
     here was a multiple of it. Type now has its own fluid scale below, so
     geometry and legibility no longer fight. */
  --u:clamp(6.6px, 100vw / 172.8, 10px);
  --pad:calc(2.4 * var(--u));
  /* type: continuous across the breakpoint, with a readable floor and a cap */
  --fs-body:clamp(13px, 0.55vw + 9.5px, 17px);
  --fs-title:clamp(28px, 3.4vw, 54px);
  --fs-small:clamp(12px, 0.4vw + 9.5px, 15px);
  --fg:#00031f;
  --muted:rgba(0,3,31,.42);

  /* tall outer: the panel below pins while you scroll through it, the same
     shape as #cs-sticky on the carousel underneath */
  position:relative;
  height:260vh;
  color:var(--fg);
  font-family:'Space Grotesk',-apple-system,BlinkMacSystemFont,sans-serif;
  font-weight:500;
  font-size:var(--fs-body);
  line-height:1.2;
  letter-spacing:-.006em;
  /* main.css has `section{padding:clamp(80px,12vw,140px) var(--pad)}` — a bare
     element selector, which class scoping cannot stop. Undo it here. */
  box-sizing:border-box;
  padding:0;
}
#seg-hero *{box-sizing:border-box;margin:0;padding:0}

#seg-hero .seg-sticky{
  position:sticky;top:0;
  /* min-height must never exceed the viewport, or a landscape phone gets a
     panel taller than the screen and the sticky stops behaving */
  height:100vh;min-height:min(560px, 100vh);
  overflow:hidden;
  background:#fff;
  isolation:isolate;
}
@supports (height:100dvh){ #seg-hero .seg-sticky{ height:100dvh;min-height:min(560px, 100dvh) } }

#seg-hero .seg-canvas{position:absolute;inset:0;width:100%;height:100%;z-index:0;display:block}
#seg-hero .seg-fallback{position:absolute;inset:0;z-index:0;display:none;place-items:center;
  color:var(--muted);font-size:var(--fs-small);text-align:center;padding:4rem}

/* real DOM, above the canvas */
#seg-hero .seg-page{position:absolute;inset:0;z-index:5;pointer-events:none}
#seg-hero .seg-page a,#seg-hero .seg-page button{pointer-events:auto}

/* main.css also styles the bare `nav` element: fixed, left:0/right:0, flex with
   justify-content:space-between, its own height and padding. Both the top nav
   and the Index are <nav>, so every one of those has to be reset explicitly —
   otherwise they stretch edge to edge and fling their children apart. */
#seg-hero .seg-nav,
#seg-hero .seg-index{
  position:absolute;top:auto;left:auto;bottom:auto;right:var(--pad);
  width:auto;height:auto;min-height:0;margin:0;padding:0;z-index:auto;
  background:none;border:0;transition:none;
  backdrop-filter:none;-webkit-backdrop-filter:none;
}
#seg-hero .seg-logo{position:absolute;top:var(--pad);left:var(--pad)}
#seg-hero .seg-nav{top:var(--pad);display:flex;align-items:baseline;
  justify-content:flex-start;gap:calc(.4 * var(--u))}
#seg-hero .seg-link{color:var(--fg);text-decoration:none;background:none;border:0;padding:0;
  font:inherit;letter-spacing:inherit;cursor:pointer;transition:opacity .25s}
#seg-hero .seg-link:hover{opacity:.45}

/* title + sub ride a centered column so the panel isn't top-heavy under the nav */
#seg-hero .seg-lead{position:absolute;top:0;bottom:0;left:var(--pad);right:calc(84 * var(--u));
  display:flex;flex-direction:column;justify-content:center;gap:calc(2.4 * var(--u))}
/* the headline is painted by the GL pass; this copy is for layout + a11y */
#seg-hero .seg-title{opacity:0;font-family:var(--ff);font-weight:700;
  text-transform:uppercase;font-size:var(--fs-title);line-height:.9;letter-spacing:.0096em}
#seg-hero .seg-title .seg-line{display:block}
#seg-hero .seg-sub{max-width:44ch;line-height:1.48}
#seg-hero .seg-sub span{display:block}

#seg-hero .seg-port{position:absolute;top:0;left:calc(87.4 * var(--u));width:calc(54.8 * var(--u));height:100%}
#seg-hero .seg-work{position:absolute;top:var(--pad);left:0;width:100%;
  display:flex;flex-direction:column;gap:calc(1.6 * var(--u));will-change:transform}
#seg-hero .seg-shot{width:100%;height:calc(33.4 * var(--u));display:block}
#seg-hero .seg-shot img{width:100%;height:100%;object-fit:cover;opacity:0}
#seg-hero .seg-shot{color:var(--fg);text-decoration:none}   /* it is an <a>: main.css gives it link blue */
#seg-hero .seg-cap{display:none}   /* the Index carries the names on desktop */
#seg-hero .seg-note{display:none} /* supporting line — mobile only */

#seg-hero .seg-index{top:38%;display:block;text-align:right}
#seg-hero .seg-index p{color:var(--muted);margin-bottom:calc(1.2 * var(--u))}
#seg-hero .seg-index ul{list-style:none}
#seg-hero .seg-index li{line-height:1.8}
#seg-hero .seg-index a{color:var(--fg);text-decoration:none;opacity:.32;transition:opacity .25s}
#seg-hero .seg-index a:hover,#seg-hero .seg-index li.on a{opacity:1}

#seg-hero .seg-metas{position:absolute;left:var(--pad);bottom:var(--pad);
  display:grid;grid-template-columns:calc(28.9 * var(--u)) calc(14 * var(--u)) auto}
#seg-hero .seg-metas dt{color:var(--muted);margin-bottom:calc(.5 * var(--u))}
#seg-hero .seg-copy{position:absolute;right:var(--pad);bottom:var(--pad)}
#seg-hero .seg-copied{color:var(--muted);opacity:0;transition:opacity .2s}
#seg-hero .seg-copied.on{opacity:1}

/* Narrow: the panel stops being a pinned two-column composition and becomes a
   normal scrolling page — copy, then the work stacked full width with captions.
   The gallery is the point of the section, so hiding it (as this used to) threw
   away the content to keep the layout. The fluid canvas is kept and still spans
   the section, so the shots are GL-drawn here too and the ink runs over them —
   fed by touch-drag and by scroll, since touch has no hover. */
@media (max-width:1000px){
  #seg-hero{--u:clamp(7px, 100vw / 46, 12px);height:auto}
  #seg-hero .seg-sticky{position:relative;height:auto;min-height:0;overflow:visible}
  /* the canvas still covers the whole section here: the shots are drawn by the
     GL pass at their laid-out positions, so the ink can run over them and flood
     the colour back exactly as the cursor does on desktop. uBand in the ink
     shader keeps the paper reveal itself up in the statement. */
  #seg-hero .seg-canvas{display:block;position:absolute;inset:0;
    width:100%;height:100%;pointer-events:none}
  #seg-hero .seg-index{display:none}          /* captions name them instead */

  #seg-hero .seg-page{position:relative;inset:auto;pointer-events:auto;
    padding:0 var(--pad) calc(6 * var(--u))}
  #seg-hero .seg-logo{top:var(--pad);left:0}
  #seg-hero .seg-nav{top:var(--pad);right:0}

  #seg-hero .seg-lead{position:static;padding-top:calc(11 * var(--u));
    gap:calc(1.8 * var(--u))}
  /* the GL pass paints the headline here too, so the DOM copy stays hidden
     (layout + a11y only) exactly as on desktop. paintTitle() rasterises each
     .seg-line in ONE fillText, so the line must not wrap or the baked texture
     runs off the canvas — hence nowrap plus a width-tracking size. */
  #seg-hero .seg-title{opacity:0;font-size:clamp(22px, 7.4vw, 34px)}
  #seg-hero .seg-title .seg-line{white-space:nowrap}
  #seg-hero .seg-sub{max-width:38ch}

  #seg-hero .seg-port{position:static;width:auto;height:auto;
    margin-top:calc(5 * var(--u));display:block}
  #seg-hero .seg-work{position:static;width:auto;transform:none!important;
    gap:calc(4 * var(--u))}
  /* the <img> stays transparent and only reserves the box — GL paints it, the
     same as desktop. (The no-WebGL fallback un-hides it inline.) */
  #seg-hero .seg-shot{height:auto}
  #seg-hero .seg-shot img{height:auto;aspect-ratio:16 / 10}
  #seg-hero .seg-cap{display:block;margin-top:calc(1.1 * var(--u))}
  #seg-hero .seg-note{display:block;margin-top:calc(0.4 * var(--u));
    color:var(--muted);font-size:var(--fs-small);line-height:1.45;max-width:42ch}

  /* two columns still: the email is too wide for three. The row gap is what
     lets the third entry wrap under them instead of colliding. */
  #seg-hero .seg-metas{position:static;margin-top:calc(6 * var(--u));
    grid-template-columns:auto auto;justify-content:start;
    gap:calc(1.6 * var(--u)) calc(3 * var(--u))}
  #seg-hero .seg-copy{display:none}
}

/* the two meta columns stop fitting once the email is wider than half the
   panel — stack them instead of letting it wrap mid-address */
@media (max-width:560px){
  #seg-hero .seg-metas{grid-template-columns:1fr;gap:calc(1.4 * var(--u)) 0}
}
