/* MV Vision: page styles. The engine's tokens are themed here; every class
   below is this page's own markup. Plane motion reads the act's --sc-p. */

:root {
  --sc-canvas:     #EDF0F5;
  --sc-surface:    #FFFFFF;
  --sc-ink:        #111B36;
  --sc-ink-soft:   #46526E;
  --sc-accent:     #2B53E2;
  --sc-accent-ink: #FFFFFF;
  --sc-font-display: "Instrument Sans", "Geist", system-ui, sans-serif;
  --sc-font-text:    "Geist", system-ui, sans-serif;
  --sc-shadow-color: 222 45% 18%;

  --night:      #0E1730;
  --night-ink:  #F1F4FB;
  --night-soft: #AEBBD6;
  --night-acc:  #7AB5FF;
  --bar-h: 64px;
  --hatch: color-mix(in oklab, var(--sc-ink) 9%, transparent);
}

html { scroll-padding-top: var(--bar-h); }
body { color: var(--sc-ink); }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ------------------------------------------------------------------ bar -- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: var(--sc-z-chrome);
  height: var(--bar-h);
  display: flex; align-items: center; gap: var(--sc-6);
  padding-inline: var(--sc-gutter);
  background: color-mix(in oklab, var(--sc-canvas) 94%, transparent);
  border-bottom: 1px solid var(--sc-hairline);
}
.bar__mark img { width: auto; height: 46px; }
.bar__nav { display: flex; gap: var(--sc-6); margin-left: auto; font-size: var(--sc-t-sm); }
.bar__nav a { text-decoration: none; color: var(--sc-ink-soft); transition: color var(--sc-d-fast) var(--sc-ease-out); }
.bar__nav a:hover { color: var(--sc-ink); }

/* ----------------------------------------------------- buttons & links -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 var(--sc-5);
  background: var(--sc-accent); color: var(--sc-accent-ink);
  font-weight: 500; font-size: var(--sc-t-base); white-space: nowrap;
  text-decoration: none; border-radius: var(--sc-r-sm);
  box-shadow: var(--sc-e1), inset 0 1px 0 rgb(255 255 255 / 0.18);
  transition: background-color var(--sc-d-fast) var(--sc-ease-out), transform 120ms var(--sc-ease-out), box-shadow var(--sc-d-fast) var(--sc-ease-out);
}
.btn:hover { background: #2244C4; box-shadow: var(--sc-e2), inset 0 1px 0 rgb(255 255 255 / 0.18); }
.btn:active { transform: translateY(1px); }
.btn--sm { min-height: 40px; padding: 0 var(--sc-4); font-size: var(--sc-t-sm); }
.btn--lg { min-height: 56px; padding: 0 var(--sc-6); font-size: var(--sc-t-lg); }
.link {
  color: var(--sc-ink); font-weight: 500; text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--sc-accent) 55%, transparent);
  text-underline-offset: 0.28em; transition: text-decoration-color var(--sc-d-fast) var(--sc-ease-out);
}
.link:hover { text-decoration-color: var(--sc-accent); }

/* -------------------------------------------------------- placeholders --
   A slot for one of Rafael's own photos. Hatched like a reserved area on a
   drawing until page.js finds the named file in assets/. */
.ph {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(-45deg, var(--hatch) 0 1px, transparent 1px 11px),
    color-mix(in oklab, var(--sc-ink) 4%, var(--sc-canvas));
  outline: 1px solid var(--sc-hairline-strong); outline-offset: -1px;
}
.ph__label {
  position: absolute; left: var(--sc-4); bottom: var(--sc-4); right: var(--sc-4);
  font-family: var(--sc-font-mono); font-size: 0.72rem; letter-spacing: 0.02em;
  color: var(--sc-ink-soft); line-height: 1.4;
}
.ph--quiet { --hatch: color-mix(in oklab, var(--sc-ink) 5%, transparent); outline: 0; }
.ph--quiet .ph__label { left: auto; bottom: auto; top: calc(var(--bar-h) + var(--sc-4)); right: var(--sc-gutter); }
.ph--filled { background: none; outline: 0; }
.ph--filled .ph__label { display: none; }
.ph__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.hero__subject .ph__img { object-fit: contain; object-position: 50% 100%; }

