/* ============================================
   Toothfairy™ Download Page — Style Sheet
   Design: Clean, premium, light — matching the app
   Palette: White bg, #5BC5B2 teal accent, black text
   ============================================ */

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

:root {
    --teal: #5BC5B2;
    --teal-dark: #4DB8A5;
    --teal-light: #D4F2EB;
    --teal-muted: #8ED5C8;
    --teal-btn: #6BCABB;
    --teal-glow: rgba(91, 197, 178, 0.18);
    --teal-subtle: rgba(91, 197, 178, 0.06);
    --black: #000000;
    --gray-900: #1A1A1A;
    --gray-700: #3C3C43;
    --gray-500: #8E8E93;
    --gray-400: #AEAEB2;
    --gray-300: #C7C7CC;
    --gray-200: #E5E5EA;
    --gray-100: #F2F2F7;
    --white: #FFFFFF;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    color-scheme: light;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--white);
    color: var(--black);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* --- Subtle Background --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 0%, rgba(91, 197, 178, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 100%, rgba(91, 197, 178, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* --- Floating Particles --- */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--teal);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.4;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 0.15;
        transform: translateY(10vh) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translateY(0vh) scale(0);
    }
}

/* --- Main Container --- */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    padding: 48px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-height: 100dvh;
    justify-content: center;
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s var(--transition-smooth) both;
}

.logo-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.logo {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
    animation: logoFloat 6s ease-in-out infinite;
}

.logo-glow {
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: var(--teal-glow);
    filter: blur(24px);
    animation: pulseGlow 3s ease-in-out infinite alternate;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes pulseGlow {
    0% { opacity: 0.3; transform: scale(0.9); }
    100% { opacity: 0.5; transform: scale(1.15); }
}

.title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-bottom: 14px;
    line-height: 1.1;
}

.title-line {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--gray-500);
    letter-spacing: -0.01em;
}

.title-wordmark {
    display: block;
    width: 220px;
    height: auto;
    margin: 4px 0;
}

.subtitle {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--gray-500);
    max-width: 340px;
    margin: 0 auto;
    font-weight: 400;
}

/* --- Buttons Section --- */
.buttons-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 48px;
}

/* --- Download Button Base (app-style) --- */
.download-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    border: none;
}

.download-btn:hover {
    transform: translateY(-2px);
}

.download-btn:active {
    transform: translateY(0px) scale(0.98);
}

/* Staggered entry animations */
.download-btn:nth-child(1) {
    animation: fadeInUp 0.6s 0.2s both;
}
.download-btn:nth-child(2) {
    animation: fadeInUp 0.6s 0.35s both;
}

.website-btn {
    animation: fadeInUp 0.6s 0.55s both !important;
}

/* --- iOS Button (app-style: solid teal, dark text) --- */
.ios-btn {
    background: var(--teal);
    color: var(--black);
    box-shadow: var(--shadow-md);
}

.ios-btn:hover {
    background: var(--teal-dark);
    box-shadow: var(--shadow-lg), 0 4px 20px rgba(91, 197, 178, 0.2);
}

/* --- Android Button (app-style: lighter muted teal, dark text) --- */
.android-btn {
    background: var(--teal-light);
    color: var(--black);
    box-shadow: var(--shadow-sm);
}

.android-btn:hover {
    background: #C2ECE3;
    box-shadow: var(--shadow-md);
}

/* --- Website Button (light outline) --- */
.website-btn {
    background: var(--gray-100);
    color: var(--black);
    border: 1.5px solid var(--gray-200);
    box-shadow: none;
}

.website-btn:hover {
    background: var(--white);
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-subtle);
}

/* --- Button Internals --- */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    color: var(--black);
}

.android-btn .btn-icon {
    background: rgba(0, 0, 0, 0.05);
}

.website-btn .btn-icon {
    background: var(--teal-subtle);
    color: var(--teal);
}

.btn-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.btn-label {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.6;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--gray-700);
}

.ios-btn .btn-label {
    color: rgba(0, 0, 0, 0.55);
}

.android-btn .btn-label {
    color: var(--gray-700);
}

.website-btn .btn-label {
    color: var(--gray-500);
}

.btn-store {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--black);
}

.btn-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.35;
    color: var(--black);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.website-btn .btn-arrow {
    color: var(--gray-400);
}

.download-btn:hover .btn-arrow {
    opacity: 0.7;
    transform: translateX(3px);
}

.website-btn:hover .btn-arrow {
    color: var(--teal);
}

/* --- Divider --- */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 0;
    animation: fadeInUp 0.6s 0.45s both;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.divider-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-400);
    text-transform: lowercase;
    letter-spacing: 0.05em;
}

/* --- Footer --- */
.footer {
    text-align: center;
    animation: fadeInUp 0.6s 0.65s both;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-bottom: 6px;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-links a {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.footer-dot {
    font-size: 0.75rem;
    color: var(--gray-300);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive: Small phones (< 380px) --- */
@media (max-width: 380px) {
    .container {
        padding: 32px 16px;
    }

    .title-wordmark {
        width: 170px;
    }

    .title-line {
        font-size: 1.15rem;
    }

    .download-btn {
        padding: 14px 16px;
        gap: 12px;
    }

    .btn-icon {
        width: 38px;
        height: 38px;
    }

    .btn-icon svg {
        width: 22px;
        height: 22px;
    }

    .btn-store {
        font-size: 1rem;
    }

    .logo {
        width: 76px;
        height: 76px;
    }

    .logo-glow {
        width: 100px;
        height: 100px;
    }
}

/* --- Responsive: Larger phones (380–600px) --- */
@media (min-width: 381px) and (max-width: 600px) {
    .container {
        padding: 40px 20px;
    }
}

/* --- Responsive: Tablets & beyond (600px+) --- */
@media (min-width: 601px) {
    .container {
        padding: 64px 32px;
        min-height: auto;
        margin: auto;
    }

    .title-wordmark {
        width: 260px;
    }

    .title-line {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 1.05rem;
        max-width: 400px;
    }

    .download-btn {
        padding: 18px 24px;
    }

    .btn-store {
        font-size: 1.15rem;
    }

    .logo {
        width: 110px;
        height: 110px;
    }
}

/* --- Responsive: Large desktops (1024px+) --- */
@media (min-width: 1024px) {
    .container {
        padding: 80px 40px;
        border-radius: var(--radius-xl);
    }

    .hero {
        margin-bottom: 48px;
    }

    .title-wordmark {
        width: 280px;
    }
}

/* --- Landscape mode on phones --- */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding: 24px;
        gap: 0;
    }

    .hero {
        margin-bottom: 20px;
    }

    .logo {
        width: 60px;
        height: 60px;
    }

    .logo-glow {
        width: 80px;
        height: 80px;
    }

    .title-wordmark {
        width: 150px;
    }

    .title-line {
        font-size: 1rem;
    }

    .subtitle {
        font-size: 0.8rem;
        margin-bottom: 0;
    }

    .logo-container {
        margin-bottom: 16px;
    }

    .buttons-section {
        gap: 10px;
        margin-bottom: 20px;
    }

    .download-btn {
        padding: 12px 16px;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
    }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }

    .logo {
        animation: none;
    }

    .logo-glow {
        animation: none;
    }

    .particle {
        animation: none;
        display: none;
    }
}

/* --- Focus styles for accessibility --- */
.download-btn:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 3px;
}

.footer-links a:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
    border-radius: 2px;
}
