body {
    background-color: #CECECE;
    overflow: hidden;
}

/* Antonio font-stretch / extra custom styling for giant display text */
/* M2: Antonio has no condensed axis on Google Fonts - the stretch rule was silently dropped.
   Using font-weight 800 + tighter letter-spacing gives the same visual squash. */
.giant-display-text {
    font-family: 'Antonio', sans-serif;
    font-weight: 800;
    letter-spacing: -0.04em;
}

/* Modern scrollbar styling for immersive overlays */
.custom-scroll::-webkit-scrollbar {
    width: 3px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: rgba(2, 2, 2, 0.1);
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #E5A93B;
}

/* Subtle floating animations for the interactive pills */
@keyframes subtleFloat {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-6px);
    }
}

.floating-pill-1 {
    animation: subtleFloat 6s ease-in-out infinite;
}

.floating-pill-2 {
    animation: subtleFloat 7s ease-in-out infinite 1s;
}

.floating-pill-3 {
    animation: subtleFloat 8s ease-in-out infinite 2s;
}

/* Flashing cursor animation */
@keyframes cursorBlink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.cursor-blink {
    animation: cursorBlink 1.2s step-end infinite;
}

/* Dynamic kinetic robot movement animation (Breathing & swaying) */
@keyframes robotMove {
    0%, 100% {
        transform: translateY(calc(8% + 50px)) translateX(0px) rotate(0.5deg) scale(1);
    }
    50% {
        transform: translateY(3.5%) translateX(16px) rotate(-1deg) scale(1.02);
    }
}

.robot-movement {
    animation: robotMove 8s ease-in-out infinite;
}

