:root {
    --bg: #e6e8e9;
    --ink: #324258;
    --muted: #5a6a78;
    --card: rgba(255, 255, 255, .65);
    --border: rgba(0, 0, 0, .08);
    --shadow: 0 10px 30px rgba(0, 0, 0, .08);
    --radius: 22px;
    --accent: #6c7ea0;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
    color: var(--ink);
}

/* Typography scale for dominant headings and lead text */
.headline-xl {
    font-size: clamp(2.4rem, 4.6vw, 3.0rem);
    line-height: 1.03;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.headline-lg {
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.lead {
    font-size: clamp(0.98rem, 1.2vw, 1.08rem);
    line-height: 1.5;
    color: var(--muted);
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.eyebrow {
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}

.stack-8>*+* {
    margin-top: 8px;
}

.stack-12>*+* {
    margin-top: 12px;
}

.stack-16>*+* {
    margin-top: 16px;
}

.stack-20>*+* {
    margin-top: 20px;
}

/* Site-wide textured background */
body {
    --bg-img: url('../images/web_assets/background.webp');
    background-image: var(--bg-img);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;

    /*  background-image: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%); */
}

/* Prevent CLS - reserve space for images before they load */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Hero section - prevent layout shift */
.hero.hero-split {
    min-height: 500px;
}

.hero .fade-card {
    aspect-ratio: 16 / 10;
    min-height: 400px;
    position: relative;
    contain: layout;
}

.hero .fade-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Comparison containers - fixed aspect ratio to prevent shift */
.comparison-container {
    aspect-ratio: 16 / 10;
    contain: layout;
    will-change: transform;
}

.comparison-layer {
    content-visibility: auto;
}

/* Video containers - prevent shift */
.flow-img {
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
}

/* Subtle overlay to improve contrast on text */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    /* final: subtle overlay, background clearly visible */
    background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
}

.site-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, .35);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 15px 16px;
}

.brand img {
    height: 42px;
}

.main-nav {
    margin-left: auto;
    display: flex;
    gap: 16px;
    align-items: center;
}

.main-nav a {
    color: var(--ink);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
}

.main-nav a:hover {
    background: rgba(0, 0, 0, .06);
}

/* Language switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang {
    opacity: .6;
    text-decoration: none;
    color: var(--ink);
    font-size: .85rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all .2s ease;
}

.lang:hover {
    opacity: .8;
    background: rgba(0, 0, 0, .06);
}

.lang.active {
    opacity: 1;
    background: var(--accent);
    color: white;
}

.lang-sep {
    opacity: .3;
    font-weight: 400;
}

/* Mobile navigation (hamburger + slide-down menu) */
.hamburger {
    display: none; /* hidden on desktop */
    margin-left: auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative; /* for absolute bars */
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.hamburger span {
    position: absolute;
    left: 10px;
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform .18s ease, opacity .18s ease;
    transform-origin: center; /* rotate around center for crisp X */
}

/* precise vertical placement for 3 bars inside 42x42 hit target */
.hamburger span:nth-child(1) { top: 12px; }
.hamburger span:nth-child(2) { top: 20px; }
.hamburger span:nth-child(3) { top: 28px; }

.hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.hamburger:focus-visible {
    outline: 2px solid rgba(11,102,195,.8); /* accessible but tidy */
    outline-offset: 2px;
}

.mobile-menu[hidden] {
    display: none !important;
}

.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(140%) blur(6px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 40px rgba(0,0,0,.10);
    padding: 12px 16px 16px;
    display: grid;
    gap: 6px;
    z-index: 11; /* above page content, within sticky header stacking context */
}

.mobile-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--ink);
}

.mobile-menu .lang-switcher {
    display: flex;
    justify-content: center;
    padding: 8px 12px;
}

.mobile-menu .lang-switcher.mobile {
    gap: 8px;
}

.mobile-menu a:hover {
    background: rgba(0,0,0,.06);
}

body.menu-open {
    overflow: hidden; /* prevent background scroll when menu is open */
}

.page {
    max-width: 1200px;
    margin: 28px auto;
    padding: 0 16px;
}

.card {
    position: relative;
    /* Brushed glass tuning variables */
    --glass-alpha: .125;        /* higher transparency (more see-through) */
    --glass-blur: 6px;         /* smaller blur for a matte look */
    --glass-noise-opacity: .15;/* subtle grain overlay (slightly stronger) */
    --grain-scale-x: 220%;     /* stretch noise for directional grain */
    --grain-scale-y: 90%;
    /* Allow swapping to an image-based noise by overriding --noise-src */
    --noise-src: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' stitchTiles='stitch'/><feComponentTransfer><feFuncR type='discrete' tableValues='0 1'/><feFuncG type='discrete' tableValues='0 1'/><feFuncB type='discrete' tableValues='0 1'/></feComponentTransfer></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");

    background: rgba(255, 255, 255, var(--glass-alpha));
    border: 0px solid rgba(255, 255, 255, .62);
    border-radius: 24px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .13);
    padding: 28px;
    margin-bottom: 22px;
    backdrop-filter: blur(var(--glass-blur)) saturate(160%) contrast(1.03);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%) contrast(1.03);
    background-clip: padding-box;
    contain: layout style;
}

