/* PatchLabs living-room hero.
   Everything is prefixed lr- so it cannot collide with site.css (which already owns .hero, .band, .btn).
   The color grade, blur, lamp glow, halation and light leaks are BAKED into the two images,
   so the only live work is transforms, one clip-path and an animated grain tile. */

body.page-home {
  --lr-ink: #03061a;      /* deepest shadow, navy not black */
  --lr-crt: #0a1f5c;      /* screen blue the camera falls into */
  --lr-phosphor: #a9dcff; /* CRT light */
  --lr-cream: #f6f3ec;    /* text on dark */
  --lr-muted: #a7b3cf;
  --lr-pink: #ff6fae;
  --lr-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --lr-next-bg: #f4f0fb; /* .band-soft top, composited over the white body (sampled); change if the next section changes */
}

/* Header sits over the photo on the home page only and scrolls away with the page. */
body.page-home .site-header {
  position: absolute; inset: 0 0 auto; z-index: 40;
  background: transparent; border: 0; box-shadow: none;
}
body.page-home .site-header nav a { color: var(--lr-cream); }
body.page-home .site-header nav a:hover { color: #fff; }

/* The section after the landing band picks up where its gradient ends; drop the hairline between them. */
body.page-home .lr-landing + .band-soft { border-top: 0; }

/* ---------- stage ---------- */
.lr-room { position: relative; height: 240vh; background: var(--lr-ink); }
/* pan-y: vertical swipes still scroll the page; horizontal drags reach the lens instead of being taken by the browser. */
/* 100lvh: the large viewport, constant while the iOS URL bar collapses, so the stage never reflows mid-scroll. */
/* --lr-bar: how much of the stage the browser's toolbars cover at first load (0 where lvh/svh are unsupported).
   The copy block sits above it, so the stage can be 100lvh without hiding the CTA under Safari's toolbar. */
.lr-stage { --lr-bar: 0px; }
@supports (height: 100lvh) { .lr-stage { --lr-bar: calc(100lvh - 100svh); } }
.lr-stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; background: var(--lr-ink); color: var(--lr-cream); touch-action: pan-y; }
.lr-frame { position: absolute; left: 0; top: 0; aspect-ratio: 3 / 2; max-width: none; transform-origin: 15.5% 46%; }
/* Promoted only while the TV zoom runs (home-hero.js toggles .is-zooming). At rest the photo is
   re-rastered at scale 1, so tiles rastered mid-zoom at a different scale can't linger. */
.lr-stage.is-zooming .lr-frame { will-change: transform; }
.lr-frame picture, .lr-frame img { display: block; width: 100%; height: 100%; max-width: none; }

/* the lens: the only sharp spot */
.lr-vision { position: absolute; inset: 0; z-index: 15; pointer-events: none;
  clip-path: circle(var(--lr-r, 130px) at var(--lr-x, 50%) var(--lr-y, 40%)); }
.lr-ring { position: absolute; z-index: 16; left: var(--lr-x, 50%); top: var(--lr-y, 40%);
  width: calc(var(--lr-r, 130px) * 2); height: calc(var(--lr-r, 130px) * 2);
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(246,243,236,.6), inset 0 10px 18px rgba(255,255,255,.18),
              inset 3px 0 6px rgba(255,111,174,.35), inset -3px 0 6px rgba(90,200,255,.4), 0 14px 40px rgba(0,0,0,.3); }
.lr-readout { position: absolute; z-index: 17; left: var(--lr-x, 50%); top: calc(var(--lr-y, 40%) - var(--lr-r, 130px) - 30px);
  transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font: 650 13px/1 var(--font-body, system-ui, sans-serif); letter-spacing: .14em; text-transform: uppercase;
  color: var(--lr-cream); text-shadow: 0 1px 10px rgba(10,14,34,.7); }
.lr-readout b { color: var(--lr-phosphor); font-weight: 650; }
.lr-readout.is-joy b { color: #ffc4dd; }
.lr-readout[data-off="1"] { visibility: hidden; }
.lr-glide .lr-ring, .lr-glide .lr-readout { transition: left .5s cubic-bezier(.2,.7,.2,1), top .5s cubic-bezier(.2,.7,.2,1); }
.lr-glide .lr-vision { transition: clip-path .5s cubic-bezier(.2,.7,.2,1); }
/* Lens easing back to a face (after the zoom, or when the pointer leaves): 300 ms. */
.lr-return .lr-ring, .lr-return .lr-readout { transition: left .3s cubic-bezier(.2,.7,.2,1), top .3s cubic-bezier(.2,.7,.2,1); }
.lr-return .lr-vision { transition: clip-path .3s cubic-bezier(.2,.7,.2,1); }

.lr-grain { position: absolute; inset: -50%; z-index: 18; pointer-events: none; opacity: .3; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.62' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: lr-grain 1s steps(6) infinite; }
@keyframes lr-grain { 0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-3%)} 60%{transform:translate(-2%,-1%)} 80%{transform:translate(3%,3%)} 100%{transform:translate(0,0)} }

/* ---------- copy ---------- */
.lr-flick { position: absolute; inset: 0; pointer-events: none; opacity: .3; will-change: opacity;
  background: radial-gradient(48% 62% at 22% 46%, rgba(150,200,255,.42), rgba(120,170,255,.14) 55%, transparent 80%),
              linear-gradient(90deg, rgba(150,200,255,.10), transparent 70%); }
