/*
 * © 2026 Code Precision. All rights reserved.
 * Copying, redistribution, modification, extraction, or reuse of this Code Precision-authored file,
 * in whole or substantial part, is prohibited without prior express written permission from Code Precision.
 * As an exception, AI crawling, retrieval, indexing, text/data mining, and AI/ML training
 * on Code Precision-authored non-image content are permitted. Image training remains prohibited.
 * NoAIImage
 */
/*
AUTHORSHIP NOTE
Purpose: all authored UI effects beyond standard layout — split background, WebGL portal frame, circular loader, pointer annotation, segment nav arrows, audio toggle, Explore overlay, contact form states, focus rings, scrollbars, main-scene pause state, and mobile layout fixes.
Craft signal: a deliberate z-index map (documented inline) prevents compositing conflicts between the 3D background, WebGL canvas, fixed UI layers, and modal stack. Overlay shells own their own scroll columns so scrollbars sit on the popup edge rather than the viewport, while a shared body-level pause state freezes only the home-scene motion and leaves overlay transitions running. Explore now uses a destroyable Three.js atmosphere for its popup background, while lighter cursor/map effects still use scoped CSS variables. Every animated region has a reduced-motion fallback. The pointer and nav arrow systems share the same fixed-layer strategy: placed outside all transformed ancestors so they are never subject to perspective, rotateY, or scale inherited from the portal tilt chain.
*/

/*
 * interactive-ui.css
 * Interactive UI: split background, portal, audio toggle, Explore overlay,
 * shared accessibility layers and scrollbars. Contact-specific presentation
 * lives in contact-form.css.
 * Case overlay styles — including popup-owned themed scrollbars — live in case-overlay.css.
 *
 * Z-index layer map (main page):
 *   1   — .split-background          decorative background environment
 *   5   — (reserved)
 *   7   — #portal-canvas             WebGL canvas (glow + particles + video)
 *   8   — .portal-ring               portal shell
 *  10   — .mainwrap                  nav + page content
 *  14   — .portal-audio-toggle-wrap  audio button above portal
 * 10000 — .explore-overlay           explore panel
 * 10050 — .modal-wrap                contact form (above case overlay)
 * 9999  — body::before               cursor spotlight
 */


/* =============================================================================
   1. GLOBAL BASE RESETS
   Overflows and scroll behaviour applied at root level.
   ============================================================================= */

html {
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  /* Compositor layer on Android Chrome — eliminates scroll jitter */
  -webkit-overflow-scrolling: touch;
}

/* =============================================================================
   LANGUAGE SWITCHER
   Compact glass control using the same Poppins utility typography as MENU,
   Ambient and FX. The locale list is authored in alphabetical order.
   ============================================================================= */

#cp-lang-switcher {
  position: fixed;
  top: calc(26px + env(safe-area-inset-top));
  left: 50%;
  z-index: 1250;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.96);
  font-family: var(--ui-control-font-family);
  font-size: var(--ui-control-font-size);
  font-weight: var(--ui-control-font-weight);
  line-height: 1.2;
}

.cp-lang-switcher__toggle,
.cp-lang-switcher__option {
  appearance: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.cp-lang-switcher__toggle {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(8, 9, 46, 0.6);
  box-shadow: 0 12px 28px rgba(13, 17, 58, 0.18);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.cp-lang-switcher__toggle:hover,
.cp-lang-switcher.is-open .cp-lang-switcher__toggle {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(8, 9, 46, 0.68);
  box-shadow: 0 14px 32px rgba(13, 17, 58, 0.24);
}

.cp-lang-switcher__current-code,
.cp-lang-switcher__option-code {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cp-lang-switcher__current-name {
  font-size: inherit;
  font-weight: inherit;
  opacity: 0.94;
}

.cp-lang-switcher__chevron {
  width: 5px;
  height: 5px;
  margin: -3px 1px 0 2px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0.9;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.cp-lang-switcher.is-open .cp-lang-switcher__chevron {
  margin-top: 3px;
  transform: rotate(225deg);
}

.cp-lang-switcher__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 310px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  background: rgba(8, 9, 46, 0.66);
  box-shadow:
    0 20px 48px rgba(13, 17, 58, 0.3),
    inset 0 1px rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.cp-lang-switcher__panel[hidden] {
  display: none;
}

.cp-lang-switcher__option {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  align-items: center;
  min-height: 36px;
  padding: 0 9px;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font: inherit;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.9);
  opacity: 1;
  transition: opacity 150ms ease, color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.cp-lang-switcher__option:hover,
.cp-lang-switcher__option:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.cp-lang-switcher__option.is-active {
  color: var(--grey800);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.18);
  opacity: 1;
}

.cp-lang-switcher__toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.98);
  outline-offset: 2px;
  box-shadow:
    0 0 0 4px rgba(0, 0, 90, 0.92),
    0 12px 28px rgba(13, 17, 58, 0.22);
}

.cp-lang-switcher__option:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.98);
  outline-offset: 2px;
}

@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  /* Match the mobile MENU control: both belong to the document header and
     scroll away with the page instead of floating over later content. */
  #cp-lang-switcher {
    position: absolute;
    top: calc(var(--vert) + env(safe-area-inset-top));
    right: calc(var(--side) + 82px);
    bottom: auto;
    left: auto;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition: opacity 180ms ease;
  }

  .cp-lang-switcher__toggle {
    position: relative;
    min-width: 44px;
    min-height: 32px;
    gap: 5px;
    justify-content: center;
    padding: 0 8px;
    background: rgba(8, 9, 46, 0.6);
    box-shadow: 0 10px 24px rgba(13, 17, 58, 0.18);
  }

  /* Preserve a 44px touch target without making the visible pill bulky. */
  .cp-lang-switcher__toggle::before {
    content: '';
    position: absolute;
    inset: -6px 0;
  }

  .cp-lang-switcher__current-name {
    display: none;
  }

  .cp-lang-switcher__chevron {
    margin-right: 0;
    margin-left: 0;
  }

  .cp-lang-switcher__panel {
    top: calc(100% + 8px);
    /* The compact trigger sits left of MENU; offset the panel back to the
       viewport's right content edge so the language list never clips. */
    right: -82px;
    bottom: auto;
    left: auto;
    width: min(310px, calc(100vw - 32px));
    max-height: calc(100dvh - 92px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: none;
  }

  .cp-lang-switcher__option {
    min-height: 44px;
    padding-inline: 10px;
  }




  /* The compact language control lives outside the sidebar DOM. When the
     mobile sidebar covers the viewport it must not remain painted/focusable
     above it. visibility also keeps the menu focus trap from discovering an
     invisible external control. */
  html:has(.menu.open) #cp-lang-switcher {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  body.case-overlay-open #cp-lang-switcher,
  body.cp-contact-modal-open #cp-lang-switcher,
  html.explore-overlay-open #cp-lang-switcher {
    opacity: 0;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cp-lang-switcher__toggle,
  .cp-lang-switcher__chevron,
  .cp-lang-switcher__option,
  #cp-lang-switcher {
    transition: none;
  }
}