/* Subtle grain/noise overlay to simulate brushed glass */
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: var(--glass-noise-opacity);
    /* Crisp static speckle noise; escape # as %23 */
    background-image: var(--noise-src);
    background-repeat: repeat;
    background-size: var(--grain-scale-x) var(--grain-scale-y);
    mix-blend-mode: multiply; /* paper-like effect */
}

/* Optional: stronger/steeper grain variant */
.glass-strong .card::before {
    opacity: calc(var(--glass-noise-opacity) + .05);
    mix-blend-mode: overlay;
}

/* Optional orientation helpers */
.glass-vertical .card { --grain-scale-x: 90%; --grain-scale-y: 220%; }
.glass-horizontal .card { --grain-scale-x: 220%; --grain-scale-y: 90%; }

/* Image-based noise helper: drop a seamless noise texture and point here */
.glass-img-noise .card { 
    --noise-src: url('/static/images/web_assets/whitenoise.png');
    --grain-scale-x: 25%;
    --grain-scale-y: 25%;
}

/* Quick kill-switch for grain (e.g., if performance or readability issues) */
.no-noise .card::before { display: none; }
/* Also disable the above-content grain for hero cards when .no-noise is present */
.no-noise .hero.card::after { display: none; }

/* subtle inner highlight without covering content */
.card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -1px 0 rgba(255, 255, 255, .15);
}

.card.elevated {
    box-shadow: 0 20px 60px rgba(0, 0, 0, .16);
}

.card .text h2,
.card .text h3 {
    margin: 0 0 6px;
}

.card .text p {
    margin: 0 0 10px;
    color: var(--muted);
}

.split {
    display: grid;
    grid-template-columns: 35% 65%;
    gap: 0px;
    align-items: center;
    container-type: inline-size;
}

.split.card {
    padding: clamp(18px, 4.2cqw, 42px) clamp(18px, 3.5cqw, 40px) clamp(14px, 3.6cqw, 40px);
}

/* Gallery card should have same horizontal padding as split card for visual consistency */
.gallery.card {
    padding: clamp(18px, 4.2cqw, 42px) clamp(18px, 3.5cqw, 40px) clamp(14px, 3.6cqw, 40px);
}

.split .media img {
    width: 100%;
    display: block;
    border-radius: 16px;
}

.split.reverse {
    grid-auto-flow: dense;
    grid-template-columns: 65% 35%;
}

.split.reverse .text {
    grid-column: 2;
}

.split.reverse .media {
    grid-column: 1;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.hero {
    position: relative;
    display: grid;
    grid-template-columns: 35% 65%;
    gap: 0px;
    align-items: center;
    container-type: inline-size;
}

/* reverse variant: keep 35/65 proportions but swap columns */
.hero.reverse {
    grid-auto-flow: dense;
    grid-template-columns: 65% 35%;
}

.hero.reverse .text {
    grid-column: 2;
}

.hero.reverse .media {
    grid-column: 1;
}

/* subtle seam between columns to match visual split */
.hero.card {
    overflow: hidden;
    padding: clamp(18px, 4.2cqw, 42px) clamp(18px, 3.5cqw, 40px) clamp(14px, 3.6cqw, 40px);
    border-radius: clamp(18px, 3.3cqw, 28px);
}

/* Ensure hero cards also show the noise overlay */
.hero.card::before {
    display: block;
}

/* frosted text pane on the left */
/* support markup WITHOUT wrappers (.text/.media) */
/* left column (text group) – apply mild spacing only; no wrapper required */
.hero> :first-child {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    backdrop-filter: none;
}

/* keep backward compatibility if .text is kept */
.hero .text,
.hero .col.text {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
    overflow: hidden;
}

/* Ensure col elements are properly sized */
.hero .col {
    max-width: 100%;
    overflow: hidden;
}

/* image framing on the right */
/* right column (image) – if there is NO wrapper, style the img directly */
.hero img {
    width: 100%;
    display: block;
    border-radius: clamp(14px, 3.6cqw, 22px);
    box-shadow: none;
    margin: clamp(12px, 3.6cqw, 36px) clamp(12px, 3.6cqw, 36px) clamp(14px, 5.4cqw, 54px) clamp(10px, 2.8cqw, 28px);
}

/* keep backward compatibility when .media wrapper exists */
.hero .media {
    padding: 0;
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
}

.hero:not(.reverse) .media {
    justify-content: flex-end;
}

.hero.reverse .media {
    justify-content: flex-start;
}

.hero .media img {
    width: 100%;
    border-radius: 18px;
    display: block;
    margin: 0;
}

/* compact vertical spacing under hero */
.hero.card {
    margin-bottom: 22px;
}

.flow-img {
    width: 100%;
    display: block;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    margin: 0; /* Match hero .media img formatting */
}

/* Video specific styling */
video.flow-img {
    background: transparent;
    object-fit: contain;
    width: 640px; /* Match hero image width */
    max-width: 100%; /* Responsive on smaller screens */
    aspect-ratio: 16 / 9;
    content-visibility: auto;
    contain: layout style paint;
}

/* Flow block ("Momentík prosím...") – headline size equals hero; target the split that contains .flow-img */
.split:has(.flow-img) h2 {
    font-size: clamp(2.4rem, 4.6vw, 3.8rem);
    line-height: 1.03;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
}

.split .media {
    display: flex;
    align-items: center;
}

.split:not(.reverse) .media {
    justify-content: flex-end;
}

.split.reverse .media {
    justify-content: flex-start;
}

.gallery .grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    justify-items: center; /* center fixed-size cards within cells */
}