/* ----------------------------------------------------------------- hero -- */
.hero__stage { --p: var(--sc-p, 0); }
.hero__far {
  position: absolute; inset: 0;
  transform: translate3d(0, calc(var(--p) * -40px), 0) scale(calc(1.06 - var(--p) * 0.06));
  transform-origin: 50% 0;
}
.hero__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg,
    var(--sc-canvas) 0%,
    color-mix(in oklab, var(--sc-canvas) 96%, transparent) 34%,
    color-mix(in oklab, var(--sc-canvas) 82%, transparent) 46%,
    color-mix(in oklab, var(--sc-canvas) 35%, transparent) 58%,
    transparent 70%);
}
.hero__contours {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  transform: translate3d(0, calc(var(--p) * -70px), 0);
  --r: calc(38% + var(--p) * 70%);
  -webkit-mask-image: radial-gradient(circle at 78% 92%, #000 var(--r), transparent calc(var(--r) + 14%));
          mask-image: radial-gradient(circle at 78% 92%, #000 var(--r), transparent calc(var(--r) + 14%));
}
.hero__contours path { fill: none; stroke: var(--sc-ink); stroke-width: 1; opacity: 0.16; vector-effect: non-scaling-stroke; }
.hero__contours path.major { opacity: 0.3; stroke-width: 1.3; }

.hero__copy {
  position: absolute; z-index: 3;
  left: var(--sc-gutter); bottom: clamp(4rem, 15vh, 10rem);
  width: fit-content; max-width: min(60rem, 64vw);
}
.hero__title {
  font-size: clamp(3rem, 1.4rem + 5.2vw, 6.4rem);
  font-weight: 600; line-height: 0.96; letter-spacing: -0.035em;
}
.hero__sub {
  margin: var(--sc-5) 0 0; max-width: 36ch;
  font-size: var(--sc-t-lg); line-height: 1.45; color: var(--sc-ink-soft); text-wrap: pretty;
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sc-4) var(--sc-6); margin-top: var(--sc-6); }

/* The cutout's bottom edge is a straight cut through the tripod legs, so the
   plane starts well below the frame: --rise never brings that edge into view. */
.hero__subject {
  --rise: 120px;
  position: absolute; z-index: 2;
  right: calc(var(--sc-gutter) * 0.9); bottom: -22vh;
  width: clamp(16rem, 30vw, 32rem); height: 96vh;
  border-radius: 999px 999px 0 0;
  transform: translate3d(0, calc(var(--p) * var(--rise) * -1), 0) scale(calc(1 + var(--p) * 0.04));
  transform-origin: 50% 100%;
}
.hero__subject.ph--filled {
  border-radius: 0;
  filter: drop-shadow(0 30px 40px hsl(var(--sc-shadow-color) / 0.28));
}
.item__media .ph__img { object-position: 50% 40%; }
.hero__subject .ph__label { bottom: calc(12vh + var(--sc-5)); text-align: center; }

.hero__near {
  position: absolute; z-index: 4;
  right: calc(var(--sc-gutter) + clamp(12rem, 22vw, 22rem)); bottom: -9vh;
  width: clamp(6.5rem, 10vw, 10rem); height: auto; max-width: none;
  transform: translate3d(calc(var(--p) * -36px), calc(var(--p) * -220px), 0);
  filter: drop-shadow(0 18px 24px hsl(var(--sc-shadow-color) / 0.22));
}
.tgt-rim { fill: none; stroke: var(--sc-ink); stroke-width: 3; }
.tgt-dark { fill: var(--sc-ink); }
.tgt-light { fill: #FFFFFF; }
.tgt-dot { fill: var(--sc-accent); }
.tgt-pole { fill: #5C6884; }

/* -------------------------------------------------------------- problem -- */
.problem { padding-block: var(--sc-section) calc(var(--sc-section) * 0.85); }
.problem__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sc-6); row-gap: var(--sc-8);
}
.problem__title {
  grid-column: 1 / span 8;
  font-size: var(--sc-t-3xl); font-weight: 600; max-width: 13ch;
}
.problem__costs { grid-column: 6 / span 7; list-style: none; margin: 0; padding: 0; }
.problem__costs li {
  padding: var(--sc-5) 0; border-top: 1px solid var(--sc-hairline-strong);
  color: var(--sc-ink-soft); max-width: 52ch;
}
.problem__costs strong {
  display: block; margin-bottom: var(--sc-2);
  font-family: var(--sc-font-display); font-weight: 600;
  font-size: var(--sc-t-xl); letter-spacing: var(--sc-track-snug); color: var(--sc-ink); line-height: 1.15;
}
.problem__turn {
  grid-column: 1 / span 8; margin: 0;
  font-family: var(--sc-font-display); font-weight: 600;
  font-size: var(--sc-t-2xl); letter-spacing: var(--sc-track-snug); color: var(--sc-accent);
}

/* ------------------------------------------------------------ the peak -- */
.peak__stage { --p: var(--sc-p, 0); }
.peak__screen {
  position: absolute; inset: 0; overflow: hidden;
  background: var(--night); color: var(--night-ink);
  --open: clamp(0, calc(var(--p) * 9), 1);
  --inset: clamp(0.75rem, 3.5vw, 3.5rem);
  clip-path: inset(calc(var(--bar-h) * (1 - var(--open)) + (1 - var(--open)) * var(--inset))
                    calc((1 - var(--open)) * var(--inset))
                    calc((1 - var(--open)) * var(--inset))
                    calc((1 - var(--open)) * var(--inset))
                    round calc((1 - var(--open)) * 20px));
}
.peak__canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.peak__scrim {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--night) 94%, transparent) 0%,
    color-mix(in oklab, var(--night) 80%, transparent) 32%,
    transparent 50%);
}
.peak__copy {
  position: absolute; z-index: 2;
  left: var(--sc-gutter); bottom: clamp(3.5rem, 13vh, 8rem);
  max-width: 30rem;
}
.peak__title { font-size: var(--sc-t-2xl); font-weight: 600; color: var(--night-ink); max-width: 15ch; }
.peak__body {
  margin: var(--sc-4) 0 0; max-width: 40ch;
  color: var(--night-soft); line-height: 1.66; letter-spacing: 0.002em; text-wrap: pretty;
}
.peak__credit { margin: var(--sc-5) 0 0; font-size: var(--sc-t-sm); color: var(--night-acc); max-width: 40ch; }
.peak__static { display: none; }
.peak__tag {
  position: absolute; z-index: 2; margin: 0;
  top: calc(var(--bar-h) + clamp(1.25rem, 4vh, 2.5rem)); right: var(--sc-gutter);
  font-family: var(--sc-font-mono); font-size: var(--sc-t-xs);
  letter-spacing: var(--sc-track-wide); text-transform: uppercase; color: var(--night-acc);
}
.rm .peak__tag { display: none; }
.peak ::selection { background: var(--night-acc); color: var(--night); }

