/* UNLOCK — the viewfinder that follows the reading. A thermal camera
   stays fixed at 5/12 beside the text and aims at whatever crosses the middle of
   the screen: Marcos, your situation, the steps, each case, the price. The offer
   reads under it. Components come from styles.css; this sheet only recomposes
   the page around the viewfinder, and on a phone turns it into a strip. */

/* ---------- A darker night ---------- */

/* The cold end of the field sinks to almost black, so only the camera and what
   burns lift off the page. Contrast pivots at mid-grey: the night crushes, the
   heat keeps its light. */
:root {
  --night: #070303;
}

.thermal {
  filter: blur(2px) contrast(1.12);
}

/* ---------- The stage ---------- */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: var(--column-gap);
  align-items: start;
}

.stage > * {
  grid-column: 2;
}

.visor {
  --visor-top: clamp(1rem, 2.5vh, 1.5rem);
  position: sticky;
  top: var(--visor-top);
  grid-column: 1;
  grid-row: 1 / span 12;
  display: flex;
  flex-direction: column;
  height: calc(100svh - 6.25rem);
  max-height: 54rem;
  margin: clamp(1.25rem, 3.5vh, 2.25rem) 0 0;
}

/* The page's own reticle steps aside while the pointer is on the camera. */
body:has(.visor__frame:hover) .spot {
  visibility: hidden;
}

/* ---------- The viewfinder ---------- */

.visor__frame {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}

.visor .camera__colour > * {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
}

.visor .camera__colour > [data-active] {
  opacity: 1;
}

/* A scene has no colour original: no seam, no reveal. */
.visor[data-kind="scene"] .camera__colour,
.visor[data-kind="scene"] .camera__seam {
  display: none;
}

.visor[data-kind="scene"] .camera__frame {
  cursor: default;
}

/* Changing aim is a refocus: the picture softens, swaps, and sharpens again. */
.visor .camera__sensor,
.visor .camera__colour {
  transition: filter 0.42s var(--ease-out);
}

.visor__frame.is-refocusing .camera__sensor {
  filter: blur(10px) brightness(0.7);
  transition-duration: 0.24s;
}

.visor__frame.is-refocusing .camera__colour {
  filter: blur(10px);
  transition-duration: 0.24s;
}

/* What the camera is looking at, set inside the corners. */
.visor__aim {
  position: absolute;
  z-index: 4;
  top: 1.5rem;
  right: 1.6rem;
  left: 1.6rem;
  margin: 0;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
  font-stretch: 112%;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  transition: opacity 0.3s var(--ease-out);
}

.visor__frame.is-refocusing .visor__aim {
  opacity: 0;
  transition-duration: 0.2s;
}

/* The offer under the camera: the price, and the action while no other is in view. */
.visor__offer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.9rem 1rem;
  padding: 1rem 1.15rem 1.1rem;
  border: 1px solid var(--frame);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(18, 9, 9, 0.94);
}

.visor__offer .price {
  margin: 0;
  font-size: clamp(1.9rem, 2.6vw, 2.5rem);
}

.visor__offer .price-note {
  margin-top: 0.45rem;
}

.visor__cta {
  flex: none;
  padding: 0.85rem 1rem;
  transition: background-color 0.25s var(--ease-out), opacity 0.3s var(--ease-out), visibility 0.3s;
}

.visor__cta.is-away {
  opacity: 0;
  visibility: hidden;
}

