/* Keep geometry in CSS pixels; the legacy TV zoom breaks rail projection. */
body.home-redline { zoom: 1; }
/* One architectural space: copy, rail and service navigation share the viewport. */
.do-redline {
  --ink: #151316;
  --body: #151316;
  --accent-text: #9d1020;
  --redline-red: #e0162b;
  --redline-ink: #151316;
  --redline-gutter: clamp(28px, 5vw, 96px);
  --redline-header: 84px;
  /* Match the render: sun from the upper right, shadows fall down-left in cool, sky-lit grey. */
  --redline-shade: 40 46 70;
  --redline-shadow: -7px 6px 16px -7px rgb(var(--redline-shade) / .30), -1px 1px 2px rgb(var(--redline-shade) / .10);
  --redline-shadow-lift: -10px 9px 22px -8px rgb(var(--redline-shade) / .34), -1px 1px 3px rgb(var(--redline-shade) / .12);
  position: relative;
  isolation: isolate;
  color: var(--redline-ink);
  background: #f3f1ef;
  font-family: Arimo, Arial, sans-serif;
}
.do-redline *, .do-redline *::before, .do-redline *::after { box-sizing: border-box; }
.do-redline__stage {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: max(640px, calc(100svh - var(--redline-header)));
  overflow: hidden;
}
.do-redline__scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #f3f1ef;
}
.do-redline__camera {
  position: absolute;
  inset: 0;
  transform: translate3d(var(--redline-x, 0px), var(--redline-y, 0px), 0) scale(var(--redline-scale, 1));
  transform-origin: 78% 56%;
  transition: transform 700ms cubic-bezier(.2,.7,.2,1);
}
.do-redline__scene img, .do-redline__scene video {
  position: absolute;
  display: block;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 100% 50%;
}
.do-redline__scene video[hidden], .do-redline__depth[hidden] { display: none; }
.do-redline__depth { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.do-redline__copy {
  position: relative;
  isolation: isolate;
  padding: clamp(48px, 6svh, 80px) 0 44px;
  margin-left: max(24px, calc((100% - 1200px) / 2 + 24px));
  width: min(780px, calc(100% - 48px));
  max-width: none;
}
.do-redline__copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40px -70px -80px -160px;
  background: linear-gradient(90deg,rgba(255,255,255,.94),rgba(255,255,255,.85) 48%,rgba(255,255,255,.42) 72%,transparent);
  -webkit-mask-image: linear-gradient(#000 65%,transparent);
  mask-image: linear-gradient(#000 65%,transparent);
  pointer-events: none;
}
.do-redline h1 {
  margin: 0;
  color: var(--redline-ink);
  font: 700 clamp(40px, 4vw, 62px)/1.1 Arimo, Arial, sans-serif;
  letter-spacing: -.035em;
  text-shadow: none;
  text-wrap: initial;
}
.do-redline h1 span { display: block; white-space: nowrap; }
.do-redline .do-redline__summary {
  margin: 24px 0 0;
  color: var(--redline-ink);
  max-width: 22em;
  font-size: clamp(19px, 1.5vw, 23px);
  line-height: 1.5;
}
.do-redline .do-redline__action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 54px;
  margin-top: 22px;
  padding: 14px 24px;
  border-radius: 10px;
  background: var(--redline-red);
  color: #fff;
  font-size: clamp(16px, 1.1vw, 19px);
  line-height: 1.2;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--redline-shadow);
  transition: background .2s, box-shadow .2s;
}
.do-redline__action span { font-family: Arial, sans-serif; font-size: 1.2em; }
.do-redline .do-redline__action:hover { background: #bd1023; box-shadow: var(--redline-shadow-lift); }
.do-redline a:focus-visible { outline: 3px solid #151316; outline-offset: 5px; }
/* Service waypoints are anchored to the physical rail, not a footer strip. */
.do-redline__links { position:absolute; inset:0; z-index:3; pointer-events:none; }
.do-redline .do-redline__links a {
  position:absolute; display:flex; align-items:center; justify-content:center;
  width:max-content; min-height:44px; padding:10px 17px;
  border:1px solid #ffffffd9; border-radius:5px; background:#fffef9f5;
  color:#201c1d; font:600 16px/1.2 Arimo,Arial,sans-serif;
  text-decoration:none; box-shadow:var(--redline-shadow); pointer-events:auto;
  transition:background .2s,color .2s,box-shadow .2s;
}
.do-redline .do-redline__links a:hover { background:#e0162b; color:#fff; box-shadow:var(--redline-shadow-lift); }
.rail-stop--start { left:46%; top:76%; }
.rail-stop--turn { right:3%; top:39%; }
.rail-stop--end { left:46%; top:35%; }
.do-redline__explore {
  position: absolute;
  right: var(--redline-gutter);
  bottom: 34px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(21,19,22,.3);
  border-radius: 50%;
  color: var(--redline-ink);
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(8px);
  font: 24px/1 Arial, sans-serif;
  text-decoration: none;
}
.do-redline__explore:hover { background: #fff; }
.home-redline #home-ip-title { scroll-margin-top: 120px; }
/* The scene owns its visibility; exclude the site's general image fade-in. */
.do-redline__scene img { opacity: 1 !important; transition: none !important; }
/* Keep all copy stationary, including during the sitewide page entrance. */
body.home-redline.pjs main { animation: none; }
@media (max-width: 960px) {
  .do-redline { --redline-header: 72px; }
  .home-redline.redline-cta-visible .mobile-contact-bar { visibility: hidden; }
}
@media (max-width: 1100px) {
  .do-redline { --redline-gutter: 24px; }
  .do-redline__stage {
    align-items: flex-start;
    min-height: max(560px, calc(100svh - var(--redline-header)));
  }
  .do-redline__copy {
    max-width: none;
    margin-left: 0;
    width: 100%;
    padding: clamp(30px, 5svh, 56px) var(--redline-gutter) 38px;
  }
  .do-redline__copy::before { inset: -30px -24px -80px; -webkit-mask-image: none; mask-image: none; background: linear-gradient(180deg,rgba(255,255,255,.94),rgba(255,255,255,.88) 68%,rgba(255,255,255,.55) 83%,transparent); }
  .do-redline h1 { font-size: clamp(32px, calc(20px + 4vw), 56px); line-height: 1.1; }
  .do-redline h1 span { display: inline; white-space: normal; }
  .do-redline .do-redline__summary { max-width: 25em; text-wrap: initial; margin-top: 20px; font-size: 18px; text-shadow: none; }
  .do-redline .do-redline__action { margin-top: 22px; gap: 24px; font-size: 15px; min-height: 50px; padding: 13px 20px; }
  /* The architecture fills the entire portrait viewport, including behind the copy. */
  .do-redline__camera { inset: 0; transform-origin: 90% 60%; }
  .do-redline__scene img, .do-redline__scene video { object-position: 96% 50%; }
  .do-redline__scene::after {
    content: "";
    position: absolute;
    inset: 0;
    background: none;
    pointer-events: none;
  }
  .do-redline .do-redline__action { border: 1px solid rgba(255,255,255,.8); box-shadow: var(--redline-shadow); }
  .do-redline .do-redline__links a { font-size:14px; padding:10px 14px; }
  .rail-stop--start { left:8%; top:78%; }
  .rail-stop--turn { right:14px; top:68%; }
  .rail-stop--end { left:14px; top:60%; }
  .do-redline__stage { min-height:calc(var(--redline-copy-height,420px) + clamp(320px,108vw,460px) - 70px); }
  .do-redline__scene::before { content:""; position:absolute; inset:0; background:linear-gradient(#fff,#f3f1ef); }
  .do-redline__camera { top:calc(var(--redline-copy-height,420px) - 70px); bottom:auto; height:clamp(320px,108vw,460px); -webkit-mask-image:linear-gradient(transparent,#000 50px); mask-image:linear-gradient(transparent,#000 50px); }
  .do-redline__explore { right: var(--redline-gutter); bottom: 86px; width: 40px; height: 40px; font-size: 21px; }
}
@media (max-width: 520px) {
  .do-redline { --redline-gutter: 18px; }
}
@media (max-width: 360px) {
  .do-redline { --redline-gutter: 18px; }
  .do-redline h1 { font-size: 32px; }
  .do-redline .do-redline__action { font-size: 14px; gap: 12px; }
  .do-redline .do-redline__links a { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce), print {
  .do-redline__scene video, .do-redline__depth { display: none !important; }
  .do-redline__camera { transform: none !important; transition: none; }
}

/* The film reveals waypoints in place, without changing layout or moving copy. */
.do-redline .do-redline__links a { transition:opacity 220ms ease,background .2s,color .2s,box-shadow .2s; }
.do-redline[data-rail-playing] .rail-stop:not(.is-reached):not(:focus-visible) { opacity:0; visibility:hidden; pointer-events:none; }
@media (prefers-reduced-motion: reduce) {
  .do-redline .do-redline__links a { opacity:1; visibility:visible; transition:none; }
}
