/**
 * Aventine Studio - Wild Glass UI Theme
 * Tropical Forest After Rain at Dusk
 * 
 * Color Palette:
 * - Ruby Leaf: #852E47
 * - Moss Shadow: #305A4A (UPDATED)
 * - Indigo Rain: #0D244D
 * - Burnt Nectar: #C2441C
 * - Deep Plum: #533849
 *
 * @package Aventine_Studio
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    /* Brand Colors - Tropical Forest After Rain */
    --color-ruby: #852E47;
    --color-ruby-light: #a33d5c;
    --color-ruby-dark: #6b243a;
    --color-ruby-glow: rgba(133, 46, 71, 0.4);
    
    --color-moss: #305A4A;
    --color-moss-light: #3d7360;
    --color-moss-dark: #254839;
    --color-moss-glow: rgba(48, 90, 74, 0.4);
    
    --color-indigo: #0D244D;
    --color-indigo-light: #1a3a6e;
    --color-indigo-dark: #081830;
    --color-indigo-glow: rgba(13, 36, 77, 0.4);
    
    --color-burnt: #C2441C;
    --color-burnt-light: #d65a32;
    --color-burnt-dark: #9a3616;
    --color-burnt-glow: rgba(194, 68, 28, 0.4);
    
    --color-plum: #533849;
    --color-plum-light: #6d4a5e;
    --color-plum-dark: #3d2936;
    --color-plum-glow: rgba(83, 56, 73, 0.4);
    
    /* Neutrals */
    --color-white: #FFFFFF;
    --color-off-white: #F0EDE8;
    --color-cream: #F5F0EB;
    --color-light-gray: #E8E4E0;
    --color-medium-gray: #9AA0A6;
    --color-dark-gray: #5F6368;
    --color-ink: #1a1a1a;
    --color-ink-soft: #2d2a35;
    
    /* Typography */
    --font-primary: 'Poppins', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', 'Source Sans Pro', system-ui, sans-serif;
    --font-serif: 'Source Serif Pro', Georgia, serif;
    
    /* Wild Glass Properties */
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-bg-hover: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    --glass-blur: 20px;
    --glass-blur-strong: 32px;
    
    /* Transitions */
    --transition-fast: 180ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 450ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Safe Areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-off-white);
    background: var(--color-ink);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Internal pages - dark text on light background */
body:not(.home) {
    color: var(--color-ink);
    background: var(--color-cream);
}

body:not(.home) .page-wrapper {
    color: var(--color-ink);
}

/* ==========================================================================
   Atmospheric Background - Seamless Tropical Forest
   ========================================================================== */

.site-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

/* Background image layer - PRIMARY LAYER */
.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Color overlay for depth */
.background-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: 
        radial-gradient(ellipse 100% 70% at 15% 15%, var(--color-ruby-glow) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 85% 75%, var(--color-moss-glow) 0%, transparent 45%),
        radial-gradient(ellipse 60% 80% at 50% 100%, var(--color-indigo-glow) 0%, transparent 40%),
        radial-gradient(ellipse 50% 40% at 75% 20%, var(--color-plum-glow) 0%, transparent 50%);
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* Subtle texture */
.background-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Animated light leaks - wet reflections */
.background-light-leak {
    position: absolute;
    pointer-events: none;
    mix-blend-mode: soft-light;
    will-change: transform, opacity;
    z-index: 4;
}

.light-leak-1 {
    top: -20%;
    left: -15%;
    width: 70%;
    height: 70%;
    background: radial-gradient(ellipse at center, 
        rgba(194, 68, 28, 0.12) 0%, 
        rgba(133, 46, 71, 0.06) 30%,
        transparent 55%
    );
    animation: floatLeak1 25s ease-in-out infinite;
}

.light-leak-2 {
    bottom: -20%;
    right: -15%;
    width: 80%;
    height: 80%;
    background: radial-gradient(ellipse at center, 
        rgba(48, 90, 74, 0.15) 0%, 
        rgba(13, 36, 77, 0.08) 35%,
        transparent 55%
    );
    animation: floatLeak2 30s ease-in-out infinite;
}

