/* CityRoamer case page. Load after case3d.css. Without html.cr-3d: one column, a still per act.
   With it: the stage pins and the acts scroll over it. Scroll lengths use --cr-u (fixed 1svh). */

/* No sideways scroll, without turning body into a scroll container (sticky needs that). */
html, body { overflow-x: visible; overflow-x: clip; }

body[data-page="cityroamer"] {
  --cr-navy: #17182C;
  --cr-navy-0: rgba(23, 24, 44, 0);
  --cr-navy-88: rgba(23, 24, 44, .88);
  --cr-amber: #D8A353;
  --cr-pale: #E6ECFF;
  --cr-pale-18: rgba(230, 236, 255, .18);
  --cr-hair: rgba(230, 236, 255, .12);
  --cr-paper: #DCDAD4;
  --cr-paper-ink: #14171C;
  --cr-paper-muted: #474D57;
  --cr-paper-rule: rgba(20, 23, 28, .32);
  --cr-dark: #07080a;
  --cr-head: 73px;
  --cr-u: var(--case3d-vh, 1svh);
  --cr-pad: max(var(--rebuild-gutter), calc((100% - var(--rebuild-max)) / 2 + var(--rebuild-gutter)));
  --cr-col: min(28rem, 34%);
}

.cr-case { display: block; }
.cr-case a:focus-visible { outline: 2px solid var(--case-accent); outline-offset: 3px; border-radius: 2px; }
.cr-wrap { max-width: var(--rebuild-max); margin: 0 auto; padding: 0 var(--rebuild-gutter); }
.cr-case .eyebrow { margin: 0 0 14px; font: 500 .8125rem/1.4 "JetBrains Mono", var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--case-accent); }
.cr-case .eyebrow a { color: inherit; text-decoration: none; }
.cr-case .eyebrow a:hover { text-decoration: underline; text-underline-offset: 4px; }
.cr-case h2 { margin: 0 0 18px; font: 500 clamp(1.75rem, 3vw, 2.5rem)/1.12 "Space Grotesk", var(--font-display); letter-spacing: -.02em; color: var(--color-text); text-wrap: balance; }

/* The reveal screen is the drafting board itself, so lifting it only uncovers the drawing. */
body[data-page="cityroamer"] .case3d-reveal { background: var(--cr-navy); }

/* ---------- the film: shared parts ---------- */
.cr-film { position: relative; background: var(--cr-navy); color: var(--color-body); }
.cr-hero { max-width: var(--rebuild-max); margin: 0 auto; padding: clamp(36px, 6vw, 80px) var(--rebuild-gutter) 32px; }
.cr-hero__title { margin: 0 0 18px; font: 500 clamp(3rem, 7.4vw, 6rem)/.98 "Space Grotesk", var(--font-display); letter-spacing: -.035em; color: var(--color-text); }
.cr-hero__deck { max-width: 34rem; margin: 0 0 26px; font-size: clamp(1.05rem, 1.35vw, 1.2rem); line-height: 1.55; color: var(--color-body); }
.cr-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0 0 22px; padding: 16px 0 0; list-style: none; border-top: 1px solid var(--cr-hair); font: 400 .8125rem/1.5 "JetBrains Mono", var(--font-mono); color: var(--color-text); }
.cr-meta span { margin-right: 4px; color: var(--color-meta); text-transform: uppercase; letter-spacing: .1em; }
.cr-meta a { color: var(--case-accent); text-decoration: none; display: inline-flex; align-items: center; min-height: 40px; margin: -10px 0; }
.cr-meta a:hover { text-decoration: underline; text-underline-offset: 4px; }
.cr-hero__note { max-width: 32rem; margin: 0; font: 400 .8125rem/1.6 "JetBrains Mono", var(--font-mono); color: var(--color-meta); }

.cr-act { max-width: var(--rebuild-max); margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--rebuild-gutter); }
.cr-act__card { max-width: 44rem; }
.cr-act__card p { margin: 0; font-size: 1.0625rem; line-height: 1.65; }
.cr-act__no { color: var(--cr-amber) !important; }
.cr-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.cr-list li { position: relative; padding-left: 20px; font-size: 1rem; line-height: 1.55; }
.cr-list li::before { content: ""; position: absolute; left: 0; top: .72em; width: 9px; height: 1px; background: var(--cr-amber); }
.cr-list strong { color: var(--color-text); font-weight: 600; }

.cr-still { margin: 32px 0 0; }
.cr-still img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--cr-hair); }
.cr-film__stage, .cr-film__veil { display: none; }