/* Page content swap transitions */
@keyframes contentFadeOut {
    from { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
    to { opacity: 0; transform: translateY(12px) scale(0.98); filter: blur(4px); }
}
@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.animate-exit {
    animation: contentFadeOut 0.22s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.animate-entry {
    animation: contentFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Connect button active pop with energy burst */
@keyframes buttonPressPop {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(229, 169, 59, 0.7);
    }
    30% {
        transform: scale(0.92);
        box-shadow: 0 0 25px 12px rgba(229, 169, 59, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(229, 169, 59, 0);
    }
}
.connect-pop-active {
    animation: buttonPressPop 0.45s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

/* Animated gradient ambient light mesh background */
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes diagonalDrift {
    0% { background-position: 0 0; }
    100% { background-position: 64px 64px; }
}
@keyframes lineZoom {
    0%, 100% { transform: scale(1.05) translate(0, 0); }
    50% { transform: scale(1.22) translate(16px, 16px); }
}
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    background: radial-gradient(circle at 20% 30%, #CECECE 0%, #B8B8B8 50%, #A4A4A4 100%) !important;
    background-size: 200% 200% !important;
    animation: gradientShift 18s ease infinite !important;
    position: relative;
    overflow-x: hidden;
}

/* Ambient Fluid Wave Background wrapper */
.bg-waves-wrapper {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}
.wave {
    position: absolute;
    bottom: -15%;
    left: 0;
    width: 200%;
    height: 45%;
    border-radius: 1000% 1000% 0 0;
    transform: translate3d(0, 0, 0);
    transform-origin: center bottom;
}

/* Wave colors and motions for light mode */
.wave-1 {
    background: rgba(0, 0, 0, 0.015);
    animation: waveMove 16s linear infinite;
}
.wave-2 {
    background: linear-gradient(90deg, rgba(229, 169, 59, 0.04) 0%, rgba(229, 169, 59, 0.09) 50%, rgba(229, 169, 59, 0.04) 100%);
    bottom: -19%;
    animation: waveMove 24s linear reverse infinite;
    opacity: 0.85;
}
.wave-3 {
    background: rgba(0, 0, 0, 0.02);
    bottom: -23%;
    animation: waveMove 32s linear reverse infinite;
    opacity: 0.9;
}

/* Wave colors for dark mode */
.dark .wave-1 {
    background: rgba(255, 255, 255, 0.008);
}
.dark .wave-2 {
    background: linear-gradient(90deg, rgba(229, 169, 59, 0.025) 0%, rgba(229, 169, 59, 0.055) 50%, rgba(229, 169, 59, 0.025) 100%);
}
.dark .wave-3 {
    background: rgba(255, 255, 255, 0.012);
}

@keyframes waveMove {
    0% { transform: translateX(0) scaleY(1); }
    25% { transform: translateX(-25%) scaleY(1.08); }
    50% { transform: translateX(-50%) scaleY(1); }
    75% { transform: translateX(-25%) scaleY(1.08); }
    100% { transform: translateX(0) scaleY(1); }
}

.dark body {
    background: radial-gradient(circle at 80% 20%, #151515 0%, #080808 50%, #010101 100%) !important;
    background-size: 200% 200% !important;
    animation: gradientShift 18s ease infinite !important;
}

/* Stable dots grid on our main content card container (with reduced opacity) */
.main-card-container::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.06;
    background-image: radial-gradient(#000000 1.2px, transparent 1.2px);
    background-size: 14px 14px;
}

.dark .main-card-container::before {
    opacity: 0.06;
    background-image: radial-gradient(#ffffff 1.2px, transparent 1.2px);
}

/* L5 consolidated theme transition - cleaner than repeating 13 selectors. */
body, .main-card-container, .giant-display-text, .connect-btn, #theme-toggle-btn, #cookie-consent-banner {
    transition: background-color 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                 color 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                 border-color 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                 box-shadow 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.text-black\/70, .text-black\/60, .text-black\/50, .text-black\/40 {
    transition: color 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.border-black\/10, .border-black\/20, .border-black\/30, .border-t-black\/10 {
    transition: border-color 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Custom Cookie consent theme overrides */
#cookie-consent-banner {
    background-color: #E6E6E6 !important;
    color: #000000 !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}
.dark #cookie-consent-banner {
    background-color: #0C0C0C !important;
    color: #FFFFFF !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}
#cookie-consent-banner .text-black\/60 {
    color: rgba(0, 0, 0, 0.6) !important;
}
.dark #cookie-consent-banner .text-black\/60 {
    color: #A1A1AA !important;
}

/* Midnight Dark Mode Overrides */
.dark body {
    /* Background handled dynamically by gradientShift animation */
}

.dark .main-card-container {
    background-color: #0C0C0C !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6) !important;
}

.dark .text-black {
    color: #FFFFFF !important;
}

.dark .text-black\/70 {
    color: rgba(255, 255, 255, 0.7) !important;
}

.dark .text-black\/60 {
    color: rgba(255, 255, 255, 0.6) !important;
}

.dark .text-black\/50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

.dark .text-black\/40 {
    color: rgba(255, 255, 255, 0.4) !important;
}

.dark .border-black\/20 {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.dark .border-black\/10 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark .border-black\/30 {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.dark .giant-display-text {
    color: #FFFFFF !important;
}

.dark .dropdown-bg {
    background-color: #161616 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.dark .dropdown-bg a {
    color: rgba(255, 255, 255, 0.6) !important;
}

.dark .dropdown-bg a:hover {
    color: #FFFFFF !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.dark #theme-toggle-btn {
    background-color: #FFFFFF !important;
    color: #000000 !important;
}

.dark #theme-toggle-btn:hover {
    background-color: #E6E6E6 !important;
}

.dark .hover\:text-black:hover {
    color: #FFFFFF !important;
}

.dark .border-t-black\/10 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Dark mode Connect button styling */
.dark .connect-btn {
    background-color: #FFFFFF !important;
    color: #000000 !important;
}

.dark .connect-btn:hover {
    background-color: #E6E6E6 !important;
}

/* Ensure the clock is white in dark mode */
.dark #system-running-clock {
    color: #FFFFFF !important;
}

/* Hide scrollbars on card container while retaining scroll ability */
.main-card-container {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.main-card-container::-webkit-scrollbar {
    display: none;
}

/* Dialogue light-mode styles (when .dark class is NOT on root) */
#luxury-dialogue-overlay {
    background-color: transparent !important;
    color: #000000 !important;
}

#luxury-dialogue-overlay .text-white {
    color: #000000 !important;
}

#luxury-dialogue-overlay .text-zinc-400,
#luxury-dialogue-overlay .text-zinc-500,
#luxury-dialogue-overlay .text-zinc-600 {
    color: #333333 !important;
}

#luxury-dialogue-overlay .border-white\/5,
#luxury-dialogue-overlay .border-white\/\[0\.05\] {
    border-color: rgba(0, 0, 0, 0.1) !important;
}

#luxury-dialogue-overlay .bg-white\/\[0\.01\] {
    background-color: rgba(0, 0, 0, 0.03) !important;
}

/* Dialogue dark-mode styles (when .dark class IS on root) */
.dark #luxury-dialogue-overlay {
    background-color: transparent !important;
    color: #FFFFFF !important;
}

.dark #luxury-dialogue-overlay .text-white {
    color: #FFFFFF !important;
}