.light-leak-3 {
    top: 40%;
    left: 30%;
    width: 50%;
    height: 50%;
    background: radial-gradient(ellipse at center, 
        rgba(83, 56, 73, 0.1) 0%, 
        transparent 50%
    );
    animation: floatLeak3 20s ease-in-out infinite;
}

/* Water droplet shimmer */
.background-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: 
        radial-gradient(circle 2px at 20% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 100%),
        radial-gradient(circle 1px at 70% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 100%),
        radial-gradient(circle 2px at 40% 70%, rgba(255, 255, 255, 0.12) 0%, transparent 100%),
        radial-gradient(circle 1px at 85% 60%, rgba(255, 255, 255, 0.08) 0%, transparent 100%),
        radial-gradient(circle 1px at 15% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 100%),
        radial-gradient(circle 2px at 60% 45%, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    animation: shimmer 10s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes floatLeak1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
    33% { transform: translate(3%, 2%) scale(1.03); opacity: 0.9; }
    66% { transform: translate(-2%, 1%) scale(0.98); opacity: 0.75; }
}

@keyframes floatLeak2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50% { transform: translate(-2%, -1%) scale(1.02); opacity: 0.8; }
}

@keyframes floatLeak3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.5; }
    50% { transform: translate(5%, -3%) rotate(3deg); opacity: 0.7; }
}

