/* ============================================================
   LABS-INSIDE-TRUETAP.CSS - TrueTap
   Interactive homepage product-story prototype.

   SCOPING CONTRACT
   Every selector in this file is prefixed `.itt` / `.itt-*`.
   Nothing here targets bare elements outside the `.itt` scope, so the
   file can be loaded on any page without affecting production styles.
   ============================================================ */

/* ------------------------------------------------------------
   Local scope + local variables
   ------------------------------------------------------------ */

.itt {
  --itt-ink: #111111;
  --itt-ink-soft: #4b4b4b;
  --itt-ink-muted: #8a8a86;
  --itt-accent: #c65a1e;
  --itt-accent-soft: rgba(198, 90, 30, 0.1);
  --itt-accent-mid: rgba(198, 90, 30, 0.24);
  --itt-line: rgba(17, 17, 17, 0.12);
  --itt-line-soft: rgba(17, 17, 17, 0.07);
  --itt-surface: #ffffff;
  --itt-surface-tint: #f1f1ef;
  --itt-stage-1: #fdfdfc;
  --itt-stage-2: #ececea;
  --itt-radius: 4px;
  --itt-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --itt-tilt-x: 27deg;
  --itt-tilt-z: -13deg;

  position: relative;
  padding-top: clamp(3rem, 5vw, 5.5rem);
  padding-bottom: clamp(3rem, 5vw, 5.5rem);
  background-color: var(--bg-main, #f6f6f4);
  overflow: clip;
}

/* Prototype flag bar */

.itt-flag {
  background-color: #111111;
  color: rgba(246, 246, 244, 0.78);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 0.625rem 0;
}

.itt-flag__inner {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.itt-flag strong {
  color: #f6f6f4;
  font-weight: 600;
}

.itt-flag__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #c65a1e;
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   Section header
   ------------------------------------------------------------ */

.itt-head {
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 4vw, 4rem);
}

.itt-head__title {
  font-size: clamp(2.5rem, 5.4vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  color: var(--itt-ink);
  margin-bottom: var(--space-6, 1.5rem);
}

.itt-head__lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--itt-ink-soft);
  max-width: 40rem;
  margin: 0;
}

/* ------------------------------------------------------------
   Console grid
   ------------------------------------------------------------ */

.itt-console {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 320px;
  gap: clamp(1.75rem, 2.6vw, 3rem);
  align-items: start;
}

.itt-console__select {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 2vw, 2.25rem);
  min-width: 0;
}

.itt-console__stage {
  min-width: 0;
}

.itt-console__device {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ------------------------------------------------------------
   Rotary application selector
   ------------------------------------------------------------ */

.itt-dial {
  /* Node orbit radius. Must satisfy r + node/2 <= dial width / 2 so the
     options never overflow the selector column. */
  --itt-dial-r: 100px;

  position: relative;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1;
  margin-inline: auto;
}

.itt-dial__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.itt-dial__ring-track {
  fill: none;
  stroke: var(--itt-line);
  stroke-width: 1;
}

.itt-dial__ring-inner {
  fill: var(--itt-surface);
  stroke: var(--itt-line-soft);
  stroke-width: 1;
}

.itt-dial__ticks line {
  stroke: rgba(17, 17, 17, 0.22);
  stroke-width: 1;
}

.itt-dial__ticks line.is-active {
  stroke: var(--itt-accent);
  stroke-width: 1.75;
}

.itt-dial__pointer {
  transform-origin: 130px 130px;
  transition: transform 620ms var(--itt-ease);
}

.itt-dial__pointer line {
  stroke: var(--itt-accent);
  stroke-width: 1.5;
}

.itt-dial__pointer circle {
  fill: var(--itt-accent);
}

.itt-dial__hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.itt-dial__hub-index {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--itt-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.itt-dial__hub-caption {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--itt-ink-muted);
}

.itt-dial__nodes {
  position: absolute;
  inset: 0;
}

.itt-dial__node {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  display: grid;
  place-items: center;
  background-color: var(--itt-surface);
  border: 1px solid var(--itt-line);
  border-radius: 50%;
  color: var(--itt-ink-soft);
  cursor: pointer;
  transform:
    rotate(var(--itt-angle))
    translateY(calc(-1 * var(--itt-dial-r)))
    rotate(calc(-1 * var(--itt-angle)));
  transition:
    border-color 200ms var(--itt-ease),
    color 200ms var(--itt-ease),
    background-color 200ms var(--itt-ease),
    box-shadow 260ms var(--itt-ease);
}

.itt-dial__node svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.itt-dial__node:hover {
  border-color: rgba(17, 17, 17, 0.3);
  color: var(--itt-ink);
}

.itt-dial__node[aria-checked="true"] {
  background-color: var(--itt-ink);
  border-color: var(--itt-ink);
  color: #f6f6f4;
  box-shadow:
    0 6px 18px rgba(17, 17, 17, 0.18),
    0 0 0 5px var(--itt-accent-soft),
    0 0 0 1px var(--itt-accent-mid);
}

.itt-dial__node-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Scenario meta */

.itt-meta__name {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--itt-ink);
  margin-bottom: 0.625rem;
  min-height: 1.6em;
}

