@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&family=Space+Mono&display=swap');

:root {
    /* Geist Master Palette */
    --background: #ffffff;
    --background-secondary: #fafafa;
    --foreground: #000000;
    --accents-1: #fafafa;
    --accents-2: #eaeaea;
    --accents-3: #999999;
    --accents-4: #707070;
    /* Increased for 4.5:1 contrast on white */
    --accents-5: #555555;
    /* Increased for 4.5:1 contrast on white */
    --accents-6: #444444;
    --accents-7: #333333;
    --accents-8: #111111;

    --geist-success: #0070f3;
    /* Primary Blue */
    --geist-success-green: #00cc66;
    /* Standard Success Green */
    --geist-success-light: #3291ff;
    --geist-error: #ee0000;
    --geist-warning: #f5a623;
    --geist-cyan: #79ffe1;
    --geist-purple: #f81ce5;

    --link-color: var(--geist-success);
    --selection: var(--geist-cyan);
    --background-rgb: 255, 255, 255;

    /* High-End Elevation */
    --shadow-subtle: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 40px 80px rgba(0, 0, 0, 0.12);
    --border-radius: 8px;

    /* Layout Constants */
    --header-height: 80px;
    --max-width: 1080px;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;

    /* Animation Curve */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --theme-ease: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme='dark'] {
    --background: #000000;
    --background-secondary: #0a0a0a;
    --foreground: #ffffff;
    --accents-1: #111111;
    --accents-2: #222222;
    --accents-3: #444444;
    --accents-4: #888888;
    --accents-5: #a0a0a0;
    /* Increased for contrast in dark mode */
    --accents-6: #bcbcbc;
    --accents-7: #ebebeb;
    --accents-8: #ffffff;

    --geist-success-green: #00e074;
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 40px 80px rgba(0, 0, 0, 0.8);
    --geist-success: #0070f3;
    --background-rgb: 0, 0, 0;
}

/* Master Reset */
* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

body {
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    width: 100%;
    transition: background var(--theme-ease), color var(--theme-ease);
    scroll-padding-top: var(--header-height);
    /* WCAG 2.2: Focus Not Obscured */
}

html {
    overflow-x: hidden;
    width: 100%;
}

/* Accessible Focus States */
:focus-visible {
    outline: 2px solid var(--geist-success);
    outline-offset: 4px;
}

/* Noise Overlay - The Masterpiece Touch */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 9999;
}

[data-theme='dark'] body::before {
    opacity: 0.04;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

/* --- High-End Navigation --- */

header {
    height: var(--header-height);
    background: var(--background);
    /* Keep header solid on mobile for better stacking */
    border-bottom: 1px solid var(--accents-2);
    position: sticky;
    top: 0;
    z-index: 2000;
    /* Higher than menu to keep toggle visible if needed */
    display: flex;
    align-items: center;
}

@media (min-width: 769px) {
    header {
        background: rgba(var(--background-rgb), 0.8);
        backdrop-filter: blur(20px) saturate(180%);
    }
}

.header-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -0.02em;
    color: var(--foreground);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cta-group {
    display: flex;
    gap: 20px;
    justify-content: center;
}

@media (max-width: 600px) {
    .cta-group {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .cta-group .btn {
        width: 100%;
        justify-content: center;
    }
}

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

.nav-link {
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    color: var(--accents-5);
    transition: color 0.2s ease;
    white-space: nowrap;
    /* Prevent nav links from wrapping on smaller desktops */
}

.nav-link:hover {
    color: var(--foreground);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--foreground);
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: var(--background);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        z-index: 3000;
        /* Higher than header (2000) */
        transform: translateX(100%);
        transition: transform 0.4s var(--ease), visibility 0.4s var(--ease);
        visibility: hidden;
        padding: 40px;
        pointer-events: none;
        /* Disable interaction when hidden */
    }

    .nav-links.active {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    .nav-link {
        font-size: 28px;
        font-weight: 700;
        color: var(--foreground);
    }
}

/* --- Buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s var(--ease);
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-black {
    background: #000000;
    color: #ffffff;
}

.btn-black:hover {
    background: #222222;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-white {
    background: #ffffff;
    color: #000000;
    border-color: var(--accents-2);
}

.btn-white:hover {
    background: var(--accents-1);
    border-color: var(--accents-3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme='dark'] .btn-black {
    background: #ffffff;
    color: #000000;
}

[data-theme='dark'] .btn-white {
    background: transparent;
    color: #ffffff;
    border-color: var(--accents-3);
}

/* --- Sun/Moon Toggle --- */

.theme-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--accents-5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 45px;
}