@keyframes shimmer {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ==========================================================================
   Homepage Grid - Smaller blocks with breathing room
   ========================================================================== */

.home-grid-container {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 70px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.home-grid {
    display: grid;
    gap: 20px;
    width: 100%;
    height: 100%;
    max-width: 800px;
    max-height: 550px;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

@media (min-width: 768px) {
    .home-grid-container {
        top: 90px;
        bottom: 80px;
        padding: 40px;
    }
    .home-grid {
        gap: 28px;
        max-width: 1000px;
        max-height: 480px;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .home-grid-container {
        top: 100px;
        bottom: 90px;
        padding: 50px;
    }
    .home-grid {
        gap: 36px;
        max-width: 1150px;
        max-height: 520px;
    }
}

@media (min-width: 1600px) {
    .home-grid-container {
        padding: 60px;
    }
    .home-grid {
        gap: 44px;
        max-width: 1300px;
        max-height: 580px;
    }
}

/* ==========================================================================
   Homepage Header
   ========================================================================== */

.home-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.home-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-logo {
    display: flex;
    align-items: center;
}

.home-logo img {
    max-height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.home-logo-text {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-off-white);
    text-decoration: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    transition: opacity var(--transition-fast);
}

.home-logo-text:hover {
    opacity: 0.85;
    color: var(--color-off-white);
}

@media (min-width: 768px) {
    .home-header {
        padding: 24px 40px;
    }
    .home-logo img {
        max-height: 48px;
    }
    .home-logo-text {
        font-size: 1.6rem;
    }
}

@media (min-width: 1200px) {
    .home-header {
        padding: 28px 50px;
    }
    .home-logo img {
        max-height: 54px;
    }
}

/* ==========================================================================
   Homepage Footer
   ========================================================================== */

.home-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
}

.home-footer-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.home-footer-links {
    display: flex;
    gap: 20px;
}

.home-footer-link {
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.home-footer-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

.home-footer-copyright {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
}

.home-footer-social {
    display: flex;
    gap: 12px;
}

.home-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    transition: 
        color var(--transition-fast),
        background var(--transition-fast),
        transform var(--transition-fast);
}

.home-social-icon:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

@media (min-width: 768px) {
    .home-footer {
        padding: 20px 40px;
    }
    .home-footer-content {
        justify-content: space-between;
    }
    .home-footer-link {
        font-size: 0.8rem;
    }
    .home-footer-copyright {
        font-size: 0.75rem;
    }
}

@media (min-width: 1200px) {
    .home-footer {
        padding: 22px 50px;
    }
}

/* ==========================================================================
   Wild Glass Tile
   ========================================================================== */

.tile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    isolation: isolate;
    transform: translateZ(0);
    transition: 
        transform var(--transition-normal),
        box-shadow var(--transition-normal);
}

.tile:hover {
    transform: scale(1.015) translateZ(0);
    z-index: 20;
}

.tile:active {
    transform: scale(0.995) translateZ(0);
}

.tile:focus-visible {
    outline: 2px solid var(--color-burnt);
    outline-offset: 4px;
}

@media (min-width: 768px) {
    .tile {
        border-radius: 22px;
    }
}

@media (min-width: 1200px) {
    .tile {
        border-radius: 26px;
    }
}

/* ==========================================================================
   Glass Layers
   ========================================================================== */

/* Base glass layer with blur */
.tile-glass-layer {
    position: absolute;
    inset: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: inherit;
    transition: 
        background var(--transition-normal),
        border-color var(--transition-normal),
        backdrop-filter var(--transition-normal);
}

.tile:hover .tile-glass-layer {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    backdrop-filter: blur(var(--glass-blur-strong));
    -webkit-backdrop-filter: blur(var(--glass-blur-strong));
}

/* Color accent layer - tinted glass */
.tile-accent {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0.85;
    transition: opacity var(--transition-normal);
}

.tile:hover .tile-accent {
    opacity: 0.95;
}

/* Wet glass refraction effect */
.tile-refraction {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: 
        linear-gradient(145deg, 
            rgba(255, 255, 255, 0.12) 0%, 
            transparent 40%,
            transparent 60%,
            rgba(255, 255, 255, 0.04) 100%
        );
    opacity: 0.5;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.tile:hover .tile-refraction {
    opacity: 0.8;
}

/* ==========================================================================
   Chess Pattern - Indigo Rain & Moss Shadow (Glowing Accents)
   ========================================================================== */

/* Indigo Rain - deep blue tones */
.tile--chess-a .tile-accent {
    background: linear-gradient(155deg, 
        rgba(13, 36, 77, 0.6) 0%,
        rgba(8, 24, 48, 0.65) 40%,
        rgba(26, 58, 110, 0.5) 100%
    );
    box-shadow: 
        inset 0 0 60px rgba(13, 36, 77, 0.25),
        inset 0 -30px 50px rgba(8, 24, 48, 0.2),
        0 0 40px rgba(13, 36, 77, 0.12);
}

.tile--chess-a:hover .tile-accent {
    box-shadow: 
        inset 0 0 80px rgba(13, 36, 77, 0.35),
        inset 0 -30px 60px rgba(8, 24, 48, 0.25),
        0 0 60px rgba(13, 36, 77, 0.18);
}

/* Moss Shadow - cool green tones */
.tile--chess-b .tile-accent {
    background: linear-gradient(155deg, 
        rgba(48, 90, 74, 0.6) 0%,
        rgba(37, 72, 57, 0.65) 40%,
        rgba(61, 115, 96, 0.5) 100%
    );
    box-shadow: 
        inset 0 0 60px rgba(48, 90, 74, 0.25),
        inset 0 -30px 50px rgba(37, 72, 57, 0.2),
        0 0 40px rgba(48, 90, 74, 0.12);
}

.tile--chess-b:hover .tile-accent {
    box-shadow: 
        inset 0 0 80px rgba(48, 90, 74, 0.35),
        inset 0 -30px 60px rgba(37, 72, 57, 0.25),
        0 0 60px rgba(48, 90, 74, 0.18);
}

/* Top highlight - curved glass effect */
.tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.25) 30%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0.25) 70%,
        transparent 100%
    );
    z-index: 5;
}

/* Bottom shadow for depth */
.tile::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 0, 0, 0.2) 50%,
        transparent 100%
    );
    z-index: 5;
}

/* ==========================================================================
   Tile Content - Icon/Text Swap
   ========================================================================== */

.tile-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}

/* Text label */
.tile-label {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-burnt);
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(194, 68, 28, 0.2);
    margin: 0;
    opacity: 1;
    transform: translateY(0);
    transition: 
        opacity var(--transition-normal),
        transform var(--transition-normal);
}

@media (min-width: 768px) {
    .tile-label {
        font-size: 1.2rem;
        letter-spacing: 0.05em;
    }
}

@media (min-width: 1200px) {
    .tile-label {
        font-size: 1.4rem;
        letter-spacing: 0.06em;
    }
}

/* Hide text on hover */
.tile:hover .tile-label {
    opacity: 0;
    transform: translateY(-8px);
}