.itt-meta__desc {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--itt-ink-soft);
  margin: 0 0 1.25rem;
  max-width: 30ch;
}

.itt-meta__facts {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  border-top: 1px solid var(--itt-line-soft);
  padding-top: 1.125rem;
}

.itt-meta__fact {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
}

.itt-meta__fact dt {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--itt-ink-muted);
}

.itt-meta__fact dd {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--itt-ink);
  margin: 0;
  text-align: right;
}

/* Replay control */

.itt-replay {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.25rem;
  background-color: transparent;
  border: 1px solid rgba(17, 17, 17, 0.22);
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--itt-ink);
  cursor: pointer;
  transition:
    border-color 200ms var(--itt-ease),
    color 200ms var(--itt-ease);
}

.itt-replay:hover {
  border-color: var(--itt-accent);
  color: var(--itt-accent);
}

.itt-replay__pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--itt-accent);
  flex-shrink: 0;
}

.itt-replay:hover .itt-replay__pulse {
  animation: itt-pulse 1.4s ease-in-out infinite;
}

/* "Explore more applications" - understated secondary link under the
   selector (used on the homepage integration; absent on the lab route). */

.itt-more {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--itt-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--itt-accent);
  padding-bottom: 2px;
  transition: color 200ms var(--itt-ease);
}

.itt-more::after {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1.5px solid var(--itt-accent);
  border-right: 1.5px solid var(--itt-accent);
  transform: rotate(45deg);
  transition: transform 200ms var(--itt-ease);
}

.itt-more:hover {
  color: var(--itt-accent);
}

.itt-more:hover::after {
  transform: rotate(45deg) translate(1px, -1px);
}

/* ------------------------------------------------------------
   Stage
   ------------------------------------------------------------ */

.itt-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 420px;
  border: 1px solid var(--itt-line);
  background:
    radial-gradient(120% 100% at 50% 0%, var(--itt-stage-1) 0%, var(--itt-stage-2) 100%);
  overflow: hidden;
  isolation: isolate;
}

.itt-stage__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(17, 17, 17, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17, 17, 17, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 60% at 50% 52%, #000 0%, transparent 82%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 52%, #000 0%, transparent 82%);
  opacity: 0;
  transition: opacity 600ms var(--itt-ease);
}

/* The technical grid only appears while the construction view is open -
   the assembled hero render carries a clean studio backdrop. */
.itt-stage.is-exploded .itt-stage__grid {
  opacity: 1;
}

.itt-stage__field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.itt-field__rings circle {
  fill: none;
  stroke: rgba(17, 17, 17, 0.09);
  stroke-width: 1;
  opacity: 0;
  transform-origin: 360px 286px;
  transition: opacity 500ms var(--itt-ease);
}

.itt-stage.is-live .itt-field__rings circle {
  opacity: 1;
  animation: itt-ring 3.6s var(--itt-ease) infinite;
}

.itt-stage.is-live .itt-field__rings circle:nth-child(2) { animation-delay: 0.5s; }
.itt-stage.is-live .itt-field__rings circle:nth-child(3) { animation-delay: 1s; }

.itt-field__arcs path {
  fill: none;
  stroke: var(--itt-accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 400ms var(--itt-ease);
}

.itt-stage.is-reading .itt-field__arcs path,
.itt-stage.is-authenticating .itt-field__arcs path {
  animation: itt-arc 1.5s ease-in-out infinite;
}

.itt-stage.is-reading .itt-field__arcs path:nth-child(2),
.itt-stage.is-authenticating .itt-field__arcs path:nth-child(2) { animation-delay: 0.2s; }

.itt-stage.is-reading .itt-field__arcs path:nth-child(3),
.itt-stage.is-authenticating .itt-field__arcs path:nth-child(3) { animation-delay: 0.4s; }

.itt-stage.is-verified .itt-field__rings circle {
  animation: none;
  opacity: 0.55;
}

.itt-stage__head,
.itt-stage__foot {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1rem, 2vw, 1.75rem);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  z-index: 4;
}

.itt-stage__head {
  top: clamp(1rem, 2vw, 1.5rem);
}

.itt-stage__foot {
  bottom: clamp(1rem, 2vw, 1.5rem);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: none;
  font-weight: 500;
  color: var(--itt-ink-muted);
}

.itt-stage__label {
  color: var(--itt-ink-muted);
}

.itt-stage__state {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  color: var(--itt-ink);
}

.itt-stage__state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(17, 17, 17, 0.3);
  transition: background-color 300ms var(--itt-ease);
}