.gallery img {
    width: 100%;
    border-radius: 12px;
    display: block;
}

/* Hover-fade cards: stack input/output and crossfade */
.fade-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0,0,0,.08);
    background: #fff;
    /* Fixed crop box: 362x242 (scales down on narrow screens) */
    width: 362px;
    max-width: 100%;
    aspect-ratio: 362 / 242;
    contain: layout style paint;
    will-change: transform;
}
.fade-card img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* crop to fill */
    object-position: center; /* center the crop */
}

/* Output layers - stack with z-index, cross-fade between them */
/* NOTE: Transition duration is set dynamically by JavaScript from ANIMATION_CONFIG.crossFadeDuration */
/* This is fallback only - JS overrides this value on page load */
.fade-card .output-layer {
    transition: opacity .5s ease;
}

/* Input layer - highest z-index, shows on hover */
/* NOTE: Transition duration is set dynamically by JavaScript from ANIMATION_CONFIG.inputFadeDuration */
/* This is fallback only - JS overrides this value on page load */
.fade-card .input-layer {
    opacity: 0;
    transition: opacity .66s ease;
    pointer-events: none; /* never block clicks, even when visible */
    /* Use z-index to control stacking instead of visibility */
    /* When not visible, move layer to back so it doesn't interfere with output layers */
    z-index: -1 !important;
}

.fade-card.hover-active .input-layer,
.fade-card.toggled .input-layer {
    /* Move to front when showing */
    z-index: 999 !important;
}

/* Show input layer when fade-card has hover-active class */
.fade-card.hover-active .input-layer,
.fade-card.toggled .input-layer { 
    opacity: 1;
    pointer-events: none; /* keep pointer-events disabled even when visible */
}

/* Hero fade-card adjustments: make it fill available space like other hero images */
.hero .media .fade-card {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 640 / 420 !important; /* match hero image proportions (ext-5 images are 640x420) - override default */
    border-radius: 18px; /* match hero img border-radius */
    box-shadow: none; /* match hero img - no shadow on the container */
    margin: 0; /* match hero .media img */
    background: transparent; /* ensure no background shows through */
}

/* Shared pill label style reused across gallery and lightbox */
.tag-pill {
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: .06em;
    color: #fff;
    /* Match fullscreen button visual treatment */
    background: rgba(0,0,0,.12);
    border: 1px solid rgba(255,255,255,.35);
    box-shadow: 0 6px 22px rgba(0,0,0,.15), inset 0 0 0 1px rgba(255,255,255,.08);
}

/* Label shown when input image (PRED) is visible */
.fade-card .fade-label {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000; /* higher than input layer to stay on top */
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
}
.fade-card.hover-active .fade-label,
.fade-card.toggled .fade-label {
    opacity: 1;
    transform: translateY(0);
}

/* Version indicators (radio button dots) */
.fade-version-indicators {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000; /* higher than input layer (999) to stay on top */
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0,0,0,.12);
    border: 1px solid rgba(255,255,255,.35);
    box-shadow: 0 6px 22px rgba(0,0,0,.15), inset 0 0 0 1px rgba(255,255,255,.08);
    backdrop-filter: blur(8px);
    opacity: 1;
    transition: opacity .3s ease;
    pointer-events: auto; /* ensure clicks work */
}

/* Hide indicators when hovering central area (showing input image) */
.fade-card.hover-active .fade-version-indicators {
    opacity: 0;
    pointer-events: none;
}

.ver-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.4);
    border: 1px solid rgba(255,255,255,.6);
    cursor: pointer;
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    position: relative;
    pointer-events: auto; /* ensure button is clickable */
}