/* Icon container */
.tile-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    color: var(--color-burnt);
    opacity: 0;
    transform: scale(0.85);
    transition: 
        opacity var(--transition-normal),
        transform var(--transition-bounce);
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.4));
}

.tile-icon svg {
    width: 100%;
    height: 100%;
}

@media (min-width: 768px) {
    .tile-icon {
        width: 60px;
        height: 60px;
    }
}

@media (min-width: 1200px) {
    .tile-icon {
        width: 68px;
        height: 68px;
    }
}

/* Show icon on hover with scale-up */
.tile:hover .tile-icon {
    opacity: 1;
    transform: scale(1.06);
}

/* External link badge */
.tile-external-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.5);
    transition: 
        background var(--transition-fast),
        color var(--transition-fast);
}

.tile:hover .tile-external-badge {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   Tile Shine Effect
   ========================================================================== */

.tile-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        110deg,
        transparent 35%,
        rgba(255, 255, 255, 0.03) 42%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(255, 255, 255, 0.03) 58%,
        transparent 65%
    );
    transform: translateX(-120%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.tile:hover .tile-shine {
    opacity: 1;
    animation: shine 0.9s ease forwards;
}

@keyframes shine {
    to { transform: translateX(120%); }
}

/* ==========================================================================
   Loading State (Page Transition)
   ========================================================================== */

.tile-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: inherit;
    border-radius: inherit;
    opacity: 0;
    visibility: hidden;
    z-index: 50;
    transition: 
        opacity var(--transition-normal),
        visibility var(--transition-normal);
}

.tile-loading-icon {
    width: 56px;
    height: 56px;
    color: var(--color-burnt);
    filter: drop-shadow(0 2px 15px rgba(0, 0, 0, 0.5));
}

.tile-loading-icon svg {
    width: 100%;
    height: 100%;
}

.tile.is-loading .tile-loading {
    opacity: 1;
    visibility: visible;
}

.tile.is-loading .tile-content {
    opacity: 0;
}

.tile.is-loading .tile-loading-icon svg {
    animation: loadingPulse 1.2s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { 
        opacity: 0.5; 
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(194, 68, 28, 0.3));
    }
    50% { 
        opacity: 1; 
        transform: scale(1.08);
        filter: drop-shadow(0 0 25px rgba(194, 68, 28, 0.5));
    }
}

/* Icon dissolve after page load */
.tile.is-loaded .tile-loading-icon {
    animation: iconDissolve 0.5s ease forwards;
}

@keyframes iconDissolve {
    to {
        opacity: 0;
        transform: scale(1.2);
        filter: blur(10px);
    }
}

/* ==========================================================================
   Page Transition Overlay
   ========================================================================== */

.page-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.page-transition-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* CRITICAL: Ensure overlay is always hidden on page load */
body:not(.page-transitioning) .page-transition-overlay {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
}

/* CRITICAL: Ensure page content is ALWAYS visible on non-home pages */
body:not(.home) .page-wrapper {
    position: relative !important;
    z-index: 50 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #F5F0EB !important;
}

body:not(.home) .page-content {
    position: relative !important;
    z-index: 100 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body:not(.home) .page-body {
    position: relative !important;
    z-index: 100 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hide homepage-only elements on other pages */
body:not(.home) .site-background,
body:not(.home) .home-grid-container,
body:not(.home) .home-header,
body:not(.home) .home-footer {
    display: none !important;
}

/* Back button should not block content */
.back-to-main {
    position: fixed;
    top: calc(var(--safe-top) + 16px);
    left: 16px;
    z-index: 100;
    pointer-events: auto;
    /* Ensure it doesn't expand beyond its content */
    width: auto !important;
    height: auto !important;
    right: auto !important;
    bottom: auto !important;
}

.transition-blur {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(13, 36, 77, 0.7) 0%,
        rgba(48, 90, 74, 0.5) 50%,
        rgba(83, 56, 73, 0.6) 100%
    );
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

/* Page exit animation */
body.page-transitioning .site-background,
body.page-transitioning .home-grid-container {
    opacity: 0;
    transform: scale(0.96);
    filter: blur(15px);
    transition: all var(--transition-slow);
}

/* Page enter animation */
body.page-entering .site-background,
body.page-entering .home-grid-container,
body.page-entering .page-wrapper {
    animation: pageEnter 0.6s ease forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: scale(0.96);
        filter: blur(15px);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/* ==========================================================================
   Glass Back Button
   ========================================================================== */

/* NOTE: .back-to-main styles are now defined earlier in the file for proper z-index handling */

.glass-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--color-indigo);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: 
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast);
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 28px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    color: var(--color-indigo);
}