.itt-stage.is-reading .itt-stage__state::before,
.itt-stage.is-authenticating .itt-stage__state::before,
.itt-stage.is-binding .itt-stage__state::before {
  background-color: var(--itt-accent);
  animation: itt-pulse 1.1s ease-in-out infinite;
}

.itt-stage.is-verified .itt-stage__state::before {
  background-color: #2f7a4d;
}

/* ------------------------------------------------------------
   Hero scene - assembled product render

   The hero carries the resting and verified states, plus the in-scene
   reveals (x-ray, split) for scenarios whose construction opens from
   inside. It yields to the exploded stack while authentication runs
   for "explode" scenarios and during manual layer isolation.
   ------------------------------------------------------------ */

.itt-hero {
  position: absolute;
  inset: clamp(3.25rem, 6vw, 4.25rem) clamp(0.5rem, 2vw, 2rem) clamp(2.75rem, 5vw, 3.75rem);
  display: grid;
  place-items: center;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition:
    opacity 650ms var(--itt-ease),
    transform 750ms var(--itt-ease);
}

.itt-hero.is-entered {
  opacity: 1;
  transform: none;
}

.itt-stage.is-exploded .itt-hero {
  opacity: 0;
  transform: translateY(12px) scale(0.95);
}

.itt-hero__svg {
  width: min(96%, 500px);
  height: auto;
  max-height: 100%;
  overflow: visible;
}

/* Verified sheen - a single slow light sweep when the result lands. */