.ver-dot:hover {
    background: rgba(255,255,255,.7);
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.ver-dot.active {
    background: #fff;
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255,255,255,.7), 0 2px 8px rgba(0,0,0,.35);
    transform: scale(1.1);
}

.ver-dot:focus-visible {
    outline: 2px solid rgba(255,255,255,.9);
    outline-offset: 3px;
}

body.light .fade-version-indicators {
    background: rgba(255,255,255,.85);
    border-color: rgba(0,0,0,.08);
}

body.light .ver-dot {
    background: rgba(0,0,0,.2);
    border-color: rgba(0,0,0,.3);
}

body.light .ver-dot:hover {
    background: rgba(0,0,0,.4);
}

body.light .ver-dot.active {
    background: #1d252c;
    border-color: #1d252c;
    box-shadow: 0 0 8px rgba(0,0,0,.3), 0 2px 6px rgba(0,0,0,.15);
}

/* Mobile tap hint indicator */
.mobile-tap-hint {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: none; /* hidden by default, shown by JS on touch devices */
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 6px 10px;
    opacity: 0.9;
    transition: opacity .3s ease;
    pointer-events: none;
}

.mobile-tap-hint svg {
    width: 14px;
    height: 14px;
    animation: tapPulse 2s ease-in-out infinite;
}

@keyframes tapPulse {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(-2px); opacity: 0.7; }
}

/* Hide tap hint when showing input or when indicators are hidden */
.fade-card.hover-active .mobile-tap-hint {
    opacity: 0;
}

body.light .mobile-tap-hint {
    background: rgba(255,255,255,.9);
    color: #1d252c;
}

/* Sentinel occupies minimal space but triggers observer */
.scroll-sentinel { height: 1px; }

/* Fullscreen lightbox */
.modal-open { overflow: hidden; }
.lightbox[hidden] { display: none !important; }
.lightbox {
    position: fixed; inset: 0; z-index: 1000;
    display: grid; place-items: center;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
    /* Precompute inner size for positioning controls relative to image area */
    --lb-w: min(96vw, 1200px);
    --lb-h: min(90vh, 800px);
}
.lightbox .lb-inner {
    width: var(--lb-w);
    height: var(--lb-h);
    display: grid; place-items: center;
}
.lightbox .lb-stage {
    width: 100%; height: 100%;
    display: grid; place-items: center;
}
.lightbox .comparison-container {
    width: 100%; height: 100%; aspect-ratio: auto;
    border-radius: 12px; overflow: hidden;
    background: #000;
}
.lightbox .cmp-handle:before { width: 34px; height: 34px; }

/* Fullscreen button for inline comparison blocks */
.cmp-fs-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 34px; height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.35);
    background: rgba(0,0,0,.12);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    display: grid; place-items: center;
    box-shadow: 0 6px 22px rgba(0,0,0,.15), inset 0 0 0 1px rgba(255,255,255,.08);
    cursor: pointer;
    z-index: 3;
}
.cmp-fs-btn:hover { filter: brightness(1.1); }
.cmp-fs-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lightbox .lb-close {
    position: absolute;
    /* Pin close button just inside the top-right corner of the image area */
    top: calc((100vh - var(--lb-h)) / 2 + 8px);
    right: calc((100vw - var(--lb-w)) / 2 + 8px);
    width: 44px; height: 44px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(0,0,0,.4); color: #fff;
    font-size: 26px; line-height: 1; cursor: pointer;
    z-index: 1001;
}
.lightbox .lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
        width: 54px; height: 78px; border-radius: 12px;
        border: 1px solid rgba(255,255,255,.35);
        background: rgba(0,0,0,.55); color: #fff; cursor: pointer;
        box-shadow: 0 6px 22px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.08);
        font-size: 36px; line-height: 1; display: grid; place-items: center;
    z-index: 1001;
}
.lightbox .lb-prev {
    /* Align close to left edge of the image area */
    left: calc((100vw - var(--lb-w)) / 2 + 8px);
}
.lightbox .lb-next {
    /* Align close to right edge of the image area */
    right: calc((100vw - var(--lb-w)) / 2 + 8px);
}

.pricing .plan {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 14px;
    text-align: center;
}

.btn {
    display: inline-block;
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 999px;
    text-align: center;
    font-size: 1rem;
}

