/* Counttable — swappable media system + story furniture (ct-media.css)
   ---------------------------------------------------------------------------
   Everything visual on the three service pages (Digital Twins, 4D Simulation,
   Design) is built out of a small set of components declared in markup and
   filled in by scripts/ct-media.js. The point is that the layout is owned by
   the CSS, never by the asset: a slot reserves its aspect ratio before the
   file loads, so swapping a placeholder clip for the real Counttable footage
   is a one-attribute edit and nothing below it moves.

   Components
     .ct-slot            the frame itself; [data-media] picks the behaviour
     .ct-slot__chip      the small "what goes here" label (hover-revealed)
     .ct-figcap          caption under a slot
     .ct-compare         before/after drag slider
     .ct-rail            sticky chapter rail (phase progress)
     .ct-grid            responsive card grids (auto-fit, no fixed counts)
     .ct-cap / .ct-h2    shared eyebrow + section-heading type
     [data-reveal]       scroll-triggered entrance, staggered by --d
     [data-parallax]     translate-on-scroll, strength in data-parallax

   Colour comes entirely from the per-page custom properties already defined by
   each page (--cx-accent, --cx-line, --cx-glass ...), so this file is
   theme-agnostic and works in both light and dark. */

/* ===========================================================================
   1. TYPE + LAYOUT PRIMITIVES
   =========================================================================== */

.ct-wrap { max-width: 1240px; margin: 0 auto; width: 100%; }
.ct-wrap--wide { max-width: 1480px; }
.ct-wrap--narrow { max-width: 900px; }

.ct-sec { position: relative; padding: clamp(80px, 11vh, 150px) 44px; }
.ct-sec--tight { padding-top: clamp(40px, 6vh, 80px); }
.ct-sec--flush { padding-bottom: 0; }

.ct-cap {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; letter-spacing: 4px; text-transform: uppercase;
  color: var(--cx-accent); font-weight: 600; margin: 0 0 18px;
}
.ct-cap::before {
  content: ""; width: 28px; height: 1px; flex: 0 0 28px;
  background: linear-gradient(90deg, var(--cx-accent), transparent);
}
.ct-cap--plain::before { display: none; }

.ct-h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(30px, 4.2vw, 62px); font-weight: 800;
  letter-spacing: -0.035em; line-height: 0.99; margin: 0 0 22px;
  max-width: 18ch;
}
.ct-h2--wide { max-width: 24ch; }
.ct-h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(19px, 1.7vw, 26px); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 10px;
}
.ct-lede {
  font-size: clamp(15px, 1.35vw, 19px); color: var(--cx-muted);
  font-weight: 300; line-height: 1.75; margin: 0; max-width: 62ch;
}
.ct-body { font-size: 14.5px; color: var(--cx-muted); line-height: 1.7; margin: 0; }

/* Big pull-quote / manifesto line. */
.ct-statement {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(28px, 5vw, 76px); font-weight: 800;
  letter-spacing: -0.04em; line-height: 1.02; margin: 0;
  max-width: 20ch;
}
.ct-statement em { font-style: normal; color: var(--cx-accent); }

/* ===========================================================================
   2. THE MEDIA SLOT
   Reserves its box from an aspect ratio so nothing reflows when the real file
   arrives. Until then it shows a procedural "blueprint" field, so an unswapped
   slot still reads as deliberate design rather than a broken image.
   =========================================================================== */

.ct-slot {
  position: relative; display: block; margin: 0; overflow: hidden;
  aspect-ratio: var(--ratio, 16 / 9);
  background:
    linear-gradient(135deg, rgba(var(--cx-accent-rgb), 0.07), transparent 55%),
    var(--cx-glass);
  border: 1px solid var(--cx-line);
  isolation: isolate;
  contain: content;
}
.ct-slot--bare { border: 0; background: none; }
.ct-slot--tall { --ratio: 3 / 4; }
.ct-slot--square { --ratio: 1 / 1; }
.ct-slot--wide { --ratio: 21 / 9; }
.ct-slot--film { --ratio: 2.39 / 1; }
.ct-slot--full { --ratio: auto; height: 100%; }

