/* visual.css — CD-105 §4.3. OURS, hash-pinned, staged and linked by every builder.
 *
 * ⛔ EVERY animation and transition in this file moves ONLY `transform` and `opacity`
 * (plus `stroke-dashoffset`, and only inside `[data-v-decor]`). `visual_composited` (§7.2)
 * parses this file and fails the build otherwise — the rule is compositor-side motion, so a
 * customer's page never repaints a layout to animate.
 *
 * ⚠ The skin battery (§4.3, D-502) rejects `view-transition-name` and the scroll-timeline
 * family on CONTENT subjects. That row governs AUTHOR css (skins), not this file: the
 * `view-transition-name` declarations below are ours, hashed, and deliberately scoped to the
 * page chrome, the hero band and, at the stronger strength, the one picture that leads a
 * listing's page (I-SBD61).
 */

/* ---------------------------------------------------------------- hover (level 0) */
.vt-hover-lift a,
.vt-hover-lift .card,
.vt-hover-lift .item {
  transition: transform 180ms cubic-bezier(.2, .6, .2, 1);
  will-change: transform;
}
.vt-hover-lift a:hover,
.vt-hover-lift .card:hover,
.vt-hover-lift .item:hover { transform: translateY(-3px); }

.vt-hover-underline a { position: relative; }
.vt-hover-underline a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 180ms cubic-bezier(.2, .6, .2, 1);
}
.vt-hover-underline a:hover::after { transform: scaleX(1); }

.vt-hover-zoom img,
.vt-hover-zoom picture { transition: transform 240ms cubic-bezier(.2, .6, .2, 1); }
.vt-hover-zoom a:hover img,
.vt-hover-zoom .card:hover img { transform: scale(1.04); }

