/* ===================================================
   Peakdose – Shared Styles
   =================================================== */

/* --- Design Tokens --- */
:root {
    /* Backgrounds */
    --bg:             hsl(220, 25%, 7%);
    --bg-surface:     hsl(220, 18%, 13%);
    --bg-surface-alt: hsl(220, 16%, 16%);

    /* Text hierarchy */
    --text-primary:   hsl(0, 0%, 96%);
    --text-secondary: hsl(220, 10%, 65%);
    --text-tertiary:  hsl(220, 10%, 45%);

    /* Accent */
    --accent:         hsl(151, 53%, 43%);
    --accent-hover:   hsl(151, 53%, 38%);
    --accent-muted:   hsla(151, 53%, 43%, 0.15);
    --accent-glow:    hsla(151, 53%, 43%, 0.25);
    --accent-gradient: linear-gradient(135deg, hsl(151, 53%, 43%), hsl(165, 50%, 38%));

    /* Borders */
    --border:         hsla(220, 20%, 50%, 0.12);
    --border-subtle:  hsla(220, 20%, 50%, 0.08);

    /* Shadows */
    --shadow-sm:  0 1px  3px  hsla(0, 0%, 0%, 0.25);
    --shadow-md:  0 4px  12px hsla(0, 0%, 0%, 0.3);
    --shadow-lg:  0 8px  30px hsla(0, 0%, 0%, 0.35);
    --shadow-glow: 0 0 30px var(--accent-glow);

    /* Spacing scale */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2.5rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;

    /* Misc */
    --radius:    12px;
    --radius-lg: 16px;
    --header-h:  72px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.7;
}

/* --- Selection --- */
::selection {
    background: var(--accent-muted);
    color: var(--text-primary);
}

/* --- Focus --- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Scrollbar (WebKit) --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: hsla(220, 15%, 40%, 0.4);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: hsla(220, 15%, 50%, 0.5); }

/* --- Layout --- */
.container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================================
   Header – sticky frosted glass
   =================================================== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.25rem 0;
    background: hsla(220, 25%, 7%, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, hsla(151, 53%, 43%, 0.4), transparent);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    text-decoration: none;
}

.logo img {
    height: 40px;
    margin-right: 10px;
    border-radius: 5px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 2rem;
    transition: color 0.3s ease;
}

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

/* --- Store badges (header) --- */
.store-badges {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.store-badge {
    height: 40px;
    width: auto;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.store-badges a:hover .store-badge {
    transform: scale(1.05);
}

.store-badge-coming-soon {
    position: relative;
    cursor: default;
    opacity: 0.5;
}
.store-badge-coming-soon:hover { opacity: 0.6; }
.store-badge-coming-soon .store-badge { filter: grayscale(100%); }

.coming-soon-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* Mobile download button */
.mobile-download-btn {
    display: none;
    padding: 0.55rem 1.5rem;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mobile-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ===================================================
   Buttons
   =================================================== */
.cta-button,
.button {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.cta-button:hover,
.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-glow);
}

.cta-button:active,
.button:active {
    transform: translateY(0);
}

/* ===================================================
   Footer
   =================================================== */
footer {
    padding: var(--space-2xl) 0 var(--space-xl) 0;
    background-color: var(--bg-surface);
    margin-top: var(--space-3xl);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.footer-section a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    text-align: center;
    margin-top: var(--space-xl);
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.footer-bottom a {
    color: var(--text-tertiary);
    text-decoration: underline;
    transition: color 0.3s ease;
}
.footer-bottom a:hover {
    color: var(--text-primary);
}

/* ===================================================
   Legal content pages (privacy, terms, health-data)
   =================================================== */
.legal-content {
    padding: var(--space-2xl) 0;
}

.legal-content h1 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 800;
    text-align: center;
}

.legal-content h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.legal-content p,
.legal-content ul {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.legal-content ul {
    list-style: disc;
    padding-left: 25px;
}

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

.legal-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.legal-content a:hover {
    text-decoration: underline;
}

.effective-date {
    text-align: center;
    margin-bottom: 2.5rem;
    font-style: italic;
    color: var(--text-tertiary);
    font-size: 1rem;
}

/* ===================================================
   Section dividers
   =================================================== */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 0 auto;
    max-width: 80%;
}

/* ===================================================
   Scroll reveal animations
   =================================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-stagger > *.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================================
   Responsive
   =================================================== */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    header .store-badges {
        display: none;
    }

    .mobile-download-btn {
        display: block;
    }

    .store-badge {
        height: 32px;
    }

    .coming-soon-label {
        font-size: 0.55rem;
        bottom: -14px;
    }

    nav p {
        font-size: 0.7rem;
        text-align: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
}