.theme-toggle {
    background: var(--background);
    border: 1px solid var(--accents-2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease);
    color: var(--foreground);
    box-shadow: var(--shadow-subtle);
}

.theme-toggle:hover {
    border-color: var(--accents-6);
    transform: scale(1.05);
}

.theme-toggle i {
    position: absolute;
    font-size: 18px;
    transition: transform 0.6s var(--ease), opacity 0.3s var(--ease);
    color: inherit;
}

[data-theme='light'] .fa-moon {
    opacity: 1;
    transform: rotate(0);
}

[data-theme='light'] .fa-sun {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme='dark'] .fa-moon {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme='dark'] .fa-sun {
    opacity: 1;
    transform: rotate(0);
}

/* Ensure high visibility in dark mode */
[data-theme='dark'] .theme-toggle {
    background: #111;
    border-color: #333;
}

/* --- Hero Section --- */

.hero {
    padding: 160px 0 120px;
    text-align: center;
    position: relative;
}

.hero-glow {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 600px;
    background: radial-gradient(circle, var(--geist-success) 0%, transparent 70%);
    opacity: 0.1;
    filter: blur(120px);
    z-index: -1;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(38px, 10vw, 88px);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 32px;
    background: linear-gradient(to bottom, var(--foreground) 60%, var(--accents-5));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    word-break: break-word;
    /* Ensure long words wrap */
}

.hero p {
    font-size: clamp(16px, 4vw, 20px);
    color: var(--accents-5);
    max-width: 720px;
    margin: 0 auto 56px;
    line-height: 1.6;
}

/* --- Section Design --- */

.section {
    padding: 120px 0;
    border-top: 1px solid var(--accents-2);
}

@media (max-width: 768px) {
    .section {
        padding: 80px 0;
    }
}

.section-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--geist-success-green);
    /* Consistency with Masterpiece Green */
    margin-bottom: 24px;
    display: block;
}

.section h2 {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 64px;
    line-height: 1.2;
}

/* --- Comparison Logic (Pain Points) --- */

.comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .comparison {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.comp-box {
    padding: 48px;
    border-radius: 16px;
    border: 1px solid var(--accents-2);
    position: relative;
    width: 100%;
    /* Ensure full width */
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .comp-box {
        padding: 32px 24px;
    }
}

.comp-box.negative {
    background: rgba(238, 0, 0, 0.02);
    border-color: rgba(238, 0, 0, 0.1);
}

.comp-box.positive {
    background: rgba(0, 112, 243, 0.02);
    border-color: rgba(0, 112, 243, 0.1);
}

.comp-box h3 {
    font-family: var(--font-heading);
    font-size: 24px;
    margin-bottom: 24px;
}

.comp-list {
    list-style: none;
}

.comp-list li {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 15px;
    color: var(--accents-5);
    line-height: 1.5;
    align-items: flex-start;
    /* Ensure top alignment for wrapping text */
}

.comp-list i {
    flex-shrink: 0;
    margin-top: 0.25em;
    /* Precisely align with first line regardless of text length */
    font-size: 16px;
}

.negative i {
    color: var(--geist-error);
}

.positive i {
    color: var(--geist-success-green);
}

/* --- Author Card Responsiveness --- */
.author-card {
    grid-column: span 2;
    display: flex;
    gap: 40px;
    align-items: center;
    padding: 48px;
    background: var(--background);
    border: 1px solid var(--accents-2);
    border-radius: 16px;
}

.author-avatar {
    width: 120px;
    height: 120px;
    min-width: 120px;
    border-radius: 50%;
    background: var(--accents-1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accents-2);
    overflow: hidden;
    /* Ensure content stays inside */
}

.author-content h3 {
    font-family: var(--font-heading);
    font-size: 32px;
    margin-bottom: 8px;
}

.author-subtitle {
    color: var(--accents-5);
    font-size: 18px;
    margin-bottom: 24px;
}

.author-description {
    max-width: 600px;
    color: var(--accents-6);
    line-height: 1.6;
}

.author-ctas {
    justify-content: flex-start;
    margin-top: 32px;
}

@media (max-width: 768px) {
    .author-card {
        flex-direction: column;
        text-align: center;
        padding: 32px 24px;
        gap: 24px;
    }

    .author-ctas {
        justify-content: center;
        flex-direction: column;
    }

    .author-ctas .btn {
        width: 100%;
    }
}

/* --- Feature Bento --- */

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

.bento-card {
    grid-column: span 4;
    padding: 40px;
    background: var(--background);
    border: 1px solid var(--accents-2);
    border-radius: 12px;
    transition: all 0.3s var(--ease);
}

.bento-card:hover {
    border-color: var(--accents-6);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.bento-card i {
    font-size: 32px;
    color: var(--foreground);
    margin-bottom: 24px;
}

.bento-card h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    margin-bottom: 12px;
}

.bento-card p {
    font-size: 14px;
    color: var(--accents-5);
    line-height: 1.6;
}

.span-8 {
    grid-column: span 8;
}

.span-4 {
    grid-column: span 4;
}

.span-12 {
    grid-column: span 12;
}

/* --- Screenshots Gallery --- */

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

.gallery-item {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--accents-2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s var(--ease);
    background: var(--background);
}

.gallery-item:hover {
    border-color: var(--accents-6);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item span {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--accents-5);
    text-align: center;
    padding: 16px;
}

.gallery-wide {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .gallery-wide {
        grid-column: span 2;
    }
}

.gallery-item {
    cursor: pointer;
}

/* --- Geist Lightbox --- */

.docs-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.docs-lightbox.active {
    display: flex;
    opacity: 1;
}

.docs-lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.docs-lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.docs-lightbox-caption {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    margin-top: 20px;
    text-align: center;
    opacity: 0.8;
}

.docs-lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.docs-lightbox-close:hover {
    opacity: 1;
}

.docs-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.docs-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

.docs-lightbox-prev {
    left: -64px;
}

.docs-lightbox-next {
    right: -64px;
}

@media (max-width: 768px) {
    .docs-lightbox-prev {
        left: 12px;
    }

    .docs-lightbox-next {
        right: 12px;
    }

    .docs-lightbox-inner {
        max-width: 95vw;
    }
}

/* --- FAQ Accordion --- */

.faq-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.faq-item {
    border-bottom: 1px solid var(--accents-2);
}

.faq-btn {
    width: 100%;
    padding: 32px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--foreground);
    text-align: left;
}

.faq-btn i {
    transition: transform 0.3s var(--ease);
}

.faq-btn.active i {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease);
}

.faq-answer p {
    padding-bottom: 32px;
    font-size: 16px;
    color: var(--accents-5);
    line-height: 1.7;
    max-width: 800px;
}

/* --- Mega Footer --- */

footer {
    padding: 120px 0 60px;
    background: var(--background-secondary);
    border-top: 1px solid var(--accents-2);
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 64px;
    margin-bottom: 80px;
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 48px;
        margin-bottom: 40px;
    }

    .footer-brand {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-col {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-links li a {
        justify-content: center;
    }
}

.footer-brand p {
    margin-top: 16px;
    font-size: 14px;
    color: var(--accents-5);
}

.footer-col h4 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

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

.footer-links a {
    text-decoration: none;
    font-size: 14px;
    color: var(--accents-5);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.footer-links i {
    width: 16px;
    text-align: center;
}

.footer-bottom {
    padding-top: 40px;
    border-top: 1px solid var(--accents-2);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--accents-4);
}

/* --- Responsive --- */

@media (max-width: 1024px) {
    .comparison {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }

    .hero h1 {
        font-size: clamp(32px, 10vw, 48px);
    }

    .bento-card {
        grid-column: span 12;
    }

    .span-8,
    .span-4 {
        grid-column: span 12;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* reveal animations */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    html {
        scroll-behavior: auto !important;
    }
}

[data-reveal].visible {
    opacity: 1;
    transform: translateY(0);
}