/* ---------------------------------------------------------------- grid (level 0) */
.vt-grid-bento-3 > *,
.vt-grid-bento-5 > * { min-width: 0; }
.vt-grid-bento-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.vt-grid-bento-3 > :first-child { grid-column: span 2; }
.vt-grid-bento-5 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.vt-grid-bento-5 > * { grid-column: span 2; }
.vt-grid-bento-5 > :nth-child(1) { grid-column: span 4; }
.vt-grid-bento-5 > :nth-child(4) { grid-column: span 3; }
.vt-grid-bento-5 > :nth-child(5) { grid-column: span 3; }
.vt-grid-editorial { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.vt-grid-masonry-2 { columns: 2; column-gap: 1rem; }
.vt-grid-masonry-2 > * { break-inside: avoid; margin-bottom: 1rem; }

@media (max-width: 720px) {
  .vt-grid-bento-3,
  .vt-grid-bento-5,
  .vt-grid-editorial { grid-template-columns: 1fr; }
  .vt-grid-bento-3 > :first-child,
  .vt-grid-bento-5 > * { grid-column: auto; }
  .vt-grid-masonry-2 { columns: 1; }
}

/* ---------------------------------------------------------------- 3d (level 0) */
.vt-3d-tilt .card,
.vt-3d-tilt .item {
  transition: transform 220ms cubic-bezier(.2, .6, .2, 1);
  transform-style: preserve-3d;
}
.vt-3d-tilt .card:hover,
.vt-3d-tilt .item:hover { transform: perspective(700px) rotateX(2deg) rotateY(-2deg); }

.vt-3d-flip-card .card { perspective: 900px; }
.vt-3d-flip-card .card > * {
  transition: transform 320ms cubic-bezier(.2, .6, .2, 1);
  transform-style: preserve-3d;
}
.vt-3d-flip-card .card:hover > * { transform: rotateY(6deg); }

/* ---------------------------------------------------------------- nav (level 0) */
.vt-nav-drawer .navcb:checked ~ .navpanel { transform: translateX(0); }
.vt-nav-drawer .navpanel {
  transform: translateX(-100%);
  transition: transform 220ms cubic-bezier(.2, .6, .2, 1);
}
.vt-nav-grouped details > summary { cursor: pointer; }
.vt-nav-grouped details[open] > summary { opacity: .72; }

/* ---------------------------------------------------- transition (level 1) */
/* Cross-document view transitions. Scoped to the chrome and the hero band — never to body
 * copy — so a navigation animates the frame, not the reader's place in the text. */
@view-transition { navigation: auto; }
header { view-transition-name: vt-header; }
.hero { view-transition-name: vt-hero; }

/* `fade` is the UA's own cross-fade, named here so the class is a real rule rather than a
 * dead string `classes_for()` can emit and nothing defines. */
.vt-transition-fade .hero { view-transition-name: vt-hero-fade; }
::view-transition-old(vt-hero-fade),
::view-transition-new(vt-hero-fade) { animation-duration: 220ms; }

.vt-transition-slide .hero { view-transition-name: vt-hero-slide; }
::view-transition-old(vt-hero-slide) { animation: vt-slide-out 240ms cubic-bezier(.2, .6, .2, 1) both; }
::view-transition-new(vt-hero-slide) { animation: vt-slide-in 240ms cubic-bezier(.2, .6, .2, 1) both; }
@keyframes vt-slide-out { to { transform: translateX(-2%); opacity: 0; } }
@keyframes vt-slide-in { from { transform: translateX(2%); opacity: 0; } }

/* I-SBD61 — at the stronger strength the picture that leads a listing's page (`.tx-lead`, I-LSTG14) has a
 * name, and `leadPicture` (visual-core.js) gives the same name to the picture of the card or row whose
 * link was clicked: the browser then grows one into the other. One picture, never copy. The two
 * snapshots are cropped, not stretched, where the card's frame and the page's differ in shape. */
html[data-v-s="2"] .tx-lead img { view-transition-name: vt-lead; }
::view-transition-old(vt-lead),
::view-transition-new(vt-lead) { height: 100%; object-fit: cover; overflow: clip; }

/* ------------------------------------------------- the reveal hide rule (§4.2 item 3) */
/*
 * ⛔⛔ THREE conditions, all load-bearing, and the failsafe most of all.
 *
 * `[data-v-ready="ok"]` — nothing is EVER hidden until the runtime has said it booted. Over a
 * `file://` document (D-1522) or with JS off, `data-v-ready` never appears and this rule never
 * matches, so the copy is simply visible. That is the progressive-enhancement floor: without
 * JS nothing is hidden, ever.
 *
 * `:not(.vt-in)` — the runtime adds `.vt-in` synchronously to everything already in the
 * viewport BEFORE this can apply, so in-view content never flickers visible→hidden→revealed.
 *
 * `:not([data-v-error])` — a recipe that threw is shown, not lost.
 *
 * The failsafe is the answer to "what if the runtime wedges after setting ready?": the element
 * animates itself back to full opacity after 3s regardless. A stuck runtime costs a late
 * entrance; it must never cost the customer their words.
 */
@media (scripting: enabled) {
  [data-v-ready="ok"] [data-v~="reveal"]:not(.vt-in):not([data-v-error]),
  [data-v-ready="ok"] [data-v~="stagger"] [data-v-items] > *:not(.vt-in):not([data-v-error]),
  [data-v-ready="ok"] [data-v~="split"]:not(.vt-in):not([data-v-error]) {
    opacity: 0;
    animation: vt-failsafe 1ms 3s forwards;
  }
}
@keyframes vt-failsafe { to { opacity: 1; } }

/* ------------------------------------------------- the hero's entrance (D-2842, `hero-enter`) */
/*
 * The owner ruled that a hero headline may rise in on a site set to the stronger strength. So,
 * on a page built at that strength and only where a script can run, the hero's copy waits hidden
 * from the FIRST PAINT: hidden only once the runtime boots, it would be seen, vanish and rise.
 * Not keyed on `data-v-ready`, for that reason. `.vt-in` is added by the runtime in the task that
 * paints each part's own start state. The failsafe is shorter than a section's: this is the first
 * thing a visitor reads, and a runtime that never arrives must cost two seconds, not the words.
 * With scripts off, and under reduced motion (below), nothing here applies.
 */
@media (scripting: enabled) {
  html[data-v-s="2"] [data-v~="hero-enter"]:not(.vt-in):not([data-v-error]) :is(h1, .eyebrow, .lead, .cta) {
    opacity: 0;
    animation: vt-failsafe 1ms 2s forwards;
  }
}
/* a headline word and the line it rises from behind */
.vt-w { display: inline-block; overflow: clip; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.vt-w > span { display: inline-block; }
/* ---- the stronger strength's small moves (D-2842, I-SBD47) ---- */
/* the header steps aside on the way down and returns on the way up (the runtime sets `.vt-away`); a focus inside it
   always brings it back, so a keyboard never lands on a link that is off the screen */
html[data-v-s="2"] header.top { transition: transform 420ms cubic-bezier(.2, .7, .1, 1); }
html[data-v-s="2"] header.top.vt-away:not(:focus-within) { transform: translateY(-100%); }
/* a question's answer comes in softly when it is opened: opacity and a short rise, the box itself opens as it did */
@media (scripting: enabled) {
  html[data-v-s="2"] .faq details[open] > :not(summary) { animation: vt-open 320ms cubic-bezier(.2, .7, .1, 1); }
}
@keyframes vt-open { from { opacity: 0; transform: translateY(-6px); } }
/* the stronger strength's steps (D-2842, I-SBD50): a line that fills as the steps are read, and the number of the
   step in view on the picture that stays. The room for the line is made only where a script can draw it. */
@media (scripting: enabled) {
  html[data-v-s="2"] [data-v~="sticky-story"] :is([data-v-items], .story-steps) { position: relative; padding-left: 2.25rem; }
}
.vt-story-line { position: absolute; left: 0; top: .4rem; bottom: .4rem; width: 1px; background: currentColor; background: color-mix(in srgb, currentColor 22%, transparent); }
.vt-story-line > i { position: absolute; left: -1px; top: 0; width: 3px; height: 100%; background: currentColor; transform-origin: top; transform: scaleY(0); }
.vt-story-n { position: absolute; left: .75rem; top: .75rem; z-index: 1; padding: .2rem .55rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .12em; background: var(--card, #fff); color: var(--ink, #111); }
/* the picture curtain (D-2842, I-SBD46): the cover the runtime adds inside a picture's own frame and scales away */
.vt-cover { position: absolute; inset: 0; z-index: 1; transform-origin: 50% 100%; pointer-events: none; }
/* the hero's own background, drawn again on a layer the runtime can scale; the copy stays above it */
.vt-hero-pic { position: absolute; inset: 0; z-index: 0; background: inherit; pointer-events: none; }
[data-v~="hero-enter"] > .wrap { position: relative; z-index: 1; }
/* I-SBD60 — the hero's scroll cue (`heroCue` adds it): a short line at the hero's foot in the copy's
 * own colour, whose fill travels down TWICE and rests out of sight. Never a loop: a move that goes on
 * needs a stop control, and a cue is not worth one. It fades when the page is first scrolled. */
.vt-cue { position: absolute; left: 50%; bottom: 26px; z-index: 1; width: 1px; height: 64px; overflow: hidden;
  pointer-events: none; transition: opacity .4s linear; }
.vt-cue::before { content: ""; position: absolute; inset: 0; background: currentColor; opacity: .35; }
.vt-cue::after { content: ""; position: absolute; inset: 0; background: currentColor; transform: translateY(-100%);
  animation: vt-cue 2.4s cubic-bezier(.65, 0, .35, 1) 2 both; }
[data-v-ready="ok"] .vt-cue.vt-off { opacity: 0; }
@keyframes vt-cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* Infinite kind animations run ONLY once the runtime has confirmed it can pause them (§4.2
 * item 6). Paused-by-default is what makes the pause control honest: a mover nobody can stop
 * never starts. */
[data-v~="marquee"] .vt-track,
[data-v~="svg-anim"] [data-vt-anim] { animation-play-state: paused; }
[data-v-ready="ok"] [data-v~="marquee"] .vt-track,
[data-v-ready="ok"] [data-v~="svg-anim"] [data-vt-anim] { animation-play-state: running; }
/* I-SBD54 — the builder's own logo strip moves by the component kit's track, not `.vt-track`:
 * its stop button stops that track too. The kit's sheet loads after this one, hence !important. */
[data-v-paused="1"] .vt-track,
[data-v-paused="1"] .kit-marquee__track,
[data-v-paused="1"] [data-vt-anim] { animation-play-state: paused !important; }

/* ---------------------------------------------------------------- snap_row / sticky_story */
.sec-snap_row [data-v-items] {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2rem) / 3);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}
.sec-snap_row [data-v-items] > * { scroll-snap-align: start; }
@media (max-width: 720px) {
  .sec-snap_row [data-v-items] { grid-auto-columns: 82%; }
}
.sec-sticky_story .vt-media { position: sticky; top: 4rem; }

/* ---------------------------------------------------------------- the pause control */
/*
 * Emitted `hidden` by the builder and un-hidden by the runtime (§4.2 item 6): with no JS there
 * is nothing to pause, so a button that cannot work is never shown.
 */
.vt-pause {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  z-index: 2;
  font: inherit;
  font-size: .8125rem;
  line-height: 1;
  padding: .45rem .7rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  color: #16202b;
  cursor: pointer;
}
.vt-pause:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
[data-v~="marquee"],
[data-v~="video-hero"],
[data-v~="shader-bg"],
[data-v~="lottie"] { position: relative; }

/* ---------------------------------------------------------------- reduced motion */
/*
 * The rm block is belt AND braces: the runtime already refuses to start anything under rm
 * (§4.2 item 2), and this makes the CSS half true even if the runtime never loads.
 */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .vt-hover-lift a,
  .vt-hover-lift .card,
  .vt-hover-lift .item,
  .vt-hover-underline a::after,
  .vt-hover-zoom img,
  .vt-hover-zoom picture,
  .vt-3d-tilt .card,
  .vt-3d-tilt .item,
  .vt-3d-flip-card .card > *,
  .vt-nav-drawer .navpanel { transition: none; }
  .vt-hover-lift a:hover,
  .vt-hover-lift .card:hover,
  .vt-hover-lift .item:hover,
  .vt-hover-zoom a:hover img,
  .vt-hover-zoom .card:hover img,
  .vt-3d-tilt .card:hover,
  .vt-3d-tilt .item:hover,
  .vt-3d-flip-card .card:hover > * { transform: none; }
  [data-v-ready="ok"] [data-v~="reveal"]:not(.vt-in),
  [data-v-ready="ok"] [data-v~="stagger"] [data-v-items] > *:not(.vt-in),
  [data-v-ready="ok"] [data-v~="split"]:not(.vt-in) { opacity: 1; animation: none; }
  html[data-v-s="2"] [data-v~="hero-enter"]:not(.vt-in) :is(h1, .eyebrow, .lead, .cta) { opacity: 1; animation: none; }
  html[data-v-s="2"] [data-v~="sticky-story"] :is([data-v-items], .story-steps) { padding-left: 0; }
  html[data-v-s="2"] header.top { transition: none; }
  html[data-v-s="2"] header.top.vt-away { transform: none; }
  html[data-v-s="2"] .faq details[open] > :not(summary) { animation: none; }
  .vt-cue { display: none; }
  .vt-track,
  [data-vt-anim],
  [data-v-ready="ok"] .vt-track,
  [data-v-ready="ok"] [data-vt-anim] { animation-play-state: paused; }
  .sec-snap_row [data-v-items] { scroll-snap-type: none; }
}

/* ---------------------------------------------------------------- steps / cursor (visual-x.js) */
/*
 * ⛔ Both are added BY the runtime and styled here; neither hides anything on its own. A form
 * whose steps depended on this file would be a form that breaks when one asset 404s.
 */
.vt-steps-nav {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-top: 1rem;
}
.vt-steps-progress { margin: 0 auto 0 0; }

/*
 * ⚠ `transform` only, and `translate(-50%, -50%)` composed into the runtime's own translate would
 * fight it — so the offset is a margin, which never animates.
 */
.vt-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  will-change: transform;
}
.vt-cursor--ring {
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: .45;
}
.vt-cursor--dot {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: currentColor;
  border-radius: 50%;
  opacity: .6;
}
@media (prefers-reduced-motion: reduce) {
  .vt-cursor { display: none; }
}

