/* Adagio Stream - Styles */

/* ── Dark Theme (default) ── */
:root,
[data-theme="dark"] {
    --bg-primary: #0A0F1A;
    --bg-secondary: #111827;
    --bg-card: rgba(20, 31, 77, 0.4);
    --bg-card-border: rgba(120, 132, 255, 0.15);
    --bg-card-hover-border: rgba(120, 132, 255, 0.3);
    --bg-nav: rgba(10, 15, 26, 0.85);

    --accent: #5864FB;
    --accent-light: #7884FF;
    --accent-glow: rgba(88, 100, 251, 0.3);

    --text-primary: #F0F0F5;
    --text-secondary: #A0A4B8;
    --text-muted: #6B7094;

    --purple: #D0BCFF;
    --pink: #EFB8C8;

    --code-bg: rgba(120, 132, 255, 0.1);
    --logo-src: url('/images/logo-dark.png');

    color-scheme: dark;
}

/* ── Light Theme ── */
[data-theme="light"] {
    --bg-primary: #F5F5FA;
    --bg-secondary: #EEEEF4;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-border: rgba(88, 100, 251, 0.15);
    --bg-card-hover-border: rgba(88, 100, 251, 0.3);
    --bg-nav: rgba(245, 245, 250, 0.85);

    --accent: #4A54E0;
    --accent-light: #5864FB;
    --accent-glow: rgba(88, 100, 251, 0.15);

    --text-primary: #1A1A2E;
    --text-secondary: #4A4A6A;
    --text-muted: #8888A8;

    --purple: #6650A4;
    --pink: #7D5260;

    --code-bg: rgba(88, 100, 251, 0.08);

    color-scheme: light;
}

/* ── Shared Constants ── */
:root {
    --radius: 16px;
    --radius-sm: 8px;
    --max-width: 960px;
    --transition-theme: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition-theme);
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--purple);
}

/* ── Navigation ── */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--bg-card-border);
    padding: 0 1.5rem;
    transition: var(--transition-theme);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.15rem;
}

.nav-brand img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

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

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.25rem 0;
    position: relative;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a.active::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--bg-card-hover-border);
    background: var(--bg-card);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }

[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* ── Main Content ── */
main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem;
    width: 100%;
}

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

.hero-logo {
    width: 160px;
    height: 160px;
    border-radius: 32px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 40px var(--accent-glow);
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
}

/* ── Glass Cards ── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}

.card:hover {
    border-color: var(--bg-card-hover-border);
    box-shadow: 0 4px 24px var(--accent-glow);
}

.card h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.card + .card {
    margin-top: 1.5rem;
}

/* ── Feature Grid ── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-grid .card {
    margin-bottom: 0;
    margin-top: 0;
}

.feature-grid .card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--accent-light);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin-top: 0.75rem;
}

.feature-list li {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    padding-left: 1.1rem;
    position: relative;
    margin-bottom: 0.3rem;
}

.feature-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

/* ── Page Header ── */
.page-header {
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid var(--bg-card-border);
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.page-header p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* ── Content Sections ── */
.content-section {
    margin-bottom: 2.5rem;
}

.content-section h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--accent-light);
}

.content-section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content-section ul {
    color: var(--text-secondary);
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.content-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.content-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: var(--text-primary);
}

code {
    background: var(--code-bg);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent-light);
}

/* ── Support Form ── */
.support-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, background-color 0.3s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A0A4B8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

.btn-submit {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
    background: var(--accent-light);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.form-note {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-status {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: none;
}

.form-status-success,
.form-status-error {
    display: block;
}

.form-status-success {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #66BB6A;
}

.form-status-error {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #EF5350;
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Section Divider ── */
.section-divider {
    border: none;
    border-top: 1px solid var(--bg-card-border);
    margin: 3rem 0;
}

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--bg-card-border);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: var(--transition-theme);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    list-style: none;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--text-secondary);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-nav);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--bg-card-border);
        padding: 1rem 1.5rem;
        gap: 0.75rem;
    }

    .nav-links.open {
        display: flex;
    }

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

    .hero-logo {
        width: 120px;
        height: 120px;
        border-radius: 24px;
    }

    main {
        padding: 2rem 1rem;
    }

    .card {
        padding: 1.5rem;
    }
}
