:root {
    --bg-color: #0c0c0e;
    --panel-color: #1a1a1e;
    --accent: #cbd5e1;
    --accent-glow: rgba(203, 213, 225, 0.3);
    --accent-secondary: #94a3b8;
    --text-main: #f0f0f5;
    --text-dim: #8a8a9a;
    --border-subtle: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Animated Glows */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent);
    top: -100px;
    right: -100px;
    animation: float 15s infinite alternate ease-in-out;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-secondary);
    bottom: -100px;
    left: -200px;
    animation: float 20s infinite alternate-reverse ease-in-out;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-50px, 50px);
    }
}

/* Nav */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    backdrop-filter: blur(12px);
    background: rgba(12, 12, 14, 0.7);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    color: var(--text-base);
}

.logo img {
    filter: invert(1) brightness(2);
}

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

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

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

.nav-links a:hover,
.github-link {
    color: var(--text-main);
}

/* Typography Helpers */
.text-gradient {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: -1px;
}

/* Hero */
.hero {
    max-width: 1200px;
    margin: 8rem auto 4rem;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin-bottom: 0;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-dim);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    background: #00ffff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--panel-color);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Browser Mockup */
.browser-mockup {
    width: 100%;
    max-width: 1000px;
    background: var(--panel-color);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px inset rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.mockup-header {
    height: 40px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.mockup-header span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f56;
}

.mockup-header span:nth-child(2) {
    background: #ffbd2e;
}

.mockup-header span:nth-child(3) {
    background: #27c93f;
}

.mockup-content {
    background: #000;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.showcase-img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Showcase Carousel */
.showcase {
    max-width: 1400px;
    margin: 4rem auto 8rem;
    padding: 0 2rem;
    scroll-margin-top: 100px;
}

.features-stack {
    display: flex;
    flex-direction: column;
    gap: 10rem;
    margin-top: 4rem;
}

.feature-row {
    display: flex;
    align-items: center;
    gap: 6rem;
}

.feature-row.reverse {
    flex-direction: row-reverse;
}

.feature-content {
    flex: 1;
}

.feature-content h3 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
    line-height: 1.1;
    letter-spacing: -1px;
}

.feature-content p {
    font-size: 1.2rem;
    color: var(--text-dim);
}

.feature-image {
    flex: 1.5;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    /* No fixed aspect-ratio: the box fits the actual image size */
    max-width: 100%;
    background: transparent;
    overflow: visible;
}

/* Inner wrapper — sizes to the image, border clips to it */
.image-stack-inner {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.hit-zone {
    position: absolute;
    top: 0;
    width: 20%;
    /* Narrower as requested */
    height: 100%;
    z-index: 100;
    cursor: pointer;
    background: transparent;
}

.hit-zone.left {
    left: 0;
}

.hit-zone.right {
    right: 0;
}

.feature-row.reverse .feature-image {
    justify-content: center;
}

/* Base image styling for floating deck effect or standalones */
.feature-image img {
    /* Display at natural size, constrained to the flex container */
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    background: transparent;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* For JS deck stack, JS handles absolute positioning */
.feature-image:not(.no-stack) img {
    position: relative;
    /* Default if only 1 image */
}

.feature-image:not(.no-stack) img:nth-child(n+2) {
    position: absolute;
    top: 0;
    left: 0;
}

.stack-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 400;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    opacity: 0.5;
    pointer-events: auto;
}

.stack-nav-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    transform: translateY(-50%) scale(1.1);
}

.stack-nav-btn.prev {
    left: -22px;
}

.stack-nav-btn.next {
    right: -22px;
}

/* Wiki */
.wiki {
    max-width: 1000px;
    margin: 8rem auto;
    padding: 0 2rem;
    scroll-margin-top: 100px;
}

.wiki-container {
    display: flex;
    gap: 2rem;
    background: rgba(26, 26, 30, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    min-height: 400px;
}

.wiki-sidebar {
    width: 250px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border-subtle);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
}

.wiki-tab {
    background: none;
    border: none;
    color: var(--text-dim);
    text-align: left;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.wiki-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.wiki-tab.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: rgba(0, 229, 255, 0.05);
}

.wiki-content {
    flex: 1;
    padding: 3rem 5rem;
    background: transparent;
}

.wiki-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.wiki-panel.active {
    display: block;
}

.wiki-panel .feature-image {
    margin-top: 2rem;
    position: relative;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    overflow: visible;
}

.wiki-panel .feature-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    transform: none !important;
    opacity: 1 !important;
    z-index: 1;
}

.wiki-panel .feature-image img:nth-child(n+2) {
    transform: scale(0.98) translate(4px, 4px);
    opacity: 0;
    z-index: 0;
}

.wiki-panel .feature-image:hover img:nth-child(n+2) {
    opacity: 0;
}

.wiki-panel .feature-image:hover .stack-nav-btn {
    opacity: 1;
}

.wiki-panel .stack-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 400;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.wiki-panel .stack-nav-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.wiki-panel .stack-nav-btn.prev {
    left: -50px;
}

.wiki-panel .stack-nav-btn.next {
    right: -50px;
}

.wiki-panel .hit-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    z-index: 999;
    cursor: pointer;
}

.wiki-panel .hit-zone.left {
    left: 0;
}

.wiki-panel .hit-zone.right {
    right: 0;
}

.wiki-panel h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.wiki-panel .notes-example {
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.wiki-panel .notes-example pre {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-dim);
    white-space: pre-wrap;
    margin: 0;
    background: transparent;
}

.wiki-panel .notes-example pre code {
    background: transparent;
    padding: 0;
    color: var(--text-dim);
    font-size: inherit;
}

.wiki-panel h4 {
    margin-bottom: 1rem;
    color: var(--accent);
}

.wiki-panel p {
    color: #ccc;
    margin-bottom: 1rem;
}

.wiki-panel ul,
.wiki-panel ol {
    padding-left: 1.5rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.wiki-panel li {
    margin-bottom: 0.5rem;
}

.wiki-panel code {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: var(--accent);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 2rem;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-dim);
    margin-top: 5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .features-stack {
        gap: 6rem;
    }

    .feature-row,
    .feature-row.reverse {
        flex-direction: column;
        gap: 3rem;
    }

    .feature-image {
        width: 100%;
        padding-right: 40px;
    }

    /* Leave room for the stack popping out on the right */

    .wiki-container {
        flex-direction: column;
    }

    .wiki-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        padding: 1rem 0;
        flex-direction: row;
        overflow-x: auto;
    }

    .wiki-tab {
        padding: 1rem;
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .wiki-tab.active {
        border-left-color: transparent;
        border-bottom-color: var(--accent);
    }

    .wiki-content {
        padding: 2rem;
    }
}

/* Lightbox Overlay */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #fff;
    font-size: 2.5rem;
    font-weight: 200;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

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