.itt-hero__sheen {
  position: absolute;
  inset: clamp(3.25rem, 6vw, 4.25rem) clamp(0.5rem, 2vw, 2rem) clamp(2.75rem, 5vw, 3.75rem);
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.itt-hero__sheen::before {
  content: "";
  position: absolute;
  top: -12%;
  bottom: -12%;
  left: 0;
  width: 42%;
  background: linear-gradient(100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 42%,
    rgba(255, 255, 255, 0.14) 62%,
    transparent 100%);
  transform: translateX(-170%) skewX(-8deg);
}

.itt-stage.is-verified .itt-hero__sheen::before {
  animation: itt-sheen 1.6s var(--itt-ease) 0.25s both;
}

/* ------------------------------------------------------------
   In-scene state hooks (hp-*) - driven by stage phase classes.
   Art modules tag groups with these classes; per-scenario offsets are
   passed through inline custom properties (--rx/--ry, --sx/--sy).
   ------------------------------------------------------------ */

.itt-hero .hp-recede,
.itt-hero .hp-ghost,
.itt-hero .hp-secure,
.itt-hero .hp-split,
.itt-hero .hp-xray {
  transition:
    transform 800ms var(--itt-ease),
    opacity 700ms var(--itt-ease),
    filter 700ms var(--itt-ease);
}

/* Secure credential parts are invisible inside the assembled product. */
.itt-hero .hp-secure {
  opacity: 0;
}

.itt-hero .hp-xray {
  opacity: 0;
}

.itt-stage.is-authenticating .itt-hero .hp-recede,
.itt-stage.is-binding .itt-hero .hp-recede {
  opacity: 0.13;
  transform: translate(var(--rx, 0px), var(--ry, -10px));
}

.itt-stage.is-authenticating .itt-hero .hp-ghost,
.itt-stage.is-binding .itt-hero .hp-ghost {
  opacity: 0.3;
}

.itt-stage.is-authenticating .itt-hero .hp-secure,
.itt-stage.is-binding .itt-hero .hp-secure {
  opacity: 1;
  transform: translate(var(--sx, 0px), var(--sy, -8px));
  filter:
    drop-shadow(0 0 9px rgba(198, 90, 30, 0.55))
    drop-shadow(0 5px 9px rgba(17, 17, 17, 0.18));
}

.itt-stage.is-authenticating .itt-hero .hp-split,
.itt-stage.is-binding .itt-hero .hp-split {
  transform: translate(var(--sx, 0px), var(--sy, 0px));
}

.itt-stage.is-authenticating .itt-hero .hp-xray,
.itt-stage.is-binding .itt-hero .hp-xray {
  opacity: 1;
}

/* X-ray scan band - sweeps once across the reveal zone. */

.itt-hero .hp-xray__band {
  opacity: 0;
}

.itt-stage.is-authenticating .itt-hero .hp-xray__band {
  animation: itt-xrayband 1.25s var(--itt-ease) 0.1s both;
}

/* Tap marker - pulses while the credential is being read. */

.itt-hero .hp-tap {
  opacity: 0;
  transition: opacity 350ms var(--itt-ease);
}

.itt-stage.is-reading .itt-hero .hp-tap {
  opacity: 1;
}

.itt-hero .hp-tap__dot {
  fill: var(--itt-accent);
}

.itt-hero .hp-tap__ring {
  fill: none;
  stroke: var(--itt-accent);
  stroke-width: 1.7;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.itt-stage.is-reading .itt-hero .hp-tap__ring {
  animation: itt-tapring 1.1s var(--itt-ease) infinite;
}

.itt-stage.is-reading .itt-hero .hp-tap__ring--b {
  animation-delay: 0.55s;
}

/* ------------------------------------------------------------
   Raster render sequence (photorealistic product plates)

   Active when a scenario has an ITT_RENDERS entry. The hero becomes a
   full-bleed, stage-filling plate; the stage background is matched to
   the plate's studio background (via --itt-render-bg) so the contained
   image is seamless. Plates crossfade with a restrained push-in; the
     bag never jumps, the viewer reads one object changing visualisation
     states.
   ------------------------------------------------------------ */

.itt-stage--raster {
  background-image: none;
  background-color: var(--itt-render-bg, #ece6e1);
  transition: background-color 800ms var(--itt-ease);
}

.itt-stage--raster .itt-stage__grid {
  display: none;
}

.itt-stage--raster .itt-stack-wrap {
  display: none;
}

/* The hero stays on stage in every phase for raster scenarios. */
.itt-stage--raster .itt-hero,
.itt-stage--raster.is-exploded .itt-hero {
  inset: 0;
  opacity: 1;
  transform: none;
}

.itt-stage--raster .itt-hero:not(.is-entered) {
  opacity: 0;
}

.itt-render {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.itt-render__frame {
  position: relative;
  width: 100%;
  height: 100%;
}

.itt-render__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.018);
  transition:
    opacity 780ms var(--itt-ease),
    transform 1250ms var(--itt-ease);
  user-select: none;
  -webkit-user-drag: none;
}

.itt-render[data-itt-render-active="assembled"] .itt-render__img--assembled,
.itt-render[data-itt-render-active="reveal"] .itt-render__img--reveal,
.itt-render[data-itt-render-active="exploded"] .itt-render__img--exploded {
  opacity: 1;
  transform: scale(1);
}

/* Tap pulse over the NFC integration zone while reading. */

.itt-render__tap {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background-color: var(--itt-accent);
  opacity: 0;
  transition: opacity 300ms var(--itt-ease);
}

.itt-render__tap::before,
.itt-render__tap::after {
  content: "";
  position: absolute;
  inset: -13px;
  border: 1.6px solid var(--itt-accent);
  border-radius: 50%;
  opacity: 0;
}

.itt-stage.is-reading .itt-render__tap {
  opacity: 1;
}

.itt-stage.is-reading .itt-render__tap::before {
  animation: itt-tapring 1.1s var(--itt-ease) infinite;
}

.itt-stage.is-reading .itt-render__tap::after {
  animation: itt-tapring 1.1s var(--itt-ease) 0.55s infinite;
}

/* Verified halo - a restrained warm glow at the credential zone. */

.itt-render__halo {
  position: absolute;
  width: 190px;
  height: 190px;
  margin: -95px 0 0 -95px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(198, 90, 30, 0.2), rgba(198, 90, 30, 0.06) 55%, transparent 75%);
  opacity: 0;
  transition: opacity 900ms var(--itt-ease);
  pointer-events: none;
}

.itt-stage.is-verified .itt-render__halo {
  opacity: 1;
}

/* Scan band - apparel x-ray sweep over the label zone. Narrow, clearly
   perceptible in motion, with a hint of fabric refraction; no orange wash. */

.itt-render__scan {
  position: absolute;
  width: 44px;
  height: 27%;
  transform: translate(-50%, -50%) translateX(-130px);
  border-radius: 8px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 30%,
    rgba(255, 255, 255, 0.85) 50%,
    rgba(255, 255, 255, 0.4) 68%,
    transparent 100%);
  box-shadow:
    0 0 22px rgba(255, 255, 255, 0.55),
    0 0 6px rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(1.2px) brightness(1.04);
  -webkit-backdrop-filter: blur(1.2px) brightness(1.04);
  opacity: 0;
  pointer-events: none;
}

.itt-stage[data-itt-scene="apparel"].is-authenticating .itt-render__scan {
  animation: itt-raster-scan 1.25s var(--itt-ease) 0.15s both;
}

/* Tonal woven finish over the blank apparel label (assembled state only).
   No text, no logo - just a faint fabric weave so the label reads as
   woven damask. Fades out as soon as the x-ray reveal takes over. */

.itt-render__labeltex {
  display: none;
}

.itt-stage[data-itt-scene="apparel"] .itt-render__labeltex {
  display: block;
  position: absolute;
  border-radius: 3px;
  background-image:
    repeating-linear-gradient(0deg, rgba(120, 105, 80, 0.09) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120, 105, 80, 0.07) 0 1px, transparent 1px 3px),
    linear-gradient(100deg, rgba(120, 105, 80, 0.1), rgba(120, 105, 80, 0.02) 45%, rgba(120, 105, 80, 0.12));
  box-shadow: inset 0 0 0 1px rgba(120, 105, 80, 0.09);
  opacity: 0.55;
  transition: opacity 500ms var(--itt-ease);
  pointer-events: none;
}