/* Corner ticks — the same drafting motif the homepage panels use. */
.ct-slot::before, .ct-slot::after {
  content: ""; position: absolute; width: 22px; height: 22px; z-index: 4;
  pointer-events: none; opacity: 0.75; transition: opacity 0.5s;
}
.ct-slot::before { top: 0; left: 0; border-top: 1.5px solid var(--cx-accent); border-left: 1.5px solid var(--cx-accent); }
.ct-slot::after { bottom: 0; right: 0; border-bottom: 1.5px solid var(--cx-accent); border-right: 1.5px solid var(--cx-accent); }
.ct-slot--bare::before, .ct-slot--bare::after { display: none; }

/* The media itself, whatever ct-media.js put in. */
.ct-slot > video,
.ct-slot > img,
.ct-slot > canvas,
.ct-slot > .ct-slot__layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; z-index: 1;
  opacity: 0; transition: opacity 0.9s cubic-bezier(.2,.8,.2,1);
}
.ct-slot > .is-in { opacity: 1; }
.ct-slot__layer { object-fit: cover; }

/* Procedural placeholder field, visible until a real asset paints over it. */
.ct-slot__ph {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(var(--cx-accent-rgb), 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--cx-accent-rgb), 0.14) 1px, transparent 1px),
    linear-gradient(rgba(var(--cx-accent-rgb), 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--cx-accent-rgb), 0.05) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  background-position: center;
  opacity: 0.85;
}
.ct-slot__ph::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(var(--cx-accent-rgb), 0.16), transparent 65%);
}
.ct-slot.is-loaded .ct-slot__ph { opacity: 0; transition: opacity 0.9s 0.1s; }

/* Scanning sweep while a heavy asset (GLB, long clip) is still arriving. */
.ct-slot__scan {
  position: absolute; left: 0; right: 0; height: 38%; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(var(--cx-accent-rgb), 0.10), transparent);
  animation: ctScan 3.6s cubic-bezier(.6,0,.4,1) infinite;
}
.ct-slot.is-loaded .ct-slot__scan { display: none; }
@keyframes ctScan { 0% { transform: translateY(-120%); } 100% { transform: translateY(360%); } }

/* Hover-revealed swap hint: what this slot is for, and what replaces it. */
.ct-slot__chip {
  position: absolute; left: 14px; bottom: 14px; z-index: 5;
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 28px);
  padding: 7px 12px; border: 1px solid var(--cx-line);
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(10px);
  font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--cx-muted); font-weight: 600;
  opacity: 0; transform: translateY(6px); transition: opacity 0.4s, transform 0.4s;
}
html[data-theme="light"] .ct-slot__chip { background: rgba(255, 255, 255, 0.72); }
.ct-slot__chip::before {
  content: ""; width: 6px; height: 6px; flex: 0 0 6px;
  background: var(--cx-accent); transform: rotate(45deg);
}
.ct-slot:hover .ct-slot__chip { opacity: 1; transform: translateY(0); }
.ct-slot__chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Media type badge, top-right. */
.ct-slot__kind {
  position: absolute; right: 14px; top: 14px; z-index: 5;
  font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--cx-accent); opacity: 0.55; font-weight: 700;
}

.ct-figcap {
  display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin: 14px 2px 0; font-size: 12.5px; color: var(--cx-muted); line-height: 1.55;
}
.ct-figcap b { color: var(--cx-text); font-weight: 600; }
.ct-figcap i { font-style: normal; letter-spacing: 2px; text-transform: uppercase; font-size: 10.5px; opacity: 0.7; }

/* Play affordance on click-to-play slots. */
.ct-slot__play {
  position: absolute; inset: 0; z-index: 6; display: flex;
  align-items: center; justify-content: center; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, 0.25); transition: background 0.4s;
}
.ct-slot__play:hover { background: rgba(0, 0, 0, 0.1); }
.ct-slot__play em {
  width: 74px; height: 74px; border: 1.5px solid var(--cx-accent); border-radius: 50%;
  display: grid; place-items: center; font-style: normal; color: var(--cx-accent);
  font-size: 15px; letter-spacing: 1px; backdrop-filter: blur(6px);
  transition: transform 0.4s, box-shadow 0.4s;
}
.ct-slot__play:hover em { transform: scale(1.08); box-shadow: 0 0 50px rgba(var(--cx-accent-rgb), 0.35); }

/* ===========================================================================
   3. BEFORE / AFTER COMPARE
   =========================================================================== */