/* The pictures the camera carries leave the text; they stay for screen readers. */
.has-visor .case__media,
.has-visor .me__photo {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- The reading ---------- */

.stage .hero {
  grid-template-columns: minmax(0, 1fr);
}

.hero__cta {
  margin-top: clamp(1.5rem, 4vh, 2.25rem);
}

.hero__ticks {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
  max-width: 46rem;
  margin: clamp(2rem, 5vh, 3rem) 0 0;
  color: var(--ink-soft);
}

.stage .section__head--split {
  display: block;
}

.stage .section__head--split .prose {
  margin-top: clamp(1.1rem, 2.6vh, 1.5rem);
}

/* Two doors to a row; the one you open lays its halves under its own row. */
.stage .situations {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 821px) {
  h3.situation:nth-of-type(-n + 2) { grid-row: 1; }
  h3.situation:nth-of-type(n + 3):nth-of-type(-n + 4) { grid-row: 3; }
  h3.situation:nth-of-type(n + 5) { grid-row: 5; }
  .situation__panel:nth-of-type(-n + 2) { grid-row: 2; }
  .situation__panel:nth-of-type(n + 3):nth-of-type(-n + 4) { grid-row: 4; }
  .situation__panel:nth-of-type(n + 5) { grid-row: 6; }
}

/* Cold over hot: the halves read down the column. */
.stage .diptych {
  grid-template-columns: minmax(0, 1fr);
}

.stage .diptych__cold {
  border-radius: var(--radius) var(--radius) 0 0;
}

.stage .diptych__hot {
  border-top: 0;
  border-left: 1px solid rgba(255, 106, 31, 0.42);
  border-radius: 0 0 var(--radius) var(--radius);
}

.stage .diptych--after .carry {
  justify-items: start;
  border-top: 1px solid rgba(255, 106, 31, 0.42);
  border-radius: var(--radius);
}

/* The steps run down one isotherm, like the case stories. */
.stage .steps {
  grid-template-columns: minmax(0, 1fr);
  row-gap: 2.5rem;
  padding: 0 0 0 1.6rem;
}

.stage .step::before {
  top: 0.8rem;
  left: -1.6rem;
  translate: -50% -50%;
}

.stage .steps::before {
  top: 0.55rem;
  right: auto;
  bottom: 0.35rem;
  width: 1px;
  height: auto;
  background: linear-gradient(to bottom, rgba(127, 214, 203, 0.5), #5a2034 28%, #8a1a2b 46%, #e0401c 64%, #ff6a1f 80%, #ffb43a);
}

.stage .step p,
.stage .step__list {
  max-width: 56ch;
}

.stage .case,
.stage .me,
.stage .faq-block,
.stage .closing {
  grid-template-columns: minmax(0, 1fr);
}

.stage .case {
  row-gap: 1.5rem;
}

.stage .case--flip .case__media {
  order: 0;
}

.stage .case__media--tall {
  justify-self: start;
  width: min(100%, 20rem);
}

.stage .me {
  row-gap: 2rem;
}

.stage .me__photo {
  width: min(100%, 22rem);
}

.stage .faq-block {
  row-gap: 1.75rem;
}

.stage .faq-block .section__head {
  position: static;
}

.stage .closing {
  row-gap: 2rem;
}

.stage .closing__buy {
  justify-self: start;
}

/* ---------- Narrow screens: the viewfinder becomes a strip ---------- */

@media (max-width: 820px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage > *,
  .stage > .visor {
    grid-column: 1;
    grid-row: auto;
  }

  /* Once the promise has been read, the strip holds the top of the screen. */
  .visor {
    z-index: 5;
    top: 0;
    height: auto;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0.5rem var(--gutter) 0.6rem;
    border-bottom: 1px solid var(--frame);
    background: var(--night);
  }

  .visor__frame {
    flex: none;
    height: clamp(9.5rem, 24svh, 13rem);
    border-radius: var(--radius);
  }

  .visor .camera__frame::after {
    inset: 0.5rem;
  }

  .visor__aim {
    top: 0.85rem;
    right: 1rem;
    left: 1rem;
    font-size: 0.75rem;
  }

  .visor .camera__controls {
    bottom: 0.6rem;
    left: 0.6rem;
    gap: 0.4rem;
  }

  .visor .control {
    padding: 0.5rem 0.7rem;
    font-size: 0.8125rem;
  }

  .visor__offer {
    flex-wrap: nowrap;
    align-items: center;
    padding: 0.55rem 0 0;
    border: 0;
    background: none;
  }

  .visor__offer .price {
    font-size: 1.5rem;
  }

  .visor__offer .price-note {
    display: none;
  }

  .visor__cta {
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
  }

  /* Anything scrolled to lands below the strip. */
  .stage [id] {
    scroll-margin-top: calc(24svh + 5.5rem);
  }

  .stage .steps {
    padding-left: 1.4rem;
  }

  .stage .step::before {
    left: -1.4rem;
  }

  .stage .situations {
    grid-template-columns: minmax(0, 1fr);
  }

  h3.situation:nth-of-type(n),
  .situation__panel:nth-of-type(n) {
    grid-row: auto;
  }

  .hero__ticks {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .visor .camera__sensor,
  .visor .camera__colour,
  .visor__aim,
  .visor__cta {
    transition: none;
  }
}