.glass-button:active {
    transform: translateY(0);
}

.glass-button svg {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-fast);
}

.glass-button:hover svg {
    transform: translateX(-3px);
}

/* ==========================================================================
   Internal Pages - Atmospheric Glass Style
   ========================================================================== */

.page-wrapper {
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Page background - inherits atmospheric feel */
.page-wrapper::before {
    content: '';
    position: fixed;
    inset: 0;
    background: #F5F0EB;
    z-index: -100;
    pointer-events: none;
}

.page-wrapper::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50vh;
    background: 
        radial-gradient(ellipse 80% 50% at 30% 0%, rgba(133, 46, 71, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 70% 10%, rgba(48, 90, 74, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -99;
}

.page-content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    margin: 0 auto;
    padding: 90px 24px 60px;
    background: transparent;
}

.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-title {
    font-family: var(--font-primary);
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #0D244D !important;
    margin-bottom: 14px;
}

.page-subtitle {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--color-dark-gray);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Page Body Content */
.page-body {
    position: relative;
    z-index: 10;
    color: #1a1a1a !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure Pagelayer content in page-body is always visible */
.page-body [class*="pagelayer-"],
.page-body .pagelayer-row,
.page-body .pagelayer-col,
.page-body .pagelayer-ele {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #1a1a1a !important;
}

.page-body p {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.8;
    color: #2d2a35 !important;
    margin-bottom: 1.5em;
}

.page-body h2 {
    font-size: 1.6rem;
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: #0D244D !important;
}

.page-body h3 {
    font-size: 1.3rem;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #0D244D !important;
}

.page-body ul, .page-body ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
    color: var(--color-ink-soft);
}

.page-body li {
    margin-bottom: 0.5em;
    line-height: 1.7;
}

.page-body a {
    color: var(--color-burnt);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.page-body a:hover {
    color: var(--color-burnt-dark);
}

.page-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5em 0;
}

.page-body blockquote {
    border-left: 3px solid var(--color-burnt);
    padding-left: 1.5em;
    margin: 1.5em 0;
    font-style: italic;
    color: var(--color-dark-gray);
}

/* Page Article */
.page-article {
    position: relative;
    z-index: 1;
}

/* Single Post */
.single-post {
    position: relative;
    z-index: 1;
}

.post-featured-image {
    margin-bottom: 2em;
    border-radius: 16px;
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
}

.post-meta {
    color: #5F6368;
    font-size: 0.9rem;
}

.post-categories,
.post-tags {
    margin-bottom: 1em;
}

.author-box {
    background: #fff;
    padding: 2em;
    border-radius: 16px;
    margin-top: 2em;
    border: 1px solid #E8E4E0;
}

.author-box h4 {
    color: #0D244D !important;
}

.author-box p {
    color: #5F6368 !important;
}

.post-navigation {
    margin-top: 2em;
    padding-top: 2em;
    border-top: 1px solid #E8E4E0;
}

.post-navigation a {
    color: #0D244D;
    text-decoration: none;
}

.post-navigation a:hover {
    color: #C2441C;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    gap: 2em;
}

.post-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.post-card h2 {
    color: #0D244D !important;
    font-size: 1.25rem;
    margin-bottom: 0.5em;
}

.post-card p {
    color: #5F6368 !important;
}

.page-featured-image {
    margin-bottom: 2em;
    border-radius: 16px;
    overflow: hidden;
}

.page-featured-image img {
    width: 100%;
    height: auto;
}

/* Project content - same as page-body */
.project-content {
    position: relative;
    z-index: 1;
    color: var(--color-ink);
}

.project-content p {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-ink-soft);
    margin-bottom: 1.5em;
}

.project-content h2 {
    font-size: 1.6rem;
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: var(--color-indigo);
}

.project-content h3 {
    font-size: 1.3rem;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--color-indigo);
}