.ct-compare { position: relative; overflow: hidden; cursor: ew-resize; touch-action: pan-y; }
.ct-compare .ct-compare__a,
.ct-compare .ct-compare__b { position: absolute; inset: 0; z-index: 1; }
.ct-compare .ct-compare__b { z-index: 2; clip-path: inset(0 0 0 var(--split, 50%)); }
.ct-compare .ct-compare__a > *,
.ct-compare .ct-compare__b > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ct-compare__handle {
  position: absolute; top: 0; bottom: 0; left: var(--split, 50%); z-index: 6;
  width: 2px; background: var(--cx-accent); transform: translateX(-1px);
  box-shadow: 0 0 30px rgba(var(--cx-accent-rgb), 0.6);
}
.ct-compare__handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 54px; height: 54px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1.5px solid var(--cx-accent); background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}
.ct-compare__tag {
  position: absolute; top: 16px; z-index: 7; padding: 6px 12px;
  font-size: 10.5px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 700;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px);
  border: 1px solid var(--cx-line); color: var(--cx-text);
}
html[data-theme="light"] .ct-compare__tag { background: rgba(255, 255, 255, 0.75); }
.ct-compare__tag--a { left: 16px; }
.ct-compare__tag--b { right: 16px; color: var(--cx-accent); }

/* ===========================================================================
   4. GRIDS + CARDS
   =========================================================================== */

.ct-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(var(--min, 250px), 1fr)); }
.ct-grid--2 { --min: 380px; }
.ct-grid--3 { --min: 300px; }
.ct-grid--4 { --min: 225px; }
.ct-grid--5 { --min: 190px; }

.ct-card {
  position: relative; padding: 28px 26px 30px; overflow: hidden;
  border: 1px solid var(--cx-line); background: var(--cx-glass);
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1), border-color 0.5s, background 0.5s;
}
.ct-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--cx-accent), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
}
.ct-card:hover { transform: translateY(-4px); border-color: rgba(var(--cx-accent-rgb), 0.4); }
.ct-card:hover::before { transform: scaleX(1); }
.ct-card__n {
  font-family: 'Space Grotesk', sans-serif; font-size: 11px; letter-spacing: 3px;
  color: var(--cx-accent); font-weight: 700; display: block; margin-bottom: 16px;
}
.ct-card h3 { font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 700; margin: 0 0 9px; letter-spacing: -0.01em; }
.ct-card p { font-size: 13.5px; color: var(--cx-muted); line-height: 1.65; margin: 0; }

/* Compact capability chips — the long feature lists in the brief. */
.ct-chips { display: flex; flex-wrap: wrap; gap: 9px; margin: 0; padding: 0; list-style: none; }
.ct-chips li {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 15px; border: 1px solid var(--cx-line); background: var(--cx-glass);
  font-size: 13px; color: var(--cx-text); letter-spacing: 0.1px;
  transition: border-color 0.4s, transform 0.4s, color 0.4s;
}
.ct-chips li::before {
  content: ""; width: 5px; height: 5px; flex: 0 0 5px;
  background: var(--cx-accent); transform: rotate(45deg); transition: transform 0.4s;
}
.ct-chips li:hover { border-color: rgba(var(--cx-accent-rgb), 0.5); transform: translateY(-2px); }
.ct-chips li:hover::before { transform: rotate(135deg) scale(1.25); }

/* Numeric readouts. */
.ct-stat { border-top: 1px solid var(--cx-line); padding-top: 18px; }
.ct-stat b {
  display: block; font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(30px, 3.6vw, 52px); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1; color: var(--cx-text);
}
.ct-stat b i { font-style: normal; color: var(--cx-accent); font-size: 0.55em; margin-left: 2px; }
.ct-stat span { display: block; margin-top: 10px; font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--cx-muted); }

/* ===========================================================================
   5. STICKY CHAPTER RAIL
   =========================================================================== */

.ct-rail {
  position: sticky; top: 96px; z-index: 20; display: flex; align-items: stretch;
  gap: 0; margin: 0 auto; border: 1px solid var(--cx-line);
  background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(16px); overflow: hidden;
}
html[data-theme="light"] .ct-rail { background: rgba(255, 255, 255, 0.72); }
.ct-rail a {
  flex: 1; position: relative; padding: 16px 18px 18px; text-decoration: none;
  display: flex; flex-direction: column; gap: 5px; min-width: 0;
  transition: background 0.5s;
}
.ct-rail a + a { border-left: 1px solid var(--cx-line); }
.ct-rail a small { font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--cx-accent); opacity: 0.75; }
.ct-rail a strong {
  font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--cx-muted); letter-spacing: -0.01em; transition: color 0.4s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ct-rail a:hover strong { color: var(--cx-text); }