/* ---------------------------------------------------------------- lightbox / snap-row nav */
/*
 * ⛔ `<dialog>` gives us the modal, the focus trap, the backdrop and Escape. Everything here is
 * appearance; nothing here is the behaviour, which is the browser's.
 */
.vt-lightbox {
  border: 0;
  padding: 0;
  max-width: min(92vw, 1100px);
  max-height: 92vh;
  background: #000;
  color: #fff;
}
.vt-lightbox::backdrop { background: rgba(0, 0, 0, .82); }
.vt-lightbox img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; }
.vt-lightbox-cap { margin: 0; padding: .6rem .9rem; font-size: 14px; }
.vt-lightbox-close { position: absolute; top: .5rem; right: .5rem; z-index: 1; }
.vt-lightbox-open {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  width: 100%;
}

.vt-row-nav { display: flex; gap: .4rem; justify-content: flex-end; margin-top: .5rem; }
/* the stronger strength's row (D-2842, I-SBD49): a line that shows where the visitor is in the row, and a mouse pull */
.vt-row-nav { align-items: center; }
.vt-row-bar { flex: 1; height: 1px; margin-right: 1rem; background: currentColor; background: color-mix(in srgb, currentColor 22%, transparent); position: relative; }
.vt-row-bar > i { position: absolute; left: 0; top: -1px; height: 3px; width: 100%; background: currentColor; transform-origin: left; }
html[data-v-s="2"] .sec-snap_row [data-v-items] { cursor: grab; }
.vt-drag { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.vt-drag a { pointer-events: none; }
.sec-snap_row [data-v-items] { grid-auto-columns: calc((100% - 2rem) / var(--vt-cols, 3)); }

/* ---------------------------------------------------------------- shader-bg (D-1573) */
/*
 * ⛔ The canvas is BEHIND the section's own content and takes no pointer events: it is an
 * ornament, and an ornament that can swallow a click is a real cost. The section keeps its own
 * background — the runtime inserts this only once it has a WebGL2 context, so with no context,
 * a failed compile or reduced motion there is no canvas here at all and nothing to override.
 */
.vt-shader {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
[data-v~="shader-bg"] > :not(.vt-shader) { position: relative; z-index: 1; }