/* ----------------------------------------------------------- the range -- */
.range__stage { display: flex; align-items: center; padding-top: var(--bar-h); }
.range__rail {
  gap: clamp(1rem, 2.2vw, 2.25rem); align-items: flex-start;
  padding-inline: var(--sc-gutter);
}
.range__lead { flex: 0 0 clamp(17rem, 29vw, 28rem); padding-top: var(--sc-4); }
.range__title { font-size: var(--sc-t-3xl); font-weight: 600; }
.range__intro { margin: var(--sc-5) 0 0; color: var(--sc-ink-soft); max-width: 30ch; font-size: var(--sc-t-lg); line-height: 1.45; }
.item { flex: 0 0 clamp(15.5rem, 23vw, 21rem); }
.item__media {
  margin: 0; aspect-ratio: 4 / 3; border-radius: var(--sc-r-sm); overflow: hidden;
  box-shadow: var(--sc-e2);
}
.item__media:not(.ph) { background: var(--sc-surface); }
.item__media > img { width: 100%; height: 100%; object-fit: cover; }
.item h3 {
  margin: var(--sc-5) 0 0; font-family: var(--sc-font-display); font-weight: 600;
  font-size: clamp(1.25rem, 0.9rem + 1vw, 1.75rem); letter-spacing: var(--sc-track-snug); line-height: 1.1;
  overflow-wrap: anywhere;
}
.item p { margin: var(--sc-3) 0 0; color: var(--sc-ink-soft); max-width: 34ch; text-wrap: pretty; }
.range__note {
  flex: 0 0 clamp(15rem, 21vw, 19rem); align-self: center;
  border-left: 1px solid var(--sc-hairline-strong); padding-left: var(--sc-6);
}
.range__note p {
  margin: 0 0 var(--sc-4); font-family: var(--sc-font-display); font-weight: 600;
  font-size: var(--sc-t-xl); line-height: 1.15; letter-spacing: var(--sc-track-snug);
}
@media (prefers-reduced-motion: no-preference) {
  .item {
    --s: clamp(0, calc(var(--sc-p, 0) * 5 - var(--i) + 2.2), 1);
    opacity: calc(0.55 + 0.45 * var(--s));
    transform: translate3d(0, calc((1 - var(--s)) * 22px), 0);
  }
}

