/* =========================================
   CREATOR CTRL SCAFFOLDING v2.0
   ⚠️ DO NOT MODIFY THIS FILE ⚠️
   
   This file contains protected navigation,
   responsive behavior, and core UI components.
   
   Only modify styles.css for template customization.
   ========================================= */

/* --- BASE RESET --- */
html, body { margin: 0; padding: 0; }
body { background: var(--bg-body, #fff); color: var(--text-main, #000); font-family: var(--font-body, system-ui, sans-serif); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading, system-ui, sans-serif); }
section, header, footer, [data-block] { background-repeat: no-repeat; background-position: center; }
:root {
    --color-bg: var(--bg-body, #fff);
    --color-accent: var(--color-primary, #6366f1);
    --border-width: 1px;
    --radius-main: var(--btn-radius, 4px);
    --tab-sidebar-rail-w: 72px;
    --tab-sidebar-expanded-w: 240px;
    --bottom-nav-height: 64px;
    --tablet-sidebar-blur: 20px;
    --tablet-item-padding: 10px 12px;
    --tablet-icon-size: 20px;
}

/* --- PER-DEVICE LAYOUT SCOPING (Plan 8) --- */
/* Wrappers with data-device-layout are hidden by default; only the wrapper
   matching html[data-device="X"] is shown. engine.js sets data-device on load
   and on resize (debounced 100ms). Legacy sites without [data-device-layout]
   wrappers are unaffected — selectors only activate when wrappers are present. */
[data-device-layout]{display:none;transition:opacity 100ms ease-out;}
html[data-device="mobile"]  [data-device-layout~="mobile"]{display:block;}
html[data-device="tablet"]  [data-device-layout~="tablet"]{display:block;}
html[data-device="desktop"] [data-device-layout~="desktop"]{display:block;}

/* --- NAV DEVICE SCOPING --- */
/* Nav blocks inject all 3 device variants (desktop/tablet/mobile) into the DOM
   simultaneously. Only the nav matching the active device should be visible.
   engine.js sets data-device on <html>; this CSS toggles nav visibility. */
[data-ar-nav-device]{display:none !important;}
html[data-device="mobile"]  [data-ar-nav-device="mobile"]{display:flex !important;}
html[data-device="tablet"]  [data-ar-nav-device="tablet"]{display:flex !important;}
html[data-device="desktop"] [data-ar-nav-device="desktop"]{display:flex !important;}

/* --- HERO DEVICE SCOPING --- */
/* Hero blocks inject all 3 device variants (desktop/tablet/mobile) into the DOM
   simultaneously via [data-ar-hero-device] containers. Only the container matching
   the active device should be visible. Follows the same pattern as nav scoping. */
[data-ar-hero-device]{display:none !important;}
html[data-device="desktop"] [data-ar-hero-device="desktop"],
html:not([data-device]) [data-ar-hero-device="desktop"]{display:block !important;}
html[data-device="tablet"]  [data-ar-hero-device="tablet"]{display:block !important;}
html[data-device="mobile"]  [data-ar-hero-device="mobile"]{display:block !important;}

/* --- PANEL DEVICE SCOPING --- */
/* Slide panel sets are emitted as 3 sibling [data-ar-panel-device] wrappers
   (desktop/tablet/mobile) so each device has independent panel content. Only
   the active device's wrapper should be visible. Mirrors hero/nav scoping. */
/* pointer-events:none — the wrapper is a full-viewport grouping container at
   z-index:200 (#rnd-panel-anchor). With pe:auto it ate every click/selection on
   the base page when NO panel was open (desktop hero-panels: nav + text dead,
   only the higher-z fixed cart button worked). The wrapper must be click-through;
   the .ar-slide-panel children re-enable pe:auto so an open panel stays
   interactive, and close-on-outside still fires via the document-level listener. */
[data-ar-panel-device]{display:none !important;pointer-events:none;}
html[data-device="desktop"] [data-ar-panel-device="desktop"],
html:not([data-device]) [data-ar-panel-device="desktop"]{display:block !important;}
html[data-device="tablet"]  [data-ar-panel-device="tablet"]{display:block !important;}
html[data-device="mobile"]  [data-ar-panel-device="mobile"]{display:block !important;}

/* --- HERO VIEWPORT MODEL (Plan E — RnD positioning) --- */
/* Hero is a relative container; children use position:absolute with
   pixel coordinates set by rnd-position-store per device breakpoint.
   engine.js section 0.5 skips scaling when hero is present (rnd + zoom
   replaces the old transform:scale workaround). */

/* Base hero properties (all devices) */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Hero children — absolutely positioned via rnd inline styles. Excludes the
   background layer divs (.hero-bg legacy + .creatorctrl-image-bg-fill +
   .creatorctrl-image-bg-overlay + .creatorctrl-section-bg) so the section-bg-store's
   own inline positioning isn't co-opted by the rnd content rule. */
.hero > *:not(.hero-bg):not(.creatorctrl-image-bg-fill):not(.creatorctrl-image-bg-overlay):not(.creatorctrl-section-bg) {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    overflow: visible;
}

/* The per-device hero wrapper must stretch to fill .hero so children inside
   it (which use absolute positioning from positions.json) resolve their
   coordinates against the full hero box, not against a shrink-wrapped
   wrapper. Without this the rule above gives the wrapper width:auto and
   variant content collapses into the top-left corner. */
.hero > [data-ar-hero-device] {
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Background layer — absolute, behind content */
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* Fluid typography for hero display titles */
html[data-device="desktop"] .hero .display-title {
    font-size: clamp(80px, 14vw, 220px);
}
html[data-device="tablet"] .hero .display-title {
    font-size: clamp(48px, 10vw, 120px);
}
html[data-device="mobile"] .hero .display-title {
    font-size: clamp(32px, 12vw, 64px);
}

/* --- ELASTIC CANVAS LAYERS (Hero Elastic Canvas — Phase 2 defaults) ---
   .rnd-bleed hosts the bleed-reveal layer (bg cover + center, runtime-sized
   by the rnd-autoscale script in SiteRendererService/TemplateController).
   .rnd-safe keeps authored pixel coords pixel-exact and centers inside bleed.
   These are sane defaults for non-iframe contexts and legacy pages that
   predate the server-injected <style id="rnd-canvas-system"> block. */
.rnd-bleed {
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.rnd-safe {
    position: relative;
    margin: 0 auto;
}

/* Per-device safe-area authored dims (scoped to [data-device="X"]) */
html[data-device="desktop"] .rnd-safe,
html:not([data-device]) .rnd-safe { width: 1920px; height: 1080px; }
html[data-device="tablet"] .rnd-safe { width: 1024px; height: 1366px; }
html[data-device="mobile"] .rnd-safe { width: 384px;  height: 724px; }

/* --- ADAPTIVE POSITIONING MODE (anchor zones) ---
   Fallback defaults mirroring the authoritative <style id="rnd-canvas-system">
   block injected by SiteRendererService/TemplateController. When a hero opts in
   via data-positioning-mode="adaptive", the stage wrappers carry .is-adaptive:
   the canvas fills the viewport (no transform:scale), elements peg to derived
   anchor zones, and the bg covers the viewport. These overrides must out-specify
   the per-device fixed-dim rules above (hence the html[...] prefix on .hero). */
/* !important is required: the per-device locked rules (html[data-device="X"]
   .rnd-scaler/.rnd-canvas/.rnd-bleed/.rnd-safe { ...724px/1366px }) have
   specificity (0,3,1) and would otherwise cap these wrappers at the fixed
   device dims (the cause of the phone-preview "locked height" bug). */
.rnd-sizing-box.is-adaptive { width: 100vw !important; height: 100vh !important; }
.rnd-scaler.is-adaptive,
.rnd-canvas.is-adaptive,
.rnd-bleed.is-adaptive { width: 100% !important; height: 100% !important; transform: none !important; }
.rnd-safe.is-adaptive {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    left: 0;
    top: 0;
    transform: none !important;
    overflow: visible;
}
.rnd-bleed.is-adaptive {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
html .rnd-safe.is-adaptive .hero { width: 100% !important; height: 100% !important; min-height: 100vh; }
html .rnd-safe.is-adaptive .hero .display-title { font-size: clamp(40px, 9vw, 220px); }
/* rnd elements anchor against their nearest positioned ancestor; the template
   nests them under a data-inject-slot + data-ar-hero-device wrapper that are
   normally 0x0 (locked uses left/top px only). Anchor zones need a sized
   containing block, so stretch those wrappers to fill the hero. */
/* Scoped to INSIDE .hero: only the wrappers that are ancestors of the rnd
   content should fill. A stray empty [data-inject-slot] sits as a sibling of
   .hero (direct child of .rnd-safe); stretching THAT to full-viewport made it
   an invisible overlay that ate every nav click. */
.rnd-safe.is-adaptive .hero [data-inject-slot],
.rnd-safe.is-adaptive .hero [data-ar-hero-device] {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}
/* The full-viewport content wrappers (the rnd inject-slot + hero-device container)
   are SIBLINGS of the composition nav, so they paint over it and eat its clicks.
   Make the wrapper layers click-through; re-enable pointer events on the actual rnd
   elements (and their links/buttons) and on the nav so everything stays interactive. */
.rnd-safe.is-adaptive .hero [data-inject-slot],
.rnd-safe.is-adaptive .hero [data-ar-hero-device] { pointer-events: none; }
.rnd-safe.is-adaptive .hero [data-ar-hero-device] [data-ar-id],
.rnd-safe.is-adaptive .hero [data-ar-nav] { pointer-events: auto; }

/* --- NAVIGATION SCAFFOLDING --- */
.nav-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 900;
    padding: 30px 50px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    mix-blend-mode: difference;
    pointer-events: none;
    background: linear-gradient(to bottom, black, transparent);
}

.nav-fixed>* {
    pointer-events: auto;
}

/* --- NAV STYLE VARIANTS --- */
/* All variants read --nav-bg and --nav-text custom properties set by setNavColors() */

/* CLASSIC: Solid bar, no blend mode */
.nav-fixed[data-nav-style="classic"] {
    mix-blend-mode: normal;
    background: var(--nav-bg, transparent);
    border-bottom: var(--nav-border, none);
    color: var(--nav-text, inherit);
    padding: var(--classic-padding-y, 30px) 50px;
}
.nav-fixed[data-nav-style="classic"] .nav-links a,
.nav-fixed[data-nav-style="classic"] .nav-dropdown-toggle {
    color: var(--nav-text, #fff);
    margin: 0 var(--classic-link-gap, 15px);
    font-size: var(--classic-text-size, 0.9rem);
    letter-spacing: var(--classic-letter-spacing, 0);
}
.nav-fixed[data-nav-style="classic"] .site-logo {
    height: var(--classic-logo-size, 30px);
}

/* STICKY-REVEAL: Solid bar + hides on scroll down, reveals on scroll up */
.nav-fixed[data-nav-style="sticky-reveal"] {
    mix-blend-mode: normal;
    background: var(--nav-bg, transparent);
    border-bottom: var(--nav-border, none);
    color: var(--nav-text, inherit);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding: var(--sticky-reveal-padding-y, 30px) 50px;
}
.nav-fixed[data-nav-style="sticky-reveal"].rt-nav-hidden {
    transform: translateY(-100%);
}
.nav-fixed[data-nav-style="sticky-reveal"] .site-logo {
    height: var(--sticky-reveal-logo-size, 30px);
}
.nav-fixed[data-nav-style="sticky-reveal"] .nav-links a,
.nav-fixed[data-nav-style="sticky-reveal"] .nav-dropdown-toggle {
    color: var(--nav-text, #fff);
    margin: 0 var(--sticky-reveal-link-gap, 15px);
    font-size: var(--sticky-reveal-text-size, 0.9rem);
    letter-spacing: var(--sticky-reveal-letter-spacing, 0);
}

/* FLOATING-ISLAND: Centered pill */
.nav-fixed[data-nav-style="floating-island"] {
    mix-blend-mode: normal;
    background: var(--nav-bg, transparent);
    color: var(--nav-text, inherit);
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 800px;
    min-width: 400px;
    padding: var(--floating-island-padding-y, 14px) 32px;
    border-radius: 999px;
    border: 1px solid var(--nav-text, rgba(255, 255, 255, 0.1));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.nav-fixed[data-nav-style="floating-island"] .site-logo {
    height: var(--floating-island-logo-size, 30px);
}
.nav-fixed[data-nav-style="floating-island"] .nav-links a,
.nav-fixed[data-nav-style="floating-island"] .nav-dropdown-toggle {
    color: var(--nav-text, #fff);
    margin: 0 var(--floating-island-link-gap, 15px);
    font-size: var(--floating-island-text-size, 0.9rem);
    letter-spacing: var(--floating-island-letter-spacing, 0);
}

/* TRANSPARENT-SOLID: Starts transparent, becomes solid on scroll */
.nav-fixed[data-nav-style="transparent-solid"] {
    mix-blend-mode: normal;
    background: transparent;
    color: var(--nav-text, inherit);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 1px solid transparent;
    padding: var(--transparent-solid-padding-y, 30px) 50px;
}
.nav-fixed[data-nav-style="transparent-solid"].rt-nav-scrolled {
    background: var(--nav-bg, transparent);
    border-bottom: var(--nav-border, none);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.nav-fixed[data-nav-style="transparent-solid"] .site-logo {
    height: var(--transparent-solid-logo-size, 30px);
}
.nav-fixed[data-nav-style="transparent-solid"] .nav-links a,
.nav-fixed[data-nav-style="transparent-solid"] .nav-dropdown-toggle {
    color: var(--nav-text, #fff);
    margin: 0 var(--transparent-solid-link-gap, 15px);
    font-size: var(--transparent-solid-text-size, 0.9rem);
    letter-spacing: var(--transparent-solid-letter-spacing, 0);
}

/* CENTERED: Logo centered, links split left/right */
.nav-fixed[data-nav-style="centered"] {
    mix-blend-mode: normal;
    background: var(--nav-bg, transparent);
    color: var(--nav-text, inherit);
    justify-content: center;
    align-items: center;
    border-bottom: var(--nav-border, none);
    padding: var(--centered-padding-y, 30px) 50px;
}
.nav-fixed[data-nav-style="centered"] .site-logo {
    margin: 0 30px;
    height: var(--centered-logo-size, 30px);
    flex-shrink: 0;
}
/* Split link wrappers created by engine.js for true centered layout */
.nav-fixed[data-nav-style="centered"] .nav-links-left,
.nav-fixed[data-nav-style="centered"] .nav-links-right {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.nav-fixed[data-nav-style="centered"] .nav-links-left {
    justify-content: flex-end;
    padding-right: var(--centered-left-offset, 10px);
}
.nav-fixed[data-nav-style="centered"] .nav-links-right {
    justify-content: flex-start;
}
.nav-fixed[data-nav-style="centered"] .nav-links-left a,
.nav-fixed[data-nav-style="centered"] .nav-links-right a,
.nav-fixed[data-nav-style="centered"] .nav-links a,
.nav-fixed[data-nav-style="centered"] .nav-dropdown-toggle {
    color: var(--nav-text, #fff);
    margin: 0 var(--centered-link-gap, 15px);
    font-size: var(--centered-text-size, 0.9rem);
    letter-spacing: var(--centered-letter-spacing, 0);
}
/* CTA stays at the far right without affecting centering */
.nav-fixed[data-nav-style="centered"] .btn-outline,
.nav-fixed[data-nav-style="centered"] .nav-cta {
    flex-shrink: 0;
}

/* SIDEBAR: Fixed left vertical nav */
.nav-fixed[data-nav-style="sidebar"] {
    mix-blend-mode: normal;
    background: var(--nav-bg, transparent);
    color: var(--nav-text, inherit);
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width, 240px);
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 30px 20px;
    border-bottom: none;
    border-right: var(--sidebar-border-width, 1px) solid var(--sidebar-border-color, rgba(255, 255, 255, 0.1));
    transition: width 0.2s ease;
}
.nav-fixed[data-nav-style="sidebar"] .site-logo {
    margin-bottom: 30px;
    height: var(--sidebar-logo-size, 28px);
}
.nav-fixed[data-nav-style="sidebar"] .nav-links {
    display: flex;
    flex-direction: column;
    gap: var(--sidebar-link-gap, 4px);
}
.nav-fixed[data-nav-style="sidebar"] .nav-links a {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--sidebar-link-radius, 6px);
    border-bottom: none;
    color: var(--nav-text, #fff);
    font-size: var(--sidebar-text-size, 14px);
    letter-spacing: var(--sidebar-letter-spacing, 0);
    position: relative;
    transition: background 0.15s ease;
}
.nav-fixed[data-nav-style="sidebar"] .nav-links a:hover {
    background: rgba(255, 255, 255, 0.06);
    border-bottom: none;
}
.nav-fixed[data-nav-style="sidebar"] .btn-outline,
.nav-fixed[data-nav-style="sidebar"] .nav-cta {
    margin-top: auto;
}
/* Push content right when sidebar nav is active — desktop only */
@media (min-width: 1025px) {
    .nav-fixed[data-nav-style="sidebar"] ~ .app-view-container {
        margin-left: var(--sidebar-width, 240px);
        width: calc(100% - var(--sidebar-width, 240px));
        transition: margin-left 0.2s ease, width 0.2s ease;
    }
}

/* Hide sidebar nav on mobile/tablet — those viewports use their own nav elements */
@media (max-width: 1024px) {
    .nav-fixed[data-nav-style="sidebar"] {
        display: none !important;
    }
}

/* --- SIDEBAR: Link Styles --- */
.nav-fixed[data-nav-style="sidebar"][data-sidebar-link-style="pill"] .nav-links a {
    border-radius: 100px;
}
.nav-fixed[data-nav-style="sidebar"][data-sidebar-link-style="left-accent"] .nav-links a {
    border-radius: 0;
    padding-left: 16px;
    border-left: 3px solid transparent;
}
.nav-fixed[data-nav-style="sidebar"][data-sidebar-link-style="left-accent"] .nav-links a:hover {
    border-left-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.04);
}
.nav-fixed[data-nav-style="sidebar"][data-sidebar-link-style="ghost"] .nav-links a {
    background: transparent !important;
    border: 1px solid transparent;
}
.nav-fixed[data-nav-style="sidebar"][data-sidebar-link-style="ghost"] .nav-links a:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: transparent !important;
}

/* --- SIDEBAR: Active Indicators --- */
.nav-fixed[data-nav-style="sidebar"][data-sidebar-active="none"] .nav-links a[data-rt-active] {
    background: transparent;
    font-weight: inherit;
}
.nav-fixed[data-nav-style="sidebar"][data-sidebar-active="left-bar"] .nav-links a[data-rt-active] {
    border-left: 3px solid var(--color-primary, #6366f1);
    padding-left: 13px;
}
.nav-fixed[data-nav-style="sidebar"][data-sidebar-active="glow-dot"] .nav-links a[data-rt-active]::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary, #6366f1);
    box-shadow: 0 0 8px var(--color-primary, #6366f1);
}
.nav-fixed[data-nav-style="sidebar"][data-sidebar-active="filled-pill"] .nav-links a[data-rt-active] {
    background: var(--color-primary, #6366f1);
    color: #fff;
    border-radius: 100px;
}

/* --- SIDEBAR: Background Styles --- */
.nav-fixed[data-nav-style="sidebar"][data-sidebar-bg="gradient"] {
    background: linear-gradient(180deg, var(--nav-bg, transparent) 0%, rgba(0, 0, 0, 0.92) 100%) !important;
}
.nav-fixed[data-nav-style="sidebar"][data-sidebar-bg="glass"] {
    background: color-mix(in srgb, var(--nav-bg, transparent) 60%, transparent) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* OFF-CANVAS: Logo + hamburger, reveals full overlay on click */
.nav-fixed[data-nav-style="off-canvas"] {
    mix-blend-mode: normal;
    background: var(--nav-bg, transparent);
    color: var(--nav-text, inherit);
    border-bottom: var(--nav-border, none);
    padding: var(--off-canvas-padding-y, 30px) 50px;
}
.nav-fixed[data-nav-style="off-canvas"] .site-logo {
    height: var(--off-canvas-logo-size, 30px);
}
.nav-fixed[data-nav-style="off-canvas"] .nav-links {
    display: none;
}
.nav-fixed[data-nav-style="off-canvas"] .nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    pointer-events: auto;
    color: var(--nav-text, #fff);
    font-size: 1.3rem;
}
/* Off-canvas overlay panel */
.rt-nav-offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--nav-bg, transparent);
    color: var(--nav-text, #fff);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.rt-nav-offcanvas-overlay[data-rt-active] {
    opacity: 1;
    visibility: visible;
}
.rt-nav-offcanvas-overlay a {
    font-family: var(--font-heading);
    font-size: var(--off-canvas-text-size, 2rem);
    text-transform: uppercase;
    letter-spacing: var(--off-canvas-letter-spacing, 3px);
    color: var(--nav-text, #fff);
    transition: color 0.2s;
    margin: 0 var(--off-canvas-link-gap, 0);
}
.rt-nav-offcanvas-overlay a:hover {
    color: var(--color-primary);
}
.nav-offcanvas-close {
    position: absolute;
    top: 30px;
    right: 50px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--nav-text, #fff);
    font-size: 1.5rem;
}

/* BOTTOM-BAR: Anchored to bottom of viewport */
.nav-fixed[data-nav-style="bottom-bar"] {
    mix-blend-mode: normal;
    background: var(--nav-bg, transparent);
    color: var(--nav-text, inherit);
    top: auto;
    bottom: 0;
    border-bottom: none;
    border-top: 1px solid var(--nav-text, rgba(255, 255, 255, 0.1));
    padding: var(--bottom-bar-padding-y, 30px) 50px;
}
.nav-fixed[data-nav-style="bottom-bar"] .site-logo {
    height: var(--bottom-bar-logo-size, 30px);
}
.nav-fixed[data-nav-style="bottom-bar"] .nav-links a,
.nav-fixed[data-nav-style="bottom-bar"] .nav-dropdown-toggle {
    color: var(--nav-text, #fff);
    margin: 0 var(--bottom-bar-link-gap, 15px);
    font-size: var(--bottom-bar-text-size, 0.9rem);
    letter-spacing: var(--bottom-bar-letter-spacing, 0);
}

/* MINIMAL: Logo + hamburger, dropdown below nav on click */
.nav-fixed[data-nav-style="minimal"] {
    mix-blend-mode: normal;
    background: var(--nav-bg, transparent);
    color: var(--nav-text, inherit);
    border-bottom: var(--nav-border, none);
    flex-wrap: wrap;
    padding: var(--minimal-padding-y, 30px) 50px;
}
.nav-fixed[data-nav-style="minimal"] .site-logo {
    height: var(--minimal-logo-size, 30px);
}
.nav-fixed[data-nav-style="minimal"] .nav-links {
    display: none;
}
.nav-fixed[data-nav-style="minimal"] .nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    pointer-events: auto;
    color: var(--nav-text, #fff);
    font-size: 1.3rem;
}
/* Minimal dropdown */
.rt-nav-minimal-dropdown {
    width: 100%;
    background: var(--nav-bg, transparent);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px 0;
    display: none;
    flex-direction: column;
    order: 99;
}
.rt-nav-minimal-dropdown[data-rt-active] {
    display: flex;
}
.rt-nav-minimal-dropdown a {
    padding: 12px 50px;
    font-family: var(--font-body);
    font-size: var(--minimal-text-size, 0.9rem);
    text-transform: uppercase;
    letter-spacing: var(--minimal-letter-spacing, 0);
    color: var(--nav-text, #fff);
    transition: background 0.2s;
    margin: 0 var(--minimal-link-gap, 0);
}
.rt-nav-minimal-dropdown a:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* SPLIT: Links centered, prominent CTA right */
.nav-fixed[data-nav-style="split"] {
    mix-blend-mode: normal;
    background: var(--nav-bg, transparent);
    color: var(--nav-text, inherit);
    border-bottom: var(--nav-border, none);
    padding: var(--split-padding-y, 30px) 50px;
}
.nav-fixed[data-nav-style="split"] .site-logo {
    height: var(--split-logo-size, 30px);
}
.nav-fixed[data-nav-style="split"] .nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.nav-fixed[data-nav-style="split"] .nav-links a,
.nav-fixed[data-nav-style="split"] .nav-dropdown-toggle {
    color: var(--nav-text, #fff);
    margin: 0 var(--split-link-gap, 15px);
    font-size: var(--split-text-size, 0.9rem);
    letter-spacing: var(--split-letter-spacing, 0);
}
.nav-fixed[data-nav-style="split"] .btn-outline,
.nav-fixed[data-nav-style="split"] .nav-cta {
    background: var(--color-primary);
    color: var(--btn-text, #000);
    border-color: var(--color-primary);
    font-weight: 700;
}
.nav-fixed[data-nav-style="split"] .btn-outline:hover,
.nav-fixed[data-nav-style="split"] .nav-cta:hover {
    opacity: 0.85;
}

/* --- NAV HAMBURGER (hidden by default, shown by off-canvas/minimal) --- */
.nav-hamburger {
    display: none;
}

/* Site Logo */
.site-logo {
    height: 30px;
    width: auto;
    display: block;
    object-fit: contain;
}
/* Placeholder logo — black SVG adaptive to nav text color */
.rt-site-logo-placeholder {
    filter: var(--logo-filter, brightness(0) invert(1));
}

.nav-links a {
    margin: 0 15px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    color: white;
    border-bottom: 1px solid transparent;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.btn-outline {
    padding: 10px 30px;
    border: var(--border-width) solid var(--color-primary);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    background: transparent;
    transition: 0.2s;
    cursor: pointer;
    border-radius: var(--radius-main);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: var(--btn-text, #000);
}

.btn-outline:active {
    transform: scale(0.95);
}

/* DESKTOP NAV DROPDOWN */
/* --- NAV OVERFLOW DROPDOWN --- */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

/* Toggle styled identically to .nav-links a */
.nav-dropdown-toggle {
    background: none;
    border: none;
    padding: 0;
    margin: 0 15px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    color: inherit;
    border-bottom: 1px solid transparent;
    transition: 0.3s;
    cursor: pointer;
    white-space: nowrap;
}

.nav-dropdown-toggle:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.nav-dropdown-toggle i {
    margin-left: 5px;
    font-size: 0.6rem;
    transition: transform 0.3s;
}

.nav-dropdown.open .nav-dropdown-toggle i {
    transform: rotate(180deg);
}

/* Dropdown panel — inherits nav bg/text colors */
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--nav-bg, transparent);
    border: 1px solid var(--nav-text, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    min-width: 180px;
    padding: 6px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    margin: 0;
    color: var(--nav-text, #fff);
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: 0.2s;
    border-bottom: none;
}

.nav-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-primary);
}

/* --- MOBILE MORE PANEL --- */
.mobile-more-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-more-overlay[data-rt-active] {
    opacity: 1;
    visibility: visible;
}

.mobile-more-panel {
    position: fixed;
    bottom: var(--bottom-nav-height);
    left: 0;
    width: 100%;
    background: rgba(15, 15, 18, 0.98);
    border-top: 1px solid var(--color-primary);
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    max-height: 60vh;
    overflow-y: auto;
}

.mobile-more-overlay[data-rt-active] .mobile-more-panel {
    transform: translateY(0);
}

.mobile-more-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.close-more-btn {
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.close-more-btn:active {
    transform: scale(0.9);
}

.mobile-more-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.more-link-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: 0.2s;
}

.more-link-item:hover,
.more-link-item:active {
    background: var(--color-primary);
    color: #000;
}

.more-link-item i {
    font-size: 1.2rem;
    width: 30px;
    text-align: center;
}

.more-link-item span {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- GALLERY MODAL PANEL --- */
.slide-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.slide-panel-overlay[data-rt-active] {
    opacity: 1;
    pointer-events: auto;
}

.slide-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 95vw;
    max-width: 100%;
    height: 100%;
    background: rgba(10, 10, 14, 0.95);
    border-left: 1px solid var(--color-primary);
    z-index: 2001;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 40px;
}

.slide-panel-overlay[data-rt-active] .slide-panel {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.panel-header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.panel-caption-text {
    font-size: 1rem;
    letter-spacing: 1px;
}

.panel-title {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-size: 1.2rem;
}

.close-panel-btn {
    background: transparent;
    border: 1px solid var(--color-secondary);
    color: var(--color-secondary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.close-panel-btn:active {
    transform: scale(0.9);
}

.panel-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.panel-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.1);
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}

.panel-image:active {
    cursor: grabbing;
}

.gallery-controls-wrapper {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.gallery-controls {
    display: flex;
    gap: 10px;
}

.key-btn {
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.1s;
    box-shadow: 0 4px 0 rgba(255, 255, 255, 0.1);
}

.key-btn:active,
.key-btn.pressed {
    transform: translateY(4px);
    box-shadow: none;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.key-btn i {
    font-size: 1.2rem;
}

.gallery-hint {
    font-family: var(--font-body);
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    opacity: 0.7;
    text-transform: uppercase;
}

/* --- SMART BLOCK --- */
.smart-cell .sw { max-width: 100% !important; width: 100%; }
.smart-cell .sw iframe { max-width: 100%; }
.smart-block[data-max-width="1200px"] > .smart-block-container { max-width: 1200px; }
.smart-block[data-max-width="1400px"] > .smart-block-container { max-width: 1400px; }
.smart-block[data-max-width="100%"] > .smart-block-container { max-width: 100%; }
.smart-block[data-container-padding="0"] > .smart-block-container { padding-left: 0; padding-right: 0; }
.smart-block[data-container-padding="16px"] > .smart-block-container { padding-left: 16px; padding-right: 16px; }
.smart-block[data-container-padding="24px"] > .smart-block-container { padding-left: 24px; padding-right: 24px; }
.smart-block[data-container-padding="48px"] > .smart-block-container { padding-left: 48px; padding-right: 48px; }

/* --- BASE APP CONTAINER --- */
.mobile-bottom-nav,
.overflow-drawer-overlay,
.scroll-progress-bar-mobile {
    display: none;
}

.app-view-container {
    width: 100%;
    display: block;
}

/* Hide tablet sidebar by default (Desktop and Mobile) */
.tablet-sidebar {
    display: none;
}

/* =========================================
   [TABLET MODE] 769px - 1024px
   Interactive Rail Sidebar + Scrolling Content
   ========================================= */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        display: flex;
        flex-direction: row;
        overflow: hidden;
        height: 100dvh;
    }

    .nav-fixed {
        display: none;
    }

    .hero-logo-inline {
        display: block;
    }

    .mobile-bottom-nav {
        display: none !important;
    }

    /* === TABLET SIDEBAR RAIL === */
    .tablet-sidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        left: 0;
        top: 0;
        width: var(--tab-sidebar-rail-w);
        height: 100dvh;
        background: var(--tablet-sidebar-bg);
        backdrop-filter: blur(var(--tablet-sidebar-blur));
        -webkit-backdrop-filter: blur(var(--tablet-sidebar-blur));
        border-right: 1px solid var(--tablet-sidebar-border);
        z-index: 900;
        padding: 20px 0;
        overflow: hidden;
    }

    /* Expanded State via data-attribute */
    body[data-rt-sidebar="open"] .tablet-sidebar {
        width: var(--tab-sidebar-expanded-w);
    }

    /* Glass Surface Mode */
    body[data-surface="glass"] .tablet-sidebar {
        background: rgba(10, 10, 14, 0.7);
    }

    /* Minimal Surface Mode */
    body[data-surface="minimal"] .tablet-sidebar {
        background: var(--bg-body);
        backdrop-filter: none;
        border-right: 1px solid var(--color-primary);
    }

    /* === SIDEBAR TOGGLE (Hamburger) === */
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 50px;
        cursor: pointer;
        color: var(--color-primary);
        font-size: 1.4rem;
        margin-bottom: 20px;
        transition: background 0.2s ease;
    }

    .sidebar-toggle:hover {
        background: rgba(0, 243, 255, 0.1);
    }

    /* Toggle Icon Animation */
    .sidebar-toggle i {
        transition: transform 0.3s ease;
    }

    body[data-rt-sidebar="open"] .sidebar-toggle i {
        transform: rotate(90deg);
    }

    /* === SIDEBAR LOGO (Rail Mode: Hidden) === */
    .tablet-sidebar-logo {
        display: none;
        padding: 0 20px 20px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 15px;
        white-space: nowrap;
        overflow: hidden;
    }

    body[data-rt-sidebar="open"] .tablet-sidebar-logo {
        display: block;
    }

    /* === SIDEBAR NAV === */
    .tablet-sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 5px;
        flex-grow: 1;
        padding: 0 10px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .tablet-nav-item {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: var(--tablet-item-padding);
        color: var(--text-muted);
        font-family: var(--font-heading);
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        cursor: pointer;
        border-radius: var(--radius-main);
        transition: all 0.2s ease;
        white-space: nowrap;
        overflow: hidden;
    }

    /* Expanded: Left-align items */
    body[data-rt-sidebar="open"] .tablet-nav-item {
        justify-content: flex-start;
        padding: 15px 20px;
    }

    .tablet-nav-item:hover {
        background: rgba(0, 243, 255, 0.05);
        color: var(--color-primary);
    }

    .tablet-nav-item[data-rt-active] {
        background: rgba(0, 243, 255, 0.1);
        color: var(--color-primary);
    }

    body[data-rt-sidebar="open"] .tablet-nav-item[data-rt-active] {
        border-left: 3px solid var(--color-primary);
    }

    .tablet-nav-item i {
        font-size: var(--tablet-icon-size);
        min-width: 28px;
        text-align: center;
        flex-shrink: 0;
    }

    /* Rail Mode: Hide labels */
    .tablet-nav-item span {
        display: none;
    }

    body[data-rt-sidebar="open"] .tablet-nav-item span {
        display: inline;
    }

    /* === CONTENT REFLOW === */
    .app-view-container {
        margin-left: var(--tab-sidebar-rail-w);
        width: calc(100% - var(--tab-sidebar-rail-w));
        height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        transition: margin-left 0.4s cubic-bezier(0.22, 1, 0.36, 1),
            width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    }

    body[data-rt-sidebar="open"] .app-view-container {
        margin-left: var(--tab-sidebar-expanded-w);
        width: calc(100% - var(--tab-sidebar-expanded-w));
    }

    .app-view-container>section {
        position: relative !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* === SCROLL INDICATOR FIX === */
    #ui-progress-bar {
        left: var(--tab-sidebar-rail-w) !important;
        transition: left 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    }

    body[data-rt-sidebar="open"] #ui-progress-bar {
        left: var(--tab-sidebar-expanded-w) !important;
    }
}

/* =========================================
   [MOBILE MODE] max-width: 768px
   Bottom Nav + Swipe Transitions
   ========================================= */
@media(max-width: 768px) {
    body {
        height: 100dvh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    ::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
    }

    * {
        -ms-overflow-style: none !important;
        scrollbar-width: none !important;
    }

    .nav-fixed {
        display: none;
    }

    ::-webkit-scrollbar-thumb {
        background: var(--color-primary, #00F3FF);
        border-radius: 0px;
        transition: background 0.3s ease;
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: var(--bottom-nav-height);
        background: rgba(10, 10, 12, 0.98);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 9999;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #666;
        font-size: 0.7rem;
        width: 33%;
        transition: transform 0.1s;
    }

    .nav-item:active {
        transform: scale(0.9);
    }

    .nav-item[data-rt-active] {
        color: var(--color-primary);
        text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    }

    .nav-item i {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }

    .app-view-container {
        height: 100%;
        width: 100%;
        position: relative;
        overflow: hidden;
        background: #000;
    }

    .app-view-container>section {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        box-sizing: border-box !important;
        padding: 60px 25px 120px 25px !important;
        background: var(--bg-body);
        border: none;
        margin: 0;
        transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease, filter 0.5s ease;
        will-change: transform;
    }

    /* DEAD: .view-active / .view-past / .view-future were removed from engine.js
       (V5.0 tombstone comment at engine.js:6). Mobile card system uses
       .rt-card-active / .rt-card-behind via GSAP inline styles instead. */

    .slide-panel {
        width: 100%;
        border-left: none;
        padding: 20px;
    }

    .gallery-controls-wrapper {
        bottom: 60px;
    }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE LAYOUT SYSTEM (data-attribute driven)
   Replaces lazy single-column collapse with app-like layouts.
   Horizontal swipe = section navigation (untouched).
   Vertical scroll-snap = carousel item navigation.
   ══════════════════════════════════════════════════════════════ */

/* --- Mobile (max-width: 768px) --- */
/* Templates use semantic grid classes (.services-grid, .hero-grid, etc.)
   so we match [class$="-grid"] alongside .section-grid as fallback. */
@media (max-width: 768px) {

    /* Single column — centered content stack */
    [data-mobile-layout="single"] :is([class$="-grid"], .section-grid) {
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
        gap: 16px;
    }

    /* 2-column grid — compact cards side by side */
    [data-mobile-layout="grid-2"] :is([class$="-grid"], .section-grid) {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    /* Ensure grid-2 children don't overflow */
    [data-mobile-layout="grid-2"] :is([class$="-grid"], .section-grid) > * {
        min-width: 0;
        overflow: hidden;
    }

    /* Vertical carousel — scroll-snap items */
    [data-mobile-layout="carousel"] :is([class$="-grid"], .section-grid) {
        display: flex !important;
        flex-direction: column !important;
        scroll-snap-type: y mandatory;
        overflow-y: auto;
        max-height: 70vh;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        position: relative;
    }

    [data-mobile-layout="carousel"] :is([class$="-grid"], .section-grid)::-webkit-scrollbar {
        display: none;
    }

    [data-mobile-layout="carousel"] :is([class$="-grid"], .section-grid) > * {
        scroll-snap-align: start;
        flex-shrink: 0;
        width: 100%;
    }
}

/* --- Tablet (769px – 1023px) --- */
@media (min-width: 769px) and (max-width: 1023px) {

    /* Single column */
    [data-tablet-layout="single"] :is([class$="-grid"], .section-grid) {
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
        gap: 20px;
    }

    /* 2-column grid */
    [data-tablet-layout="grid-2"] :is([class$="-grid"], .section-grid) {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 16px !important;
    }

    /* 3-column grid */
    [data-tablet-layout="grid-3"] :is([class$="-grid"], .section-grid) {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px !important;
    }

    /* Tablet carousel */
    [data-tablet-layout="carousel"] :is([class$="-grid"], .section-grid) {
        display: flex !important;
        flex-direction: column !important;
        scroll-snap-type: y mandatory;
        overflow-y: auto;
        max-height: 75vh;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        position: relative;
    }

    [data-tablet-layout="carousel"] :is([class$="-grid"], .section-grid)::-webkit-scrollbar {
        display: none;
    }

    [data-tablet-layout="carousel"] :is([class$="-grid"], .section-grid) > * {
        scroll-snap-align: start;
        flex-shrink: 0;
        width: 100%;
    }

    /* Tablet grid children overflow protection */
    [data-tablet-layout="grid-2"] :is([class$="-grid"], .section-grid) > *,
    [data-tablet-layout="grid-3"] :is([class$="-grid"], .section-grid) > * {
        min-width: 0;
        overflow: hidden;
    }
}

/* --- Carousel indicators (all breakpoints, injected by engine.js) --- */
.carousel-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
    pointer-events: none;
}

.carousel-indicator .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(var(--color-primary-rgb, 255, 255, 255), 0.3);
    transition: background 0.3s, transform 0.3s;
}

.carousel-indicator .dot[data-rt-active] {
    background: rgba(var(--color-primary-rgb, 255, 255, 255), 0.9);
    transform: scale(1.4);
}

/* Swipe-up hint arrow (fades after first interaction) */
.carousel-hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-primary, #fff);
    opacity: 0.6;
    font-size: 14px;
    animation: carousel-hint-bounce 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.3s;
}

@keyframes carousel-hint-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

/* =========================================
   SLIDE PANELS
   ========================================= */

/* Panel base — shared properties for all animations.
 * position: absolute (not fixed) — panels live inside .rnd-bleed at render time
 * so they span the full elastic canvas area (including bleed), scaled alongside
 * the hero by .rnd-scaler. The SiteRendererService hoists the panels inject slot
 * out of .rnd-safe and into .rnd-bleed as a sibling. */
/* ── Panel Motion — easing presets (Phase 1) ──────────────────────────────
   Named easing tokens consumed by the transition rule below.
   Controlled via html[data-panel-easing] (global) or
   data-ar-panel-easing (per-panel). Default: standard (Material).        */
:root {
    --panel-easing-fast:     cubic-bezier(0.2, 0, 0, 1);
    --panel-easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --panel-easing-smooth:   cubic-bezier(0.25, 0, 0, 1);
    --panel-easing-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ar-slide-panel, [data-ar-slide-panel] {
    position: absolute;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* re-enable hit-testing — the [data-ar-panel-device] wrapper is pe:none so it
       doesn't block the base page; an open panel must still receive its own events. */
    pointer-events: auto;
    z-index: 1000;
    background: color-mix(in srgb, var(--panel-surface-bg, transparent) calc(var(--panel-surface-opacity, 1) * 100%), transparent);
    backdrop-filter: blur(var(--panel-surface-blur, 0px));
    -webkit-backdrop-filter: blur(var(--panel-surface-blur, 0px));
    transition: transform var(--panel-duration, 0.35s) var(--panel-easing, var(--panel-easing-standard)),
                opacity var(--panel-duration, 0.35s) var(--panel-easing, var(--panel-easing-standard)),
                filter var(--panel-duration, 0.35s) var(--panel-easing, var(--panel-easing-standard));
}

/* --- Slide Right (default) --- */
.ar-slide-panel[data-ar-panel-animation="slide-right"],
.ar-slide-panel:not([data-ar-panel-animation]) {
    top: var(--panel-inset, 0px); right: var(--panel-inset, 0px); bottom: var(--panel-inset, 0px);
    width: var(--panel-width, 70%);
    transform: translateX(100%);
}
.ar-slide-panel[data-ar-panel-animation="slide-right"].rt-panel-open,
.ar-slide-panel:not([data-ar-panel-animation]).rt-panel-open {
    transform: translateX(0);
}

/* --- Slide Left --- */
.ar-slide-panel[data-ar-panel-animation="slide-left"] {
    top: var(--panel-inset, 0px); left: var(--panel-inset, 0px); bottom: var(--panel-inset, 0px);
    width: var(--panel-width, 70%);
    transform: translateX(-100%);
}
.ar-slide-panel[data-ar-panel-animation="slide-left"].rt-panel-open {
    transform: translateX(0);
}

/* --- Slide Bottom — fullscreen modal. Swipe-down close is disabled in
   engine.js (initSwipeClose) so overflowing content can scroll freely; the
   auto-injected .ar-panel-close X button is the only way out. --- */
.ar-slide-panel[data-ar-panel-animation="slide-bottom"] {
    top: var(--panel-inset, 0px);
    bottom: var(--panel-inset, 0px);
    left: 0; right: 0;
    width: 100%;
    transform: translateY(100%);
}
.ar-slide-panel[data-ar-panel-animation="slide-bottom"].rt-panel-open {
    transform: translateY(0);
}

/* --- Slide Top --- */
.ar-slide-panel[data-ar-panel-animation="slide-top"] {
    top: var(--panel-inset, 0px); left: 0; right: 0;
    width: 100%; max-height: 80vh;
    transform: translateY(-100%);
}
.ar-slide-panel[data-ar-panel-animation="slide-top"].rt-panel-open {
    transform: translateY(0);
}

/* --- Bottom Sheet ---
   Slides in from the bottom at a configurable height. Reuses --panel-duration
   and --panel-easing from Panel Motion — no new motion tokens needed.
   Width is always 100% (widthFixedByAnimation in editor).
   Panel Mobile Gestures Phase 1: bottom-sheet swipe-to-close is implemented —
   downward swipe (dy > threshold, or velocity flick) triggers closePanel().
   Cancelled swipes snap back via the transition below.
   ---------------------------------------- */
.ar-slide-panel[data-ar-panel-animation="bottom-sheet"] {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--panel-sheet-height, 60vh);
    max-height: 85vh;
    border-radius: var(--panel-radius, 16px) var(--panel-radius, 16px) 0 0;
    transform: translateY(100%);
    transition: transform var(--panel-duration, 0.35s) var(--panel-easing, var(--panel-easing-standard)),
                opacity var(--panel-duration, 0.35s) var(--panel-easing, var(--panel-easing-standard)),
                filter var(--panel-duration, 0.35s) var(--panel-easing, var(--panel-easing-standard));
}
.ar-slide-panel[data-ar-panel-animation="bottom-sheet"].rt-panel-open {
    transform: translateY(0);
}

/* --- Centered variants shared base --- */
.ar-slide-panel[data-ar-panel-animation="fade"],
.ar-slide-panel[data-ar-panel-animation="scale"],
.ar-slide-panel[data-ar-panel-animation="blur"] {
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: var(--panel-width, 70%); max-height: 85vh;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
}

/* --- Fade --- */
.ar-slide-panel[data-ar-panel-animation="fade"].rt-panel-open {
    opacity: 1;
    pointer-events: auto;
}

/* --- Scale --- */
.ar-slide-panel[data-ar-panel-animation="scale"] {
    transform: translate(-50%, -50%) scale(0.95);
}
.ar-slide-panel[data-ar-panel-animation="scale"].rt-panel-open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* --- Blur --- */
.ar-slide-panel[data-ar-panel-animation="blur"] {
    filter: blur(12px);
}
.ar-slide-panel[data-ar-panel-animation="blur"].rt-panel-open {
    opacity: 1;
    filter: blur(0);
    pointer-events: auto;
}

/* Lock page scroll while a panel is open */
body.rt-panel-backdrop-active {
    overflow: hidden;
}

/* Backdrop — removed. Hero dimming is handled solely by .hero-scrim (user-controlled via Depth slider). */

/* Close button — auto-injected by engine.js */
.ar-panel-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1002;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    border-radius: 50%;
    color: inherit;
    line-height: 0;
    transition: background 0.2s;
    pointer-events: auto;
}

.ar-panel-close:hover {
    background: rgba(0, 0, 0, 0.45);
}

/* Mobile — full-width slide panels, 95% centered panels */
@media (max-width: 768px) {
    .ar-slide-panel[data-ar-panel-animation="slide-right"],
    .ar-slide-panel[data-ar-panel-animation="slide-left"],
    .ar-slide-panel:not([data-ar-panel-animation]) {
        width: 100%;
    }
    .ar-slide-panel[data-ar-panel-animation="fade"],
    .ar-slide-panel[data-ar-panel-animation="scale"],
    .ar-slide-panel[data-ar-panel-animation="blur"] {
        width: 95%;
    }
}

/* =========================================
   SLIDE PANEL SURFACE PACK — TEXTURE OVERLAYS
   Panel Surface Pack (cortex_plan:9tjojbuthzh6oa6ci28h)

   Texture is applied via a CSS ::after pseudo-element that sits above the
   background but below panel content (z-index: 0 on pseudo, z-index: 1 on content).
   The data-ar-panel-texture attribute is set by ModifyAttributes mutation.
   Opacity is controlled by --panel-texture-opacity CSS custom property set
   via SetStyle mutation directly on the panel element.
   ========================================= */

/* Ensure panel has position context for ::after pseudo */
.ar-slide-panel[data-ar-panel-texture] {
    position: relative;
}

/* All texture variants share base pseudo properties */
.ar-slide-panel[data-ar-panel-texture]::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: soft-light;
    opacity: var(--panel-texture-opacity, 0.15);
    z-index: 0;
    border-radius: inherit;
}

/* Ensure panel content sits above texture layer */
.ar-slide-panel[data-ar-panel-texture] > * {
    position: relative;
    z-index: 1;
}

/* =========================================
   GLOBAL TEXTURE — driven by html[data-panel-texture]
   These rules let Theme Studio's global texture setting apply to ALL panels
   without requiring a per-panel data-ar-panel-texture attribute.

   IMPORTANT cascade order: global rules come FIRST so the per-panel
   rules below (same specificity 0,1,2) win via source order when both
   match. Per-element data-ar-panel-texture attrs are preserved as overrides.
   ========================================= */

/* Base pseudo for global texture — panel needs position context */
html[data-panel-texture] .ar-slide-panel {
    position: relative;
}

html[data-panel-texture] .ar-slide-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: soft-light;
    opacity: var(--panel-texture-opacity, 0.15);
    z-index: 0;
    border-radius: inherit;
}

html[data-panel-texture] .ar-slide-panel > * {
    position: relative;
    z-index: 1;
}

/* --- Global Grain --- */
html[data-panel-texture="grain"] .ar-slide-panel::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* --- Global Paper --- */
html[data-panel-texture="paper"] .ar-slide-panel::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.35' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 300px 300px;
}

/* --- Global Concrete --- */
html[data-panel-texture="concrete"] .ar-slide-panel::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 150px 150px;
}

/* =========================================
   PER-PANEL TEXTURE OVERRIDES — placed AFTER global rules.
   Same specificity (0,1,2) so source order gives these the win,
   allowing individual panel data-ar-panel-texture attrs to beat
   the global html[data-panel-texture] setting.
   ========================================= */

/* --- Grain: turbulence noise --- */
/* SVG: <svg xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="turbulence" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(#n)"/></svg> */
.ar-slide-panel[data-ar-panel-texture="grain"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* --- Paper: fractal noise at low frequency --- */
/* SVG: <svg xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.35" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(#n)"/></svg> */
.ar-slide-panel[data-ar-panel-texture="paper"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.35' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 300px 300px;
}

/* --- Concrete: high-frequency fractal noise --- */
/* SVG: <svg xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="5" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(#n)"/></svg> */
.ar-slide-panel[data-ar-panel-texture="concrete"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 150px 150px;
}
/* =========================================
   PHASE 2 — HERO SCRIM + HERO BLUR
   .hero-scrim is injected by SiteRendererService as a sibling of .rnd-safe
   inside .rnd-bleed. It dims the hero when a panel is open.
   z-index 998 keeps it below panels (1000+).
   Opacity and blur are driven purely by CSS custom props written by engine.js
   on ar-panel-open/close — no body-class gate needed.
   ========================================= */
.hero-scrim {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: var(--hero-scrim-opacity, 0);
    pointer-events: none;
    z-index: 998;
    transition: opacity 0.35s;
}
.rnd-safe {
    filter: blur(var(--hero-blur-amount, 0));
    transition: filter 0.35s;
}

/* =========================================
   PHASE 3 — PANEL EDGE EFFECTS
   Glow, gradient border, top accent line.
   Numeric custom props are written as inline
   styles by PanelStyleEditor (SetStyle mutation).
   Selector matching uses data attrs set by
   ModifyAttributes mutation.
   ========================================= */

/* ──────────────────────────────────────────────────────────────────────────
   GLOBAL DEPTH EFFECTS — driven by :root custom props set by
   global-panel-style-store::applyAllToDoc().
   These apply to ALL panels unless per-panel overrides exist.
   ──────────────────────────────────────────────────────────────────────── */

/* Note: scrim + hero blur are driven by engine.js data-attrs on a per-panel-open
   basis. Global scrimOpacity/heroBlur are stored for editor UX but the publish
   runtime uses per-panel data-ar-scrim-opacity / data-ar-hero-blur. */

/* ──────────────────────────────────────────────────────────────────────────
   GLOBAL EDGE EFFECTS — driven by html data-attrs + :root custom props
   set by global-panel-style-store::applyAllToDoc().
   Only applies to panels that do NOT already have a per-panel data-attr override.
   ──────────────────────────────────────────────────────────────────────── */

/* Global glow — static */
html[data-panel-glow-mode="static"] .ar-slide-panel:not([data-ar-panel-glow]) {
    box-shadow: inset 0 0 var(--panel-glow-intensity-global, 20px) var(--panel-glow-color-global, var(--color-primary, #6366f1));
}

/* Global glow — breathing */
html[data-panel-glow-mode="breathing"] .ar-slide-panel:not([data-ar-panel-glow]) {
    animation: ar-panel-glow-breathe 2.4s ease-in-out infinite;
    --panel-glow-intensity: var(--panel-glow-intensity-global, 20px);
    --panel-glow-color: var(--panel-glow-color-global, var(--color-primary, #6366f1));
}

/* Global gradient border */
html[data-panel-border-gradient="on"] .ar-slide-panel:not([data-ar-panel-border-gradient])::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: var(--panel-border-thickness-global, 2px);
    background: linear-gradient(
        180deg,
        var(--panel-border-from-global, var(--color-primary, #6366f1)),
        var(--panel-border-to-global, var(--color-primary, #6366f1))
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

/* Global accent line */
html[data-panel-accent-line="on"] .ar-slide-panel:not([data-ar-panel-accent-line]) {
    border-top: var(--panel-accent-thickness-global, 2px) solid var(--panel-accent-color-global, var(--color-primary, #6366f1));
}

/* Global scanlines — panels without per-panel texture OR per-panel scanlines attr */
html[data-panel-scanlines="on"] .ar-slide-panel:not([data-ar-panel-scanlines]):not([data-ar-panel-texture])::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.25) 0px,
        rgba(0, 0, 0, 0.25) 1px,
        transparent 1px,
        transparent 3px
    );
    opacity: var(--panel-scanlines-opacity-global, 0.15);
    mix-blend-mode: overlay;
    border-radius: inherit;
    z-index: 2;
}

/* ── Glow ─────────────────────────────────────────────────────────────── */

/* Glow uses inset box-shadow so it renders inside the panel boundary.
   .rnd-bleed has overflow:hidden which would clip an outward box-shadow. */
.ar-slide-panel[data-ar-panel-glow="static"] {
    box-shadow: inset 0 0 var(--panel-glow-intensity, 20px) var(--panel-glow-color, var(--color-primary, #6366f1));
}

.ar-slide-panel[data-ar-panel-glow="breathing"] {
    animation: ar-panel-glow-breathe 2.4s ease-in-out infinite;
}

@keyframes ar-panel-glow-breathe {
    0%, 100% {
        box-shadow: inset 0 0 calc(var(--panel-glow-intensity, 20px) * 0.4) var(--panel-glow-color, var(--color-primary, #6366f1));
    }
    50% {
        box-shadow: inset 0 0 var(--panel-glow-intensity, 20px) var(--panel-glow-color, var(--color-primary, #6366f1));
    }
}

/* ── Gradient border ──────────────────────────────────────────────────── */
/* Uses ::before pseudo so existing border-radius is preserved.           */
/* mask-composite trick: only the border ring is painted.                 */

/* position: absolute is already set on .ar-slide-panel base rule; no override needed */

.ar-slide-panel[data-ar-panel-border-gradient="on"]::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: var(--panel-border-thickness, 2px);
    background: linear-gradient(
        180deg,
        var(--panel-border-from, var(--color-primary, #6366f1)),
        var(--panel-border-to, var(--color-primary, #6366f1))
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

/* ── Top accent line ─────────────────────────────────────────────────── */
/* Applied directly as border-top so it doesn't compete with ::before.   */

.ar-slide-panel[data-ar-panel-accent-line="on"] {
    border-top: var(--panel-accent-thickness, 2px) solid var(--panel-accent-color, var(--color-primary, #6366f1));
}

/* ── CRT Scanlines ───────────────────────────────────────────────────── */
/* Uses ::after (z-index 2, above ::before gradient-border ring at z 1). */
/* position: absolute is already set on .ar-slide-panel base rule.       */
/*                                                                        */
/* COLLISION NOTE: the texture system also uses ::after on .ar-slide-panel.
   When both data-ar-panel-texture and data-ar-panel-scanlines="on" are set,
   the rule appearing LATER in source wins the pseudo-element. The combined
   selectors below (specificity 0,3,0 — three attribute selectors) beat both
   the plain texture rule (0,2,0) and the plain scanlines rule (0,2,0),
   stacking scanlines as a second background-image layer above the texture.
   The global html[data-panel-texture] variant is handled by the last two
   combined rules (specificity 0,2,1 — one type + two attributes, still
   beats global-only 0,1,2 which is one type + one attr + one class).     */

/* Panel has scanlines only (no texture attr) */
.ar-slide-panel[data-ar-panel-scanlines="on"]:not([data-ar-panel-texture])::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.25) 0px,
        rgba(0, 0, 0, 0.25) 1px,
        transparent 1px,
        transparent 3px
    );
    opacity: var(--panel-scanlines-opacity, 0.15);
    mix-blend-mode: overlay;
    border-radius: inherit;
    z-index: 2;
}

/* ── Scanlines + Texture combined — per-panel attr overrides ── */
/* Grain + scanlines */
.ar-slide-panel[data-ar-panel-texture="grain"][data-ar-panel-scanlines="on"]::after {
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.25) 0px,
            rgba(0, 0, 0, 0.25) 1px,
            transparent 1px,
            transparent 3px
        ),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: auto, 200px 200px;
    opacity: var(--panel-scanlines-opacity, 0.15);
    mix-blend-mode: overlay;
    z-index: 2;
}

/* Paper + scanlines */
.ar-slide-panel[data-ar-panel-texture="paper"][data-ar-panel-scanlines="on"]::after {
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.25) 0px,
            rgba(0, 0, 0, 0.25) 1px,
            transparent 1px,
            transparent 3px
        ),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.35' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: auto, 300px 300px;
    opacity: var(--panel-scanlines-opacity, 0.15);
    mix-blend-mode: overlay;
    z-index: 2;
}

/* Concrete + scanlines */
.ar-slide-panel[data-ar-panel-texture="concrete"][data-ar-panel-scanlines="on"]::after {
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.25) 0px,
            rgba(0, 0, 0, 0.25) 1px,
            transparent 1px,
            transparent 3px
        ),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: auto, 150px 150px;
    opacity: var(--panel-scanlines-opacity, 0.15);
    mix-blend-mode: overlay;
    z-index: 2;
}

/* ── Scanlines + Global texture (html[data-panel-texture]) ── */
/* When the global texture is set via html attr but no per-panel attr,
   the panel won't match [data-ar-panel-texture] so the :not() scanlines
   rule above handles it correctly (plain scanlines wins). If a per-panel
   attr is set on the panel, the combined rules above take precedence.    */
/* ── Per-device section-background layers — visibility convention ── */
/* Any injected layer with class prefix .creatorctrl-section-bg-img-pd that carries
   an .is-desktop / .is-tablet / .is-mobile modifier picks up device visibility
   from this single block. Add a new per-device layer class? It Just Works.

   Editor iframe does NOT use this — it reactively mounts only the active
   device's DOM via engine.js. This block only governs the static per-device
   DOM emitted by SiteRendererService::insertPerDeviceImageLayersIntoSection. */
[class*="creatorctrl-section-bg-img-pd"].is-tablet,
[class*="creatorctrl-section-bg-img-pd"].is-mobile { display: none; }
html[data-device="tablet"] [class*="creatorctrl-section-bg-img-pd"].is-desktop { display: none; }
html[data-device="tablet"] [class*="creatorctrl-section-bg-img-pd"].is-tablet { display: block; }
html[data-device="mobile"] [class*="creatorctrl-section-bg-img-pd"].is-desktop { display: none; }
html[data-device="mobile"] [class*="creatorctrl-section-bg-img-pd"].is-mobile { display: block; }

/* ══════════════════════════════════════════════════════════════════════════
   PANEL MOTION — EASING PRESETS (Phase 1)
   Paired selector pattern: global cascade first, per-panel override after.
   Global: html[data-panel-easing="X"] sets --panel-easing on all panels
           that have no per-panel override.
   Per-panel: data-ar-panel-easing="X" sets --panel-easing on that element only.
   ══════════════════════════════════════════════════════════════════════════ */

/* — Fast — */
html[data-panel-easing="fast"] .ar-slide-panel:not([data-ar-panel-easing]) {
    --panel-easing: var(--panel-easing-fast);
}
.ar-slide-panel[data-ar-panel-easing="fast"] {
    --panel-easing: var(--panel-easing-fast);
}

/* — Standard — */
html[data-panel-easing="standard"] .ar-slide-panel:not([data-ar-panel-easing]) {
    --panel-easing: var(--panel-easing-standard);
}
.ar-slide-panel[data-ar-panel-easing="standard"] {
    --panel-easing: var(--panel-easing-standard);
}

/* — Smooth — */
html[data-panel-easing="smooth"] .ar-slide-panel:not([data-ar-panel-easing]) {
    --panel-easing: var(--panel-easing-smooth);
}
.ar-slide-panel[data-ar-panel-easing="smooth"] {
    --panel-easing: var(--panel-easing-smooth);
}

/* — Spring — */
html[data-panel-easing="spring"] .ar-slide-panel:not([data-ar-panel-easing]) {
    --panel-easing: var(--panel-easing-spring);
}
.ar-slide-panel[data-ar-panel-easing="spring"] {
    --panel-easing: var(--panel-easing-spring);
}

/* ══════════════════════════════════════════════════════════════════════════
   PANEL MOTION — DURATION (Phase 1)
   Global: html[data-panel-duration] cascades --panel-duration-global to panels
           without a per-panel override, via the --panel-duration consumer prop.
   Per-panel: data-ar-panel-duration stores the ms value; CSS reads via
              --panel-duration set inline by the editor (SetStyle mutation).
   ══════════════════════════════════════════════════════════════════════════ */

/* Global duration cascade — panels without a per-panel duration attr inherit global */
html[data-panel-duration] .ar-slide-panel:not([data-ar-panel-duration]) {
    --panel-duration: var(--panel-duration-global, 0.35s);
}

/* Per-panel duration — --panel-duration is written inline as e.g. "0.5s"
   via SetStyle mutation; the transition rule above consumes it directly. */
.ar-slide-panel[data-ar-panel-duration] {
    /* --panel-duration is set as an inline custom property by the editor */
}

/* ──────────────────────────────────────────────────────────────────────────────
   PANEL MOTION — EXIT BLUR (Phase 2)
   Applies filter:blur() to a panel while it exits (has .rt-panel-closing class).
   .rt-panel-closing is added by closePanel() in engine.js and removed after
   transitionend by a one-shot listener — blur does NOT persist after exit.

   Global: html[data-panel-motion-blur="on"] cascades blur to all panels that
           do NOT have a per-panel data-ar-panel-motion-blur attr.
   Per-panel: data-ar-panel-motion-blur="on" applies blur to that element only.

   Intensity tokens:
     --panel-motion-blur-global  written by setMotionBlurIntensity (global)
     --panel-motion-blur         written inline by SetStyle mutation (per-panel)
   ────────────────────────────────────────────────────────────────────────────── */

/* Global — panels without a per-panel override inherit global blur on exit */
html[data-panel-motion-blur="on"] .ar-slide-panel:not([data-ar-panel-motion-blur]).rt-panel-closing {
    filter: blur(var(--panel-motion-blur, var(--panel-motion-blur-global, 6px)));
    transition: filter var(--panel-duration, 0.35s);
}

/* Per-panel — explicit per-panel enable */
.ar-slide-panel[data-ar-panel-motion-blur="on"].rt-panel-closing {
    filter: blur(var(--panel-motion-blur, 6px));
    transition: filter var(--panel-duration, 0.35s);
}

/* ──────────────────────────────────────────────────────────────────────────────
   PANEL MOTION — CONTENT STAGGER (Phase 3)
   On panel open, direct children fade/slide in sequentially.
   engine.js assigns --ar-stagger-index inline per child on ar-panel-open;
   clears them on ar-panel-close so re-open always starts from index 0.

   Global: html[data-panel-stagger="on"] cascades stagger to all panels that
           do NOT have a per-panel data-ar-panel-stagger attr.
   Per-panel: data-ar-panel-stagger="on" applies stagger to that element only.

   Delay tokens:
     --panel-stagger-delay-global  written by setStaggerDelay (global)
     --panel-stagger-delay         written inline by SetStyle mutation (per-panel)
     --ar-stagger-index            written by engine.js per child on ar-panel-open
   ────────────────────────────────────────────────────────────────────────────── */

@keyframes ar-panel-stagger-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

/* Global — panels without a per-panel override inherit global stagger on open */
/* Exclude .creatorctrl-section-bg (animated canvas container) — it must not fade in
   with the stagger keyframe; it is always visible and positioned behind content. */
html[data-panel-stagger="on"] .ar-slide-panel:not([data-ar-panel-stagger]).rt-panel-open > *:not(.creatorctrl-section-bg) {
    animation: ar-panel-stagger-in 0.4s ease both;
    animation-delay: calc(var(--ar-stagger-index, 0) * var(--panel-stagger-delay, var(--panel-stagger-delay-global, 60ms)));
}

/* Per-panel — explicit per-panel enable */
/* Exclude .creatorctrl-section-bg for same reason as global rule above. */
.ar-slide-panel[data-ar-panel-stagger="on"].rt-panel-open > *:not(.creatorctrl-section-bg) {
    animation: ar-panel-stagger-in 0.4s ease both;
    animation-delay: calc(var(--ar-stagger-index, 0) * var(--panel-stagger-delay, 60ms));
}

/* ══════════════════════════════════════════════════════════════════════════
   PANEL MOTION — REDUCED MOTION ACCESSIBILITY (Phase 4)
   Respects the user's OS "Reduce motion" setting.
   - Disables the stagger keyframe animation (instant appearance, no slide-in)
   - Disables exit motion blur (filter: none)
   - Forces standard easing on all panel transitions (no spring overshoot)
   The :root overrides keep --panel-easing-spring etc. readable for JS but
   force the live --panel-easing fallback to the standard curve.
   ══════════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════════════
   PANEL SHAPE — WIDTH (Phase 1)
   Global cascade: html[data-panel-width] stamps --panel-width-global onto
   all panels that don't have a per-panel override. Excludes slide-top /
   slide-bottom / bottom-sheet (those are full-width by design).
   Per-panel override: data-ar-panel-width + inline --panel-width custom prop.
   ══════════════════════════════════════════════════════════════════════════ */

/* Global width cascade — apply to side + centered panels without per-panel override */
html[data-panel-width] .ar-slide-panel:not([data-ar-panel-width]):not([data-ar-panel-animation="slide-top"]):not([data-ar-panel-animation="slide-bottom"]):not([data-ar-panel-animation="bottom-sheet"]) {
    --panel-width: var(--panel-width-global, 70%);
}

/* Per-panel width override — --panel-width is written as an inline custom prop by the editor (SetStyle mutation) */
.ar-slide-panel[data-ar-panel-width] {
    /* --panel-width resolved from element inline style via SetStyle mutation */
}

/* ══════════════════════════════════════════════════════════════════════════
   PANEL SHAPE — INSET (Phase 1)
   Global cascade: html[data-panel-inset] stamps --panel-inset-global onto
   all panels that don't have a per-panel override.
   Per-panel override: data-ar-panel-inset + inline --panel-inset custom prop.
   ══════════════════════════════════════════════════════════════════════════ */

/* Global inset cascade */
html[data-panel-inset] .ar-slide-panel:not([data-ar-panel-inset]) {
    --panel-inset: var(--panel-inset-global, 0px);
}

/* Per-panel inset override — --panel-inset is written as an inline custom prop by the editor (SetStyle mutation) */
.ar-slide-panel[data-ar-panel-inset] {
    /* --panel-inset resolved from element inline style via SetStyle mutation */
}

/* ══════════════════════════════════════════════════════════════════════════
   PANEL SHAPE — CORNER RADIUS (Phase 2)
   Edge-aware: radius applies only to the corners that face the visible interior
   of the viewport (the "exposed" edges) per animation variant.
   slide-right  → left+top-bottom corners (top-left + bottom-left)
   slide-left   → right+top-bottom corners (top-right + bottom-right)
   slide-top    → bottom corners (bottom-left + bottom-right)
   slide-bottom → top corners (top-left + top-right)
   centered/fade/scale/blur-in → all four corners
   ══════════════════════════════════════════════════════════════════════════ */

/* Global: slide-right */
html[data-panel-radius] .ar-slide-panel:not([data-ar-panel-radius])[data-ar-panel-animation="slide-right"] {
    border-radius: var(--panel-radius-global, 0) 0 0 var(--panel-radius-global, 0);
}
/* Per-panel: slide-right */
.ar-slide-panel[data-ar-panel-radius][data-ar-panel-animation="slide-right"] {
    border-radius: var(--panel-radius, 0) 0 0 var(--panel-radius, 0);
}

/* Global: slide-left */
html[data-panel-radius] .ar-slide-panel:not([data-ar-panel-radius])[data-ar-panel-animation="slide-left"] {
    border-radius: 0 var(--panel-radius-global, 0) var(--panel-radius-global, 0) 0;
}
/* Per-panel: slide-left */
.ar-slide-panel[data-ar-panel-radius][data-ar-panel-animation="slide-left"] {
    border-radius: 0 var(--panel-radius, 0) var(--panel-radius, 0) 0;
}

/* Global: slide-top */
html[data-panel-radius] .ar-slide-panel:not([data-ar-panel-radius])[data-ar-panel-animation="slide-top"] {
    border-radius: 0 0 var(--panel-radius-global, 0) var(--panel-radius-global, 0);
}
/* Per-panel: slide-top */
.ar-slide-panel[data-ar-panel-radius][data-ar-panel-animation="slide-top"] {
    border-radius: 0 0 var(--panel-radius, 0) var(--panel-radius, 0);
}

/* Global: slide-bottom */
html[data-panel-radius] .ar-slide-panel:not([data-ar-panel-radius])[data-ar-panel-animation="slide-bottom"] {
    border-radius: var(--panel-radius-global, 0) var(--panel-radius-global, 0) 0 0;
}
/* Per-panel: slide-bottom */
.ar-slide-panel[data-ar-panel-radius][data-ar-panel-animation="slide-bottom"] {
    border-radius: var(--panel-radius, 0) var(--panel-radius, 0) 0 0;
}

/* Global: bottom-sheet — top corners only (mirrors slide-bottom pattern) */
html[data-panel-radius] .ar-slide-panel:not([data-ar-panel-radius])[data-ar-panel-animation="bottom-sheet"] {
    border-radius: var(--panel-radius-global, 16px) var(--panel-radius-global, 16px) 0 0;
}
/* Per-panel: bottom-sheet */
.ar-slide-panel[data-ar-panel-radius][data-ar-panel-animation="bottom-sheet"] {
    border-radius: var(--panel-radius, 16px) var(--panel-radius, 16px) 0 0;
}

/* Global: centered / fade / scale / blur-in (all four corners) */
html[data-panel-radius] .ar-slide-panel:not([data-ar-panel-radius]):not([data-ar-panel-animation="slide-right"]):not([data-ar-panel-animation="slide-left"]):not([data-ar-panel-animation="slide-top"]):not([data-ar-panel-animation="slide-bottom"]):not([data-ar-panel-animation="bottom-sheet"]) {
    border-radius: var(--panel-radius-global, 0);
}
/* Per-panel: centered / fade / scale / blur-in */
.ar-slide-panel[data-ar-panel-radius]:not([data-ar-panel-animation="slide-right"]):not([data-ar-panel-animation="slide-left"]):not([data-ar-panel-animation="slide-top"]):not([data-ar-panel-animation="slide-bottom"]):not([data-ar-panel-animation="bottom-sheet"]) {
    border-radius: var(--panel-radius, 0);
}

/* ══════════════════════════════════════════════════════════════════════════
   PANEL ANIMATED BACKGROUNDS — Glass Surface Layering (Phase 5)
   When a panel hosts an animated background canvas (.creatorctrl-section-bg child),
   the panel's own "glass" effect (background tint + backdrop-filter blur) must
   float ABOVE the canvas but BELOW the panel content. This is achieved with a
   ::before pseudo-element that consumes --panel-glass-bg / --panel-glass-blur
   custom props written by PanelStyleEditor when the panel has an animated BG.

   IMPORTANT — only kicks in when data-creatorctrl-bg is present (published runtime).
   In the editor the store is the source of truth; data-creatorctrl-bg may also be
   present during active injection. Panels without animated BG retain existing
   background / backdrop-filter inline-style behaviour unaffected.

   DOM layering when BG active:
     z-index 0: .creatorctrl-section-bg (canvas, animates behind everything)
     z-index 1: ::before (glass tint + blur layer, between canvas and content)
     z-index 2: direct children (content, scrollable, above glass)
   ══════════════════════════════════════════════════════════════════════════ */

/* Glass layer — sits between the animated canvas and panel content */
.ar-slide-panel[data-creatorctrl-bg]::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--panel-glass-bg, transparent);
    backdrop-filter: blur(var(--panel-glass-blur, 0px));
    -webkit-backdrop-filter: blur(var(--panel-glass-blur, 0px));
    pointer-events: none;
    border-radius: inherit;
}

/* Animated canvas — position:absolute covering the panel box. */
.ar-slide-panel[data-creatorctrl-bg] > .creatorctrl-section-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    overflow: hidden;
}

/* ── Panel Mobile Gestures Phase 4: Touch Ripple ─────────────────────────────
   Site-level only — no per-panel variant (follow-up plan if ever needed).
   .ar-ripple spans are injected by engine.js spawnRipple() on pointerdown
   inside .ar-slide-panel bodies and [data-ar-open-panel] trigger elements.
   pointer-events: none ensures child interactive elements still receive input.
   --ripple-tint is set on :root by SiteRendererService (published) and by
   global-panel-style-store (editor preview).
   ─────────────────────────────────────────────────────────────────────────── */
.ar-ripple {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(var(--ripple-tint, rgba(255,255,255,0.4)) 0%, transparent 70%);
    animation: ar-ripple 0.6s ease-out forwards;
    transform: translate(-50%, -50%) scale(0);
    width: 120px;
    height: 120px;
}

@keyframes ar-ripple {
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Force standard easing — override all preset tokens used in transition */
    .ar-slide-panel {
        --panel-easing: var(--panel-easing-standard);
    }

    /* Cancel stagger animation for globally-enabled stagger */
    html[data-panel-stagger="on"] .ar-slide-panel:not([data-ar-panel-stagger]).rt-panel-open > *:not(.creatorctrl-section-bg),
    /* Cancel stagger animation for per-panel stagger */
    .ar-slide-panel[data-ar-panel-stagger="on"].rt-panel-open > *:not(.creatorctrl-section-bg) {
        animation: none;
    }

    /* Cancel exit motion blur for globally-enabled blur */
    html[data-panel-motion-blur="on"] .ar-slide-panel:not([data-ar-panel-motion-blur]).rt-panel-closing,
    /* Cancel exit motion blur for per-panel blur */
    .ar-slide-panel[data-ar-panel-motion-blur="on"].rt-panel-closing {
        filter: none;
    }

    /* Cancel touch ripple animation */
    .ar-ripple {
        animation: none;
    }
}


/* ========================================
 * Wallpaper lock mode — Section 5.4
 * Applied to <body> on published wallpapers when the lock toggle is on.
 * Blocks all canvas interaction, but keeps the controls overlay and any
 * embedded iframes (YouTube, Spotify, etc.) clickable so users can still
 * pause media or hit unlock.
 * ======================================== */
.wallpaper-locked {
  pointer-events: none;
}

.wallpaper-locked [data-wallpaper-controls],
.wallpaper-locked [data-wallpaper-controls] *,
.wallpaper-locked [data-iframe-embed],
.wallpaper-locked [data-iframe-embed] * {
  pointer-events: auto;
}


/* ========================================
 * Wallpaper canvas — Section 5 follow-up (2026-05-10)
 * Body holds a single .creatorctrl-wallpaper-canvas section sized to the chosen
 * aspect ratio. The hero rnd-position pipeline anchors elements inside it.
 * ======================================== */
body.creatorctrl-wallpaper-body {
  margin: 0;
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

body.creatorctrl-wallpaper-body main {
  display: contents;
}

.creatorctrl-wallpaper-canvas {
  outline: 1px solid rgba(255, 255, 255, 0.08);
}

/* ========================================
 * Creator card panels — transparent root
 * Every creator card archetype (mixed-hub, hero-embed, link-tile, action-card,
 * feed-grid, map, donation) renders inside an .ar-slide-panel which provides
 * its own glassmorphic background. Each panel template sets a
 * `background: var(--bg-surface)` on its root for standalone preview, but in
 * the actual product it should defer to the parent panel's surface so the
 * glass effect shows through. One rule overrides them all.
 * Inner elements (brand strips, embed frames, CTAs) keep their intentional
 * backgrounds — we only neutralize the panel root.
 * ======================================== */
[data-cc-archetype] {
  background: transparent !important;
}

/* ========================================
 * Mixed-hub header variants
 * Three presets the user picks from in the inspector. All share the same
 * underlying fields (avatar_url / name / title / subtitle / tag) so switching
 * presets never loses content. Renderer bakes the right markup from
 * project.settings.social_hub.header on every render.
 * ======================================== */
.cc-head .cc-avatar {
  display: block;
  margin: 0 auto;
  object-fit: cover;
  background: color-mix(in srgb, var(--text-main) 8%, transparent);
}

.cc-head-profile .cc-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
}

.cc-head-profile .cc-name {
  margin: .35rem 0 0;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.15;
}

.cc-head-hero .cc-avatar {
  width: 6rem;
  height: 6rem;
  border-radius: 1rem;
}

.cc-head-hero .cc-name-large {
  margin: .5rem 0 0;
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
}