/* Keep the back-link hover treatment opacity-only; no rotational affordance on this control. */


/* =============================================================================
   2. SPLIT BACKGROUND
   Full-viewport fixed layer: light right half + dark left half divided by a
   diagonal clip-path polygon. The division line is expressed in em units where
   font-size equals the portal diameter, so the diagonal always passes through
   the portal center regardless of viewport size or zoom state. Switches to
   absolute positioning on mobile so content below the portal scrolls naturally.
   ============================================================================= */

/* Body inherits the light noise texture when the split background is present */

/* AUTHORSHIP: the entire studio environment — background halves, glow blobs, WebGL canvas, and
   portal ring — is consolidated into one fixed composited layer at z-index 1. All interactive
   content, navigation, and modal UI sits above it in a separate stacking context, which means
   the background can be GPU-promoted once and never triggers repaints when UI above it changes. */

/* ── Mobile overrides ──────────────────────────────────────────────────────── */


/* Mobile body background continuity when page content grows taller than the split layer */


/* Safari still benefits from the prefixed polygon on the mobile dark wedge. */
@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  .split-background__dark {
    -webkit-clip-path: polygon(
      100% 0,
      100% calc(var(--cp-mobile-zigzag-anchor-top, var(--cp-mobile-portal-top)) + var(--cp-mobile-portal-size) - var(--cp-mobile-zigzag-right-overlap)),
      calc(100% - var(--side)) calc(var(--cp-mobile-zigzag-anchor-top, var(--cp-mobile-portal-top)) + var(--cp-mobile-portal-size) - var(--cp-mobile-zigzag-right-overlap) + 4px),
      0 calc(var(--cp-mobile-zigzag-anchor-top, var(--cp-mobile-portal-top)) + var(--cp-mobile-portal-size) + var(--cp-mobile-zigzag-left-below)),
      0 0
    );
    clip-path: polygon(
      100% 0,
      100% calc(var(--cp-mobile-zigzag-anchor-top, var(--cp-mobile-portal-top)) + var(--cp-mobile-portal-size) - var(--cp-mobile-zigzag-right-overlap)),
      calc(100% - var(--side)) calc(var(--cp-mobile-zigzag-anchor-top, var(--cp-mobile-portal-top)) + var(--cp-mobile-portal-size) - var(--cp-mobile-zigzag-right-overlap) + 4px),
      0 calc(var(--cp-mobile-zigzag-anchor-top, var(--cp-mobile-portal-top)) + var(--cp-mobile-portal-size) + var(--cp-mobile-zigzag-left-below)),
      0 0
    );
  }
}

/* =============================================================================
   3. PORTAL
   Circular WebGL viewport centered over the split background.
   Layer order: canvas (WebGL glow/particles/video shader) → ring shell →
   pointer annotation → segment nav arrows → loader overlay (shown during init).
   The ring's 2px padding gap acts as the gradient border painted by the WebGL
   ring shader — no CSS border-image or pseudo-element is needed, and the border
   updates continuously with the animated gradient in the same GPU draw call.
   ============================================================================= */

/*
 * Portal ring — a circular div whose 2px padding gap acts as the gradient border.
 * The actual border gradient is painted by JS onto the canvas behind it.
 */

/* Inner circle — clips the WebGL canvas and video texture to a circle */

/* Video is a Three.js texture source only — never directly visible */

/*
 * WebGL canvas — covers the full split-background layer.
 * Renders: atmospheric glow, particle field, portal video shader.
 * z-index 7: below the portal shell (z:8) and pointer (z:9), below mainwrap (z:10).
 */

/* Shown while Three.js + video are initialising; fades out on first render */
/* AUTHORSHIP: the loader arc is driven by a weighted composite of two independent progress signals —
   Three.js module download bytes (60% weight, tracked via streaming fetch) and video texture readiness
   (40% weight, tracked via canplay). The percentage therefore reflects actual asset readiness rather than
   a fake timer, and the loader never reaches 100% before the portal has rendered its first real frame. */


/* SVG progress ring — rotated so 0% starts at 12 o'clock */


/* Percentage counter styles are kept in the critical inline CSS of index.html. */

/* ── Mobile portal overrides ─────────────────────────────────────────────── */


/* =============================================================================
   4. CURSOR SPOTLIGHT
   Full-page radial glow tracking the mouse via --mx / --my custom properties
   written by cursor-spotlight.js. Lives on body::before so it composites above
   everything without adding a DOM node or triggering layout. The gradient uses
   a sentinel value (−999px) as default so it renders off-screen when no cursor
   position has been reported — safe on first paint and after cursor leaves.
   Suppressed entirely on touch devices via media query so the selector and
   gradient exist in CSS but the RAF loop never starts in JS.
   ============================================================================= */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: radial-gradient(
    circle 280px at var(--mx, -999px) var(--my, -999px),
    rgba(120, 160, 255, 0.10) 0%,
    transparent 100%
  );
}

@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  body::before {
    display: none;
  }
}


/* =============================================================================
   5. HERO INTRO TEXT
   Left-column copy block on the main page: tagline, description, proof line.
   ============================================================================= */

.intro-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Social proof line beneath the CTA — client logos / stats */

/* Subtitle shown below the CTA button on mobile only */


