/* ============================
   CSS Custom Properties — Light Mode (default)
   ============================ */
:root {
    --color-bg-primary: #FAFBFC;
    --color-bg-secondary: #FFFFFF;
    --color-bg-card: #FFFFFF;
    --color-bg-card-hover: #F5F7FA;
    --color-accent: #3B82F6;
    --color-accent-hover: #2563EB;
    --color-accent-subtle: rgba(59, 130, 246, 0.08);
    --color-text-primary: #111827;
    --color-text-secondary: #374151;
    --color-text-muted: #6B7280;
    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-hover: rgba(59, 130, 246, 0.25);
    --color-badge-bg: rgba(59, 130, 246, 0.08);
    --color-badge-text: #3B82F6;
    --color-shadow: rgba(0, 0, 0, 0.06);
    --color-shadow-hover: rgba(0, 0, 0, 0.12);
    --color-header-bg: rgba(250, 251, 252, 0.85);
    --color-nav-mobile-bg: #FFFFFF;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 1200px;
    --radius: 12px;
    --radius-lg: 20px;
    color-scheme: light dark;
}

/* ============================
   Dark Mode
   ============================ */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg-primary: #0B0F19;
        --color-bg-secondary: #111827;
        --color-bg-card: #151C2C;
        --color-bg-card-hover: #1C2539;
        --color-accent: #60A5FA;
        --color-accent-hover: #93C5FD;
        --color-accent-subtle: rgba(96, 165, 250, 0.1);
        --color-text-primary: #F3F4F6;
        --color-text-secondary: #D1D5DB;
        --color-text-muted: #9CA3AF;
        --color-border: rgba(255, 255, 255, 0.08);
        --color-border-hover: rgba(96, 165, 250, 0.3);
        --color-badge-bg: rgba(96, 165, 250, 0.12);
        --color-badge-text: #93C5FD;
        --color-shadow: rgba(0, 0, 0, 0.2);
        --color-shadow-hover: rgba(0, 0, 0, 0.4);
        --color-header-bg: rgba(11, 15, 25, 0.85);
        --color-nav-mobile-bg: #111827;
    }
}

/* ============================
   Archivist Theme — Light
   ============================ */
body.archivist-theme {
    --color-bg-primary: #F0F5F4;
    --color-bg-secondary: #FFFFFF;
    --color-bg-card: #FFFFFF;
    --color-bg-card-hover: #EDF5F3;
    --color-accent: #259485;
    --color-accent-hover: #1D7A6D;
    --color-accent-subtle: rgba(37, 148, 133, 0.08);
    --color-text-primary: #0A1F1C;
    --color-text-secondary: #1C3B36;
    --color-text-muted: #5A7A74;
    --color-border: rgba(37, 148, 133, 0.12);
    --color-border-hover: rgba(37, 148, 133, 0.3);
    --color-badge-bg: rgba(37, 148, 133, 0.1);
    --color-badge-text: #1D7A6D;
    --color-shadow: rgba(0, 40, 35, 0.06);
    --color-shadow-hover: rgba(0, 40, 35, 0.12);
    --color-header-bg: rgba(240, 245, 244, 0.85);
    --color-nav-mobile-bg: #FFFFFF;
}

/* Archivist Theme — Dark */
@media (prefers-color-scheme: dark) {
    body.archivist-theme {
        --color-bg-primary: #00202F;
        --color-bg-secondary: #002B3D;
        --color-bg-card: #0A3042;
        --color-bg-card-hover: #0F3A4E;
        --color-accent: #2FBDA8;
        --color-accent-hover: #5CD4C2;
        --color-accent-subtle: rgba(47, 189, 168, 0.1);
        --color-text-primary: #E8F4F2;
        --color-text-secondary: #97D4C8;
        --color-text-muted: #6BA89C;
        --color-border: rgba(47, 189, 168, 0.12);
        --color-border-hover: rgba(47, 189, 168, 0.3);
        --color-badge-bg: rgba(47, 189, 168, 0.12);
        --color-badge-text: #5CD4C2;
        --color-shadow: rgba(0, 0, 0, 0.3);
        --color-shadow-hover: rgba(0, 0, 0, 0.5);
        --color-header-bg: rgba(0, 32, 47, 0.9);
        --color-nav-mobile-bg: #002B3D;
    }
}

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

html {
    scroll-behavior: smooth;
}

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

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-accent-hover);
}

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

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

/* ============================
   Header
   ============================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

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

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

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

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

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
}

/* ============================
   Hero
   ============================ */