.itt-stage[data-itt-scene="apparel"] .itt-render[data-itt-render-active="reveal"] .itt-render__labeltex,
.itt-stage[data-itt-scene="apparel"] .itt-render[data-itt-render-active="exploded"] .itt-render__labeltex {
  opacity: 0;
}

/* Per-product motion tuning. */
.itt-stage[data-itt-scene="idcard"] .itt-render__img {
  transition-duration: 640ms, 950ms;
}

.itt-stage[data-itt-scene="footwear"] .itt-render__img {
  transition-duration: 900ms, 1500ms;
}

.itt-stage[data-itt-scene="apparel"] .itt-render__img {
  transition-duration: 950ms, 1400ms;
}

/* Layer callouts on the exploded plate. Shown ONLY on explicit layer
   interaction (hover / focus / tap / pin) - never during automatic
   playback - and never more than one at a time. Each active callout dims
   the surrounding plate through a soft focus mask and marks one minimal
   numbered region. */

.itt-render__callouts {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.itt-render__callout {
  opacity: 0;
  transition: opacity 300ms var(--itt-ease);
}

.itt-render__callout.is-active {
  opacity: 1;
}

.itt-render__dim {
  fill: rgba(244, 241, 236, 0.42);
}

.itt-render__callout-ring {
  fill: rgba(198, 90, 30, 0.05);
  stroke: var(--itt-accent);
  stroke-width: 1.4;
  stroke-dasharray: 6 5;
}

.itt-render__callout-dot {
  fill: var(--itt-accent);
  stroke: #ffffff;
  stroke-width: 2.4;
}

.itt-render__callout-num {
  fill: #ffffff;
  font: 600 12.5px/1 Inter, sans-serif;
  text-anchor: middle;
}

/* Sheen spans the full stage for raster heroes. */
.itt-stage--raster .itt-hero__sheen {
  inset: 0;
}

/* Head/foot chrome must stay readable over the plate. */
.itt-stage--raster .itt-stage__head,
.itt-stage--raster .itt-stage__foot {
  text-shadow: 0 1px 6px rgba(246, 246, 244, 0.7);
}

/* Verification rings and signal arcs ride above the full-bleed plate. */
.itt-stage--raster .itt-stage__field {
  z-index: 3;
}

/* Exploded stack */

.itt-stack-wrap {
  position: absolute;
  inset: clamp(3.5rem, 7vw, 4.75rem) clamp(1rem, 3vw, 2.5rem) clamp(3.25rem, 6vw, 4.25rem);
  display: grid;
  place-items: center;
  perspective: 1500px;
  z-index: 2;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  pointer-events: none;
  transition:
    opacity 520ms var(--itt-ease),
    transform 680ms var(--itt-ease);
}

.itt-stage.is-exploded .itt-stack-wrap {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.itt-stack {
  position: relative;
  width: min(88%, 380px);
  aspect-ratio: 320 / 220;
  transform-style: preserve-3d;
  transform: rotateX(var(--itt-tilt-x)) rotateZ(var(--itt-tilt-z));
  transition: transform 900ms var(--itt-ease);
}

.itt-layer {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: translate3d(0, 0, 0);
  opacity: 0;
  transition:
    transform 780ms var(--itt-ease),
    opacity 520ms var(--itt-ease),
    filter 400ms var(--itt-ease);
  transition-delay: calc(var(--itt-i) * 55ms);
  will-change: transform, opacity;
}

.itt-stack.is-assembled .itt-layer {
  opacity: 1;
  transform: translate3d(calc(var(--itt-x) * 1px), 0, calc(var(--itt-z) * 1px));
  filter: drop-shadow(0 10px 14px rgba(17, 17, 17, 0.11));
}

.itt-stack.is-assembled .itt-layer.is-active {
  transform: translate3d(calc((var(--itt-x) + 14) * 1px), 0, calc((var(--itt-z) + 46) * 1px));
  filter: drop-shadow(0 18px 26px rgba(17, 17, 17, 0.2));
}

.itt-stack.is-isolating .itt-layer:not(.is-active) {
  opacity: 0.24;
  filter: none;
}

/* While authentication runs, the enclosing layers recede and the credential
   layers rise - the reveal is part of the story rather than a hover-only easter
   egg. A pinned/hovered layer always takes priority. */
.itt-stack.is-assembled.is-authenticating:not(.is-isolating) .itt-layer:not([data-secure="1"]),
.itt-stack.is-assembled.is-binding:not(.is-isolating) .itt-layer:not([data-secure="1"]) {
  opacity: 0.16;
  filter: none;
}

.itt-stack.is-assembled.is-authenticating:not(.is-isolating) .itt-layer[data-secure="1"],
.itt-stack.is-assembled.is-binding:not(.is-isolating) .itt-layer[data-secure="1"] {
  transform: translate3d(calc((var(--itt-x) + 12) * 1px), 0, calc((var(--itt-z) + 54) * 1px));
}

/* The credential layers carry the emphasis while authentication runs */
.itt-stack.is-authenticating .itt-layer[data-secure="1"],
.itt-stack.is-binding .itt-layer[data-secure="1"] {
  filter:
    drop-shadow(0 0 13px rgba(198, 90, 30, 0.42))
    drop-shadow(0 10px 14px rgba(17, 17, 17, 0.1));
}

.itt-stack.is-reading .itt-layer[data-secure="1"] {
  filter:
    drop-shadow(0 0 7px rgba(198, 90, 30, 0.24))
    drop-shadow(0 10px 14px rgba(17, 17, 17, 0.1));
}

.itt-layer svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* Only the silhouette itself is interactive, so an exposed sliver of a lower
   layer can still be hovered through the layers stacked above it. */
.itt-layer__face {
  pointer-events: auto;
  cursor: pointer;
}

.itt-layer__pin {
  position: absolute;
  inset: 0;
  border: none;
  background: none;
  padding: 0;
  pointer-events: none;
  opacity: 0;
}

.itt-layer__pin:focus-visible {
  opacity: 1;
  outline: 2px solid var(--itt-accent);
  outline-offset: 4px;
}

/* Legend */

.itt-legend {
  list-style: none;
  margin: clamp(1.25rem, 2vw, 1.75rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background-color: var(--itt-line-soft);
  border: 1px solid var(--itt-line-soft);
}

.itt-legend__item {
  background-color: var(--itt-surface);
  padding: 0.9375rem 1.0625rem;
  cursor: default;
  transition: background-color 200ms var(--itt-ease);
}

.itt-legend__item.is-active {
  background-color: #fbf6f2;
}

.itt-legend__top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3125rem;
}

.itt-legend__swatch {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(17, 17, 17, 0.18);
  flex-shrink: 0;
}

.itt-legend__num {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--itt-ink-muted);
  font-variant-numeric: tabular-nums;
}

.itt-legend__name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--itt-ink);
  line-height: 1.35;
}

