/* ===================================================
   PopTutor Design System — Evergreen
   =================================================== */

/* --- Custom Properties --- */
:root {
    --color-green:      #34C759;
    --color-green-dark: #28A745;
    --color-purple:     #7C5CFC;
    --color-purple-dark:#6344E0;
    --color-orange:     #FF9500;
    --color-blue:       #007AFF;
    --color-red:        #FF3B30;

    --color-bg:         #0A0F1E;
    --color-bg-card:    rgba(255, 255, 255, 0.05);
    --color-bg-card-hover: rgba(255, 255, 255, 0.09);
    --color-border:     rgba(255, 255, 255, 0.10);
    --color-border-hover: rgba(124, 92, 252, 0.45);

    --color-text:       #F0F4FF;
    --color-text-muted: rgba(240, 244, 255, 0.62);
    --color-text-faint: rgba(240, 244, 255, 0.38);

    --font-sans: 'Nunito', system-ui, -apple-system, sans-serif;

    --radius-sm:  8px;
    --radius-md:  14px;
    --radius-lg:  24px;
    --radius-xl:  36px;

    --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.32);
    --shadow-glow-green:  0 0 32px rgba(52, 199, 89, 0.25);
    --shadow-glow-purple: 0 0 32px rgba(124, 92, 252, 0.35);

    --transition-fast: 160ms ease;
    --transition-base: 260ms ease;
    --transition-slow: 420ms ease;

    --nav-height: 64px;
    --section-gap: 96px;
    --inner-max: 1100px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Focus Visible --- */
:focus-visible {
    outline: 3px solid var(--color-purple);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ===================================================
   Navigation
   =================================================== */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    background: rgba(10, 15, 30, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
}

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

.nav-brand {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.5px;
}

/* --- Brand Wordmark Colors --- */
.brand-pop   { color: var(--color-green); }
.brand-tutor { color: var(--color-text); }

/* --- Language Switcher --- */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-link {
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-text-muted);
    letter-spacing: 0.04em;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.lang-link:hover {
    color: var(--color-text);
    background: var(--color-bg-card);
}

.lang-link.lang-active {
    color: var(--color-green);
    background: rgba(52, 199, 89, 0.12);
}

/* ===================================================
   Floating Orb Backgrounds
   =================================================== */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    will-change: transform;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(52, 199, 89, 0.18) 0%, transparent 70%);
    top: -180px;
    right: -120px;
    animation: orb-drift-1 18s ease-in-out infinite;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 92, 252, 0.16) 0%, transparent 70%);
    bottom: -60px;
    left: -100px;
    animation: orb-drift-2 22s ease-in-out infinite;
}

.orb-3 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(255, 149, 0, 0.10) 0%, transparent 70%);
    top: 40%;
    left: 35%;
    animation: orb-drift-3 26s ease-in-out infinite;
}

@keyframes orb-drift-1 {
    0%, 100% { transform: translate(0, 0); }
    50%       { transform: translate(-40px, 30px); }
}

@keyframes orb-drift-2 {
    0%, 100% { transform: translate(0, 0); }
    50%       { transform: translate(30px, -40px); }
}

@keyframes orb-drift-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%       { transform: translate(-20px, 20px) scale(1.08); }
}

/* ===================================================
   Hero Section
   =================================================== */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
    overflow: hidden;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: var(--inner-max);
    margin: 0 auto;
    padding: 64px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(52, 199, 89, 0.12);
    border: 1px solid rgba(52, 199, 89, 0.30);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-green);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    width: fit-content;
}

.brand-wordmark {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
}

.hero-tagline {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--color-text-muted);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    max-width: 520px;
    line-height: 1.7;
}

/* --- Buttons --- */
.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--color-green);
    color: #0A0F1E;
    box-shadow: var(--shadow-glow-green);
}

.btn-primary:hover {
    background: var(--color-green-dark);
    box-shadow: 0 0 48px rgba(52, 199, 89, 0.45);
    transform: translateY(-2px);
}

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

.btn-ghost:hover {
    background: var(--color-bg-card-hover);
    border-color: var(--color-border-hover);
    transform: translateY(-2px);
}

/* --- Hero Stats --- */
.hero-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 8px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--color-green);
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--color-text-faint);
    font-weight: 600;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: var(--color-border);
    flex-shrink: 0;
}

/* --- Mascot --- */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.mascot-container {
    position: relative;
    width: 340px;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mascot-container::before {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(52, 199, 89, 0.15) 0%, transparent 70%);
    animation: mascot-glow 3s ease-in-out infinite;
}

@keyframes mascot-glow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50%       { opacity: 1;   transform: scale(1.06); }
}

.mascot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: mascot-bounce-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both,
               mascot-bob 4s ease-in-out 0.8s infinite;
    filter: drop-shadow(0 16px 48px rgba(52, 199, 89, 0.30));
}