.hero {
    text-align: center;
    padding: 100px 24px 80px;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero h1 span {
    color: var(--color-accent);
}

.hero p {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================
   Product Cards
   ============================ */
.products {
    padding: 40px 0 100px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 32px;
}

.product-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px var(--color-shadow);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px var(--color-shadow-hover);
    border-color: var(--color-border-hover);
}

.product-card-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.product-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-card .tagline {
    color: var(--color-accent);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.product-card .description {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    flex-grow: 1;
    margin-bottom: 24px;
}

.product-card .platforms {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.platform-badge {
    background: var(--color-badge-bg);
    color: var(--color-badge-text);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    color: #fff;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

.btn-secondary:hover {
    background: var(--color-badge-bg);
    color: var(--color-accent-hover);
    transform: translateY(-1px);
}

.btn-arrow {
    transition: transform 0.2s;
}

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

/* ============================
   Archivist Feature Page — Hero
   ============================ */
.archivist-hero {
    text-align: center;
    padding: 80px 24px 60px;
}

.archivist-hero .app-icon {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    margin: 0 auto 24px;
    box-shadow: 0 8px 40px var(--color-shadow-hover);
}

.archivist-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.archivist-hero .subtitle {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    max-width: 550px;
    margin: 0 auto 40px;
}

.hero-screenshots {
    display: flex;
    justify-content: center;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
}

.hero-screenshots img {
    width: 220px;
    border-radius: var(--radius);
    box-shadow: 0 8px 30px var(--color-shadow-hover);
}

/* ============================
   Feature Sections
   ============================ */
.features {
    padding: 60px 0;
}

.feature {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 60px 0;
}

.feature:nth-child(even) {
    flex-direction: row-reverse;
}

.feature-text {
    flex: 1;
}

.feature-text h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.feature-text p {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.7;
}

.feature-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.feature-image img {
    max-width: 280px;
    border-radius: var(--radius);
    box-shadow: 0 8px 30px var(--color-shadow-hover);
}

/* ============================
   Platforms Section
   ============================ */
.platforms-section {
    text-align: center;
    padding: 80px 0;
    border-top: 1px solid var(--color-border);
}

.platforms-section h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

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

.platforms-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.platform-item {
    text-align: center;
}

.platform-icon {
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
}

.platform-icon svg {
    width: 40px;
    height: 40px;
    fill: var(--color-text-muted);
}

.platform-item span {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================
   Screenshots Gallery
   ============================ */
.screenshot-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 40px 0;
}

.screenshot-row img {
    width: 200px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px var(--color-shadow);
}

/* ============================
   Animations — Scroll Reveal
   ============================ */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.stagger-children > .animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.stagger-children > .animate-on-scroll:nth-child(2) { transition-delay: 100ms; }
.stagger-children > .animate-on-scroll:nth-child(3) { transition-delay: 200ms; }
.stagger-children > .animate-on-scroll:nth-child(4) { transition-delay: 300ms; }
.stagger-children > .animate-on-scroll:nth-child(5) { transition-delay: 400ms; }

/* ============================
   Animations — Hero Entrance
   ============================ */
@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate {
    opacity: 0;
    animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-animate:nth-child(1) { animation-delay: 0.1s; }
.hero-animate:nth-child(2) { animation-delay: 0.25s; }
.hero-animate:nth-child(3) { animation-delay: 0.4s; }
.hero-animate:nth-child(4) { animation-delay: 0.55s; }
.hero-animate:nth-child(5) { animation-delay: 0.7s; }

/* ============================
   Animations — Card Shimmer
   ============================ */
.product-card {
    position: relative;
    overflow: hidden;
}

.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.06),
        transparent
    );
    transition: none;
    pointer-events: none;
}

.product-card:hover::after {
    left: 200%;
    transition: left 0.6s ease;
}

/* ============================
   Animations — Screenshot Hover
   ============================ */
.feature-image img,
.hero-screenshots img,
.screenshot-row img {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-image img:hover,
.hero-screenshots img:hover,
.screenshot-row img:hover {
    transform: scale(1.04);
    box-shadow: 0 16px 50px var(--color-shadow-hover);
}

/* ============================
   Animations — Platform Icon Hover
   ============================ */
.platform-item {
    transition: transform 0.3s ease;
}

.platform-item:hover {
    transform: translateY(-4px);
}

.platform-item:hover .platform-icon svg {
    fill: var(--color-accent);
    transition: fill 0.3s ease;
}

/* ============================
   Footer
   ============================ */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 32px 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

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

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

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

    .hero {
        padding: 60px 24px 40px;
    }

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

    .feature {
        flex-direction: column !important;
        gap: 32px;
        text-align: center;
    }

    .feature-image img {
        max-width: 220px;
    }

    .hero-screenshots img {
        width: 150px;
    }

    .platforms-grid {
        gap: 24px;
    }
}

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

    .product-card {
        padding: 28px;
    }

    .hero-screenshots {
        gap: 8px;
    }

    .hero-screenshots img {
        width: 110px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::after, *::before {
        transition: none !important;
        animation: none !important;
    }

    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }

    .hero-animate {
        opacity: 1 !important;
        transform: none !important;
    }

    html {
        scroll-behavior: auto;
    }
}