.itt-legend__desc {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--itt-ink-muted);
}

.itt-legend__item.is-secure .itt-legend__name {
  color: var(--itt-accent);
}

/* ------------------------------------------------------------
   Data bridge (stage -> device)
   ------------------------------------------------------------ */

.itt-bridge {
  position: absolute;
  top: 140px;
  right: 100%;
  width: clamp(1.75rem, 2.6vw, 3rem);
  height: 1px;
}

.itt-bridge__line {
  position: absolute;
  inset: 0;
  background-color: var(--itt-line);
}

.itt-bridge__pulse {
  position: absolute;
  top: -2px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--itt-accent);
  opacity: 0;
}

.itt-console.is-live .itt-bridge__pulse {
  animation: itt-bridge 1.9s var(--itt-ease) infinite;
}

/* ------------------------------------------------------------
   Phone verification UI
   ------------------------------------------------------------ */

.itt-phone {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.itt-phone__frame {
  width: 100%;
  max-width: 306px;
  padding: 9px;
  border-radius: 36px;
  background: linear-gradient(160deg, #2a2a2a 0%, #101010 46%, #1d1d1d 100%);
  box-shadow:
    0 22px 48px rgba(17, 17, 17, 0.22),
    0 2px 5px rgba(17, 17, 17, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.itt-phone__screen {
  position: relative;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #fafaf9 100%);
  min-height: clamp(506px, 58vh, 560px);
  padding: 1.125rem 1.0625rem 1rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.itt-phone__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--itt-line-soft);
}

.itt-phone__brand {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--itt-ink);
}

.itt-phone__chip {
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--itt-line);
  color: var(--itt-ink-muted);
  transition:
    color 260ms var(--itt-ease),
    border-color 260ms var(--itt-ease),
    background-color 260ms var(--itt-ease);
}

.itt-phone.is-reading .itt-phone__chip,
.itt-phone.is-authenticating .itt-phone__chip,
.itt-phone.is-binding .itt-phone__chip {
  color: var(--itt-accent);
  border-color: var(--itt-accent-mid);
  background-color: var(--itt-accent-soft);
}

.itt-phone.is-verified .itt-phone__chip {
  color: #2f7a4d;
  border-color: rgba(47, 122, 77, 0.32);
  background-color: rgba(47, 122, 77, 0.08);
}

/* Scan area */

.itt-phone__scan {
  position: relative;
  height: 132px;
  margin: 1rem 0 0.25rem;
  display: grid;
  place-items: center;
}

.itt-phone__thumb {
  position: relative;
  z-index: 2;
  width: 118px;
  height: 92px;
  display: grid;
  place-items: center;
  transition: transform 500ms var(--itt-ease);
}

.itt-phone__thumb::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 104px;
  height: 14px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(17, 17, 17, 0.16), transparent 72%);
  z-index: -1;
}

