/* ==========================================================================
   TaleKit Website — style.css
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
    --color-primary: #5856D6;
    --color-primary-dark: #4240a8;
    --color-primary-light: #7a78e6;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f7ff;
    --color-surface: #f2f1ff;
    --color-text: #1a1a2e;
    --color-text-secondary: #6b6b80;
    --color-border: #e5e5ef;
    --color-hero-gradient-start: #4a3fb5;
    --color-hero-gradient-end: #6c63ff;
    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius: 12px;
    --radius-lg: 20px;
    --max-width: 1120px;
    --nav-height: 64px;
}

/* ---------- Dark Mode ---------- */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #0f0e1a;
        --color-bg-alt: #1a1830;
        --color-surface: #242240;
        --color-text: #f0f0f5;
        --color-text-secondary: #a0a0b8;
        --color-border: #2e2c50;
        --color-hero-gradient-start: #2a2566;
        --color-hero-gradient-end: #4a3fb5;
    }
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

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

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

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-dark);
}

/* ---------- Utilities ---------- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3 {
    line-height: 1.2;
    color: var(--color-text);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: center;
}

h3 {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 600;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: clamp(1rem, 2vw, 1.15rem);
    margin-top: 12px;
    margin-bottom: 48px;
}

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

@media (prefers-color-scheme: dark) {
    .nav {
        background: rgba(15, 14, 26, 0.85);
    }
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-text);
}

.nav-logo:hover {
    color: var(--color-text);
}

.nav-icon {
    border-radius: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.nav-cta {
    background: var(--color-primary);
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}

.nav-cta:hover {
    background: var(--color-primary-dark);
    color: #fff !important;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
    padding: 140px 0 80px;
    background: linear-gradient(135deg, var(--color-hero-gradient-start), var(--color-hero-gradient-end));
    color: #fff;
    overflow: hidden;
}

.hero .container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-content {
    flex: 1;
    min-width: 0;
}

.hero h1 {
    color: #fff;
}

.hero-icon {
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, 0.85);
    margin-top: 16px;
    max-width: 500px;
}

.hero-actions {
    margin-top: 32px;
}

.app-store-badge svg {
    transition: transform 0.2s;
}

.app-store-badge:hover svg {
    transform: scale(1.05);
}

.hero-image {
    flex: 0 0 400px;
}

.hero-screenshot-placeholder {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    aspect-ratio: 3/4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
    gap: 8px;
}

.hero-screenshot-placeholder small {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ---------- Features ---------- */
.features {
    padding: 96px 0;
    background: var(--color-bg);
}

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

.feature-card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(88, 86, 214, 0.1);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* ---------- How It Works ---------- */
.how-it-works {
    padding: 96px 0;
    background: var(--color-bg-alt);
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    counter-reset: step;
}

.step {
    text-align: center;
}

.step-number {
    width: 56px;
    height: 56px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.step h3 {
    margin-bottom: 12px;
}

.step p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    max-width: 320px;
    margin: 0 auto;
}

/* ---------- Pricing ---------- */
.pricing {
    padding: 96px 0;
    background: var(--color-bg);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

.pricing-card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 36px 28px;
    position: relative;
}

.pricing-card-featured {
    border-color: var(--color-primary);
    box-shadow: 0 4px 24px rgba(88, 86, 214, 0.15);
    transform: scale(1.03);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.pricing-header {
    text-align: center;
    margin-bottom: 24px;
}

.pricing-header h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.pricing-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
}

.pricing-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pricing-features li {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    padding-left: 24px;
    position: relative;
}

.pricing-features li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: 700;
}

.pricing-note {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-top: 32px;
}

/* ---------- CTA ---------- */
.cta {
    padding: 96px 0;
    background: linear-gradient(135deg, var(--color-hero-gradient-start), var(--color-hero-gradient-end));
    text-align: center;
    color: #fff;
}

.cta h2 {
    color: #fff;
    margin-bottom: 12px;
}

.cta p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.15rem;
    margin-bottom: 32px;
}

/* ---------- Footer ---------- */
.footer {
    padding: 40px 0;
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.05rem;
}

.footer-icon {
    border-radius: 6px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

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

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

.footer-copy {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

/* ---------- Fade-in Animations ---------- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    /* Nav */
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        padding: 24px;
        gap: 20px;
    }

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

    .nav-cta {
        text-align: center;
    }

    /* Hero */
    .hero {
        padding: 120px 0 60px;
    }

    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-subtitle {
        margin: 16px auto 0;
    }

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

    .hero-image {
        flex: none;
        width: 100%;
        max-width: 300px;
    }

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

    /* Steps */
    .steps {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    /* Pricing */
    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .pricing-card-featured {
        transform: none;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: 16px;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-icon {
        width: 80px;
        height: 80px;
    }
}