.dark #luxury-dialogue-overlay .text-zinc-400 {
    color: #A1A1AA !important;
}

.dark #luxury-dialogue-overlay .text-zinc-500 {
    color: #71717A !important;
}

.dark #luxury-dialogue-overlay .text-zinc-600 {
    color: #52525B !important;
}

.dark #luxury-dialogue-overlay .border-white\/5,
.dark #luxury-dialogue-overlay .border-white\/\[0\.05\] {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.dark #luxury-dialogue-overlay .bg-white\/\[0\.01\] {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

@keyframes bannerFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.banner-bobble {
    animation: bannerFloat 5s ease-in-out infinite;
}

/* Progress border wrap around pills */
.progress-border-wrap {
    position: relative;
    padding: 1.5px;
    border-radius: 9999px;
    background: conic-gradient(#E5A93B var(--progress, 0%), rgba(0, 0, 0, 0.08) var(--progress, 0%));
    display: inline-block;
    cursor: pointer;
    transition: background 0.1s linear;
}
.dark .progress-border-wrap {
    background: conic-gradient(#E5A93B var(--progress, 0%), rgba(255, 255, 255, 0.12) var(--progress, 0%));
}

.progress-border-wrap a {
    display: block;
    background-color: #E6E6E6 !important;
    border: none !important;
}
.dark .progress-border-wrap a {
    background-color: #0C0C0C !important;
    color: #FFFFFF !important;
}
.progress-border-wrap a:hover {
    background-color: rgba(229, 169, 59, 0.08) !important;
}
.dark .progress-border-wrap a:hover {
    background-color: rgba(229, 169, 59, 0.12) !important;
}

@keyframes mascotPatrol {
    0% {
        margin-right: -25%;
        transform: translateY(calc(8% + 50px)) translateX(0px) rotate(0.5deg) scaleX(1);
    }
    /* Zoom to 25% (traveling left) */
    15% {
        margin-right: 25%;
        transform: translateY(calc(8% + 50px)) translateX(0px) rotate(0.5deg) scaleX(1);
    }
    /* Flip horizontally at 25% */
    17% {
        margin-right: 25%;
        transform: translateY(calc(8% + 50px)) translateX(0px) rotate(0.5deg) scaleX(-1);
    }
    /* Do a few bobble loops in this flipped state (from 17% to 83%) */
    30% {
        margin-right: 25%;
        transform: translateY(3.5%) translateX(16px) rotate(-1deg) scaleX(-1) scaleY(1.02);
    }
    43% {
        margin-right: 25%;
        transform: translateY(calc(8% + 50px)) translateX(0px) rotate(0.5deg) scaleX(-1);
    }
    56% {
        margin-right: 25%;
        transform: translateY(3.5%) translateX(16px) rotate(-1deg) scaleX(-1) scaleY(1.02);
    }
    70% {
        margin-right: 25%;
        transform: translateY(calc(8% + 50px)) translateX(0px) rotate(0.5deg) scaleX(-1);
    }
    83% {
        margin-right: 25%;
        transform: translateY(3.5%) translateX(16px) rotate(-1deg) scaleX(-1) scaleY(1.02);
    }
    /* Zoom back to -25% (still facing right so he travels forward) */
    97% {
        margin-right: -25%;
        transform: translateY(calc(8% + 50px)) translateX(0px) rotate(0.5deg) scaleX(-1);
    }
    /* Flip back to normal direction once arrived */
    100% {
        margin-right: -25%;
        transform: translateY(calc(8% + 50px)) translateX(0px) rotate(0.5deg) scaleX(1);
    }
}

.robot-patrolling {
    animation: mascotPatrol 18s ease-in-out forwards !important;
}

/* M6: hardware acceleration for animated overlays prevents Safari backdrop-filter glitches */
.bg-waves-wrapper, #mobile-menu-drawer, #cookie-consent-banner {
    will-change: transform, opacity;
}

/* L6: respect prefers-contrast (iOS Increase Contrast, Windows High Contrast) */
@media (prefers-contrast: more) {
    .text-black\/40 { color: rgba(0, 0, 0, 0.65) !important; }
    .text-black\/50 { color: rgba(0, 0, 0, 0.75) !important; }
    .text-black\/60 { color: rgba(0, 0, 0, 0.85) !important; }
    .text-black\/70 { color: rgba(0, 0, 0, 0.95) !important; }
    .dark .text-black\/40 { color: rgba(255, 255, 255, 0.65) !important; }
    .dark .text-black\/50 { color: rgba(255, 255, 255, 0.75) !important; }
    .dark .text-black\/60 { color: rgba(255, 255, 255, 0.85) !important; }
    .dark .text-black\/70 { color: rgba(255, 255, 255, 0.95) !important; }
    .border-black\/10, .border-black\/20 { border-color: rgba(0, 0, 0, 0.35) !important; }
    .dark .border-black\/10, .dark .border-black\/20 { border-color: rgba(255, 255, 255, 0.35) !important; }
}

/* H3 tiny-mobile clamp - prevents layout breakage below 380px width */
@media (max-width: 380px) {
    .giant-display-text {
        font-size: clamp(2rem, 11vw, 3.25rem) !important;
        margin-left: -0.5rem !important;
        margin-right: -0.5rem !important;
    }
    #robot-hero-img {
        margin-right: -10% !important;
        height: 160% !important;
    }
    .main-card-container { padding: 1rem !important; }
    #system-running-clock { display: none; }
}