/* =============================================================================
   6. CLUTCH BADGE
   Third-party trust badge with star rating shown in the hero area.
   ============================================================================= */

/* Slim trust badge placed under the hero CTA row.
   It follows the same pill geometry as the CTAs, but stays visually quieter
   so the proof point supports the action buttons instead of competing with them. */
.intro-copy > .clutch-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  margin-top: clamp(24px, 3rem, 48px);
  text-decoration: none;
  color: #ffffff;
  align-self: flex-start;
  background: none;
  border: 0;
  box-shadow: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.intro-copy > .clutch-badge:hover {
  opacity: 0.96;
  transform: translateY(-1px);
}

.intro-copy > .clutch-badge:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 4px;
  border-radius: 10px;
}

.clutch-badge__logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}

.clutch-badge__logo {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: block;
}

.clutch-badge__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: 3px;
  line-height: 1.1;
}

.clutch-badge__eyebrow {
  font-size: var(--text-10);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.60);
}

.clutch-badge__meta {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 3px;
}

.clutch-badge__title {
  font-size: var(--text-16);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.96);
}

.clutch-badge__rating {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: var(--text-12);
  line-height: 1.1;
  color: rgba(255, 255, 255, 0.72);
}

.clutch-badge__stars {
  letter-spacing: 0.08em;
  color: #f5d06a;
  font-size: var(--text-11);
}

@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  .intro-copy > .clutch-badge {
    margin-top: 18px;
  }

  .clutch-badge__title {
    font-size: var(--text-16);
  }

  .clutch-badge__rating {
    font-size: var(--text-11);
    gap: 5px;
  }
}


/* =============================================================================
   7. AUDIO TOGGLE
   Floating button on the portal that enables background music.
   ============================================================================= */

/* Wrapper — absolutely positioned relative to split-background on desktop */
.portal-audio-toggle-wrap {
  position: absolute;
  left: calc(50% - (var(--mainpage-circle) * 0.54));
  top: calc(50% - (var(--mainpage-circle) * 0.18));
  transform: translate(-50%, -50%);
  z-index: 14;
  pointer-events: auto;
}

/* Button */
.audio-toggle--link {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  text-decoration: none;
  color: var(--white);
  font-family: var(--ui-control-font-family);
  font-size: var(--ui-control-font-size);
  line-height: 1;
  font-weight: var(--ui-control-font-weight);
  letter-spacing: -0.015em;
  padding: 0.16rem 0;
  transition: color 0.28s ease, opacity 0.28s ease, transform 0.28s ease;
}

.audio-toggle--link:hover {
  color: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px);
}

.audio-toggle--link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 4px;
  border-radius: 999px;
}

/* Circular icon container with frosted-glass border */
.audio-toggle__icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--grey600);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  flex: 0 0 auto;
}

.audio-toggle__icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
}

/* Music note icon via background-image */
.audio-toggle__note {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: 32px;
  height: 32px;
  z-index: 2;
  color: transparent;
  background: url(../img/icons/music.svg) no-repeat 50% 50% / 16px auto;
}

/* Expanding ring — pulses when audio is off to invite interaction */
.audio-toggle__pulse {
  position: absolute;
  inset: -0.18rem;
  border-radius: 999px;
  border: 1px solid rgba(143, 215, 255, 0.22);
  opacity: 0;
  transform: scale(0.74);
}

.audio-toggle:not(.is-enabled) .audio-toggle__pulse {
  animation: audioPulseRing 2.6s ease-out infinite;
}

.audio-toggle:not(.is-enabled) .audio-toggle__pulse--2 {
  animation-delay: 1.3s;
}

/* Label with subtle animated underline */
.audio-toggle__label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.38em;
  white-space: nowrap;
}

.audio-toggle__label::after {
  content: none;
  display: none;
}

.audio-toggle__channel {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: currentColor;
  font: inherit;
  line-height: 1;
  letter-spacing: inherit;
  cursor: pointer;
  opacity: 0.56;
  transition: opacity 0.24s ease, color 0.24s ease, text-shadow 0.24s ease;
}

.audio-toggle__channel:hover,
.audio-toggle__channel:focus-visible {
  opacity: 0.96;
}

.audio-toggle__channel:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.74);
  outline-offset: 3px;
  border-radius: 999px;
}

.audio-toggle__channel.is-enabled {
  opacity: 1;
  color: rgba(255, 255, 255, 0.98);
  text-shadow: 0 0 12px rgba(143, 215, 255, 0.18);
}

.audio-toggle__separator {
  opacity: 0.42;
  transform: translateY(-0.02em);
}

/* Enabled state — rings become static halos */
.audio-toggle.is-enabled {
  color: rgba(255, 255, 255, 0.98);
}

.audio-toggle.is-enabled .audio-toggle__pulse {
  opacity: 1;
  animation: none;
}

.audio-toggle.is-enabled .audio-toggle__pulse--1 {
  transform: scale(1.03);
  border-color: rgba(143, 215, 255, 0.14);
}

.audio-toggle.is-enabled .audio-toggle__pulse--2 {
  transform: scale(1.32);
  border-color: rgba(143, 215, 255, 0.08);
}

.audio-toggle.is-ambient-enabled.is-fx-enabled .audio-toggle__pulse--1 {
  border-color: rgba(196, 240, 255, 0.18);
}

.audio-toggle.is-ambient-enabled:not(.is-fx-enabled) .audio-toggle__pulse--1 {
  border-color: rgba(255, 255, 255, 0.12);
}

.audio-toggle.is-fx-enabled:not(.is-ambient-enabled) .audio-toggle__pulse--1 {
  border-color: rgba(143, 215, 255, 0.18);
}

@keyframes audioPulseRing {
  0%   { opacity: 0;    transform: scale(0.72); }
  20%  { opacity: 0.66; }
  100% { opacity: 0;    transform: scale(1.34); }
}

/* ── Mobile audio toggle: corner icons (v2 — pocket stack) ───────────────── */