@keyframes mascot-bounce-in {
    from { opacity: 0; transform: scale(0.6) translateY(40px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes mascot-bob {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-12px); }
}

/* ===================================================
   Section Shared Styles
   =================================================== */
.section-inner {
    max-width: var(--inner-max);
    margin: 0 auto;
    padding: 0 24px;
}

.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 56px;
}

/* ===================================================
   How It Works Section
   =================================================== */
.how-section {
    padding: var(--section-gap) 0;
    background: linear-gradient(180deg, rgba(52, 199, 89, 0.04) 0%, transparent 100%);
}

.steps-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 0;
    align-items: center;
}

.step-connector {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-green), var(--color-purple));
    margin: 0 8px;
    margin-top: -40px;
    opacity: 0.4;
}

.step-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
    position: relative;
    overflow: hidden;
}

.step-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.06) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.step-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-card);
}

.step-card:hover::before {
    opacity: 1;
}

.step-number {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 3rem;
    font-weight: 900;
    color: rgba(52, 199, 89, 0.10);
    line-height: 1;
    pointer-events: none;
}

.step-icon {
    font-size: 2.8rem;
    margin-bottom: 16px;
    display: block;
}

.step-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--color-text);
}

.step-desc {
    font-size: 0.92rem;
    color: var(--color-text-muted);
    line-height: 1.65;
}

/* ===================================================
   Features Section
   =================================================== */
.features-section {
    padding: var(--section-gap) 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-card), var(--shadow-glow-purple);
}

.feature-icon {
    font-size: 2.2rem;
    margin-bottom: 14px;
    display: block;
}

.feature-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--color-text);
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.65;
}

/* ===================================================
   Download CTA Section
   =================================================== */
.download-section {
    padding: var(--section-gap) 0;
    background: linear-gradient(135deg, rgba(124, 92, 252, 0.20) 0%, rgba(52, 199, 89, 0.12) 100%);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.download-title {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.download-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    margin-bottom: 40px;
}

.store-badges {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    font-weight: 700;
    transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
    min-width: 180px;
}

.store-badge:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.store-icon {
    width: 28px;
    height: 28px;
    fill: var(--color-text);
    flex-shrink: 0;
}

.store-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.store-label {
    font-size: 0.70rem;
    font-weight: 600;
    color: var(--color-text-muted);
    line-height: 1.2;
}

.store-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.2;
}

/* ===================================================
   Footer
   =================================================== */
.site-footer {
    padding: 40px 24px;
    background: rgba(0, 0, 0, 0.30);
}

.footer-inner {
    max-width: var(--inner-max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.footer-brand {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.footer-rights {
    font-size: 0.84rem;
    color: var(--color-text-faint);
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    font-size: 0.84rem;
    color: var(--color-text-muted);
    font-weight: 600;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--color-green);
}

/* ===================================================
   Legal / Content Pages
   =================================================== */
.legal-page {
    padding: calc(var(--nav-height) + 48px) 24px 64px;
    min-height: 100vh;
}

.legal-inner {
    max-width: 780px;
    margin: 0 auto;
}

.legal-page h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--color-green), var(--color-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legal-updated {
    font-size: 0.84rem;
    color: var(--color-text-faint);
    margin-bottom: 40px;
}

.legal-page h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-text);
    margin-top: 40px;
    margin-bottom: 12px;
}

.legal-page p {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.legal-page ul {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

.legal-page li {
    position: relative;
    padding-left: 20px;
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.legal-page li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 11px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-green);
}

.legal-page a {
    color: var(--color-green);
    font-weight: 600;
    transition: color var(--transition-fast);
}

.legal-page a:hover {
    color: var(--color-green-dark);
}

.legal-divider {
    border: none;
    height: 1px;
    background: var(--color-border);
    margin: 48px 0;
}

/* Contact page card */
.contact-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 36px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-card);
    max-width: 480px;
    margin-top: 32px;
}

.contact-card dt {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.contact-card dd {
    font-size: 1.05rem;
    color: var(--color-text);
    margin: 0 0 24px;
    font-weight: 600;
}

.contact-card dd:last-child {
    margin-bottom: 0;
}

.contact-card a {
    color: var(--color-green);
    transition: color var(--transition-fast);
}

.contact-card a:hover {
    color: var(--color-green-dark);
}

/* ===================================================
   Scroll Reveal
   =================================================== */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

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

/* ===================================================
   Responsive
   =================================================== */
@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 80px 24px 48px;
    }

    .hero-subtitle {
        margin: 0 auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .mascot-container {
        width: 240px;
        height: 240px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .step-connector {
        width: 2px;
        height: 32px;
        margin: 0 auto;
        margin-top: 0;
        background: linear-gradient(180deg, var(--color-green), var(--color-purple));
    }

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

@media (max-width: 600px) {
    :root {
        --section-gap: 64px;
    }

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

    .hero-stats {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .stat-divider {
        width: 40px;
        height: 1px;
    }
}

/* ===================================================
   Reduced Motion
   =================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ===================================================
   Print
   =================================================== */
@media print {
    .site-nav,
    .orb,
    .lang-switcher,
    .hero-actions,
    .store-badges {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}