/* ----------------------------------------------------------- the proof -- */
.proof { padding-block: var(--sc-section); }
.proof__title { font-size: var(--sc-t-3xl); font-weight: 600; max-width: 14ch; }
.proof__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sc-6); row-gap: var(--sc-8); margin-top: var(--sc-9); align-items: start;
}
.quote { margin: 0; }
.quote blockquote { margin: 0; text-wrap: pretty; }
.quote figcaption { display: flex; align-items: center; gap: var(--sc-4); margin-top: var(--sc-5); font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.quote figcaption img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.quote figcaption b { display: block; color: var(--sc-ink); font-weight: 600; }
.quote--lead { grid-column: 1 / span 7; }
.quote--lead blockquote {
  font-family: var(--sc-font-display); font-weight: 500;
  font-size: var(--sc-t-xl); line-height: 1.3; letter-spacing: var(--sc-track-snug); color: var(--sc-ink);
}
.ledger { grid-column: 9 / span 4; margin: 0; }
.ledger > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--sc-4);
  padding: var(--sc-4) 0; border-top: 1px solid var(--sc-hairline-strong);
}
.ledger dt { color: var(--sc-ink-soft); font-size: var(--sc-t-sm); }
.ledger dd {
  margin: 0; font-family: var(--sc-font-display); font-weight: 600;
  font-size: var(--sc-t-2xl); letter-spacing: var(--sc-track-snug); line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--sc-accent);
}
.proof__pair {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sc-8);
  margin-top: var(--sc-9);
}
.proof__pair .quote { border-top: 1px solid var(--sc-hairline-strong); padding-top: var(--sc-5); }
.proof__pair blockquote { color: var(--sc-ink); max-width: 58ch; }

/* ----------------------------------------------------------- the close -- */
.close__stage { --p: var(--sc-p, 0); display: flex; flex-direction: column; padding-top: var(--bar-h); }
.close__inner { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.close__title { font-size: var(--sc-t-3xl); font-weight: 600; max-width: 16ch; }
.close__lede { margin: var(--sc-5) 0 0; max-width: 46ch; font-size: var(--sc-t-lg); line-height: 1.45; color: var(--sc-ink-soft); }

/* The plan as one dimension line: ticks at each station, drawn by scroll,
   closing on the button. */
.chain {
  --draw: clamp(0, calc(var(--p) * 2.1), 1);
  position: relative; list-style: none; margin: var(--sc-8) 0 0; padding: var(--sc-6) 0 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; column-gap: var(--sc-6);
}
.chain::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1.5px;
  background: var(--sc-ink); transform-origin: 0 50%; transform: scaleX(var(--draw));
}
.chain > li { position: relative; }
.chain > li::before {
  content: ""; position: absolute; top: calc(var(--sc-6) * -1 - 9px); left: 0;
  width: 1.5px; height: 18px; background: var(--sc-ink); transform: rotate(45deg);
}
.chain__step b { display: block; font-family: var(--sc-font-display); font-weight: 600; font-size: var(--sc-t-xl); letter-spacing: var(--sc-track-snug); line-height: 1.1; }
.chain__step span { display: block; margin-top: var(--sc-2); color: var(--sc-ink-soft); max-width: 26ch; }
.chain__end { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sc-3); }
.chain__end::before { left: auto !important; right: 0; }
.chain__alt { font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.chain__alt a { color: var(--sc-ink); }

.foot { border-top: 1px solid var(--sc-hairline); padding-block: var(--sc-5); font-size: var(--sc-t-xs); color: var(--sc-ink-soft); }
.foot__inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sc-3) var(--sc-6); }
.foot__mark { width: auto; height: 36px; }
.foot address { font-style: normal; max-width: 52ch; }
.foot a { color: var(--sc-ink-soft); }
.foot a:hover { color: var(--sc-ink); }

/* -------------------------------------------------------- reduced motion --
   page.js adds .rm and turns the pinned acts into flow before mounting. The
   whole story stays: planes rest, the peak shows the cloud beside the model. */