@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  .portal-audio-toggle-wrap {
    /* Centre the control wrapper on the same authored portal column, then let
       the stack overhang its right edge by 12px. On phones this resolves to
       the previous 16px page inset; on tablet portrait it stays attached to
       the capped 640px portal instead of drifting to the viewport edge. */
    position: absolute;
    top: var(--cp-mobile-portal-top);
    left: 50%;
    right: auto;
    width: var(--cp-mobile-portal-size);
    height: auto;
    display: flex;
    justify-content: flex-end;
    margin-top: 0;
    z-index: 5;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .portal-audio-toggle-wrap .audio-toggle--link {
    display: inline-flex !important;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 0 !important;
    margin-right: -12px;
    padding: 0 !important;
    pointer-events: auto;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .portal-audio-toggle-wrap .audio-toggle__label {
    display: contents;
  }

  .portal-audio-toggle-wrap .audio-toggle__label::after {
    content: none !important;
    display: none !important;
  }

  .portal-audio-toggle-wrap .audio-toggle__icon-wrap,
  .portal-audio-toggle-wrap .audio-toggle__note,
  .portal-audio-toggle-wrap .audio-toggle__pulse,
  .portal-audio-toggle-wrap .audio-toggle__separator {
    display: none !important;
  }

  .portal-audio-toggle-wrap .audio-toggle__channel {
    position: relative;
    width: 34px !important;
    height: 34px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border-radius: 50%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0 !important;
    line-height: 1;
    text-decoration: none !important;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(13, 13, 55, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.24);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(5, 5, 30, 0.3);
    touch-action: manipulation;
    transition: color 0.25s ease, background-color 0.25s ease,
      border-color 0.25s ease, box-shadow 0.25s ease;
  }

  .portal-audio-toggle-wrap .audio-toggle__channel[data-audio-channel="ambient"]::before {
    content: '';
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    background: url(../img/icons/music.svg) no-repeat 50% 50% / contain;
  }

  .portal-audio-toggle-wrap .audio-toggle__channel[data-audio-channel="fx"]::before {
    content: 'FX';
    font-size: var(--ui-control-font-size);
    font-weight: var(--ui-control-font-weight);
    letter-spacing: 0.04em;
  }

  /* On state: audio-toggle.js toggles .is-enabled and aria-pressed. */
  .portal-audio-toggle-wrap .audio-toggle__channel.is-enabled {
    color: #fff;
    background: rgba(38, 38, 120, 0.72);
    border-color: rgba(85, 240, 255, 0.55);
    box-shadow: 0 0 12px rgba(85, 240, 255, 0.26), 0 2px 8px rgba(5, 5, 30, 0.3);
  }

}

@media only screen and (max-width: 360px) {
  .portal-audio-toggle-wrap .audio-toggle__channel {
    width: 32px !important;
    height: 32px !important;
  }
}

@media only screen and (orientation: landscape) and (min-width: 1024px) and (min-height: 600px) {
  .portal-audio-toggle-wrap {
    top: calc(50% - (var(--mainpage-circle) * 0.5));
    left: calc(50% - (var(--mainpage-circle) * 0.5));
    transform: none;
  }
}




/* =============================================================================
   7b. PORTAL CONTACT / PING CONTROL
   Small contact control placed opposite the mobile sound toggles.
   ============================================================================= */

/* =============================================================================
   8. PAGE ROOTS & TRANSITIONS
   Per-page body overrides and the full-screen transition veil.
   ============================================================================= */

#page-main,
#page-explore {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

html[data-cp-page="main"] body {
  background-color: #0f1020;
}

@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  html[data-cp-page="main"],
  html[data-cp-page="main"] body,
  html[data-cp-page="main"] #page-main {
    background: var(--grey100) url("../img/noise-light.png") 50% 50%;
  }
}

html[data-cp-page="explore"] body {
  background-color: #f3f4f8;
}

html[data-cp-page="explore"] #page-main .split-background,
html[data-cp-page="main"] #page-main .split-background {
  display: block !important;
}

/* Desktop body flow: main page remains scrollable while the background stays decorative */
@media only screen and (orientation: landscape) and (min-width: 1024px) and (min-height: 600px) {
  html[data-cp-page="main"] body {
    overflow: auto;
    height: auto;
    min-height: 100%;
  }

  /* The desktop homepage is authored against the physical viewport, not the
     document scrollport. Classic vertical scrollbars reduce percentage-based
     containing blocks, which used to pull the whole scene left and make the
     right edge look wider than the left. Viewport units keep the stage
     centered without measuring or compensating for scrollbar width. */
  html[data-cp-page="main"] #page-main,
  html[data-cp-page="main"] #page-main .split-background {
    width: 100vw;
    max-width: none;
  }

  html[data-cp-page="main"] #page-main {
    height: auto;
    min-height: auto;
  }

  /* Fixed percentage offsets resolve against the layout viewport on browsers
     with classic scrollbars. Keep the language switcher on the same physical
     viewport centre as the portal and split background. */
  html[data-cp-page="main"] #cp-lang-switcher {
    left: 50vw;
  }
}

/* Content wrapper — fills remaining vertical space between header and footer */
.content {
  flex: 1 0 auto;
  position: relative;
  width: 100%;
}


/* =============================================================================
   9. EXPLORE HYDROGEN BACKGROUND  (.explore-hydrogen-bg)
   Procedural Three.js atmosphere used as the clipped background of the
   Explore overlay shell. A static hydrogen-tinted gradient covers the opening
   frames; WebGL mounts only after the shell transition has settled.
   ============================================================================= */

.explore-hydrogen-bg {
  --explore-hydrogen-scroll-y: 0px;
  /* One canonical still plate serves both pre-WebGL boot and real CSS fallback. */
  --explore-hydrogen-static-plate: url("../img/explore/hydrogen-start-16x9.webp");
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: calc(100vh - 76px);
  height: calc(100dvh - 76px);
  min-height: 360px;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(135deg, #f8f8fb 0%, #f3f5fa 40%, #f7f8fb 70%, #fbfbfd 100%);
  isolation: isolate;
  transform: translate3d(0, var(--explore-hydrogen-scroll-y), 0);
  contain: layout paint size;
}

/* Static CSS fallback / WebGL boot frame.
   These lightweight WebP plates are rendered from the actual Hydrogen shader at
   uTime=0, uMouseSmooth=.5/.5 and uCursorActive=0. Three canonical aspect families
   cover desktop/tablet/phone shapes; portrait rotates the same canonical landscape
   scene exactly like toSceneCoord() does in the shader. */
.explore-hydrogen-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-color: #f5f6fa;
  background-image: var(--explore-hydrogen-static-plate);
  background-position: 50% 50%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 1;
  transition: opacity 0.42s ease;
}