/* ---------- the film, live: the stage pins and the acts scroll over it ---------- */
.cr-3d .cr-film { display: grid; margin-top: calc(-1 * var(--cr-head)); }
.cr-3d .cr-film > * { grid-area: 1 / 1; min-width: 0; }
.cr-3d .cr-still { display: none; }
.cr-3d .cr-film__stage { display: block; position: sticky; top: 0; align-self: start; z-index: 0; background: var(--cr-navy); --case3d-stage-vh: 100; }
.cr-3d .cr-film__copy { position: relative; z-index: 1; }
.cr-3d .cr-hero { max-width: none; margin: 0; display: flex; flex-direction: column; justify-content: center; min-height: calc(var(--cr-u) * 100); padding: calc(var(--cr-head) + 24px) var(--cr-pad) 48px; }
.cr-3d .cr-act { max-width: none; margin: 0; min-height: calc(var(--cr-u) * 130); padding: 0 var(--cr-pad); }
.cr-3d .cr-act--refined { min-height: calc(var(--cr-u) * 170); }

.cr-film__frame { position: absolute; z-index: 0; left: 4%; right: 4%; top: calc(var(--cr-head) + 10px); bottom: 48px; }
.cr-film__frame picture { display: contents; }
.cr-film__poster { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.cr-film__alt[hidden] { display: none; }
.case3d-stage .case3d-canvas { z-index: 1; }

.cr-hud { position: absolute; z-index: 3; left: 4%; right: 4%; bottom: 14px; font: 500 .75rem/1 "JetBrains Mono", var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--cr-pale); }
.cr-hud__acts { display: flex; gap: 16px; margin: 0 0 10px; padding: 0; list-style: none; }
.cr-hud__acts li { opacity: .6; transition: opacity 300ms var(--ease-out); white-space: nowrap; }
.cr-hud__acts li.is-on { opacity: 1; }
.cr-hud__acts b { margin-right: 5px; font-weight: 500; color: var(--cr-amber); }
.cr-hud__line { display: block; height: 1px; max-width: 420px; overflow: hidden; background: var(--cr-pale-18); }
.cr-hud__fill { display: block; height: 100%; background: var(--cr-amber); transform-origin: 0 50%; transform: scaleX(var(--cr-progress, 0)); }

/* Phone and portrait: the stage holds the top of the screen and the copy slides under its edge. */
@media not all and (min-width: 821px) and (min-aspect-ratio: 5/4) {
  /* The bottom margin equals the veil, so stage and veil let go together and the rail leaves whole. */
  .cr-3d .cr-film__stage { --case3d-stage-vh: 56; z-index: 2; margin-bottom: 40px; }
  .cr-3d .cr-film__veil { display: block; position: sticky; z-index: 2; align-self: start; top: calc(var(--cr-u) * 56); height: 40px; margin-top: calc(var(--cr-u) * 56); pointer-events: none; background: linear-gradient(var(--cr-navy), var(--cr-navy-0)); }
  .cr-3d .cr-hero { justify-content: flex-start; padding-top: calc(var(--cr-u) * 56 + 28px); padding-bottom: 40px; }
  .cr-3d .cr-hero__title { font-size: clamp(2.6rem, 12vw, 4rem); margin-bottom: 12px; }
  .cr-3d .cr-hero__deck { margin-bottom: 18px; }
  .cr-3d .cr-act { padding-top: calc(var(--cr-u) * 14); min-height: calc(var(--cr-u) * 120); }
  .cr-3d .cr-act--refined { min-height: 0; padding-bottom: 32px; } /* the film ends with its last line */
  /* Tall enough screens hold the short cards under the stage while their act plays above them. */
  @media (min-height: 700px) {
    .cr-3d .cr-act:not(.cr-act--refined) .cr-act__card { position: sticky; top: calc(var(--cr-u) * 56 + 30px); }
  }
}

/* Desktop: the copy holds a left column over a scrim, the block sits to its right. */
@media (min-width: 821px) and (min-aspect-ratio: 5/4) {
  .cr-3d .cr-hero > *, .cr-3d .cr-act__card { max-width: var(--cr-col); }
  .cr-3d .cr-hero__title { font-size: clamp(3.2rem, 6vw, 5.6rem); }
  .cr-3d .cr-act { display: flex; flex-direction: column; }
  .cr-3d .cr-act__card { position: sticky; top: calc(var(--cr-head) + var(--cr-u) * 14); padding: 8px 0 40px; }
  .cr-3d .cr-act__card h2 { font-size: clamp(1.75rem, 2.5vw, 2.4rem); }
  .cr-3d .cr-film__stage::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(90deg, var(--cr-navy) 0, var(--cr-navy-88) calc(var(--cr-pad) + var(--cr-col) * .7), var(--cr-navy-0) calc(var(--cr-pad) + var(--cr-col) + 4%)); }
  .cr-film__frame { left: calc(var(--cr-pad) + var(--cr-col) + 3%); right: 3%; top: calc(var(--cr-head) + 5%); bottom: 13%; }
  .cr-hud { left: calc(var(--cr-pad) + var(--cr-col) + 3%); right: auto; bottom: 5%; }
  .cr-hud__acts { gap: 26px; letter-spacing: .14em; }
  .cr-hud__line { width: 420px; }
}