/* H4 landscape phone - flattens the card so content fits horizontally */
@media (orientation: landscape) and (max-height: 500px) {
    .main-card-container {
        min-height: 100dvh !important;
        padding: 0.75rem !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    .bg-waves-wrapper { display: none !important; }
    main { margin-top: 0.25rem !important; gap: 0.25rem !important; }
    .giant-display-text { font-size: clamp(2rem, 9vh, 5rem) !important; }
    #robot-hero-img { height: 140% !important; margin-right: -10% !important; }
    /* Keep a slim compliance row accessible (GDPR accessibility in landscape) */
    footer .grid { display: none !important; }
    footer { padding-top: 0.5rem !important; margin-top: 0.5rem !important; }
    footer > div:last-child { display: flex !important; padding-top: 0.5rem !important; gap: 0.75rem !important; font-size: 9px !important; }
    #cookie-consent-banner { display: none !important; }
}

/* Accessibility: Support prefers-reduced-motion configuration */
@media (prefers-reduced-motion: reduce) {
    .robot-movement, .robot-patrolling, .wave, .floating-pill-1, .floating-pill-2, .floating-pill-3, .banner-bobble {
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Custom styled token buttons for Support page */
.token-btn {
    background-color: rgba(255, 255, 255, 0.01) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.token-btn span.amount {
    color: #3F3F46 !important; /* zinc-700 */
    transition: color 0.25s ease !important;
}
.token-btn span.currency {
    color: #71717A !important; /* zinc-500 */
    transition: color 0.25s ease !important;
}
/* Active state */
.token-btn.active {
    background-color: #E5A93B !important; /* brandGold */
    border-color: #E5A93B !important;
}
.token-btn.active span.amount {
    color: #000000 !important;
}
.token-btn.active span.currency {
    color: rgba(0, 0, 0, 0.6) !important;
}

/* Light mode overrides for token buttons (default is light mode) */
#luxury-dialogue-overlay .token-btn {
    background-color: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
#luxury-dialogue-overlay .token-btn span.amount {
    color: #1A1A1A !important;
}
#luxury-dialogue-overlay .token-btn span.currency {
    color: #52525B !important; /* zinc-600 */
}
#luxury-dialogue-overlay .token-btn.active {
    background-color: #E5A93B !important;
    border-color: #E5A93B !important;
}
#luxury-dialogue-overlay .token-btn.active span.amount {
    color: #000000 !important;
}
#luxury-dialogue-overlay .token-btn.active span.currency {
    color: rgba(0, 0, 0, 0.6) !important;
}