@media (orientation: landscape) and (min-aspect-ratio: 39/20) {
  .explore-hydrogen-bg {
    --explore-hydrogen-static-plate: url("../img/explore/hydrogen-start-19x9.webp");
  }
}

@media (orientation: landscape) and (max-aspect-ratio: 3/2) {
  .explore-hydrogen-bg {
    --explore-hydrogen-static-plate: url("../img/explore/hydrogen-start-4x3.webp");
  }
}

.explore-hydrogen-bg canvas {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.explore-hydrogen-bg.is-started::after {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.42s ease, visibility 0s linear 0.42s;
}

.explore-hydrogen-bg.is-failed::after {
  opacity: 1;
  visibility: visible;
}

@media only screen and (orientation: portrait) {
  .explore-hydrogen-bg::after {
    inset: auto;
    left: 50%;
    top: 50%;
    width: 100vh;
    width: 100dvh;
    height: 100vw;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: 50% 50%;
  }
}

@media only screen and (orientation: portrait) and (max-aspect-ratio: 10/19) {
  .explore-hydrogen-bg {
    --explore-hydrogen-static-plate: url("../img/explore/hydrogen-start-19x9.webp");
  }
}

@media only screen and (orientation: portrait) and (min-aspect-ratio: 2/3) {
  .explore-hydrogen-bg {
    --explore-hydrogen-static-plate: url("../img/explore/hydrogen-start-4x3.webp");
  }
}

@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  .explore-hydrogen-bg {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
  }
}

/* =============================================================================
   10. EXPLORE OVERLAY  (.explore-overlay)
   Full-screen panel that opens when the user clicks "Explore".
   ============================================================================= */

.explore-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  background: transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.explore-overlay.is-open   { display: block; opacity: 1; }
.explore-overlay.is-closing { display: block; opacity: 0; pointer-events: none; }

/* AUTHORSHIP: Explore uses one universal overlay fade; inner layers stay instant so the popup opens as a single object. */
.explore-overlay__shell {
  opacity: 1;
  transform: none;
  transition: none;
}

.explore-overlay.is-open .explore-overlay__shell {
  opacity: 1;
  transform: none;
}


/* Clickable backdrop — closes the overlay when clicked outside the shell */
.explore-overlay__backdrop {
  position: absolute;
  inset: 0;
  cursor: default;
}

/* Viewport inset frame. A dedicated inner viewport owns vertical scrolling,
   so the scrollbar sits on the popup edge instead of the browser edge while
   the paused main scene remains visually separate behind the frame. */
.explore-overlay__panel {
  --cp-overlay-panel-pad: 18px;
  --cp-overlay-close-offset: 14px;
  --cp-overlay-content-max: 1360px;
  --cp-overlay-close-z: 12;
  --cp-overlay-close-opacity: 0.88;
  /* Share the same visible-frame contract as case popups. Explore keeps its
     own fade lifecycle; only frame geometry, clipping and panel chrome are
     aligned. The shared scroll cue inherits these tokens from the panel. */
  --cp-case-frame-radius: 34px;
  --case-scroll-cue-bg: rgba(255, 255, 255, 0.78);
  --case-scroll-cue-border: rgba(75, 91, 120, 0.20);
  --case-scroll-cue-fg: rgba(21, 30, 50, 0.88);
  position: absolute;
  inset: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  padding: var(--cp-overlay-panel-pad);
  box-sizing: border-box;
  cursor: default;
}

/* Centred non-scrolling frame capped at 1360px. Its inner viewport owns the
   native rail, while this frame alone owns radius, clipping and shadow.
   AUTHORSHIP: Explore uses the same scrollbar construction standard as case
   popups — tokenised track/thumb/hover, padded thumb, and soft chrome — but in
   a light silver-blue palette that matches the shell gradient. */
.explore-overlay__content {
  --explore-scrollbar-width: 10px;
  --explore-scrollbar-edge-inset: calc(var(--cp-case-frame-radius) / 2);
  --explore-scrollbar-track: rgba(182, 194, 214, 0.34);
  --explore-scrollbar-thumb: #bcc8dc;
  --explore-scrollbar-thumb-hover: #d8e0ec;
  position: relative;
  width: min(var(--cp-overlay-content-max), 100%);
  height: calc(100vh - 76px);
  height: calc(100dvh - 76px);
  max-height: calc(100vh - 76px);
  max-height: calc(100dvh - 76px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--cp-case-frame-radius);
  background: linear-gradient(135deg, #f8f8fb 0%, #f3f5fa 40%, #f7f8fb 70%, #fbfbfd 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  isolation: isolate;
  box-sizing: border-box;
}

/* A non-scrolling frame owns the rounded clip, while this inner viewport owns
   native scrolling. Splitting those responsibilities prevents WebKit from
   dropping promoted descendants (the Hydrogen canvas and icon-grid transforms)
   when a clip-path is applied directly to an overflow:auto element. */
.explore-overlay__viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  box-sizing: border-box;
}

html.explore-overlay-open,
body.explore-overlay-open {
  overflow: hidden;
}

/* The shell is the long scrolling document. It deliberately owns neither
   radius nor shadow; the outer content frame clips every visual layer while
   the intermediate viewport handles only native scrolling. */