/* ---------- four service studies ---------- */
/* .is-stepped (set by the script, wide screens, motion on) pins the grid while four steps of scroll
   light one tile each; .is-live dims the tiles that are not lit. Without either: a plain grid. */
.cr-studies { position: relative; background: var(--cr-navy); padding: clamp(64px, 9vw, 120px) 0 clamp(40px, 6vw, 80px); color: var(--color-body); }
.cr-studies__pin { display: grid; gap: 32px; max-width: var(--rebuild-max); margin: 0 auto; padding: 0 var(--rebuild-gutter); }
.cr-studies__copy p:not(.eyebrow) { max-width: 30rem; margin: 0; font-size: 1.0625rem; line-height: 1.65; }
.cr-studies__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; margin: 0; padding: 0; list-style: none; }
.cr-study { min-width: 0; }
.cr-study figure { margin: 0; }
.cr-study__frame { position: relative; overflow: hidden; aspect-ratio: 1; border: 1px solid var(--cr-hair); border-radius: 10px; background: var(--cr-navy); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
.cr-study__frame img, .cr-study__frame video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.cr-study__frame video { opacity: 0; }
.cr-study.is-shown video { opacity: 1; } /* the poster is the loop's first frame: no fade needed */
.cr-study__frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--cr-amber); opacity: 0; pointer-events: none; transition: opacity 450ms var(--ease-out); }
.cr-studies.is-live .cr-study.is-on .cr-study__frame::after { opacity: 1; }
.cr-studies.is-live .cr-study:not(.is-on) .cr-study__frame { opacity: .42; transform: scale(.97); }
.cr-study figcaption { margin-top: 10px; font: 500 .8125rem/1.4 "JetBrains Mono", var(--font-mono); letter-spacing: .06em; color: var(--color-text); }
.cr-study figcaption span { margin-right: 8px; color: var(--cr-amber); }
@media (max-width: 600px) {
  .cr-studies__grid { grid-template-columns: minmax(0, 1fr); max-width: 480px; gap: 28px; }
}
@media (min-width: 821px) and (min-aspect-ratio: 5/4) {
  .cr-studies { --cr-tile: min(calc((var(--cr-u) * 100 - var(--cr-head) - 150px) / 2), 24vw); }
  .cr-studies__pin { max-width: none; padding: 0 var(--cr-pad); grid-template-columns: var(--cr-col) auto; column-gap: 3%; align-items: center; justify-content: start; }
  .cr-studies__grid { grid-template-columns: repeat(2, var(--cr-tile)); }
  .cr-studies.is-stepped { height: calc(var(--cr-u) * 320); padding: 0; }
  .cr-studies.is-stepped .cr-studies__pin { position: sticky; top: 0; height: calc(var(--cr-u) * 100); padding-top: var(--cr-head); align-content: center; }
}

/* ---------- every page, as served ---------- */
.cr-pages { padding: clamp(80px, 11vw, 150px) 0 clamp(56px, 8vw, 110px); background: linear-gradient(var(--cr-navy), var(--cr-dark) 240px); }
.cr-pages__note { max-width: 40rem; margin: 0; font: 400 .8125rem/1.6 "JetBrains Mono", var(--font-mono); color: var(--color-meta); }
.cr-spread { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; margin: 40px 0 0; padding: 0; list-style: none; }
.cr-spread li { min-width: 0; }
.cr-spread figure { margin: 0; }
.cr-spread img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); background: var(--cr-navy); }
.cr-spread figcaption { margin-top: 9px; font: 400 .75rem/1.35 "JetBrains Mono", var(--font-mono); color: var(--color-meta); }
@media (min-width: 600px) { .cr-spread { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cr-spread { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 26px 14px; } }

/* ---------- July words ---------- */
.cr-words { padding: clamp(40px, 6vw, 80px) 0; background: var(--cr-dark); }
.cr-quote { max-width: 54rem; margin: 0; padding-left: clamp(18px, 3vw, 32px); border-left: 1px solid var(--cr-amber); }
.cr-quote blockquote { margin: 0; }
.cr-quote p { margin: 0; font: 400 clamp(1.3rem, 2.4vw, 1.95rem)/1.42 "Space Grotesk", var(--font-display); letter-spacing: -.01em; color: var(--color-text); }
.cr-quote figcaption { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font: 500 .75rem/1.4 "JetBrains Mono", var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--color-meta); }
.cr-quote__by { color: var(--case-accent); }

