/* Refined concept: the live studea.co.uk styles (base.css) plus a pinned chrome umbrella. */

/* base.css sets body overflow-x: hidden, which makes body a scroll container and stops
   position: sticky from pinning. clip keeps the same no-horizontal-scroll guarantee. */
body { overflow-x: clip; }

/* Two columns: the copy scrolls, the umbrella stays pinned beside it. */
.split {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(24px, 4vw, 64px);
}
.split-copy { min-width: 0; }
.split-stage { position: relative; }
.stage-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: grid; place-items: center;
}
#umbrella {
  grid-area: 1 / 1; width: 100%; height: 84vh; height: 84svh;
  opacity: 0; transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: grab; touch-action: pan-y;
}
#umbrella.pointing { cursor: pointer; }
#umbrella.dragging { cursor: grabbing; }

/* The tag that follows the pointer over a panel: number, name, what it is. */
.umb-tag {
  position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none;
  display: grid; grid-template-columns: auto auto; column-gap: 12px; row-gap: 6px;
  padding: 12px 14px; border: 1px solid var(--rule-strong);
  background: rgba(5, 5, 5, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: var(--ink); letter-spacing: 0.16em; white-space: nowrap;
  opacity: 0; transform: translate3d(var(--tx, 0), var(--ty, 0), 0) scale(0.96);
  transform-origin: 0 0;
  transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.umb-tag.show { opacity: 1; transform: translate3d(var(--tx, 0), var(--ty, 0), 0); }
.umb-tag-idx { color: var(--tag-tint, var(--ink-faint)); }
.umb-tag-cat { grid-column: 2; color: var(--ink-faint); font-size: 0.86em; }
.umb-tag-name { color: var(--ink); }
.gl-ready #umbrella { opacity: 1; }
/* The static chrome placeholder is a different look from the WebGL line umbrella, so showing it
   during load made the two swap and read as a glitch. Keep the stage black until the real umbrella
   fades in; only reveal the placeholder when WebGL is genuinely unavailable. */
.stage-fallback { grid-area: 1 / 1; width: min(64%, 420px); height: auto; opacity: 0; transition: opacity 0.8s ease; pointer-events: none; }
.nogl .stage-fallback { opacity: 0.9; }
.stage-caption {
  position: absolute; left: 0; right: 0; bottom: max(28px, 4vh);
  display: flex; justify-content: space-between; gap: 16px;
  color: var(--ink-dim); letter-spacing: 0.18em; margin: 0; font-size: 12px;
}
.stage-name { color: var(--ink); transition: color 0.3s ease; }
/* The hint leads the eye on load, then clears so it is not permanent instruction copy. */
.stage-hint { transition: opacity 0.6s ease; }
.hint-done .stage-hint { opacity: 0; }
.nogl .stage-hint, .nogl #umbrella { display: none; }

/* Hero: the live copy, revealed line by line. */
.r-hero {
  min-height: calc(100svh - 96px);
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 24px; padding-bottom: 72px;
}
.r-kicker { display: flex; align-items: center; gap: 14px; color: var(--ink-faint); letter-spacing: 0.18em; margin: 0 0 28px; }
.r-kicker .rule, .section-eyebrow .rule { display: inline-block; width: 36px; height: 1px; background: var(--rule-strong); }
.r-hero { padding-left: 0 !important; padding-right: 0 !important; }
.r-title {
  font-size: clamp(40px, 4.6vw, 76px); line-height: 1.04; letter-spacing: -0.03em; margin: 0;
  max-width: 14ch; text-wrap: balance;
  animation: r-rise 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes r-rise { from { clip-path: inset(0 0 100% 0); transform: translateY(0.2em); } to { clip-path: inset(0 0 -0.2em 0); transform: none; } }
.r-sub { margin-top: 44px !important; max-width: 46ch; }

/* Index: rows sized for the narrower column; the row in focus leads. */
.r-index { padding: 0 0 12vh !important; }
.r-index-head { padding: 96px 0 40px; border-top: 1px solid var(--rule); }
.r-index-title { font-size: clamp(40px, 4.4vw, 72px); margin: 18px 0 0; letter-spacing: -0.03em; }
.r-index .position { display: flex; flex-direction: column; }
.r-index .iso { order: 2; }
.r-index .position-link {
  order: 1;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 28px;
  padding-top: 44px; padding-bottom: 8px;
}
.r-index .position-meta { justify-self: start; margin-top: 6px; }
.r-index .position-name { font-size: clamp(40px, 4.6vw, 76px); }
.r-index .iso { transition: opacity 0.5s ease; }
.has-active .r-index .position:not(.is-active) .iso { opacity: 0.4; }
@media (hover:hover) and (pointer:fine){.has-active .r-index .position:not(.is-active):hover .iso{ opacity: 1; }}

/* The product in focus takes its brand colour, matching its lit panel on the umbrella,
   and its line motif plays. Same treatment as hover, without the padding shift. */
.r-index .position-idx { font-variant-numeric: tabular-nums; }
.r-index .position-line { text-wrap: pretty; }
.r-index .position.is-active .position-idx { color: var(--tint); }
.r-index .position-name { transition: color 0.4s ease, transform 220ms cubic-bezier(0.23, 1, 0.32, 1); }
.r-index .position.is-active .position-name { color: var(--tint); text-shadow: 0 0 28px color-mix(in srgb, var(--tint) 42%, transparent); }
.r-index .position.is-active .position-motif { color: var(--tint); }
.r-index .position.is-active .position-link::after { width: 100%; }
.r-index .position.is-active .position-meta { border-color: var(--ink-faint); color: var(--ink); }
/* Hover keeps the live behaviour, but labels stay neutral so colour belongs to the name. */
@media (hover:hover) and (pointer:fine){.r-index .position-link:hover .position-cat{ color: var(--ink); }}
@media (hover:hover) and (pointer:fine){.r-index .position-link:hover .position-name{ color: var(--tint); }}
.r-index .position.is-active .m-needle { animation: m-needle 1.8s ease-in-out infinite alternate; }
.r-index .position.is-active .m-road { animation: m-road 1.2s linear infinite; }
.r-index .position.is-active .m-van { animation: m-van 1.5s ease-in-out infinite; }
.r-index .position.is-active .m-check { animation: m-check 2.4s ease-in-out infinite; }
.r-index .position.is-active .m-scan { animation: m-scan 2.4s ease-in-out infinite; }
.r-index .position.is-active .m-forecast { animation: m-forecast 2.8s ease-in-out infinite; }
.r-index .position.is-active .m-forecast-dot { animation: m-forecast-dot 2.8s ease-in-out infinite; }
.stage-name { display: inline-flex; align-items: center; gap: 10px; }
.stage-name::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--active-tint, var(--ink-faint));
  transition: background-color 0.3s ease;
}

/* Company record: the live grid with the full register details. */
.record-grid .r-wide { grid-column: span 2; }
.record-grid .r-full { grid-column: 1 / -1; }
.r-sic span { display: block; }
.r-sic span + span { margin-top: 6px; }
.r-record-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 28px; }
.r-record-actions a { color: var(--ink-dim); text-decoration: none; letter-spacing: 0.16em; }
@media (hover:hover) and (pointer:fine){.r-record-actions a:hover{ color: var(--ink); }}
.r-copy {
  font: inherit; letter-spacing: 0.16em; color: var(--ink); background: transparent;
  border: 1px solid var(--rule-strong); padding: 12px 18px; cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
@media (hover:hover) and (pointer:fine){.r-copy:hover{ border-color: var(--ink); background: rgba(255, 255, 255, 0.04); }}
.r-copy:focus-visible, #umbrella:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Footer wordmark catches the light as the pointer crosses it. */
.r-foot-text { fill: url(#foot-sweep); }

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .split-copy { display: contents; }
  .r-hero { order: 0; min-height: 0; padding-top: 24px; padding-bottom: 8px; }
  .split-stage { order: 1; }
  .r-index { order: 2; }
  .stage-sticky { position: relative; height: auto; aspect-ratio: 4 / 3; max-height: 40svh; margin: 0 auto; width: 100%; }
  #umbrella { height: 100%; }
  .stage-caption { bottom: 4px; }
  .stage-hint { display: none; }
  .r-index .position-link { grid-template-columns: 36px minmax(0, 1fr); gap: 16px; padding-top: 32px; padding-bottom: 32px; }
  .r-index .position-motif { display: none; }
  .record-grid .r-wide, .record-grid .r-full { grid-column: auto; }
  .has-active .r-index .position:not(.is-active) { opacity: 1; }
  .r-index-head { padding-top: 32px; padding-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .r-title { animation: none; }
  #umbrella, .umb-tag { transition: none; }
}