.project-content ul, .project-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
    color: var(--color-ink-soft);
}

.project-content li {
    margin-bottom: 0.5em;
    line-height: 1.7;
}

.project-content a {
    color: var(--color-burnt);
    text-decoration: underline;
}

.project-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5em 0;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-indigo);
    line-height: 1.3;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.15rem; }

p {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--color-dark-gray);
}

a {
    color: var(--color-burnt);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-burnt-light);
}

/* Text on dark glass */
.on-glass {
    color: var(--color-off-white);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Text on light glass */
.on-light-glass {
    color: var(--color-plum);
}

/* ==========================================================================
   Contact Form - Wild Glass Style
   ========================================================================== */

.contact-form-wrapper {
    max-width: 540px;
    margin: 0 auto;
    padding: 36px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 22px;
    box-shadow: 
        0 8px 40px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(133, 46, 71, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-indigo);
    margin-bottom: 7px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 13px 16px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-ink);
    background: rgba(255, 255, 255, 0.75);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    transition: 
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-burnt);
    background: var(--color-white);
    box-shadow: 
        0 0 0 3px rgba(194, 68, 28, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.04);
}

.form-input.error,
.form-textarea.error {
    border-color: var(--color-ruby);
}

.form-textarea {
    min-height: 130px;
    resize: vertical;
}

.form-error {
    display: none;
    font-size: 0.8rem;
    color: var(--color-ruby);
    margin-top: 5px;
}

.form-error.visible {
    display: block;
}