/* ---------- the receipt: HTML text on Blender thermal paper ---------- */
.cr-proof { padding: clamp(56px, 8vw, 120px) 0; background: var(--cr-dark); }
.cr-proof__grid { display: grid; gap: 40px; }
.cr-proof__intro p:not(.eyebrow) { max-width: 30rem; margin: 0; font-size: 1.0625rem; line-height: 1.65; color: var(--color-body); }
.cr-receipt { position: relative; width: 100%; max-width: 440px; margin: 0 auto; }
.cr-receipt__slot { position: relative; z-index: 2; height: 14px; margin: 0 -12px; border-radius: 7px; background: #0e1015; border: 1px solid rgba(255, 255, 255, .12); box-shadow: inset 0 3px 5px rgba(0, 0, 0, .7); }
/* The paper rises out of a slot under it, head first; its curled end stays inside the slot. */
.cr-receipt__tray { position: relative; z-index: 1; margin-bottom: -7px; overflow: hidden; }
.cr-receipt__paper { margin-bottom: -44px; border: solid var(--cr-paper); border-width: 29px 23px 61px; background-color: var(--cr-paper); background-clip: padding-box; }
/* The paper texture loads as the receipt comes near (the script adds .is-near), or at once without scripts. */
html:not(.js) .cr-receipt__paper, .cr-receipt__paper.is-near { border-color: transparent; border-image: url("/images/cityroamer/receipt-paper.webp") 60 48 125 fill / 29px 23px 61px stretch; }
.cr-receipt__ink { padding: 14px 10px 6px; color: var(--cr-paper-ink); font: 400 .8125rem/1.45 "JetBrains Mono", var(--font-mono); background-color: var(--cr-paper); }
.cr-receipt__head { display: grid; gap: 4px; margin: 0 0 14px; padding-bottom: 12px; text-align: center; border-bottom: 1px dashed var(--cr-paper-rule); letter-spacing: .08em; }
.cr-receipt__head b { font-weight: 700; font-size: .9375rem; letter-spacing: .16em; }
.cr-receipt__head span { color: var(--cr-paper-muted); font-size: .75rem; }
.cr-receipt__lines { margin: 0; }
.cr-receipt__lines > div { display: grid; grid-template-columns: max-content minmax(10px, 1fr) max-content; align-items: baseline; column-gap: 6px; padding: 9px 0; border-bottom: 1px dashed var(--cr-paper-rule); }
.cr-receipt__lines > div::before { content: ""; grid-column: 2; grid-row: 1; align-self: end; margin-bottom: 4px; border-bottom: 1px dotted var(--cr-paper-muted); }
.cr-receipt__lines dt { grid-column: 1; grid-row: 1; font-weight: 600; }
.cr-receipt__lines dd { margin: 0; }
.cr-receipt__lines .v { grid-column: 3; grid-row: 1; font-weight: 700; text-align: right; }
.cr-receipt__lines .how { grid-column: 1 / -1; grid-row: 2; margin-top: 3px; font-size: .75rem; line-height: 1.45; color: var(--cr-paper-muted); }
.cr-receipt__lines .is-self dt, .cr-receipt__lines .is-self .v { color: #000; }
.cr-receipt__foot { margin: 12px 0 0; text-align: center; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cr-paper-muted); }
.cr-proof__more { margin: 36px 0 0; font-size: 1.0625rem; line-height: 1.6; color: var(--color-body); }
.cr-proof__more a { display: inline-flex; align-items: center; min-height: 40px; margin: -8px 0; color: var(--case-accent); text-decoration: none; }
.cr-proof__more a:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 900px) {
  .cr-proof__grid { grid-template-columns: minmax(0, 1fr) 440px; align-items: start; gap: 72px; }
  .cr-receipt { margin: 0; }
}

/* ---------- call to action ---------- */
.cr-cta { padding: 8px 0 clamp(72px, 10vw, 128px); background: var(--cr-dark); text-align: center; }
.cr-cta p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion-preference="on"]) :is(.cr-hud__acts li, .cr-study__frame, .cr-study__frame::after) { transition: none; }
}