.rm .hero__far, .rm .hero__contours, .rm .hero__subject, .rm .hero__near { transform: none; }
.rm .hero__contours { -webkit-mask-image: none; mask-image: none; }
.rm .hero { position: relative; height: 100svh; overflow: clip; }
.rm .hero__stage { position: absolute; inset: 0; }
.rm .peak__screen { position: relative; clip-path: none; padding: calc(var(--bar-h) + var(--sc-8)) var(--sc-gutter) var(--sc-8); }
.rm .peak__canvas, .rm .peak__scrim { display: none; }
.rm .peak__copy { position: relative; left: auto; bottom: auto; margin-bottom: var(--sc-7); }
.rm .peak__static { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--sc-6); align-items: center; margin-top: var(--sc-6); }
.rm .peak__static img { width: 100%; height: auto; border-radius: var(--sc-r-sm); }
.rm .peak__static img:last-child { background: #FFFFFF; }
.rm .close__stage { min-height: 100svh; }
/* The rail would otherwise hold 2.8 screens still; laid out as a grid instead. */
.rm .range__stage { padding-block: calc(var(--bar-h) + var(--sc-8)) var(--sc-9); }
.rm .range__rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--sc-7) var(--sc-6); }
.rm .range__lead { grid-column: 1 / -1; }
.rm .range__note { align-self: start; }
/* As flow sections these cues would key to a progress the page never reaches
   (the close sits at the very end), so the CTA would never appear. Show them. */
.rm :is(.hero, .peak, .close) [data-sc-cue] { opacity: 1 !important; transform: none !important; }
.rm .chain { --draw: 1; }

/* ---------------------------------------------------------------- phone -- */
@media (max-width: 760px) {
  :root { --bar-h: 58px; }
  .bar { gap: var(--sc-4); }
  .bar__nav { display: none; }
  .bar__mark img { height: 40px; }
  .bar .btn--sm { margin-left: auto; padding: 0 var(--sc-3); font-size: 0.8rem; min-height: 38px; }

  .hero__copy { top: calc(var(--bar-h) + var(--sc-6)); bottom: auto; right: var(--sc-gutter); max-width: none; }
  .hero__title { font-size: clamp(2.5rem, 11vw, 3.2rem); }
  .hero__sub { font-size: var(--sc-t-base); }
  .hero__actions { gap: var(--sc-3) var(--sc-5); }
  .hero__scrim { background: linear-gradient(180deg, var(--sc-canvas) 0%, color-mix(in oklab, var(--sc-canvas) 82%, transparent) 46%, transparent 64%); }
  .hero__subject { --rise: 50px; right: -4vw; width: 64vw; height: 52vh; bottom: -18vh; }
  .hero__subject .ph__label { bottom: calc(8vh + var(--sc-4)); font-size: 0.62rem; }
  .hero__near { right: auto; left: -4vw; width: 6rem; bottom: -6vh; }
  .hero__contours { -webkit-mask-image: none; mask-image: none; opacity: 0.8; }

  .problem__title, .problem__costs, .problem__turn { grid-column: 1 / -1; }
  .problem__grid { row-gap: var(--sc-6); }

  .peak__scrim { background: linear-gradient(0deg, color-mix(in oklab, var(--night) 94%, transparent) 0%, color-mix(in oklab, var(--night) 72%, transparent) 34%, transparent 52%); }
  .peak__copy { right: var(--sc-gutter); bottom: clamp(2rem, 6vh, 3rem); }
  .peak__title { font-size: clamp(1.7rem, 7.4vw, 2.2rem); }
  .peak__body { font-size: var(--sc-t-sm); }

  .item { flex-basis: 76vw; }
  .range__lead { flex-basis: 74vw; }
  .range__note { flex-basis: 70vw; }

  .quote--lead, .ledger { grid-column: 1 / -1; }
  .proof__grid { margin-top: var(--sc-7); row-gap: var(--sc-6); }
  .proof__pair { grid-template-columns: 1fr; gap: var(--sc-6); margin-top: var(--sc-7); }

  .close__title { font-size: var(--sc-t-2xl); }
  .close__lede { font-size: var(--sc-t-base); }
  .chain {
    grid-template-columns: 1fr; row-gap: var(--sc-4);
    margin-top: var(--sc-6); padding: 0 0 0 var(--sc-6);
  }
  .chain::before { right: auto; bottom: 0; width: 1.5px; height: auto; transform-origin: 50% 0; transform: scaleY(var(--draw)); }
  .chain > li::before { top: 4px; left: calc(var(--sc-6) * -1 - 8px); width: 18px; height: 1.5px; transform: rotate(-45deg); }
  .chain__end::before { left: calc(var(--sc-6) * -1 - 8px) !important; right: auto; }
  .chain__step span { font-size: var(--sc-t-sm); }
  .chain__step b { font-size: var(--sc-t-lg); }
  .btn--lg { min-height: 52px; font-size: var(--sc-t-base); }
  .foot__inner { gap: var(--sc-2) var(--sc-5); }
  .foot address { flex-basis: 100%; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .rm .peak__static { grid-template-columns: 1fr; }
}