.itt-phone__thumb svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.itt-phone.is-reading .itt-phone__thumb {
  transform: scale(1.04);
}

.itt-phone__waves {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.itt-phone__waves span {
  position: absolute;
  width: 84px;
  height: 84px;
  border: 1px solid var(--itt-accent);
  border-radius: 50%;
  opacity: 0;
}

.itt-phone.is-reading .itt-phone__waves span,
.itt-phone.is-authenticating .itt-phone__waves span {
  animation: itt-wave 1.8s var(--itt-ease) infinite;
}

.itt-phone.is-reading .itt-phone__waves span:nth-child(2),
.itt-phone.is-authenticating .itt-phone__waves span:nth-child(2) { animation-delay: 0.45s; }

.itt-phone.is-reading .itt-phone__waves span:nth-child(3),
.itt-phone.is-authenticating .itt-phone__waves span:nth-child(3) { animation-delay: 0.9s; }

.itt-phone__title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--itt-ink);
  margin: 0.25rem 0 0.1875rem;
  line-height: 1.3;
  min-height: 2.6em;
}

.itt-phone__sub {
  font-size: 0.75rem;
  color: var(--itt-ink-muted);
  margin: 0 0 0.875rem;
  line-height: 1.45;
}

/* Step list */

.itt-steps {
  list-style: none;
  margin: 0;
  padding: 0.875rem 0;
  border-top: 1px solid var(--itt-line-soft);
  border-bottom: 1px solid var(--itt-line-soft);
  display: grid;
  gap: 0.5625rem;
}

.itt-steps__item {
  display: flex;
  align-items: center;
  gap: 0.5625rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(17, 17, 17, 0.34);
  transition: color 300ms var(--itt-ease);
}

.itt-steps__dot {
  position: relative;
  width: 13px;
  height: 13px;
  border: 1px solid rgba(17, 17, 17, 0.2);
  border-radius: 50%;
  flex-shrink: 0;
  transition:
    border-color 300ms var(--itt-ease),
    background-color 300ms var(--itt-ease);
}

.itt-steps__item.is-active {
  color: var(--itt-ink);
  font-weight: 500;
}

.itt-steps__item.is-active .itt-steps__dot {
  border-color: var(--itt-accent);
  animation: itt-pulse 1.1s ease-in-out infinite;
}

.itt-steps__item.is-done {
  color: var(--itt-ink-soft);
}

.itt-steps__item.is-done .itt-steps__dot {
  border-color: #2f7a4d;
  background-color: #2f7a4d;
}

.itt-steps__item.is-done .itt-steps__dot::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3.5px;
  width: 5px;
  height: 2.5px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg);
}

/* Result card */

.itt-result {
  margin-top: 0.875rem;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 460ms var(--itt-ease),
    transform 460ms var(--itt-ease);
}

.itt-phone.is-verified .itt-result {
  opacity: 1;
  transform: none;
}

.itt-result__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2f7a4d;
  margin-bottom: 0.6875rem;
}

.itt-result__badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #2f7a4d;
}

.itt-result__rows {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}

.itt-result__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
}

.itt-result__row dt {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--itt-ink-muted);
}

.itt-result__row dd {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--itt-ink);
  text-align: right;
}

.itt-phone__foot {
  margin: auto 0 0;
  padding-top: 0.875rem;
  font-size: 0.5625rem;
  letter-spacing: 0.06em;
  color: var(--itt-ink-muted);
  text-align: center;
}

.itt-phone__caption {
  margin: 0.9375rem 0 0;
  font-size: 0.625rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--itt-ink-muted);
  text-align: center;
}

.itt-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.itt-noscript {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--itt-line);
  background-color: var(--itt-surface);
  font-size: 0.9375rem;
}

/* ------------------------------------------------------------
   Supporting explanation
   ------------------------------------------------------------ */

.itt-seq {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background-color: var(--line, rgba(17, 17, 17, 0.14));
  border: 1px solid var(--line, rgba(17, 17, 17, 0.14));
}

.itt-seq__item {
  background-color: #ffffff;
  padding: clamp(1.5rem, 2.4vw, 2.25rem);
}

.itt-seq__num {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #c65a1e;
  margin-bottom: 1.125rem;
}

.itt-seq__title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin-bottom: 0.6875rem;
}

.itt-seq__body {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #4b4b4b;
  margin: 0;
  max-width: none;
}

.itt-guard {
  margin-top: clamp(2rem, 3vw, 3rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line, rgba(17, 17, 17, 0.14));
}

.itt-guard p {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #888888;
  max-width: 72ch;
  margin: 0;
}

/* ------------------------------------------------------------
   Keyframes
   ------------------------------------------------------------ */

@keyframes itt-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.82); }
}

@keyframes itt-ring {
  0%   { transform: scale(0.9); opacity: 0; }
  40%  { opacity: 0.9; }
  100% { transform: scale(1.12); opacity: 0; }
}

