/* SleepTrack Audio - Shared Styles */

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

:root {
    color-scheme: dark;
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-card: #1c1c22;
    --border: rgba(63, 63, 70, 0.5);
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #7c3aed;
    --accent-light: #a78bfa;
    --accent-glow: rgba(124, 58, 237, 0.15);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Links */
a, a:link, a:visited { color: var(--text-secondary); text-decoration: none; }
a:hover, a:focus { color: var(--text-primary); }

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.container--narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-primary);
}

.lang-toggle {
    color: var(--accent-light);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 0.875rem;
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 8px;
    transition: all 0.2s;
}

.lang-toggle:hover {
    background: var(--accent-glow);
    border-color: rgba(124, 58, 237, 0.4);
    color: var(--text-primary);
}

/* Main */
main {
    padding: 3rem 0;
}

/* Content Card (subpages) */
.content-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 3rem;
}

/* Typography */
h1 {
    font-size: clamp(1.75rem, 3.5vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2.5rem 0 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 1.75rem 0 0.625rem;
    color: var(--text-secondary);
}

h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    color: var(--text-secondary);
}

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 0.9375rem;
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

ul, ol {
    margin: 0.75rem 0 1.25rem 1.5rem;
    color: var(--text-secondary);
}

li {
    margin-bottom: 0.375rem;
    line-height: 1.6;
    font-size: 0.9375rem;
}

/* Policy meta */
.policy-meta {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.8125rem;
}

/* Highlight / callout boxes */
.highlight-box {
    background: var(--accent-glow);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}

.highlight-box p {
    margin-bottom: 0;
    color: var(--text-secondary);
}

.highlight-box strong {
    color: var(--accent-light);
}

.notice-box {
    background: rgba(250, 204, 21, 0.06);
    border: 1px solid rgba(250, 204, 21, 0.15);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
}

.notice-box strong {
    color: #fbbf24;
}

.notice-box a {
    color: #fbbf24;
}

.note-box {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
}

.note-box strong {
    color: #60a5fa;
}

/* Contact sections */
.contact-box {
    background: var(--accent-glow);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1.25rem 0;
}

.contact-box h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.contact-box .contact-info {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.9375rem;
}

.contact-box a {
    color: var(--accent-light);
}

.contact-box a:hover {
    color: var(--text-primary);
}

/* TOC */
.toc {
    background: rgba(124, 58, 237, 0.05);
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}

.toc h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toc ul {
    margin-left: 1rem;
    margin-bottom: 0;
}

.toc a {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.toc a:hover {
    color: var(--accent-light);
}

/* Compatibility page */
.tested-box {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}

.tested-box h3 {
    color: #4ade80;
    margin-top: 0;
}

.tested-box p {
    color: var(--text-secondary);
}

.compatibility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.device-category {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.device-category h4 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    margin-top: 0;
}

.device-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.device-list li {
    color: var(--text-secondary);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.device-list li:last-child {
    border-bottom: none;
}

.status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.status-tested {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

.status-compatible {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.status-partial {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.status-unsupported {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.requirements {
    background: rgba(124, 58, 237, 0.05);
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.requirements h3 {
    margin-top: 0;
    color: var(--text-primary);
}

.requirements ul {
    margin-bottom: 0;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.8125rem;
}

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

.footer-copy {
    color: var(--text-muted);
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8125rem;
}

/* Accessibility */
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    left: 0;
    top: -40px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 12px;
    z-index: 1000;
    border-radius: 6px;
    text-decoration: none;
}

.skip-link:focus {
    top: 10px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 0.75rem 0;
        gap: 0.5rem;
    }

    .nav-links {
        gap: 0.75rem;
    }

    .content-card {
        padding: 1.75rem;
    }

    h1 {
        font-size: clamp(1.5rem, 6vw, 1.75rem);
    }

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

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}
