/* =============================================================================
   lawgicLA, hero.css: h01, the home hero (sections_hero.py), driven by assets/js/hero.js. Tokens only. One breakpoint (1023px).
   The photo sits in a window inset by the page gutter (the top inset is the header bar). hero.js writes ONE property on the section,
   --e (0 closed, 1 full bleed), and this file turns it into the clip-path and a small photo scale (GPU work, no layout). The text layer
   never moves. Reduced motion, no script and phones get the still full-bleed version (--e is 1 there, nothing is pinned).
   ========================================================================== */

/* ---- the still version, shared by every width ---------------------------------------- */
.s-hero--lg { position: relative; background: var(--ground); --e: 1;
  --hero-fs: var(--t-display-l-size); }
.s-hero__stage { position: relative; min-height: 100vh; min-height: 100svh; }
.s-hero__window { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: var(--anchor); }
.s-hero__photo { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 58%; }
/* the scrim: a soft top veil for the headline and the header, a deeper foot for the lede and the practice row. Colour is the dark ground token. */
.s-hero__scrim { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, color-mix(in srgb, var(--anchor) 56%, transparent) 0, color-mix(in srgb, var(--anchor) 42%, transparent) 30%, color-mix(in srgb, var(--anchor) 34%, transparent) 50%, transparent 70%),
    linear-gradient(to top, color-mix(in srgb, var(--anchor) 88%, transparent) 0, color-mix(in srgb, var(--anchor) 58%, transparent) 15%, transparent 40%); }

/* ---- the text layer: it sits inside the window as it is at rest and never moves ------ */
.s-hero__over { position: relative; z-index: 2; color: var(--white); }
.s-hero__main { position: relative; }
.s-hero__h { margin: 0; color: var(--white); font-size: var(--hero-fs); line-height: var(--t-display-l-lh); letter-spacing: var(--t-display-l-track); white-space: nowrap; }
.s-hero__lede { margin: 0; max-width: 22em; font-family: var(--body); font-size: var(--t-p1-size); line-height: 1.4; font-weight: 400; letter-spacing: -.01em; color: var(--white); }
.hero-calls { display: flex; flex-wrap: wrap; gap: var(--gap-12); margin-top: var(--gap-24); }

/* the six practice names: the running line along the foot of the photo */
.s-hero__run ul { display: flex; justify-content: space-between; gap: var(--gap-24); margin: 0; padding: var(--gap-16) 0 0; list-style: none;
  border-top: 1px solid color-mix(in srgb, var(--white) 34%, transparent); }
.s-hero__run a { display: inline-flex; align-items: center; min-height: 24px; color: var(--white); font-family: var(--display); font-weight: 400;
  font-size: clamp(17px, 1.75vw, 48px); line-height: 1.25; letter-spacing: -.01em; white-space: nowrap; }
.s-hero__run .roll { height: 1.25em; line-height: 1.25; }
.s-hero__run a:hover .roll > span, .s-hero__run a:focus-visible .roll > span { transform: translateY(-100%); }

/* keyboard focus over the photo: the dark-ground ring of base.css (paper outline, dark halo) */
.s-hero__over :focus-visible { outline-color: var(--ground); box-shadow: 0 0 0 5px var(--anchor); }

/* ---- desktop: the window with the gutter inset, pinned while it opens ---------------- */
@media (min-width: 1024px) {
  .s-hero--lg { --hero-fs: min(var(--t-display-l-size), 20vh); --hero-fs: min(var(--t-display-l-size), 20svh); }
  .s-hero__stage { height: 100vh; height: 100svh; }
  .s-hero__over { position: absolute; inset: var(--hdr-h) var(--pad-x) var(--pad-x); display: flex; flex-direction: column; justify-content: space-between;
    padding: var(--gap-40) var(--gap-32) var(--gap-24); }
  /* line two sits to the right; the lede and the calls fill the empty left under line one */
  .s-hero__sub { position: absolute; left: 0; top: calc(var(--hero-fs) * .9 + var(--gap-24)); font-size: var(--t-p1-size);
    width: min(22.5em, calc(100% - var(--hero-fs) * 1.95 - var(--gap-32))); }
  .s-hero__lede { max-width: none; }
}
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  html.js .s-hero--lg { --e: 0; height: calc(100vh * 1.6); height: calc(100svh * 1.6); }
  html.js .s-hero__stage { position: sticky; top: 0; }
  html.js .s-hero__window { clip-path: inset(calc(var(--hdr-h) * (1 - var(--e))) calc(var(--pad-x) * (1 - var(--e))) calc(var(--pad-x) * (1 - var(--e))) calc(var(--pad-x) * (1 - var(--e)))
    round calc(var(--r-card) * (1 - var(--e)))); }
  html.js .s-hero__photo { transform: scale(calc(1.07 - .07 * var(--e))); transform-origin: 50% 62%; will-change: transform; }
}

/* ---- phones and tablets: full bleed from the start, the text stacked under the photo's sky ------------------ */
@media (max-width: 1023px) {
  .s-hero__stage { display: flex; flex-direction: column; }
  .s-hero__photo { height: 68%; object-position: 50% 30%; }
  .s-hero__scrim { background:
    linear-gradient(to bottom, color-mix(in srgb, var(--anchor) 54%, transparent) 0, color-mix(in srgb, var(--anchor) 42%, transparent) 24%, color-mix(in srgb, var(--anchor) 30%, transparent) 36%, transparent 50%),
    linear-gradient(to bottom, transparent 38%, color-mix(in srgb, var(--anchor) 78%, transparent) 54%, var(--anchor) 70%); }
  .s-hero__over { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; gap: var(--gap-24);
    padding: calc(var(--hdr-h) + var(--gap-24)) var(--pad-x) var(--gap-24); }
  .s-hero__main { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; gap: var(--gap-24); }
  .s-hero__lede { font-size: clamp(16px, 4.4vw, 20px); }
  .s-hero__run ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-8) var(--gap-16); padding-top: var(--gap-16); }
  .s-hero__run a { font-size: 19px; min-height: 32px; }
}
/* short phones (360 by 640): the lede and the second headline line land on the sunset glow, so the middle of the photo takes more scrim */
@media (max-width: 1023px) and (max-height: 740px) {
  .s-hero__scrim { background:
    linear-gradient(to bottom, color-mix(in srgb, var(--anchor) 58%, transparent) 0, color-mix(in srgb, var(--anchor) 46%, transparent) 26%, color-mix(in srgb, var(--anchor) 40%, transparent) 42%, transparent 58%),
    linear-gradient(to bottom, transparent 30%, color-mix(in srgb, var(--anchor) 70%, transparent) 40%, color-mix(in srgb, var(--anchor) 86%, transparent) 50%, var(--anchor) 62%); }
}
