/* css/sections/01-opening.css · H01 · the light comes on like a filament; the machine settles; the words rise out of a mask.
 * No ground of its own: the studio light (css/pages/studio.css) shows through, and the photo feathers into it on every edge. */
@layer sections {
  .s-opening {
    position: relative;
    display: grid;
    align-items: end;
    min-block-size: 100svh;
    overflow: clip;
    isolation: isolate;
  }

  /* ---------- media ---------- */
  .hero__media {
    position: absolute;
    inset: 0;
    z-index: -1;
    /* the bottom melts into the black: no hard edge into the next scene */
    -webkit-mask-image: linear-gradient(to bottom, var(--mask-ink) 70%, transparent);
            mask-image: linear-gradient(to bottom, var(--mask-ink) 70%, transparent);
  }
  .hero__media picture,
  .hero__flare-wrap { position: absolute; inset: 0; }
  .hero__img,
  .hero__flare img {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    object-position: 50% 30%;
    transform-origin: 50% 40%;
  }
  .hero__img { filter: contrast(1.04); }
  /* the chrome flare: the same photo again, pushed until only chrome survives, shown only where the light falls */
  .hero__flare-wrap {
    mix-blend-mode: screen;
    opacity: .85;
    pointer-events: none;
    -webkit-mask-image: radial-gradient(26vmax 22vmax at var(--fx, 50%) var(--fy, 36%), var(--mask-ink) 0%, color-mix(in srgb, var(--color-shadow) 35%, transparent) 45%, transparent 75%);
            mask-image: radial-gradient(26vmax 22vmax at var(--fx, 50%) var(--fy, 36%), var(--mask-ink) 0%, color-mix(in srgb, var(--color-shadow) 35%, transparent) 45%, transparent 75%);
  }
  .hero__flare img { filter: brightness(.9) contrast(3.2) saturate(.35) sepia(.25); }
  .hero__steam { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; pointer-events: none; }
  .hero__shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      linear-gradient(0deg, var(--color-stage) 2%, color-mix(in srgb, var(--color-stage) 86%, transparent) 30%, color-mix(in srgb, var(--color-stage) 20%, transparent) 58%, transparent 75%),
      linear-gradient(180deg, color-mix(in srgb, var(--color-stage) 60%, transparent), transparent 16%);
  }
  .hero__veil { position: absolute; inset: 0; background: var(--color-stage); opacity: 0; pointer-events: none; }

  /* ---------- words ---------- */
  .hero__copy {
    position: relative;
    padding-block: calc(var(--header-h) + var(--space-xl)) calc(var(--space-2xl) + 3.5rem);
  }
  .hero__title {
    max-inline-size: 12ch;
    font-size: var(--text-display);
    line-height: var(--leading-display);
    letter-spacing: var(--tracking-display);
    text-wrap: balance;
  }
  .hero__line { display: block; overflow: clip; padding-block-end: .1em; margin-block-end: -.1em; }
  .hero__line > span { display: block; }
  @media (min-width: 24em) { .hero__line { white-space: nowrap; } }
  .hero__title em { padding-inline-end: .06em; }
  .hero__lede { margin-block: var(--space-xl); max-inline-size: 30ch; }

  /* ---------- the ruler (C): a thin brass scale with one engraved line ---------- */
  .hero__ruler {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding-block-end: var(--space-lg);
    pointer-events: none;
  }
  .hero__scale {
    display: block;
    block-size: 12px;
    margin-block-end: var(--space-sm);
    transform-origin: left;
    background:
      repeating-linear-gradient(90deg, color-mix(in srgb, var(--color-brass-hi) 50%, transparent) 0 1px, transparent 1px 80px) bottom / 100% 12px no-repeat,
      repeating-linear-gradient(90deg, color-mix(in srgb, var(--color-brass-hi) 28%, transparent) 0 1px, transparent 1px 16px) bottom / 100% 6px no-repeat,
      linear-gradient(color-mix(in srgb, var(--color-brass-hi) 30%, transparent), color-mix(in srgb, var(--color-brass-hi) 30%, transparent)) bottom / 100% 1px no-repeat;
  }
  .hero__engrave { font: italic 400 clamp(1rem, .9rem + .4vw, 1.25rem)/1.2 var(--font-display); color: var(--color-brass-hi); letter-spacing: .01em; }

  /* ---------- the scroll cue: one drop of light down a hairline ---------- */
  .hero__cue { display: none; }

  /* ---------- landscape: the machine at the right, the words in the dark at the left ---------- */
  @media (min-width: 48em) and (min-aspect-ratio: 4/3) {
    .s-opening { align-items: center; min-block-size: max(600px, 100svh); }
    .hero__img, .hero__flare img { object-position: 78% 50%; transform-origin: 75% 40%; }
    .hero__flare-wrap {
      -webkit-mask-image: radial-gradient(26vmax 22vmax at var(--fx, 76%) var(--fy, 42%), var(--mask-ink) 0%, color-mix(in srgb, var(--color-shadow) 35%, transparent) 45%, transparent 75%);
              mask-image: radial-gradient(26vmax 22vmax at var(--fx, 76%) var(--fy, 42%), var(--mask-ink) 0%, color-mix(in srgb, var(--color-shadow) 35%, transparent) 45%, transparent 75%);
    }
    .hero__shade {
      background:
        linear-gradient(90deg, color-mix(in srgb, var(--color-stage) 92%, transparent) 0%, color-mix(in srgb, var(--color-stage) 55%, transparent) 32%, transparent 58%),
        linear-gradient(0deg, var(--color-stage) 0%, color-mix(in srgb, var(--color-stage) 60%, transparent) 14%, transparent 34%),
        linear-gradient(180deg, color-mix(in srgb, var(--color-stage) 55%, transparent) 0%, transparent 18%);
    }
    .hero__copy { padding-block: calc(var(--header-h) + var(--space-2xl)) var(--space-4xl); }
    .hero__text { max-inline-size: min(52rem, 56vw); }
    .hero__title { max-inline-size: none; font-size: min(var(--text-display), 8.4vw); }
    .hero__cue {
      display: block;
      position: absolute;
      left: 50%;
      bottom: calc(var(--space-lg) + 12px + var(--space-sm) + 2.5rem);
      inline-size: 1px;
      block-size: 4.5rem;
      background: linear-gradient(transparent, var(--color-rule));
      overflow: clip;
    }
    .hero__cue i {
      position: absolute;
      left: 0;
      top: 0;
      inline-size: 1px;
      block-size: 1.2rem;
      background: linear-gradient(transparent, var(--color-brass-hi));
      transform: translateY(-1.2rem);
    }
  }
  @media (min-width: 48em) and (min-aspect-ratio: 4/3) and (prefers-reduced-motion: no-preference) {
    .hero__cue i { animation: hero-drip 2.8s var(--ease-out) infinite; }
  }
  @keyframes hero-drip {
    0% { transform: translateY(-1.2rem); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: translateY(4.5rem); opacity: 0; }
  }

  /* ---------- before the entrance (only with motion; the 3 s failsafe in _head.html drops .anim) ---------- */
  .anim .s-opening :is(.hero__line > span, .hero__lede, .hero__cta, .hero__engrave) { opacity: 0; }

  @media (max-width: 22.49em) {
    .hero__cta { inline-size: 100%; }
  }
  @media print {
    .hero__flare-wrap, .hero__steam, .hero__shade, .hero__veil, .hero__cue { display: none; }
  }
}