.btn.ghost {
    background: rgba(255, 255, 255, .5);
    color: var(--ink);
    border: 1px solid rgba(0, 0, 0, .08);
    backdrop-filter: saturate(120%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

/* Stronger default button for prominence on white cards */
.btn {
    box-shadow: 0 6px 18px rgba(16,24,40,.16);
}
.btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn.ghost:hover {
    background: rgba(255, 255, 255, .7);
}

.btn:disabled {
    opacity: .6;
}

.form {
    display: grid;
    gap: 10px;
}

.form label {
    display: grid;
    gap: 6px;
    font-size: .95rem;
}

/* Make explicitly inline labels truly inline (override grid) */
.form label.inline { display: flex; gap: 8px; align-items: center; }

.form input,
.form textarea,
.form select {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.link {
    color: #0b66c3;
    text-decoration: none;
}

.muted {
    color: var(--muted);
    margin-top: 10px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

/* Registration narrow layout */
.card.auth.narrow { max-width: 350px; margin: 0 auto; }
.card.auth.narrow .form input[type="text"],
.card.auth.narrow .form input[type="email"],
.card.auth.narrow .form input[type="password"],
.card.auth.narrow .form input[type="number"],
.card.auth.narrow .form input[type="tel"],
.card.auth.narrow .form select,
.card.auth.narrow .form textarea { width: 100%; }
.form input[type="checkbox"] { width: auto; padding: 0; }
.card.auth.narrow .btn { width: auto; display: block; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

.tab {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    text-decoration: none;
    color: var(--ink);
    background: #fff;
}

.tab.active {
    background: var(--ink);
    color: #fff;
}

.media-hero img {
    width: 100%;
    border-radius: 16px;
    display: block;
}

.site-footer {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px;
    color: var(--muted);
    text-align: center;
}

/* Lightweight comparison slider for homepage */
.comparison-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    border: 0; /* no stroke around image */
    border-radius: 20px;
    overflow: hidden;
    background: transparent; /* avoid dark ring on rounded corners */
    --pos: 50%;
    /* aspect-ratio removed to allow JS-driven or intrinsic sizing without forcing bands */
    touch-action: none; /* prevent browser panning during drag */
    user-select: none;
}

.comparison-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* fill container nicely */
    user-select: none;
    pointer-events: none;
    z-index: 0; /* below handle, labels */
}

/* win over generic `.split .media img` rules at large breakpoints */
.comparison-container .comparison-layer {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
}

.comparison-layer.before {
    clip-path: inset(0 calc(100% - var(--pos)) 0 0);
    transition: clip-path .08s linear; /* eased when not dragging */
    will-change: clip-path; /* hint GPU */
}

/* During drag or hint animation, disable transition for immediate response */
.comparison-container.dragging .comparison-layer.before,
.comparison-container.animating .comparison-layer.before {
    transition: none;
}

/* Comparison handle (vertical dividing line + grabber) */
.cmp-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos);
    width: 2px;
    height: 100%; /* ensure it respects container height */
    transform: translateX(-1px);
    background: rgba(255,255,255,.92); /* visible on dark/light */
    cursor: ew-resize;
    z-index: 2; /* above image layers (0), below nav/labels (1001+) */
}

/* Disable handle transition during drag or animation for immediate response */
.comparison-container.dragging .cmp-handle,
.comparison-container.animating .cmp-handle {
    transition: none;
}
.cmp-handle:before { display: none; }
.cmp-handle .arrows {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 14px;
    pointer-events: none;
}
.cmp-handle .arrows span {
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.6));
}
.cmp-handle .arrows span.left { border-right: 10px solid #fff; }
.cmp-handle .arrows span.right { border-left: 10px solid #fff; }
.cmp-handle:focus-visible:before { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Lightbox: slightly smaller grabber to reduce overlap */
.lightbox .cmp-handle:before { display: none; }

.pricing .plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 8px;
}

/* Inline comparison tags (PRED/PO) */
.comparison-container .cmp-tag {
    position: absolute;
    top: 12px;
    z-index: 2;
    pointer-events: none;
    white-space: nowrap;
}
.comparison-container .cmp-tag.left { left: 12px; }
.comparison-container .cmp-tag.right { right: 12px; }

/* Lightbox comparison tags inside the container for proper anchoring */
/* Show markup-based tags (PRED/PO) inside comparison container */
.lightbox .comparison-container .cmp-tag {
    position: absolute;
    top: 12px;
    z-index: 1002; /* above close/nav (1001) and handle (2) */
    pointer-events: none;
    display: inline-block;
    white-space: nowrap;
    text-shadow: 0 1px 1px rgba(0,0,0,.5);
}
.lightbox .comparison-container .cmp-tag.left { left: 12px; }
.lightbox .comparison-container .cmp-tag.right { right: 56px; }


/* Version navigation overlay */
.cmp-version-nav {
    position: absolute;
    bottom: 10px; left: 50%;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px;
    background: rgba(0,0,0,.45);
    color: #fff; padding: 6px 10px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.15);
    z-index: 3;
    backdrop-filter: blur(6px);
    font-weight: 700; font-size: 12px;
}
.cmp-version-nav .ver-btn {
    appearance: none; border: 0; border-radius: 999px;
    width: 28px; height: 28px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.25); color: #fff;
}
.cmp-version-nav .ver-btn:hover { background: rgba(255,255,255,.28); }
.cmp-version-nav .ver-indicator { min-width: 38px; text-align: center; }

/* Arrow triangles for version nav, matching the handle arrows */
.cmp-version-nav .ver-btn .arrow { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.cmp-version-nav .ver-btn .arrow.left { border-right: 7px solid #fff; }
.cmp-version-nav .ver-btn .arrow.right { border-left: 7px solid #fff; }

/* ===== COMPARISON HINTS OVERLAY ===== */
.cmp-hints-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    animation: fadeInHints 0.4s ease-out 1.2s forwards;
}

.cmp-hints-overlay.hidden {
    animation: fadeOutHints 0.3s ease-out forwards;
}

/* Pulse animation for controls */
.cmp-hint-pulse {
    animation: pulseGlow 1.8s ease-in-out infinite;
}

/* Keyframes for hint animations */
@keyframes fadeInHints {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOutHints {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes pulseGlow {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4),
                    0 0 0 0 rgba(255, 255, 255, 0.2);
    }
    50% { 
        box-shadow: 0 0 12px 4px rgba(255, 255, 255, 0.6),
                    0 0 20px 8px rgba(255, 255, 255, 0.3);
    }
}

@media (max-width: 880px) {
    /* Full-width layout on mobile */
    .page {
        max-width: 100vw;
        margin: 12px 0 0;
        padding: 0 12px; /* Add small horizontal padding to prevent overflow */
        overflow-x: hidden; /* Prevent horizontal scroll */
        box-sizing: border-box;
    }
    
    /* Ensure body doesn't overflow */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Show hamburger, hide desktop nav */
    .main-nav {
        display: none;
    }
    .hamburger {
        display: inline-flex;
    }

    /* Space brand on left, hamburger on right */
    .nav-inner {
        justify-content: space-between;
    }

    .two-col,
    .pricing .plans,
    .gallery .grid-3 {
        grid-template-columns: 1fr;
    }
    
    /* Ensure all cards fit within viewport on mobile */
    .card {
        max-width: 100%;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }
    
    /* Gallery fade cards should be full width on mobile */
    .gallery .fade-card {
        width: 100%;
        max-width: 100%;
        margin: 0 auto; /* Center within container */
    }
    
    .gallery .grid-3 {
        padding: 0; /* Remove any padding that might offset images */
        justify-items: center; /* Center items */
    }

    .split,
    .hero {
        grid-template-columns: 1fr;
        overflow: hidden; /* Prevent any overflow */
    }

    /* Ensure split blocks stack cleanly on mobile */
    .split { 
        grid-auto-flow: row;
    }
    
    .split.card {
        padding: 18px 12px 24px; /* Reduced horizontal padding on mobile */
    }
    
    .split > .text,
    .split > .media { 
        grid-column: 1 / -1;
        max-width: 100%;
        overflow: hidden;
        padding: 0; /* Remove any inherited padding */
    }
    
    .split .media { 
        justify-content: center;
        overflow: hidden; /* prevent child elements from overflowing */
        max-width: 100%;
        width: 100%;
        padding: 0 !important; /* Ensure no padding on media container */
    }
    
    .split .media img { 
        width: 100%; 
        height: auto; 
        margin: 0; 
    }

    .hero.card::before {
        display: none;
    }

    /* LOW variant: adaptive height (no fixed 500px), image fits width 640 without cropping */
    .page .hero.card.low {
        height: auto;
    }

    .hero .media {
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    .hero.card {
        margin-bottom: 24px;
        padding: 18px 12px 24px; /* Reduced horizontal padding */
        overflow: hidden; /* Prevent content overflow */
        max-width: 100%; /* Ensure card doesn't exceed viewport */
        box-sizing: border-box;
    }

    .hero> :first-child,
    .hero .col {
        padding: 0; /* Remove padding to prevent double padding */
        max-width: 100%; /* Ensure content doesn't overflow */
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .hero .col.text {
        padding: 0 8px; /* Small horizontal padding for text */
        gap: 16px; /* Add space between elements in text column */
    }
    
    .hero .col.text .btn {
        margin-top: 8px; /* Extra space above button */
    }
    
    .hero .col.media {
        padding: 0;
        max-width: 100%;
        margin-top: 20px; /* Add space between text and image on mobile */
    }

    .hero img {
        margin: 0; /* Remove margins to fix aspect ratio */
        max-width: 100%; /* Ensure images don't overflow */
        box-sizing: border-box;
    }
    
    /* Fix fade-card aspect ratio on mobile */
    .hero .fade-card {
        aspect-ratio: 16 / 10; /* Maintain proper aspect ratio */
        width: 100%;
        margin: 0;
        min-height: 0 !important; /* Override desktop min-height: 400px */
        height: auto;
    }

    /* Flow images should not have margins on mobile - override .hero img rule */
    .hero .flow-img,
    video.flow-img {
        margin: 0 !important;
        min-height: auto !important; /* Remove fixed height on mobile */
        height: auto;
        object-fit: contain;
        aspect-ratio: 16 / 9;
    }

    /* Improve readability of vertical flow video on small screens */
    .flow-img {
        max-width: 100%;
        width: 100%;
        margin: 0; /* Match hero .media img formatting */
        padding: 0;
    }

    /* on mobile, stack natural DOM order for reverse hero */
    .hero.reverse .text,
    .hero.reverse .media {
        grid-column: auto;
    }
    
    /* Mobile comparison container general fixes */
    .comparison-container {
        min-height: 250px; /* reduce min-height on mobile */
        border-radius: 16px; /* slightly smaller radius */
        overflow: hidden; /* ensure nothing overflows container */
        max-width: 100%; /* prevent overflow on mobile */
        width: 100%;
    }
    
    /* Fix split section comparison containers on mobile */
    .split .media .comparison-container {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        margin: 0;
        overflow: hidden;
    }
    
    /* Fix split section comparison layer images */
    .split .media .comparison-container .comparison-layer {
        width: 100% !important;
        height: 100% !important;
        max-width: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    /* Ensure hero comparison containers work on mobile too */
    .hero .media .comparison-container {
        width: 100% !important;
        height: auto !important;
        margin: 12px 0 18px 0;
        aspect-ratio: 16 / 12;
        overflow: hidden;
    }
}

/* Fixed desktop dimensions requested: 1168x500 hero, image 420px height, text block 320px */
/* LOW variant: text column should size to content */
.hero.low> :first-child:not(img),
.hero.low .text,
.hero.low .col-text {
    height: auto;
    min-height: 0;
}

/* Tablet viewport: center workflow image between 881px and 1199px */
@media (min-width: 881px) and (max-width: 1199px) {
    .flow-img {
        max-width: 500px;
        width: 100%;
        margin: 0; /* Match hero .media img formatting */
        display: block;
        border-radius: 16px;
    }
    
    /* Center the media column containing the flow image */
    .hero.low .col.media {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* Ensure picture element is also centered */
    .hero.low .col.media picture {
        display: flex;
        justify-content: center;
        width: 100%;
    }
}

@media (min-width: 1200px) {
    .page .hero.card {
        width: 1168px;
        height: 500px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Normal hero keeps 35/65 split */
    .hero {
        grid-template-columns: 35% 65%;
        align-items: center;
    }

    /* Reverse hero swaps proportions so media remains 65% */
    .hero.reverse {
        grid-template-columns: 65% 35%;
    }

    /* text column height 320px; works with or without wrappers */
    .hero> :first-child:not(img),
    .hero .text,
    .hero .col-text {

        min-height: 320px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 12px;
    }

    /* image column image fixed height */
    .hero img {
        width: 640px;
        max-width: 100%;
        height: 420px;
        object-fit: cover;
        object-position: center;
        border-radius: 20px;
        box-shadow: none;
        margin: 0 auto;
        align-self: center;
        justify-self: center;
    }

    /* if a .media wrapper exists, ensure the image still respects 640x420 and is centered */
    /* Keep media aligned to the outer edges, not centered */
    .hero .media {
        display: flex;
        align-items: center;
    }

    .hero:not(.reverse) .media {
        justify-content: flex-end;
    }

    .hero.reverse .media {
        justify-content: flex-start;
    }

    .hero .media img {
        width: 640px;
        height: 420px;
        object-fit: cover;
        object-position: center;
        margin: 0;
    }

    .hero .media .fade-card {
        width: 640px !important;
        height: 420px !important;
        aspect-ratio: 640 / 420 !important; /* ensure correct proportions */
    }

    /* Flow block image same width as hero img */
    .flow-img {
        width: 640px;
        height: auto;
        margin: 0; /* Match hero .media img formatting */
        display: block;
        border-radius: 20px;
    }

    /* LOW variant: adaptive height, keep same 35/65 grid so media aligns like default; text max 320, image not cropped */
    .page .hero.card.low {
        height: auto;
    }

    .hero.low {
        grid-template-columns: 35% 65%;
        align-items: center;
    }

    .hero.low> :first-child:not(img),
    .hero.low .text,
    .hero.low col-text {
        min-height: 200px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 12px;
    }

    .hero.low img {
        width: 640px;
        height: auto;
        object-fit: contain;
        object-position: center;
        margin: 0 auto;
        box-shadow: none;
    }

    .hero.low .media img {
        width: 640px;
        height: auto;
        margin: 0;
        object-fit: contain;
    }

    /* Split cards: mirror hero proportions and centering */
    .page > .card.split {
        width: 1168px;
        margin-left: auto;
        margin-right: auto;
    }

    .split {
        grid-template-columns: 35% 65%;
        align-items: center;
    }

    /* Reverse split swaps proportions so media remains 65% */
    .split.reverse {
        grid-template-columns: 65% 35%;
    }

    .split .text {
        display: flex;
        flex-direction: column;
        gap: 12px;
        justify-content: flex-start;
    }

    .split .media {
        display: flex;
        align-items: center;
    }

    .split:not(.reverse) .media {
        justify-content: flex-end;
    }

    .split.reverse .media {
        justify-content: flex-start;
    }

    .split .media img {
        width: 640px;
        height: 420px;
        object-fit: cover;
        object-position: center;
        border-radius: 20px;
        box-shadow: none;
    }

    /* Ensure comparison sliders in split cards match 640x420 like plain images */
    .split .media .comparison-container {
        width: 640px;
        height: 420px;
        max-width: 100%;
        margin: 0; /* align nicely within media area */
    }
}

/* Tablet: ensure comparison containers have size and are centered */
@media (min-width: 881px) and (max-width: 1199px) {
    /* Center media content in split cards */
    .split .media { display: flex; align-items: center; justify-content: center; }
    /* Give comparison containers dimensions (otherwise height collapses) */
    .split .media .comparison-container {
        width: clamp(520px, 58vw, 640px);
        aspect-ratio: 3 / 2; /* ~640x420 */
        height: auto; /* with aspect-ratio, this computes to proper height */
        min-height: 300px; /* safety to avoid collapse on some engines */
        max-width: 100%;
        margin: 0;
    }
}

@media (max-width: 880px) {
    .split {
        grid-template-columns: 1fr;
    }

    .split.reverse .text,
    .split.reverse .media {
        grid-column: 1 / -1; /* full-width rows for both */
    }

    /* kill reverse desktop layout on mobile to keep natural order */
    .split.reverse {
        grid-template-columns: 1fr;
        grid-auto-flow: row;
    }

    /* ensure images span width under text */
    .split .media { justify-content: center; }
    .split .media img { width: 100%; height: auto; }
    
    /* Fix comparison containers in split sections for mobile */
    .split .media .comparison-container {
        width: 100% !important;
        height: auto !important;
        max-width: 100%;
        margin: 0 0 0 0;
        aspect-ratio: 3 / 2; /* match desktop 640x420 proportion */
        min-height: 280px; /* avoid 0-height collapse */
    }
    
    /* Make comparison layers responsive on mobile */
    .split .media .comparison-container .comparison-layer {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
    }
    
    /* Mobile-specific comparison slider improvements */
    .comparison-container .cmp-handle {
        width: 4px; /* slightly wider handle for easier touch */
        height: 100% !important; /* ensure handle doesn't overflow container */
        background: rgba(255,255,255,.95);
        box-shadow: 0 0 8px rgba(0,0,0,.3);
    }
    
    .comparison-container .cmp-handle .arrows {
        gap: 16px; /* larger arrow spacing for mobile */
    }
    
    .comparison-container .cmp-handle .arrows span {
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        filter: drop-shadow(0 2px 4px rgba(0,0,0,.8));
    }
    
    .comparison-container .cmp-handle .arrows span.left { 
        border-right: 12px solid #fff; 
    }
    
    .comparison-container .cmp-handle .arrows span.right { 
        border-left: 12px solid #fff; 
    }
    
    /* Make tags more prominent on mobile */
    .comparison-container .cmp-tag {
        padding: 8px 12px;
        font-size: 14px;
        font-weight: 500;
        top: 14px; /* more space from top on mobile */
    }
    
    .comparison-container .cmp-tag.left { left: 14px; }
    .comparison-container .cmp-tag.right { right: 14px; }
    
    /* Version navigation better mobile sizing */
    .cmp-version-nav {
        padding: 8px 12px;
        gap: 12px;
    }
    
    .cmp-version-nav .ver-btn {
        width: 32px;
        height: 32px;
    }
    
    /* Fullscreen button more accessible on mobile */
    .cmp-fs-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
        bottom: 12px;
        right: 12px;
    }
    
    /* Hero fade-card mobile adjustments */
    .hero .media .fade-card {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 3 / 2 !important; /* 640/420 simplified to 3/2 */
    }
    
    /* Make fade label more prominent on mobile */
    .fade-card .fade-label {
        top: 14px;
        left: 14px;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* Make version indicators more touch-friendly on mobile */
    .fade-version-indicators {
        bottom: 16px;
        padding: 10px 14px;
        gap: 12px;
    }
    
    .ver-dot {
        width: 12px;
        height: 12px;
    }
    
    /* Mobile tap hint adjustments */
    .mobile-tap-hint {
        top: 14px;
        right: 14px;
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .mobile-tap-hint svg {
        width: 16px;
        height: 16px;
    }
}