.ct-rail a[aria-current="true"] strong { color: var(--cx-text); }
.ct-rail a[aria-current="true"] { background: rgba(var(--cx-accent-rgb), 0.08); }
.ct-rail a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--cx-accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
}
.ct-rail a[aria-current="true"]::after { transform: scaleX(1); }

/* Thin scroll-progress line, top of page. */
.ct-progress {
  position: fixed; top: 0; left: 0; height: 2px; z-index: 130;
  width: 100%; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--cx-accent), var(--cx-teal));
  pointer-events: none;
}

/* ===========================================================================
   6. TIMELINE / PIPELINE / DASHBOARD FURNITURE
   =========================================================================== */

.ct-time { position: relative; padding-left: 34px; }
.ct-time::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px;
  background: linear-gradient(to bottom, var(--cx-accent), rgba(var(--cx-accent-rgb), 0.08));
}
.ct-time__row { position: relative; padding: 0 0 34px; }
.ct-time__row:last-child { padding-bottom: 0; }
.ct-time__row::before {
  content: ""; position: absolute; left: -34px; top: 5px; width: 15px; height: 15px;
  border: 1.5px solid var(--cx-accent); background: var(--cx-bg); transform: rotate(45deg);
  transition: background 0.5s, box-shadow 0.5s;
}
.ct-time__row:hover::before { background: var(--cx-accent); box-shadow: 0 0 26px rgba(var(--cx-accent-rgb), 0.5); }
.ct-time__row h4 { font-family: 'Space Grotesk', sans-serif; font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.ct-time__row time { display: block; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--cx-accent); margin-bottom: 8px; }
.ct-time__row p { font-size: 13.5px; color: var(--cx-muted); line-height: 1.65; margin: 0; }

/* Vertical animated workflow pipeline (Design page). */
.ct-flow { position: relative; display: grid; gap: 0; }
.ct-flow__line {
  position: absolute; left: 21px; top: 24px; bottom: 24px; width: 2px;
  background: var(--cx-line); overflow: hidden;
}
.ct-flow__line i {
  position: absolute; inset: 0 0 auto 0; height: var(--flow, 0%);
  background: linear-gradient(to bottom, var(--cx-accent), var(--cx-teal));
  transition: height 0.25s linear;
}
.ct-flow__step {
  position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 22px;
  align-items: start; padding: 15px 0;
}
.ct-flow__dot {
  width: 44px; height: 44px; display: grid; place-items: center; position: relative; z-index: 2;
  border: 1px solid var(--cx-line); background: var(--cx-bg);
  font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 800;
  color: var(--cx-muted); transition: color 0.5s, border-color 0.5s, background 0.5s, box-shadow 0.5s;
}
.ct-flow__step.is-on .ct-flow__dot {
  color: var(--cx-accent); border-color: var(--cx-accent);
  box-shadow: 0 0 34px rgba(var(--cx-accent-rgb), 0.28);
}
.ct-flow__body { padding-top: 6px; }
.ct-flow__body h4 {
  font-family: 'Space Grotesk', sans-serif; font-size: clamp(17px, 1.6vw, 22px);
  font-weight: 700; margin: 0 0 6px; letter-spacing: -0.015em;
  color: var(--cx-muted); transition: color 0.5s;
}
.ct-flow__step.is-on .ct-flow__body h4 { color: var(--cx-text); }
.ct-flow__body p { font-size: 13.5px; color: var(--cx-muted); line-height: 1.7; margin: 0; max-width: 56ch; opacity: 0.75; }