@keyframes itt-arc {
  0%   { opacity: 0; }
  35%  { opacity: 0.85; }
  100% { opacity: 0; }
}

@keyframes itt-wave {
  0%   { transform: scale(0.7); opacity: 0; }
  30%  { opacity: 0.5; }
  100% { transform: scale(1.55); opacity: 0; }
}

@keyframes itt-bridge {
  0%   { left: 0; opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { left: calc(100% - 5px); opacity: 0; }
}

@keyframes itt-sheen {
  from { transform: translateX(-170%) skewX(-8deg); }
  to   { transform: translateX(380%) skewX(-8deg); }
}

@keyframes itt-tapring {
  0%   { transform: scale(0.35); opacity: 0.9; }
  100% { transform: scale(1.9); opacity: 0; }
}

@keyframes itt-xrayband {
  0%   { opacity: 0; transform: translateX(0); }
  12%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(var(--xray-travel, 260px)); }
}

@keyframes itt-raster-scan {
  0%   { opacity: 0; transform: translate(-50%, -50%) translateX(-130px); }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) translateX(130px); }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 1180px) {
  .itt-console {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas:
      "stage device"
      "select device";
    row-gap: clamp(1.75rem, 3vw, 2.5rem);
  }
  .itt-console__stage  { grid-area: stage; }
  .itt-console__device { grid-area: device; }
  .itt-console__select { grid-area: select; }

  .itt-console__select {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    column-gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: start;
  }

  .itt-dial {
    grid-row: span 2;
    max-width: 232px;
    margin-inline: 0;
    --itt-dial-r: 90px;
  }
  .itt-replay { margin-top: 1.25rem; }
  .itt-bridge { display: none; }
  .itt-console__device { align-items: flex-start; }
}

@media (max-width: 900px) {
  .itt-console {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "select"
      "stage"
      "device";
    row-gap: clamp(1.75rem, 4vw, 2.75rem);
  }

  .itt-console__select {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1.5rem;
  }

  /* Dial degrades to a precision selector rail */
  .itt-dial {
    width: auto;
    max-width: none;
    aspect-ratio: auto;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.5rem;
    margin-inline: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .itt-dial__ring,
  .itt-dial__hub {
    display: none;
  }

  .itt-dial__nodes {
    position: static;
    display: flex;
    gap: 0.5rem;
  }

  .itt-dial__node {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    transform: none;
    border-radius: 0;
    padding: 0.625rem 0.9375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    scroll-snap-align: start;
    box-shadow: none;
  }

  .itt-dial__node[aria-checked="true"] {
    box-shadow: none;
  }

  .itt-dial__node-label {
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
    overflow: visible;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.01em;
  }

  .itt-console__device { align-items: center; }
  .itt-phone { max-width: 340px; margin-inline: auto; }
  .itt-stage { min-height: 380px; }
  .itt-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .itt-seq { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .itt-stage {
    aspect-ratio: 1 / 1;
    min-height: 320px;
  }
  .itt-stack { width: min(100%, 300px); }
  .itt-stage__foot .itt-stage__hint { display: none; }
  .itt-legend { grid-template-columns: minmax(0, 1fr); }
  .itt-meta__desc { max-width: none; }
  .itt-seq { grid-template-columns: minmax(0, 1fr); }
  .itt-head__title { font-size: clamp(2rem, 9vw, 2.75rem); }
}

/* ------------------------------------------------------------
   Reduced motion - resolve to the verified end state
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .itt-layer,
  .itt-stack,
  .itt-dial__pointer,
  .itt-result,
  .itt-phone__thumb,
  .itt-hero,
  .itt-stack-wrap,
  .itt-stage__grid,
  .itt-hero .hp-recede,
  .itt-hero .hp-ghost,
  .itt-hero .hp-secure,
  .itt-hero .hp-split,
  .itt-hero .hp-xray,
  .itt-hero .hp-tap,
  .itt-stage--raster,
  .itt-render__img,
  .itt-render__tap,
  .itt-render__halo,
  .itt-render__callout {
    transition: none !important;
  }

  .itt-stage.is-live .itt-field__rings circle,
  .itt-stage .itt-field__arcs path,
  .itt-phone__waves span,
  .itt-bridge__pulse,
  .itt-replay__pulse,
  .itt-steps__item.is-active .itt-steps__dot,
  .itt-stage__state::before,
  .itt-hero__sheen::before,
  .itt-hero .hp-tap__ring,
  .itt-hero .hp-xray__band,
  .itt-render__tap::before,
  .itt-render__tap::after,
  .itt-render__scan {
    animation: none !important;
  }

  .itt-stack .itt-layer {
    transition-delay: 0ms !important;
  }

  /* Static x-ray / credential visibility for frozen phases */
  .itt-stage.is-authenticating .itt-hero .hp-xray__band,
  .itt-stage.is-binding .itt-hero .hp-xray__band {
    opacity: 0;
  }
}