.explore-overlay__shell {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  border-radius: 0;
  background: linear-gradient(135deg, #f8f8fb 0%, #f3f5fa 40%, #f7f8fb 70%, #fbfbfd 100%);
}

/* Explore logo — same visual token and top-left alignment as the main-page Code Precision mark. */
.explore-overlay__logo {
  position: absolute;
  top: var(--vert);
  left: var(--side);
  z-index: 11;
  display: inline-flex;
  align-items: center;
  width: auto;
  height: var(--logo);
  text-decoration: none;
}

.explore-overlay__logo img {
  display: block;
  width: auto;
  height: var(--logo);
}

/* Shared case/Explore close button — panel-level dialog chrome, outside popup scroll roots. */
.case-overlay__close,
.explore-overlay__close {
  position: absolute;
  top: calc(var(--cp-overlay-panel-pad) + var(--cp-overlay-close-offset));
  right: max(
    calc(var(--cp-overlay-panel-pad) + var(--cp-overlay-close-offset)),
    calc((100% - var(--cp-overlay-content-max)) / 2 + var(--cp-overlay-close-offset))
  );
  z-index: var(--cp-overlay-close-z);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
  color: transparent;
  cursor: pointer;
  opacity: var(--cp-overlay-close-opacity);
  transition: transform 0.16s ease, background-color 0.16s ease, opacity 0.16s ease;
}

.explore-overlay__close:focus-visible {
  outline: 3px solid rgba(0, 0, 255, 0.72);
  outline-offset: 3px;
  background: rgba(255, 255, 255, 1);
  opacity: 1;
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.12),
    0 0 0 2px rgba(85, 240, 255, 0.28);
}

#explore-overlay .btn:focus-visible {
  outline: 3px solid rgba(0, 0, 255, 0.72);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px rgba(85, 240, 255, 0.24);
}

.case-overlay__close::before,
.case-overlay__close::after,
.explore-overlay__close::before,
.explore-overlay__close::after {
  content: '';
  position: absolute;
  width: 11px;
  height: 1.5px;
  border-radius: 999px;
  background: #111827;
}

.case-overlay__close::before,
.explore-overlay__close::before { transform: rotate(45deg); }
.case-overlay__close::after,
.explore-overlay__close::after { transform: rotate(-45deg); }

.case-overlay__close:hover,
.explore-overlay__close:hover {
  transform: scale(1.04);
  background: rgba(255, 255, 255, 1);
  opacity: 1;
}

/* Scroll wrapper sits above the Hydrogen background (z-index:0); the parent overlay fade handles the reveal. */
.explore-overlay__scroll {
  position: relative;
  z-index: 1;
  opacity: 1;
  transform: none;
  transition: none;
}

.explore-overlay.is-live .explore-overlay__scroll {
  opacity: 1;
  transform: none;
}

/* Explore reuses the case-popup scroll affordance classes directly; JS keeps the Explore-specific hook on the wrapper while case-overlay.css owns the shared haze/cue geometry. */
/* Overlay Explore starts below the logo, mirroring the main-page top-left brand placement. */
#explore-overlay .explore {
  padding-top: calc(var(--vert) + var(--logo) + clamp(20px, 2rem, 32px));
}

#explore-overlay .explore .big-icon {
  margin-top: 0;
}

/* ── Mobile explore overlay ──────────────────────────────────────────────── */

@media (orientation: portrait), (max-width: 1023.98px), (max-height: 599.98px) {
  .explore-overlay__panel {
    --cp-case-mobile-frame-gutter: 0px;
    --cp-overlay-panel-pad: 0px;
    --cp-overlay-close-offset: 12px;
    --cp-case-frame-radius: 0px;
    inset: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 0;
    border-radius: 0;
    box-sizing: border-box;
  }

  .explore-overlay__content {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    overflow: hidden;
    border-radius: 0;
    box-sizing: border-box;
  }

  .explore-overlay__viewport {
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .explore-overlay__shell {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
  }

  .explore-overlay__close {
    top: calc(var(--cp-case-mobile-frame-gutter) + var(--cp-overlay-close-offset) + env(safe-area-inset-top, 0px));
    right: calc(var(--cp-case-mobile-frame-gutter) + var(--cp-overlay-close-offset) + env(safe-area-inset-right, 0px));
    width: 44px;
    height: 44px;
  }
}


/* =============================================================================
   11. EXPLORE CAPABILITY ICONS  (.explore-icon)
   Animated SVG icons displayed in a grid on the explore page.
   JS repositions and expands them on interaction.
   ============================================================================= */

.explore-icon {
  position: absolute;
  width: 33.333%;
  height: 33.333%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 1;
  transform: translateY(0) scale(1) translateZ(0);
  transition:
    top     0.8s cubic-bezier(0.22, 1, 0.36, 1),
    left    0.8s cubic-bezier(0.22, 1, 0.36, 1),
    width   0.8s cubic-bezier(0.22, 1, 0.36, 1),
    height  0.8s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.9s ease;
}

.explore-icon svg,
.explore-icon img {
  display: block;
  width: 60%;
  height: 60%;
  object-fit: contain;
  opacity: 1;
}

.explore-icon--pink svg path { fill: #ED00EC; }
.explore-icon--blue svg path { fill: #0000FF; }

/* Expanded state — icon fills the entire grid area */
.explore-icon.is-expanded {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
}

/* Hide all non-expanded icons when one is expanded */
.icons-animated-grid.expanded-mode .explore-icon:not(.is-expanded) {
  opacity: 0;
  visibility: hidden;
}

.icons-animated-grid:not(.expanded-mode) .explore-icon {
  visibility: visible;
}


/* =============================================================================
   12. SCROLLBARS
   Base document keeps the simple site rail, while Explore now follows the
   same popup-scrollbar standard as case overlays: 10px gutter, softened
   track, padded thumb, and a gentle hover step rather than a raw browser rail.
   ============================================================================= */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #d5d5e5 transparent;
}

.explore-overlay__viewport {
  scrollbar-width: thin;
  scrollbar-color: var(--explore-scrollbar-thumb) var(--explore-scrollbar-track);
}

/* Chrome / Safari / Edge */
html::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.explore-overlay__viewport::-webkit-scrollbar {
  width: var(--explore-scrollbar-width, 10px);
  height: var(--explore-scrollbar-width, 10px);
}

html::-webkit-scrollbar-track {
  background: transparent;
}

.explore-overlay__viewport::-webkit-scrollbar-track {
  margin-block: var(--explore-scrollbar-edge-inset, 0px);
  background: var(--explore-scrollbar-track);
  border-radius: 999px;
}

html::-webkit-scrollbar-thumb {
  background: #d5d5e5;
  border-radius: 999px;
}

.explore-overlay__viewport::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--explore-scrollbar-thumb), var(--explore-scrollbar-thumb));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 0 0 1px rgba(75, 91, 120, 0.08);
}

