@font-face {
    font-family: 'Roboto Fallback';
    src: local('Arial'), local('Helvetica'), local('Liberation Sans'), local('Noto Sans');
}
@font-face {
    font-family: 'Orbitron Fallback';
    src: local('Arial Black'), local('Impact'), local('Roboto Black');
}
@font-face {
    font-family: 'Caveat Fallback';
    src: local('Segoe Print'), local('Bradley Hand'), local('Comic Sans MS');
}
:root {
    --bg-color: #fff;
    --text-color: #222;
    --toggle-bg: #e0e0e0;
    --toggle-color: var(--text-color);
    --nav-height: 56px;
}
[data-theme="dark"] {
    --bg-color: #1B0033;
    --text-color: #fafafa;
    --toggle-bg: #333;
    --toggle-color: var(--text-color);
}
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: 'Roboto', 'Roboto Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    font-size-adjust: 0.5;
    min-height: 100vh;
    background: var(--bg-color);
    transition: background 0.3s;
    color: var(--text-color);
    padding-top: var(--nav-height);
}
.center-text {
    font-size: 5.5rem;
    font-family: 'Orbitron', 'Orbitron Fallback', Arial, sans-serif;
    font-size-adjust: 0.55;
    letter-spacing: 2px;
    color: var(--text-color);
    text-align: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.08);
    animation: titleColorPulse 60s ease-in-out infinite;
}
@keyframes titleColorPulse {
    0% {
        color: var(--text-color);
    }
    12.5% {
        color: #00b3ff;
    }
    25% {
        color: var(--text-color);
    }
    37.5% {
        color: #e25555;
    }
    50% {
        color: var(--text-color);
    }
    62.5% {
        color: #19c37d;
    }
    75% {
        color: var(--text-color);
    }
    87.5% {
        color: #ffe066;
    }
    100% {
        color: var(--text-color);
    }
}
.theme-toggle {
    position: fixed;
    top: calc(var(--nav-height) + 12px);
    right: 20px;
    background: #333;
    color: #fafafa;
    border: none;
    border-radius: 16px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s, color 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.theme-toggle i {
    font-size: 1.25em;
    vertical-align: middle;
    margin-right: 0.5em;
    color: #ffd43b; /* yellow */
    text-shadow: 0 2px 6px rgba(0,0,0,0.22);
}
.theme-toggle:focus {
    outline: 2px solid #888;
}
.subtitle {
    font-weight: bold;
    font-size: 1.8rem;
    font-family: 'Caveat', 'Caveat Fallback', cursive;
    font-size-adjust: 0.6;
    color: var(--text-color);
    opacity: 0.85;
    margin-top: 0.5em;
    text-align: right;
    letter-spacing: 1px;
}
/* Full-height sections */
.section {
    min-height: 100vh;
    padding: 4rem 1rem 80px; /* bottom padding to clear fixed bottom nav */
}
/* Left fixed vertical social sidebar */
.social-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 6px;
    z-index: 1040; /* above content, below modals */
}
.social-btn {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    color: var(--text-color);
    background: transparent;
    border-radius: 10px;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease, transform 0.1s ease;
}
.social-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    transform: translateX(2px);
}
[data-theme="dark"] .social-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}
.social-btn i {
    font-size: 1.5rem;
}
/* Bottom nav link underline via bottom border */
#bottom-nav .nav-link {
    border-bottom: 2px solid transparent;
    padding-bottom: 0.35rem; /* space for border */
}
#bottom-nav .nav-link.active {
    border-bottom-color: currentColor;
}
/* Circular image utility */
.img-circle {
    /* Keep width responsive (inherited or constrained by parent) */
    aspect-ratio: 1 / 1; /* ensure a square box */
    border-radius: 50%; /* make it a circle */
    object-fit: cover; /* crop to fill the circle without distortion */
    overflow: hidden; /* ensure no overflow outside the circle */
    display: inline-block; /* play nice with inline images */
}
/* Cookie banner (mobile-first) */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1045; /* above content/sidebars (1040), below Bootstrap backdrop (1050)/modal (1055) */
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.15);
}
.cookie-text {
    line-height: 1.4;
    font-size: 0.95rem;
}
.cookie-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.cookie-actions .btn {
    width: 100%;
}

/* At >= 768px, float banner as compact box bottom-right and arrange actions in a row */
@media (min-width: 768px) {
    .cookie-banner {
        left: 20px;
        right: auto;
        bottom: 20px;
        max-width: 560px;
        border-top: none;
        border-radius: 0.5rem;
        padding: 16px 18px;
        gap: 12px;
    }
    .cookie-actions {
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
        gap: 10px;
    }
    .cookie-actions .btn {
        width: auto;
    }
}

/* Footer link decoration: none by default; underline on hover/focus for clarity */
footer a {
    text-decoration: none;
}
footer a:hover,
footer a:focus {
    text-decoration: underline;
}
.text-theme {
    color: var(--text-color);
}
.opacity-85 {
    opacity: 0.85;
}
.flash-float-wrap {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    display: grid;
    gap: .75rem;
}
.flash-float {
    min-width: 280px;
    max-width: min(420px, 90vw);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: .9rem;
    box-shadow: 0 12px 28px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.12);
    animation: flash-in .28s ease-out;
}
.flash-float .card-body { padding: .85rem 1rem; }
.flash-float i { margin-top: .15rem; }
.flash-float.is-success {
    background: rgba(35, 134, 54, .12);
    border: 1px solid rgba(35, 134, 54, .25);
    color: #155b34;
}
.flash-float.is-danger {
    background: rgba(190, 18, 60, .12);
    border: 1px solid rgba(190, 18, 60, .25);
    color: #7a1a1a;
}
@keyframes flash-in {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
/* Dark theme: increase visibility and contrast for danger flash */
[data-theme="dark"] .flash-float.is-danger {
    background: rgba(220, 53, 69, .28);
    border: 1px solid rgba(220, 53, 69, .55);
    color: #ffe6ea;
}
[data-theme="dark"] .flash-float.is-danger i {
    color: #ff8c9b;
}
[data-theme="dark"] .flash-float .btn-close {
    filter: invert(1) grayscale(100%);
    opacity: .9;
}

/* Dark theme: increase visibility and contrast for success flash */
[data-theme="dark"] .flash-float.is-success {
    background: rgba(25, 135, 84, .30); /* Bootstrap success base, higher alpha */
    border: 1px solid rgba(25, 135, 84, .60);
    color: #e6ffef; /* light mint text for contrast */
}
[data-theme="dark"] .flash-float.is-success i {
    color: #7cffb8; /* bright mint icon */
}