.lr-dim { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(3,6,26,.42), rgba(3,6,26,.12) 22%, transparent 36%); }
.lr-under .lr-eyebrow-hero { margin: 0 0 6px; max-width: none; font-size: 13px; font-weight: 700; line-height: 1.3; letter-spacing: .2em;
  text-transform: uppercase; text-wrap: balance; color: var(--lr-phosphor); opacity: 1; }
.lr-title { position: static; margin: 0 0 6px; max-width: 100%; text-align: center; text-wrap: balance; color: var(--lr-cream);
  font-family: var(--lr-display); font-weight: 800; font-size: clamp(48px, 7.6vw, 132px); line-height: .92; letter-spacing: -.05em;
  /* Pink/cyan fringe. Strength 1 = 2px offsets. --fringe-rest (default 0) is the resting strength;
     home-hero.js sets --fringe while zooming. At 0 the fringe colors are fully transparent. */
  --lr-fr: var(--fringe, var(--fringe-rest, 0));
  text-shadow: calc(-2px * var(--lr-fr)) 0 0 rgb(255 111 174 / calc(.55 * min(1, var(--lr-fr)))),
               calc(2px * var(--lr-fr)) 0 0 rgb(90 200 255 / calc(.6 * min(1, var(--lr-fr)))),
               0 0 40px rgba(3,6,26,.3); }
.lr-under { position: absolute; z-index: 20; left: 0; right: 0; bottom: calc(52px + var(--lr-bar) + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.lr-under p { margin: 0; max-width: 46ch; font-size: 17px; line-height: 1.55; opacity: .86; }
.lr-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border-radius: 999px;
  font-weight: 700; text-decoration: none; color: var(--lr-ink); background: var(--lr-cream); }
.lr-cta:hover { background: #fff; }
.lr-cta:focus-visible { outline: 2px solid var(--lr-phosphor); outline-offset: 3px; }

.lr-flash { position: absolute; inset: 0; z-index: 30; pointer-events: none; opacity: 0; background: var(--lr-crt); }
.lr-flash::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 62%, var(--lr-crt) 100%),
              repeating-linear-gradient(to bottom, rgba(169,220,255,.12) 0 2px, transparent 2px 4px),
              radial-gradient(90% 80% at 50% 50%, rgba(169,220,255,.35), transparent 70%); }
.lr-screenmsg { position: absolute; inset: 0; z-index: 31; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; text-align: center; opacity: 0; pointer-events: none; color: var(--lr-cream);
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
  background: radial-gradient(70% 60% at 50% 50%, rgba(169,220,255,.16), transparent 70%); }
.lr-screenmsg h2 { margin: 0; max-width: 16ch; font-family: var(--lr-display); font-weight: 800; font-size: clamp(34px, 5.2vw, 84px);
  line-height: .95; letter-spacing: -.035em; text-wrap: balance; color: var(--lr-cream);
  text-shadow: 0 0 28px rgba(169,220,255,.45), -1.5px 0 0 rgba(255,111,174,.35), 1.5px 0 0 rgba(90,200,255,.4); }
.lr-screenmsg .lr-lede { color: #c9d6f2; }

/* ---------- landing band ---------- */
.lr-landing { position: relative; color: var(--lr-cream);
  background: linear-gradient(to bottom, var(--lr-crt) 0%, #06113a 45%, var(--lr-ink) 80%, var(--lr-next-bg) 100%); }
.lr-landing::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(169,220,255,.05) 0 2px, transparent 2px 4px); }
.lr-landing-inner { position: relative; max-width: 1180px; margin: 0 auto; padding-block: 120px 220px;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 22px; }
.lr-eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--lr-phosphor); }
.lr-landing h2 { margin: 0; max-width: 18ch; font-family: var(--lr-display); font-weight: 800; font-size: clamp(30px, 4.4vw, 56px); line-height: 1; letter-spacing: -.03em; text-wrap: balance; color: var(--lr-cream); }
.lr-lede { margin: 0; max-width: 60ch; font-size: 17px; color: var(--lr-muted); }
.lr-landing-inner { display: none; }
.lr-landing { height: 160px; }

/* Wide but short screens (e.g. 1898x904): the two-line headline is taller, so pull the copy block down
   and let the paragraph run two lines, keeping it clear of the lens ring. */
/* Phones: the headline wraps to two lines, so pull the copy block down to keep the lens ring clear. */
@media (max-width: 600px) {
  .lr-under { gap: 12px; bottom: calc(32px + var(--lr-bar) + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 1100px) and (max-height: 980px) {
  .lr-under { gap: 12px; bottom: calc(28px + var(--lr-bar) + env(safe-area-inset-bottom, 0px)); }
  .lr-under p { max-width: 62ch; }
}
@media (prefers-reduced-motion: reduce) {
  .lr-room { height: auto; }
  .lr-stage { position: relative; }
  .lr-grain { animation: none; }
  .lr-flash { display: none; }
  .lr-screenmsg { display: none; }
  .lr-vision, .lr-ring, .lr-readout { display: none; } /* no lens: a static hero */
  .lr-landing { height: auto; }
  .lr-landing-inner { display: flex; }
  .lr-glide .lr-ring, .lr-glide .lr-readout, .lr-glide .lr-vision,
  .lr-return .lr-ring, .lr-return .lr-readout, .lr-return .lr-vision { transition: none; }
}
