/* Splunk Cluster Backup (3D). The hero world is a vertical conveyor tower that sits in the free rail beside the text.
   Desktop: the text column stays narrow and the tower is fitted to the rail (work-cluster-backup.js measures it every frame).
   Narrow screens: the tower sits above the title, then behind the text where it sinks into the dark; the ring comes back below the last paragraph. */

/* ------------------------------------------------------------------ poster hero */

.case-hero {
  min-height: calc(100svh - var(--header) - 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.case-hero .back { align-self: flex-start; }
.case-hero h1 { max-width: 9.5ch; }
.case-hero .lede { max-width: 26em; }

/* the scrim darkens the text columns only; the rail on the right stays clear */
main > .case { --scrim: 0.78; --scrim-x0: 0.6; --scrim-x1: 0.78; --scrim-feather: 120; }
#aio { scroll-margin-top: calc(var(--header) + 24px); }
.case-shot { scroll-margin-top: calc(var(--header) + 24px); }
/* a focused screenshot is drawn by the canvas, so the DOM outline sits on the figure's frame */
.case-shot:has(img:focus-visible) .shot-frame { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 18px; }

/* the last read line keeps its distance from the first screenshot */
.case-read { margin-bottom: clamp(72px, 12vh, 140px); }

/* the footer is a solid bar on this page: the AIO ring never runs under its text */
.site-footer { background: rgba(var(--bg-rgb), 0.94); border-top-color: var(--line-strong); }

/* ------------------------------------------------------------------ rail layout (wide screens) */

@media (min-width: 1200px) and (min-aspect-ratio: 6/5) {
  .case-read { grid-template-columns: 250px minmax(0, 500px); gap: 40px; margin-top: 16vh; }
  .case-read .read-line { max-width: none; font-size: 18px; }
  .chain li { padding: 11px 14px 12px; }
  .chain li span { font-size: 12.5px; }
  .case-aside .read { max-width: 520px; }
  .case-aside .read-line { font-size: 18px; }
  .case-aside h2 { max-width: 12ch; }
  /* a figure that follows a lone read-line keeps the line close */
  .case > .read-line { max-width: 520px; font-size: 18px; }
}

/* ------------------------------------------------------------------ narrow screens: world behind the text */

@media (max-width: 800px), (max-aspect-ratio: 6/5) {
  /* the article-wide scrim is off here: work-cluster-backup.js darkens the canvas behind the text blocks only */
  main > .case { --scrim: 0; }
  .case-hero {
    min-height: calc(100svh - var(--header) - 40px);
    justify-content: flex-end;
    padding-bottom: 10px;
  }
  .case-hero h1 { max-width: 12ch; }
  /* the machine is dimmed while the reader is in the text; the type carries its own dark halo on top of the canvas scrim */
  .lede, .read-line, .case-shot figcaption, .chain li {
    text-shadow: 0 0 2px rgba(var(--bg-rgb), 1), 0 0 14px rgba(var(--bg-rgb), 1), 0 0 28px rgba(var(--bg-rgb), 0.95);
  }
  .lede, .read-line { color: var(--ink); }
  .back, .kicker { font-size: 12px; text-shadow: 0 0 2px rgba(var(--bg-rgb), 1), 0 0 14px rgba(var(--bg-rgb), 1); }
  .chain li i { font-size: 12px; }
  .case-shot figcaption { font-size: 13px; line-height: 1.5; }
  /* room below the last paragraph: the ring settles there (work-cluster-backup.js reads the gap between the text and the footer) */
  html.gl .case-aside { padding-bottom: clamp(230px, 38vh, 340px); }
  .case { padding-bottom: 40px; }
}

@media (max-width: 800px) {
  .case-hero h1 { font-size: clamp(44px, 14vw, 64px); }
  .site-footer { font-size: 12px; }
}

/* a phone on its side: the step list scrolls with the page and the title gets a smaller size */
@media (max-height: 640px) and (orientation: landscape) {
  .chain { position: static; }
  .case-hero { min-height: 0; padding-bottom: 28px; }
  .case-hero h1 { font-size: clamp(36px, 11vh, 56px); max-width: 14ch; }
}

/* ------------------------------------------------------------------ without WebGL: the plain page still gets the same rhythm */

html.no-webgl .case-hero { min-height: 0; justify-content: flex-start; }
html.no-webgl main > .case { --scrim: 0; }
html.no-webgl .case-read { margin-bottom: 40px; }

/* ------------------------------------------------------------------ pacing: each read line gets its own stretch of scroll,
   so the lead bucket has time to travel to its station while the line is read */

.case-read .read .read-line { margin-bottom: max(14vh, 96px); }
.case-read .read .read-line:last-child { margin-bottom: 0; }
@media (min-width: 1200px) and (min-aspect-ratio: 6/5) {
  .case-read .read .read-line { margin-bottom: max(26vh, 190px); }
}
html.no-webgl .case-read .read .read-line { margin-bottom: 28px; }
html.no-webgl .case-read .read .read-line:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ touch: tap targets of the chrome, the screenshot chip
   (page scoped; these belong in 3d.css when the other work pages want them too) */

@media (pointer: coarse), (max-width: 800px) {
  .site-header .brand { padding: 14px 10px; margin: -14px -10px; }
  .back { padding: 14px 12px 14px 0; margin-bottom: 14px; }
  .menu-btn { min-width: 48px; min-height: 44px; }
  .calm-toggle { min-width: 44px; height: 44px; }
  .site-footer a { display: inline-block; padding: 14px 8px; margin: -8px -4px; }
}
/* the "Enlarge" chip sits on the figure, not inside the sideways scrolling frame, so it never scrolls away or covers a title bar */
.case-shot { position: relative; }
.case-shot .shot-frame::after { content: none; }
.case-shot::after {
  content: "Enlarge";
  position: absolute; right: 10px; top: 10px; z-index: 2;
  padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(var(--bg-rgb), 0.82);
  color: var(--ink); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0.85; pointer-events: none;
}
/* with a mouse the cursor ring already says it */
@media (hover: hover) and (pointer: fine) { .case-shot::after { display: none; } }

/* ------------------------------------------------------------------ reduced motion: the page stays alive, the DOM moves less */

@media (prefers-reduced-motion: reduce) {
  html.js-3d:not(.reveal-off) :is([data-reveal], .sec-label, .prose p, .lede, .read-line, .card, .work-row, .badge, .case-shot, .case-aside):not(.is-in):not([data-owned]):not([data-owned] *):not(.hero *):not(.case-hero *) { translate: 0 10px; }
  html.js-3d:not(.is-ready):not(.reveal-off) .chain li { translate: 0 0; }
  html.js-3d :is(.hero h1, .case-hero h1)[data-split] .wi { transition-duration: 0.5s; }
  html.js-3d :is(section, .case-aside) h2[data-split].is-in .wi { transition-duration: 0.5s; }
}
