/* Custom styles for the mirrored 'e' in logo */
.mirrored-e {
    display: inline-block;
    transform: scale(-1, 1);
    position: relative;
    margin: 0 0.05em; /* Add slight spacing around the e */
    text-shadow: 0 0 1px rgba(59, 130, 246, 0.5); /* Subtle glow effect */
}
.logo {
    font-family: 'Roboto', sans-serif;
    font-weight: 100; /* Thin weight for slimmer appearance */
    font-size: 2.5rem; /* Bigger letters */
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Base styles */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light mode defaults */
:root {
    color-scheme: light;
}

/* Dark mode */
.dark {
    color-scheme: dark;
}

/* Base transitions */
* {
    transition-property: background-color, border-color, color;
    transition-duration: 200ms;
}

/* 3D Cube Styles */
.cube-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px; /* Fixed width */
    height: 200px; /* Fixed height */
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    z-index: 5;
}

.cube {
    position: relative;
    width: 200px; /* Fixed width */
    height: 200px; /* Fixed height */
    will-change: transform;
    transform-style: preserve-3d;
    animation: rotateCube 30s infinite linear;
}

.face {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(59, 130, 246, 0.5);
    background-color: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.dark .face {
    border-color: rgba(96, 165, 250, 0.5);
    background-color: rgba(96, 165, 250, 0.1);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.3);
}

.face.front { transform: translateZ(100px); }
.face.back { transform: rotateY(180deg) translateZ(100px); }
.face.left { transform: rotateY(-90deg) translateZ(100px); }
.face.right { transform: rotateY(90deg) translateZ(100px); }
.face.top { transform: rotateX(90deg) translateZ(100px); }
.face.bottom { transform: rotateX(-90deg) translateZ(100px); }

@keyframes rotateCube {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}
@keyframes rotateCube {
    to { transform: rotateX(360deg) rotateY(360deg); }
}

@media (max-width: 768px) {
    .cube-container {
        position: relative;
        transform: translate(0, 0);
        left: auto;
        top: auto;
        margin: 2rem auto;
    }

    .cube {
        transform-origin: center center;
    }
}

/* Focus styles for better accessibility */
a:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Ensure sufficient color contrast */
.text-contrast {
    color: #1a365d; /* Dark blue for light backgrounds */
}

.dark .text-contrast {
    color: #93c5fd; /* Light blue for dark backgrounds */
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1d4ed8;
    color: white;
    padding: 8px;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

*:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.focus-visible:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563eb;
}