/* ===== VARIABLES ===== */
:root {
    --primary: #4f8cff;
    --primary-dark: #3a6fd8;
    --primary-light: #e0ecff;
    --accent: #ff6b6b;
    --bg: #ffffff;
    --bg-alt: #f7f9fc;
    --bg-dark: #1a1a2e;
    --text: #2d3748;
    --text-light: #718096;
    --text-white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 40px rgba(79, 140, 255, 0.12);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Lato', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

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

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

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

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--primary);
    color: var(--text-white);
    padding: 8px 16px;
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    font-weight: 700;
    transition: top var(--transition);
}

.skip-link:focus {
    top: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-title {
    font-size: 2.2rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== NAVIGATION ===== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: box-shadow var(--transition);
}

#navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
    height: 70px;
}

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

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

.nav-logo-img {
    border-radius: 8px;
    object-fit: cover;
}

.logo-icon {
    font-size: 1.6rem;
}

.logo-text {
    font-weight: 900;
    font-size: 1.3rem;
}

.logo-accent {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 4px;
}

.nav-links a {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--primary);
    background: var(--primary-light);
}

.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: 2.5px;
    background: var(--text);
    border-radius: 4px;
    transition: all var(--transition);
}

/* ===== HERO ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-top: 70px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #e0ecff 0%, #f7f9fc 50%, #ffe0e0 100%);
    z-index: 0;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 140, 255, 0.12) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite;
}

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

.hero-content {
    position: relative;
    z-index: 1;
    padding: 60px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 48px;
}

.hero-text {
    text-align: left;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), #8b5cf6, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-light);
    max-width: 540px;
    margin: 0 0 32px;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-image img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ===== ABOUT ===== */
.about-content {
    text-align: center;
}

.about-img {
    max-width: 700px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* ===== BUTTONS ===== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.button:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.button.primary {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
}

.button.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(79, 140, 255, 0.3);
}

.button.outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.button.outline:hover {
    background: var(--primary);
    color: var(--text-white);
    transform: translateY(-2px);
}

.button.large {
    padding: 16px 36px;
    font-size: 1.1rem;
    border-radius: 12px;
}

.button.small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.button.full-width {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
}

/* ===== SERVICES GRID ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    transition: all var(--transition);
    cursor: default;
}

.service-card:hover,
.service-card:focus-visible {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.service-icon {
    font-size: 2.8rem;
    margin-bottom: 16px;
}

.service-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.service-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

.services-image {
    text-align: center;
    margin-top: 48px;
}

.services-image img {
    max-width: 700px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* ===== VIDEO ===== */
.video-wrapper {
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-wrapper video {
    display: block;
    width: 100%;
}

/* ===== BADGE ===== */
.badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 16px;
    border-radius: 20px;
    margin-bottom: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ===== TRY PRODUCT LAYOUT ===== */
.try-header {
    text-align: center;
    margin-bottom: 40px;
}

.try-header .section-title {
    margin-bottom: 8px;
}

.try-header .section-subtitle {
    margin-bottom: 0;
}

.try-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.try-form-col,
.try-preview-col {
    min-width: 0;
}

/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--text);
}

.required {
    color: var(--accent);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font);
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.error-msg {
    display: block;
    color: var(--accent);
    font-size: 0.85rem;
    margin-top: 4px;
    min-height: 1.2em;
}

.form-help {
    margin-top: 10px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Trust row */
.trust-row {
    display: flex;
    gap: 20px;
    list-style: none;
    margin-top: 16px;
    padding: 0;
    font-size: 0.88rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.trust-row li {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Dropzone */
.dropzone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg);
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.dropzone-content p {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.dropzone-hint {
    font-size: 0.85rem;
    color: var(--text-light);
}

.logo-preview {
    margin-top: 12px;
    max-height: 100px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Prompt chips */
.prompt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.prompt-chips button {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    font-family: var(--font);
    font-size: 0.82rem;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
}

.prompt-chips button:hover,
.prompt-chips button:focus-visible {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ===== PREVIEW / RESULTS ===== */
.preview-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: sticky;
    top: 90px;
}

.preview-card h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text);
}

.preview-hint {
    margin-top: 12px;
    font-size: 0.88rem;
    color: var(--text-light);
    text-align: center;
}

.skeleton-box {
    background: linear-gradient(110deg, #f0f0f0 30%, #fafafa 50%, #f0f0f0 70%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.95rem;
    text-align: center;
    padding: 24px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.preview-img,
.output-img {
    width: 100%;
    border-radius: var(--radius);
    margin-top: 12px;
}

/* Loader */
.loader {
    text-align: center;
    padding: 32px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader p {
    color: var(--text-light);
    font-weight: 500;
}

.description {
    margin-top: 16px;
    padding: 16px;
    background: var(--primary-light);
    border-radius: var(--radius);
    color: var(--text);
    line-height: 1.7;
    font-size: 0.95rem;
    white-space: pre-line;
}

.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ===== HISTORY ===== */
.history-form {
    max-width: 560px;
    margin: 0 auto 32px;
}

.history-input-group {
    display: flex;
    gap: 12px;
}

.history-input-group input {
    flex: 1;
    padding: 14px 18px;
    font-family: var(--font);
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    transition: border-color var(--transition);
}

.history-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.12);
}

.history-results {
    margin-top: 24px;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.history-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: all var(--transition);
}

.history-card:hover {
    box-shadow: var(--shadow);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

.history-card-header small {
    color: var(--text-light);
    font-weight: 400;
}

.history-img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.history-img-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--bg-alt);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.history-prompt {
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 10px;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-dark);
    color: rgba(255, 255, 255, 0.85);
    padding: 64px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-logo-img {
    border-radius: 10px;
    margin-bottom: 8px;
}

.footer-brand .logo-text {
    color: var(--text-white);
    font-size: 1.3rem;
    font-weight: 900;
}

.footer-brand .logo-accent {
    color: var(--primary);
}

.footer-brand p {
    margin-top: 8px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.7;
}

.footer-links h4,
.footer-contact-info h4 {
    color: var(--text-white);
    font-weight: 700;
    margin-bottom: 16px;
    font-size: 1rem;
}

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

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    transition: color var(--transition);
}

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

.footer-contact-info p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.footer-contact-info a {
    color: rgba(255, 255, 255, 0.6);
}

.footer-contact-info a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding: 24px 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text {
        text-align: center;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

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

    .hero-image {
        max-width: 480px;
        margin: 0 auto;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .try-layout {
        grid-template-columns: 1fr;
    }

    .preview-card {
        position: static;
    }

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

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        padding: 16px 24px;
        gap: 4px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }

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

    .nav-toggle {
        display: flex;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

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

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .history-input-group {
        flex-direction: column;
    }

    .trust-row {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .button.large {
        width: 100%;
    }

    .container {
        padding: 0 16px;
    }

    .section {
        padding: 56px 0;
    }
}

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

/* ===== FOCUS VISIBLE ===== */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* ===== HIGH CONTRAST ===== */
@media (prefers-contrast: high) {
    :root {
        --text: #000000;
        --text-light: #333333;
        --border: #666666;
    }
}