.form-submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-white);
    background: linear-gradient(135deg, var(--color-burnt) 0%, var(--color-ruby) 100%);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    box-shadow: 
        0 4px 14px rgba(194, 68, 28, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: 
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 22px rgba(194, 68, 28, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.form-submit:active {
    transform: translateY(0);
}

.form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.form-message {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 22px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.form-message.error {
    background: rgba(133, 46, 71, 0.1);
    color: var(--color-ruby);
    border: 1px solid rgba(133, 46, 71, 0.2);
}

/* ==========================================================================
   Footer - Glass Style
   ========================================================================== */

.site-footer {
    padding: 28px 24px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.footer-links {
    display: flex;
    gap: 22px;
}

.footer-link {
    font-size: 0.85rem;
    color: var(--color-medium-gray);
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--color-burnt);
}

.footer-copyright {
    font-size: 0.8rem;
    color: var(--color-medium-gray);
    opacity: 0.65;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 50%;
    color: var(--color-medium-gray);
    transition: 
        background var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
}

.social-icon:hover {
    background: var(--color-burnt);
    color: var(--color-white);
    transform: translateY(-2px);
}

.social-icon svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Gallery & Media - Glass Containers
   ========================================================================== */

.gallery-container,
.video-container,
.media-container {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 
        0 6px 30px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition-normal);
}

.gallery-item:hover img {
    transform: scale(1.03);
}

/* ==========================================================================
   WooCommerce - Glass Product Cards
   ========================================================================== */

.woocommerce ul.products li.product,
.wc-block-grid__product {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 
        0 6px 28px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: 
        transform var(--transition-normal),
        box-shadow var(--transition-normal);
}

.woocommerce ul.products li.product:hover,
.wc-block-grid__product:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.woocommerce ul.products li.product img,
.wc-block-grid__product-image img {
    border-radius: 12px;
    margin-bottom: 14px;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.wc-block-grid__product-title {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-indigo);
}

.woocommerce ul.products li.product .price,
.wc-block-grid__product-price {
    color: var(--color-burnt);
    font-weight: 600;
}

.woocommerce ul.products li.product .button,
.wc-block-grid__product .wp-block-button__link {
    background: linear-gradient(135deg, var(--color-burnt) 0%, var(--color-ruby) 100%);
    color: var(--color-white);
    border: none;
    border-radius: 100px;
    padding: 10px 20px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: 
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.woocommerce ul.products li.product .button:hover,
.wc-block-grid__product .wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(194, 68, 28, 0.3);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .page-transition-overlay,
    .tile-shine,
    .background-shimmer,
    .light-leak-1,
    .light-leak-2,
    .light-leak-3 {
        animation: none !important;
    }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .back-to-main,
    .page-transition-overlay,
    .site-background,
    .tile-shine,
    .tile-loading {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .tile {
        border: 1px solid #ccc !important;
        background: white !important;
    }
}

/* ==========================================================================
   No-JS Fallback (Progressive Enhancement)
   ========================================================================== */

.no-js .tile-loading,
.no-js .page-transition-overlay,
.no-js .tile-shine {
    display: none !important;
}

.no-js .tile:hover .tile-label {
    opacity: 1;
    transform: none;
}

.no-js .tile-icon {
    display: none !important;
}

/* ==========================================================================
   Pagelayer Compatibility - Global Content Styles
   ========================================================================== */

/* Pagelayer editable area - MUST be visible */
.pagelayer-editable-area {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #1a1a1a !important;
    background: transparent !important;
}

.pagelayer-editable-area * {
    visibility: visible !important;
}

/* Force dark text on all page content */
body:not(.home) .page-wrapper,
body:not(.home) .page-content,
body:not(.home) .page-body,
body:not(.home) .pagelayer-ele,
body:not(.home) .pagelayer-row,
body:not(.home) .pagelayer-col,
body:not(.home) .pagelayer-inner,
body:not(.home) .pagelayer-wp-title,
body:not(.home) .pagelayer-heading,
body:not(.home) .pagelayer-text,
body:not(.home) .pagelayer-richtext,
body:not(.home) [class*="pagelayer-"],
body:not(.home) article,
body:not(.home) main {
    color: #1a1a1a !important;
}

/* All Pagelayer elements - regardless of page */
.pagelayer-row,
.pagelayer-col,
.pagelayer-wrap,
.pagelayer-inner,
.pagelayer-ele {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Pagelayer text elements */
.pagelayer-text,
.pagelayer-richtext,
.pagelayer-heading,
.pagelayer-ele-text,
[class*="pagelayer-"] p,
[class*="pagelayer-"] span,
[class*="pagelayer-"] h1,
[class*="pagelayer-"] h2,
[class*="pagelayer-"] h3,
[class*="pagelayer-"] h4,
[class*="pagelayer-"] h5,
[class*="pagelayer-"] h6 {
    color: #1a1a1a !important;
    visibility: visible !important;
}

/* Pagelayer specific elements */
body:not(.home) .pagelayer-heading h1,
body:not(.home) .pagelayer-heading h2,
body:not(.home) .pagelayer-heading h3,
body:not(.home) .pagelayer-heading h4,
body:not(.home) .pagelayer-heading h5,
body:not(.home) .pagelayer-heading h6 {
    color: #0D244D !important;
}

body:not(.home) .pagelayer-text p,
body:not(.home) .pagelayer-richtext p,
body:not(.home) .pagelayer-ele p,
body:not(.home) p {
    color: #2d2a35 !important;
}

body:not(.home) .pagelayer-text,
body:not(.home) .pagelayer-richtext,
body:not(.home) .pagelayer-ele-text {
    color: #2d2a35 !important;
}

/* Links in Pagelayer */
body:not(.home) .pagelayer-ele a:not(.pagelayer-btn),
body:not(.home) .pagelayer-text a,
body:not(.home) .pagelayer-richtext a {
    color: #C2441C !important;
}

body:not(.home) .pagelayer-ele a:not(.pagelayer-btn):hover {
    color: #9a3616 !important;
}

/* Lists in Pagelayer */
body:not(.home) .pagelayer-ele ul,
body:not(.home) .pagelayer-ele ol,
body:not(.home) .pagelayer-ele li {
    color: #2d2a35 !important;
}

/* Ensure background is visible */
body:not(.home) {
    background-color: #F5F0EB !important;
}

body:not(.home) .page-wrapper {
    background-color: transparent !important;
}

/* Override any white/transparent text from Pagelayer */
body:not(.home) [style*="color: rgb(255, 255, 255)"],
body:not(.home) [style*="color:#fff"],
body:not(.home) [style*="color: #fff"],
body:not(.home) [style*="color:white"],
body:not(.home) [style*="color: white"] {
    color: #1a1a1a !important;
}

/* Make sure post/page content is always visible */
.entry-content,
.post-content,
.page-body,
.the-content,
article .content {
    color: #1a1a1a !important;
}

.entry-content p,
.post-content p,
.page-body p,
.the-content p {
    color: #2d2a35 !important;
}

.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5, .entry-content h6,
.post-content h1, .post-content h2, .post-content h3,
.page-body h1, .page-body h2, .page-body h3 {
    color: #0D244D !important;
}

/* ==========================================================================
   Pagelayer Editor Styles
   ========================================================================== */

/* Ensure content is visible in Pagelayer editor */
.pagelayer-builder-active .page-wrapper,
.pagelayer-builder-active .page-content,
.pagelayer-builder-active .page-body {
    color: #1a1a1a !important;
    background: #F5F0EB !important;
}

/* Pagelayer elements in editor */
.pagelayer-builder-active [class*="pagelayer-"] {
    color: #1a1a1a !important;
}

.pagelayer-builder-active .pagelayer-ele-text,
.pagelayer-builder-active .pagelayer-text,
.pagelayer-builder-active .pagelayer-richtext {
    color: #2d2a35 !important;
}

/* Frontend: Pagelayer active pages */
body.pagelayer-active .page-wrapper,
body.pagelayer-active .page-content {
    color: #1a1a1a !important;
}

body.pagelayer-active .page-body {
    min-height: 200px;
}

/* Ensure all Pagelayer rows/columns have correct text color */
.pagelayer-row,
.pagelayer-col,
.pagelayer-inner,
.pagelayer-wrap {
    color: inherit;
}

body:not(.home) .pagelayer-row,
body:not(.home) .pagelayer-col,
body:not(.home) .pagelayer-inner,
body:not(.home) .pagelayer-wrap {
    color: #1a1a1a !important;
}

/* Fix for Pagelayer default white text */
body:not(.home) .pagelayer-ele[style*="color"],
body:not(.home) .pagelayer-text[style*="color"],
body:not(.home) [data-pagelayer-id][style*="color"] {
    color: #1a1a1a !important;
}

/* ==========================================================================
   Pagelayer Editor Fix - CRITICAL
   ========================================================================== */

/* Reset styles for Pagelayer iframe editor */
body.pagelayer-iframe,
body.pagelayer-editor-body {
    background: #ffffff !important;
    color: #1a1a1a !important;
}

body.pagelayer-iframe *,
body.pagelayer-editor-body * {
    color: inherit;
}

/* Ensure Pagelayer can render in iframe */
.pagelayer-iframe .page-wrapper,
.pagelayer-iframe .page-content,
.pagelayer-iframe .page-body {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent !important;
}

/* Fix for transition overlay blocking editor */
.pagelayer-iframe .page-transition-overlay,
.pagelayer-editor-body .page-transition-overlay {
    display: none !important;
}

/* Fix back button in editor */
.pagelayer-iframe .back-to-main,
.pagelayer-editor-body .back-to-main {
    display: none !important;
}

/* Pagelayer row/column visibility */
.pagelayer-iframe .pagelayer-row,
.pagelayer-iframe .pagelayer-col,
.pagelayer-iframe .pagelayer-wrap,
.pagelayer-iframe [class*="pagelayer-"] {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Text visibility in editor */
.pagelayer-iframe .pagelayer-text,
.pagelayer-iframe .pagelayer-heading,
.pagelayer-iframe .pagelayer-richtext,
.pagelayer-iframe p,
.pagelayer-iframe h1,
.pagelayer-iframe h2,
.pagelayer-iframe h3,
.pagelayer-iframe span {
    color: #1a1a1a !important;
    visibility: visible !important;
}

/* Remove any backdrop filters that might cause issues */
.pagelayer-iframe .glass-button,
.pagelayer-iframe [class*="glass"] {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #f0f0f0 !important;
}

/* ==========================================================================
   Page Loader - BUTENKO ART Random Animations
   ========================================================================== */

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F0EB;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loader-animations {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.loader-animation {
    display: none;
}

.loader-animation.active {
    display: block;
}

.loader-text {
    font-family: var(--font-primary);
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #1a1a1a;
    opacity: 0.4;
}

/* Disable loader in Pagelayer editor */
.pagelayer-iframe .page-loader,
body.pagelayer-editor-active .page-loader {
    display: none !important;
}