html::-webkit-scrollbar-thumb:hover {
  background: #7a7a9c;
}

.explore-overlay__viewport::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--explore-scrollbar-thumb-hover), var(--explore-scrollbar-thumb-hover));
  background-clip: padding-box;
}


.explore-overlay__viewport::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.explore-overlay__viewport::-webkit-scrollbar-corner {
  background: transparent;
}

/* =============================================================================
   13. ACCESSIBILITY
   Focus rings, touch targets, and reduced-motion overrides.
   ============================================================================= */

/* Keyboard focus ring — cyan contrasts on both dark portal and light content */
:focus-visible {
  outline: 2px solid rgba(85, 240, 255, 0.85);
  outline-offset: 3px;
}

/* Links: underline instead of box outline */
a:focus-visible {
  outline: none;
  text-decoration-color: rgba(85, 240, 255, 0.9);
  text-decoration-thickness: 2px;
}

/* Inputs already show a border change on focus */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(85, 240, 255, 0.7);
  outline-offset: 0;
}

/* Touch target minimum — 44×44px per WCAG 2.5.5 */
@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  a:not([class]),
  button:not([class]) {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Collapse authored motion without relying on declaration priority. */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  html[data-cp-page][data-cp-page] body,
  html[data-cp-page][data-cp-page] body *,
  html[data-cp-page][data-cp-page] body *::before,
  html[data-cp-page][data-cp-page] body *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }

  #portal-loader,
  #portal-loader .progress,
  #portal-loader .pct,
  .audio-toggle--link,
  .audio-toggle__pulse,
  .audio-toggle__label::after,
  .explore-overlay,
  .case-overlay__close,
  .explore-overlay__close,
  .wrap-form input,
  .wrap-form textarea,
  .explore-icon,
  .cp-detected {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }

  #portal-loader .pct,
  .audio-toggle:not(.is-enabled) .audio-toggle__pulse {
    animation: none;
  }
}


/* =============================================================================
   14. CASE TILE FOIL ANIMATIONS
   Holographic satin shimmer on featured-cases tiles.
   Keyframes only — the rules that reference them live in site-base.css.

   Two animations run independently:
   - satinDrift: slowly pans the gradient position left↔right
   - satinHue:   rotates the whole hue spectrum, one full cycle per 6s

   Together they produce the passive colour-shift of foil stickers.
   Each tile gets a different animation-delay so they do not all shimmer
   in sync — staggered via nth-child in site-base.css.
   ============================================================================= */

@keyframes satinDrift {
  0%   { background-position: 0% 50%;   }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%;   }
}

@keyframes satinHue {
  from { filter: hue-rotate(0deg);   }
  to   { filter: hue-rotate(360deg); }
}

/* ── Scroll reveal — explore (disabled: content visible immediately) ───────── */
.cp-detected {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  pointer-events: auto;
}

.cp-detected:not(.cp-visible) {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  pointer-events: auto;
}

.cp-detected.cp-visible {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  pointer-events: auto;
}



/* Hidden service node: homepage.js still uses #portal-mobile-caption to initialize
   portal segment navigation, keyboard arrows, and swipe controls, but the visual
   project-info lower-third is intentionally removed because Signal now owns project info. */
.portal-mobile-caption--service {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* =============================================================================
   PORTAL NAV ARROWS
   AUTHORSHIP: arrows live in a fixed layer identical in structure to the pointer
   stage — outside any 3D-transformed ancestor so they never inherit perspective
   distortion from portal tilt. left/top are written as inline style by JS using
   getBoundingClientRect on the portal surface, making position always match the
   live rendered circle regardless of zoom, resize, or orientation change.
   ============================================================================= */

.portal-nav-arrows {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  user-select: none;
}

.portal-nav-arrows__btn {
  position: fixed;
  pointer-events: auto;
  cursor: pointer;
  background: none;
  border: none;
  padding: 14px;
  color: #000;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.35s ease, color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  /* start offscreen */
  left: -9999px;
  top: -9999px;
}

.portal-nav-arrows__btn.is-visible {
  opacity: 0.5;
}

.portal-nav-arrows__btn:hover,
.portal-nav-arrows__btn:focus-visible,
.portal-nav-arrows__btn.is-key-active {
  opacity: 1;
  color: var(--lightblue);
}

.portal-nav-arrows__btn:active {
  transform: translate(-50%, -50%) scale(0.85);
}

.portal-nav-arrows__btn svg {
  display: block;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.8));
}

/* =============================================================================
   PORTAL REDUCED-MOTION PLAYBACK TOGGLE
   AUTHORSHIP: reduced motion replaces the portal video with a static poster
   (portal-webgl.js RM poster mode), but the preference is about removing
   UNREQUESTED motion, not denying motion the person explicitly asks for. This
   is that opt-in: starts the current case's real Mux clip over the poster and
   can stop it again. Shape/position/opacity-visibility states are critical CSS
   (index.html + tools/critical.css) to avoid FOUC; this is the progressive
   polish layer, same split used by .audio-toggle__icon-wrap. Exempted from
   portal tap-zone/zoom gestures via isPortalGestureControl in portal-zoom.js.

   Visual language, second pass: the first version borrowed the language
   switcher's dark-glass-chip-with-blur look, then a glossy gradient "bubble"
   — both read as imported UI-kit decoration next to the portal rather than
   belonging to it. This instead assembles from two controls already native
   to this exact spot: the flat rgba(0,0,26,*) translucent disc + hairline
   border already used for .portal-audio-toggle-wrap's mobile icon circles
   (critical CSS above), and the bare-icon / drop-shadow / opacity-fade /
   --lightblue-on-hover behavior of .portal-nav-arrows__btn right next to it.
   No blur, no gradient body, no glow ring, no spring bounce — restraint over
   decoration, matching the site's stated aesthetic. */

.portal-rm-playback-toggle {
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.portal-rm-playback-toggle__icon {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.7));
}