/* Dashboard panel that sits beside a simulation. */
.ct-dash { border: 1px solid var(--cx-line); background: var(--cx-glass); backdrop-filter: blur(14px); }
.ct-dash__head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 20px; border-bottom: 1px solid var(--cx-line);
  font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--cx-muted);
}
.ct-dash__head b { color: var(--cx-accent); font-weight: 700; }
.ct-dash__body { padding: 20px; display: grid; gap: 16px; }
.ct-meter { display: grid; gap: 8px; }
.ct-meter__top { display: flex; justify-content: space-between; font-size: 12px; color: var(--cx-muted); letter-spacing: 0.4px; }
.ct-meter__top b { color: var(--cx-text); font-family: 'Space Grotesk', sans-serif; font-weight: 700; }
.ct-meter__bar { height: 3px; background: var(--cx-line); overflow: hidden; }
.ct-meter__bar i {
  display: block; height: 100%; width: var(--v, 0%);
  background: linear-gradient(90deg, var(--cx-accent), var(--cx-teal));
  transition: width 1.4s cubic-bezier(.2,.8,.2,1);
}

/* Scrubber used by the 4D page. */
.ct-scrub { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--cx-line); background: var(--cx-glass); }
.ct-scrub__top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ct-scrub__wk { font-family: 'Space Grotesk', sans-serif; font-size: clamp(24px, 3vw, 40px); font-weight: 800; letter-spacing: -0.03em; }
.ct-scrub__wk i { font-style: normal; color: var(--cx-accent); }
.ct-scrub input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 3px;
  background: var(--cx-line); outline: none; cursor: pointer;
}
.ct-scrub input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px;
  background: var(--cx-accent); transform: rotate(45deg); cursor: grab;
  box-shadow: 0 0 20px rgba(var(--cx-accent-rgb), 0.55);
}
.ct-scrub input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border: 0; background: var(--cx-accent); cursor: grab;
}
.ct-btn-ghost {
  border: 1px solid var(--cx-line); background: transparent; color: var(--cx-muted);
  padding: 9px 16px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: color 0.4s, border-color 0.4s;
}
.ct-btn-ghost:hover { color: var(--cx-accent); border-color: rgba(var(--cx-accent-rgb), 0.5); }
.ct-btn-ghost[aria-pressed="true"] { color: var(--cx-accent); border-color: rgba(var(--cx-accent-rgb), 0.5); }

/* Tabs for the integrations panel. */
.ct-tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--cx-line); }
.ct-tabs button {
  border: 0; background: none; cursor: pointer; font-family: inherit;
  padding: 13px 18px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  font-weight: 600; color: var(--cx-muted); position: relative; transition: color 0.4s;
}
.ct-tabs button::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--cx-accent); transform: scaleX(0); transition: transform 0.45s cubic-bezier(.2,.8,.2,1);
}
.ct-tabs button:hover { color: var(--cx-text); }
.ct-tabs button[aria-selected="true"] { color: var(--cx-accent); }
.ct-tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.ct-tabpane[hidden] { display: none; }

/* ===========================================================================
   7. MOTION — reveals + parallax
   =========================================================================== */

[data-reveal] {
  opacity: 0; transform: translateY(var(--ry, 34px)) scale(var(--rs, 1));
  transition:
    opacity 0.95s cubic-bezier(.2,.8,.2,1) var(--d, 0s),
    transform 1.05s cubic-bezier(.2,.8,.2,1) var(--d, 0s),
    clip-path 1.1s cubic-bezier(.2,.8,.2,1) var(--d, 0s);
  will-change: opacity, transform;
}
[data-reveal="wipe"] { clip-path: inset(0 0 100% 0); transform: none; }
[data-reveal="scale"] { --rs: 1.04; --ry: 0px; }
[data-reveal="left"] { transform: translateX(-38px); }
[data-reveal="right"] { transform: translateX(38px); }
[data-reveal].is-in { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }

/* Line-by-line headline entrance. */
.ct-lines span { display: block; overflow: hidden; }
.ct-lines span i {
  display: block; font-style: normal;
  transform: translateY(105%); transition: transform 1.05s cubic-bezier(.2,.8,.2,1) var(--d, 0s);
}
.ct-lines.is-in span i { transform: translateY(0); }

[data-parallax] { will-change: transform; }

/* ===========================================================================
   8. HERO SHELL shared by the three pages
   =========================================================================== */

