/* --- variables --- */
:root {
    --bg-color: #121212;
    --card-color: #1e1e1e;
    --primary-color: #7289da;
    --primary-hover: #677bc4;
    --secondary-color: #2c2f33;
    --secondary-hover: #3c3f44;
    --text-color: #ffffff;
    --text-muted-color: #b9bbbe;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --border-radius: 24px;
    --font-size: 16px;
}

/* --- high contrast themes --- */
body.high-contrast-1 {
    --bg-color: #000000;
    --card-color: #1a1a1a;
    --primary-color: #00ffff; /* Cyan */
    --primary-hover: #00dddd;
    --text-color: #ffffff;
    --text-muted-color: #cccccc;
}

body.high-contrast-2 {
    --bg-color: #ffffff;
    --card-color: #f0f0f0;
    --primary-color: #0000ff; /* Blue */
    --primary-hover: #0000cc;
    --secondary-color: #ff00ff; /* Magenta */
    --secondary-hover: #cc00cc;
    --text-color: #000000;
    --text-muted-color: #333333;
}

body.high-contrast-1 .btn-primary,
body.high-contrast-2 .btn-primary {
    color: #ffffff; /* White text for high-contrast buttons */
}

body.high-contrast-2 .btn-primary {
    color: #ffffff; /* White text for high-contrast buttons */
}

body.animations-paused * {
    animation: none !important;
    transition: none !important;
}

/* --- global styles --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size);
    background-color: var(--bg-color);
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    display: grid;
    place-items: center;
    height: 100%;
    padding: 2rem 1rem;
    transition: background-color 0.3s, color 0.3s;
}

body.video-on {
    background-color: transparent;
}

body.video-off {
    background-color: var(--bg-color);
}

.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.video-background video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(8px) brightness(0.2);
    transition: filter 0.5s ease;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body.video-paused .video-background video {
    filter: blur(0) brightness(0.4);
}

body.video-off .video-background {
    display: none;
}

/* --- layout containers --- */
.main-container {
    width: 100%;
    max-width: 900px;
    text-align: center;
}

/* --- card styles --- */
.card {
    background-color: var(--card-color);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 16px var(--shadow-color), 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out;
}

.card h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.tagline {
    color: var(--text-muted-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.logo {
    max-width: 100px;
    height: auto;
}

/* --- button styles --- */
.button-group {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.8rem 1.75rem;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    flex-grow: 1;
    max-width: 200px;
}

.btn-icon {
    font-size: 1.25rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(114, 137, 218, 0.25);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-3px);
}

/* --- Tooltip --- */
.tooltip-wrapper .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 10;
    top: calc(100% + 1rem);
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s ease, visibility 0.3s ease;
    width: 300px;
    text-align: left;
}

.tooltip-wrapper .btn {
    width: 100%;
}

.tooltip {
    display: none; /* Hidden by default */
    position: absolute;
    bottom: calc(100% + 1rem); /* Position above the button with a gap */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--card-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 16px var(--shadow-color);
    z-index: 100;
    width: 370px; /* iframe width + padding */
}

/* Show tooltip only on devices that support hover */
@media (hover: hover) {
    .tooltip-wrapper:hover .tooltip {
        display: block;
        visibility: visible;
        opacity: 1;
        transition: opacity 0.3s, visibility 0.3s;
    }
}

/* --- about page --- */
.about-card {
    max-width: 700px;
    position: relative;
    padding: 2.5rem;
    padding-top: 4rem;
    text-align: left;
    align-items: flex-start;
}

.back-button {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: var(--text-muted-color);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.2s;
}

.back-button:hover {
    background-color: var(--secondary-hover);
    color: var(--text-color);
    transform: scale(1.1);
}

.back-button i {
    transition: transform 0.2s ease-in-out;
}

.back-button:hover i {
    transform: translateX(-3px);
}

.feature-content-wrapper {
    width: 100%;
    min-height: 160px;
}

.feature-content {
    display: none;
}

.feature-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.feature-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.feature-content p {
    color: var(--text-muted-color);
    line-height: 1.7;
    font-size: 1.1rem;
}

.feature-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    max-width: 700px;
}

.nav-btn {
    background-color: var(--secondary-color);
    color: var(--text-muted-color);
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(114, 137, 218, 0.2);
}

.nav-btn:not(.active):hover {
    background-color: var(--secondary-hover);
    color: var(--text-color);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- footer --- */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    text-align: center;
    opacity: 0.3;
    transition: opacity 0.3s ease-in-out;
    font-size: 0.8rem;
    color: var(--text-muted-color);
    pointer-events: none;
}

body:hover footer {
    opacity: 1;
    pointer-events: all;
}

/* --- accessibility --- */
.accessibility-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

#accessibility-toggle {
    background-color: var(--card-color);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 8px var(--shadow-color);
    display: grid;
    place-items: center;
    transition: transform 0.3s ease, background-color 0.2s;
    font-size: 1.5rem;
}

#accessibility-toggle.open {
    transform: rotate(45deg);
}

#accessibility-toggle:hover {
    transform: scale(1.1);
    background-color: var(--secondary-hover);
}

.accessibility-panel {
    position: absolute;
    bottom: 65px;
    right: 0;
    width: 250px;
    background-color: var(--card-color);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 8px 16px var(--shadow-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(10px);
    visibility: hidden;
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

.accessibility-panel.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.accessibility-panel h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    text-align: center;
}

.panel-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s;
}

.panel-btn:hover {
    background-color: var(--secondary-hover);
}

/* --- responsive design --- */
@media (max-width: 768px) {
    .feature-nav {
        flex-direction: column;
        align-items: center;
    }

    .nav-btn {
        width: 80%;
    }
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
    }
    .card {
        padding: 2rem 1.5rem;
    }
    .button-group {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }
    .btn, .tooltip-container {
        width: 100%;
        max-width: none;
    }
    .about-card {
        padding: 1.5rem;
        padding-top: 4rem;
    }
    .feature-content-wrapper {
        min-height: 220px;
    }
    footer {
        opacity: 1;
        position: relative;
        margin-top: 2rem;
        padding-bottom: 0;
    }
}