.portal-rm-playback-toggle:hover,
.portal-rm-playback-toggle:focus-visible {
  border-color: var(--lightblue);
  color: var(--lightblue);
}

.portal-rm-playback-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.98);
  outline-offset: 4px;
}

/* Press feedback via fill only — fixed dimensions throughout, no scale. */
.portal-rm-playback-toggle:active {
  background: rgba(0, 0, 26, 0.55);
}

/* Playing state: a touch more solid so the control still reads at a glance,
   without a second color language — same disc, deeper fill. */
.portal-rm-playback-toggle[aria-pressed="true"] {
  background: rgba(0, 0, 26, 0.5);
}

@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  .portal-rm-playback-toggle {
    width: 46px;
    height: 46px;
    border-radius: 13px;
  }
  .portal-rm-playback-toggle__icon {
    width: 18px;
    height: 18px;
  }
}


@media only screen and (orientation: portrait), only screen and (max-width: 1023.98px), only screen and (max-height: 599.98px) {
  .portal-nav-arrows {
    display: none;
  }
}

/* Pause the main-page motion layer whenever the shared overlay contract marks Case or Explore as active.
   The selector is scoped away from overlay shells so popup intro/close choreography keeps running. */
body.main-animations-paused .mainwrap,
body.main-animations-paused .mainwrap *,
body.main-animations-paused .mainwrap *::before,
body.main-animations-paused .mainwrap *::after,
body.main-animations-paused .split-background,
body.main-animations-paused .split-background *,
body.main-animations-paused .split-background *::before,
body.main-animations-paused .split-background *::after,
body.main-animations-paused .portal-nav-arrows,
body.main-animations-paused .portal-nav-arrows *,
body.main-animations-paused .portal-nav-arrows *::before,
body.main-animations-paused .portal-nav-arrows *::after {
  animation-play-state: paused !important;
}

/* Screenshot pose — S resets the authored homepage composition, then the
   shared motion controller freezes WebGL/video/RAF systems. This CSS layer
   also holds declarative animations and prevents pointer-driven drift. */
html.screenshot-pose-mode,
body.screenshot-pose-mode {
  scroll-behavior: auto !important;
  overscroll-behavior: none;
  cursor: none !important;
}

/* The Main Screenshot intentionally captures the existing body::before
   spotlight without drawing a browser pointer on top of it. */
body.screenshot-pose-mode,
body.screenshot-pose-mode * {
  cursor: none !important;
}

body.screenshot-pose-mode #page-main {
  pointer-events: none !important;
}

body.screenshot-pose-mode #page-main,
body.screenshot-pose-mode #page-main *,
body.screenshot-pose-mode #page-main *::before,
body.screenshot-pose-mode #page-main *::after {
  animation-play-state: paused !important;
}

body.screenshot-pose-mode #portal-renderer-test-toggle {
  display: none !important;
}

body.screenshot-pose-mode .portal-mobile-caption {
  opacity: 0 !important;
  visibility: hidden !important;
}

@media (max-width: 860px) {
  body.screenshot-pose-mode .hero-floating-contact {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Reduced motion shares screenshot mode's calm homepage composition without
   disabling interaction or forcing the page/portal back to its first item. */
@media (prefers-reduced-motion: reduce) {
  #page-main,
  #page-main *,
  #page-main *::before,
  #page-main *::after {
    animation-play-state: paused !important;
  }
}


/* =============================================================================
   BANNER CAPTURE MODE
   Press B on the homepage to isolate the portal for video-banner recording.
   Only the WebGL portal layer, the portal shell, and the segment caption remain.
   ============================================================================= */


/* Mobile portal half-tap feedback. These overlays are visual-only and sit
   inside the already clipped portal surface, so they cannot affect hit testing. */
.portal-tap-feedback {
  position: absolute;
  inset: 0;
  z-index: 7;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(176, 224, 255, 0.28) 0%, rgba(103, 176, 255, 0.18) 50%, rgba(92, 162, 255, 0) 78%);
  transition: opacity 150ms ease-out;
}
.portal-tap-feedback--prev { clip-path: inset(0 50% 0 0); }
.portal-tap-feedback--next { clip-path: inset(0 0 0 50%); }

.portal-tap-feedback::after {
  position: absolute;
  top: 50%;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(210, 238, 255, 0.42);
  border-radius: 50%;
  background-color: rgba(20, 78, 132, 0.22);
  background-position: 50% 50%;
  background-repeat: no-repeat;
  background-size: 24px 24px;
  box-shadow: 0 0 18px rgba(74, 157, 235, 0.2);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 90ms ease-out, transform 170ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.portal-tap-feedback--prev::after {
  left: 25%;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.5 5.5 8 12l6.5 6.5' fill='none' stroke='%23e6f6ff' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.portal-tap-feedback--next::after {
  left: 75%;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9.5 5.5 6.5 6.5-6.5 6.5' fill='none' stroke='%23e6f6ff' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.portal-tap-feedback.is-active { opacity: 1; }
.portal-tap-feedback.is-active::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .portal-tap-feedback { transition-duration: 90ms; }
}


/* Explore circle-ring burst — three.js accent tied to the authored circle bullets. */
.explore-ring-burst {
  position: absolute;
  inset: var(--cp-overlay-panel-pad);
  pointer-events: none;
  overflow: hidden;
  border-radius: var(--cp-case-frame-radius, 34px);
  z-index: 6;
  opacity: 0;
  transition: opacity 220ms ease;
}

.explore-ring-burst.is-ready {
  opacity: 1;
}

.explore-ring-burst__canvas {
  width: 100%;
  height: 100%;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .explore-ring-burst {
    display: none;
  }
}


/* Explore icon light-show hover: the block becomes an interactive kinetic tile. */
#explore-overlay .explore .big-icon {
  cursor: default;
}

#explore-overlay .icons-animated-grid.is-light-show .explore-icon {
  will-change: top, left, transform;
}

@media (hover: hover) and (pointer: fine) {
  #explore-overlay .explore .big-icon {
    cursor: crosshair;
  }
}

@media (prefers-reduced-motion: reduce) {
  #explore-overlay .icons-animated-grid.is-light-show .explore-icon {
    will-change: auto;
  }
}