.ct-hero {
  position: relative; min-height: 100svh; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 150px 44px 56px; overflow: hidden;
}
.ct-hero__media { position: absolute; inset: 0; z-index: 0; }
.ct-hero__media video, .ct-hero__media img, .ct-hero__media canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.ct-hero__scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to top, var(--cx-bg) 2%, rgba(2, 3, 4, 0.45) 42%, rgba(2, 3, 4, 0.18) 72%),
    radial-gradient(ellipse at 30% 40%, transparent 35%, rgba(2, 3, 4, 0.55) 100%);
}
html[data-theme="light"] .ct-hero__scrim {
  background:
    linear-gradient(to top, var(--cx-bg) 2%, rgba(233, 237, 242, 0.72) 42%, rgba(233, 237, 242, 0.35) 75%),
    radial-gradient(ellipse at 30% 40%, transparent 30%, rgba(233, 237, 242, 0.6) 100%);
}
.ct-hero__inner { position: relative; z-index: 2; width: 100%; }
.ct-hero h1 {
  font-family: 'Space Grotesk', sans-serif; font-weight: 800;
  font-size: min(clamp(42px, 7.6vw, 118px), 15.5vh);
  line-height: 0.94; letter-spacing: -0.045em; margin: 0 0 26px; max-width: 15ch;
}
.ct-hero h1 em { font-style: normal; color: var(--cx-accent); }
.ct-hero__foot {
  display: flex; gap: 34px; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; margin-top: 44px;
  padding-top: 26px; border-top: 1px solid var(--cx-line);
}
.ct-hero__foot dl { display: flex; gap: 40px; flex-wrap: wrap; margin: 0; }
.ct-hero__foot dt { font-size: 10.5px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--cx-muted); margin-bottom: 7px; }
.ct-hero__foot dd {
  margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
}

.ct-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--cx-accent); color: #0a0602; padding: 16px 32px;
  font-weight: 700; font-size: 12.5px; letter-spacing: 1.6px; text-transform: uppercase;
  text-decoration: none; border: 1px solid var(--cx-accent);
  transition: box-shadow 0.5s, transform 0.4s;
}
.ct-btn:hover { box-shadow: 0 0 60px rgba(var(--cx-accent-rgb), 0.45); transform: translateY(-2px); color: #0a0602; }
.ct-btn--ghost { background: transparent; color: var(--cx-text); border-color: var(--cx-line); }
.ct-btn--ghost:hover { border-color: rgba(var(--cx-accent-rgb), 0.6); color: var(--cx-text); }

/* Closing CTA band. */
.ct-cta { position: relative; overflow: hidden; text-align: center; padding: clamp(90px, 14vh, 180px) 44px; }
.ct-cta canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0.6; }
.ct-cta > div { position: relative; z-index: 2; }

/* ===========================================================================
   9. RESPONSIVE
   =========================================================================== */

@media (max-width: 1024px) {
  .ct-sec { padding-left: 30px; padding-right: 30px; }
  .ct-hero { padding-left: 30px; padding-right: 30px; }
  .ct-cta { padding-left: 30px; padding-right: 30px; }
  .ct-rail { top: 128px; }
}
@media (max-width: 860px) {
  .ct-rail { top: 122px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ct-rail a { min-width: 148px; flex: 0 0 auto; }
  .ct-hero { padding-top: 168px; }
  .ct-hero__foot dl { gap: 26px; }
}
@media (max-width: 700px) {
  .ct-sec { padding-left: 20px; padding-right: 20px; }
  .ct-hero { padding-left: 20px; padding-right: 20px; }
  .ct-cta { padding-left: 20px; padding-right: 20px; }
  .ct-slot--film, .ct-slot--wide { --ratio: 16 / 10; }
  .ct-slot--tall { --ratio: 4 / 5; }
  .ct-card { padding: 24px 20px 26px; }
  .ct-flow__step { grid-template-columns: 36px 1fr; gap: 16px; }
  .ct-flow__dot { width: 36px; height: 36px; font-size: 11px; }
  .ct-flow__line { left: 17px; }
  .ct-figcap { font-size: 12px; }
  .ct-slot__chip { left: 10px; bottom: 10px; font-size: 9.5px; letter-spacing: 1.5px; padding: 6px 9px; }
}

/* Touch devices never get the hover-only swap chip, so pin it visible-faint. */
@media (pointer: coarse) {
  .ct-slot__chip { opacity: 0.55; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal], .ct-lines span i { transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; clip-path: none; }
  .ct-lines span i { transform: none; }
  .ct-slot__scan { animation: none; display: none; }
  .ct-card:hover, .ct-btn:hover { transform: none; }
}
