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

:root {
    --primary-black: #000000;
    --primary-white: #ffffff;
    --light-gray: #f5f5f5;
    --dark-gray: #333333;
    --border-gray: #e0e0e0;

    /* Semantic variables for theming */
    --bg: var(--primary-white);
    --text: var(--primary-black);
    --text-muted: var(--dark-gray);
    --card-bg: var(--light-gray);
    --border-color: var(--border-gray);
    --footer-bg: var(--primary-black);
    --footer-text: var(--primary-white);
    --accent: var(--primary-black);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text-muted);
    line-height: 1.6;
    opacity: 0; /* start hidden for transition; JS will fade in */
    transition: opacity 360ms cubic-bezier(.2,.9,.2,1);
}

/* Navigation */
.navbar {
    background-color: var(--bg);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 2px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

/* Logo placed in the nav-container: push it to the far right */
.logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

/* push menu (links + toggle) to the right when logo is first in container */
.nav-menu {
    margin-left: auto;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent);
}

/* Theme toggle button */
.theme-toggle {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 180ms ease;
}

.theme-toggle:hover {
    color: var(--accent);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Content Section */
.content {
    padding: 2rem 0;
}

.content h2 {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    text-align: center;
}

/* Bubbles Grid */
.bubbles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.bubble {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
    cursor: default;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.bubble:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.bubble h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.bubble p {
    color: var(--text-muted);
    font-size: 1rem;
    flex-grow: 1;
}

/* Footer */
.footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    font-size: 0.95rem;
}

/* Dark theme overrides (applies when html[data-theme=\"dark\"]) */
html[data-theme="dark"] {
    --bg: #0b0b0c;
    --text: #e6e6e6;
    --text-muted: #bfbfbf;
    --card-bg: #121213;
    --border-color: #222222;
    --footer-bg: #070707;
    --footer-text: #cfcfcf;
    --accent: #e6e6e6;
}

/* Link color adjustment in dark mode */
html[data-theme="dark"] a {
    color: #9ad0ff;
}

/* Terms Modal Styles */
.terms-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 200ms ease;
}

.terms-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.terms-modal-content {
    background-color: var(--bg);
    color: var(--text);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 300ms ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.terms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.terms-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 200ms ease;
}

.close-btn:hover {
    color: var(--accent);
}

.terms-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    padding: 0;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 200ms ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: var(--text);
    background-color: var(--card-bg);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.terms-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: var(--bg);
}

.tab-content {
    display: none;
    animation: fadeIn 200ms ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tab-content h1,
.tab-content h2 {
    color: var(--text);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.tab-content h1 { font-size: 1.5rem; }
.tab-content h2 { font-size: 1.25rem; }
.tab-content h3 { font-size: 1.1rem; }

.tab-content p,
.tab-content li {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.tab-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.tab-content a {
    color: #2563eb;
    text-decoration: none;
}

.tab-content a:hover {
    text-decoration: underline;
}

.terms-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 2px solid var(--border-color);
    justify-content: flex-end;
}

.accept-btn,
.decline-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 200ms ease;
    font-size: 1rem;
}

.accept-btn {
    background-color: var(--accent);
    color: var(--bg);
}

.accept-btn:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.decline-btn {
    background-color: var(--card-bg);
    color: var(--text);
    border: 2px solid var(--border-color);
}

.decline-btn:hover {
    background-color: var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .bubbles-grid {
        grid-template-columns: 1fr;
    }

    /* keep nav-container row to keep logo aligned top-right on small screens */
    .nav-container {
        gap: 1rem;
    }

    .terms-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .terms-tabs {
        flex-direction: column;
    }

    .tab-btn {
        text-align: left;
        border-bottom: none;
        border-left: 3px solid transparent;
        padding-left: 1.5rem;
    }

    .tab-btn.active {
        border-left-color: var(--accent);
        border-bottom-color: transparent;
    }
}