/* Dark mode overrides for token buttons */
.dark #luxury-dialogue-overlay .token-btn {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}
.dark #luxury-dialogue-overlay .token-btn span.amount {
    color: #A1A1AA !important; /* zinc-400 */
}
.dark #luxury-dialogue-overlay .token-btn span.currency {
    color: #E4E4E7 !important; /* zinc-200 for maximum legibility */
}
.dark #luxury-dialogue-overlay .token-btn.active {
    background-color: #E5A93B !important;
    border-color: #E5A93B !important;
}
.dark #luxury-dialogue-overlay .token-btn.active span.amount {
    color: #000000 !important;
}
.dark #luxury-dialogue-overlay .token-btn.active span.currency {
    color: rgba(0, 0, 0, 0.6) !important;
}

/* Dialogue form input contrast overrides */
#custom-token-input {
    background-color: #FFFFFF !important;
    color: #1A1A1A !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}
#custom-token-input::placeholder {
    color: #71717A !important; /* zinc-500 */
}

.dark #custom-token-input {
    background-color: rgba(0, 0, 0, 0.4) !important;
    color: #FFFFFF !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}
.dark #custom-token-input::placeholder {
    color: #52525B !important; /* zinc-600 */
}

/* Hide native number input spinners to prevent overlap with inner layout tags */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
}


/* ===========================================================================
   LOWEFORD LEGAL EMBED — style hooks for loweford-legal.js
   Central legal documents render into [data-legal-doc] placeholders
   (dialogue overlay routes: #terms, #privacy, #cookie, #dpa).
   Structural spacing + the dialogue renderer's own header/paragraph
   treatment, so embedded legal pages look native to the site.
   =========================================================================== */
.ll-legal__meta {
    color: rgb(161 161 170);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .65rem;
    opacity: .65;
    margin: 0 0 1.25em;
}
.ll-legal__section { margin: 0 0 1.5em; }
.ll-legal__heading {
    color: #fff;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 0 0 .5em;
}
.ll-legal__text {
    color: rgb(161 161 170);
    font-size: .875rem;
    line-height: 1.625;
    font-weight: 300;
    margin: 0 0 .75em;
}
.ll-legal__text a { color: #d4a017; }
.ll-legal__text a:hover { text-decoration: underline; }
.ll-legal__list { margin: 0 0 .75em; padding-left: 1.25em; }
.ll-legal__list li {
    color: rgb(161 161 170);
    font-size: .875rem;
    line-height: 1.625;
    font-weight: 300;
    margin-bottom: .35em;
}
