/* === DocuClaw Website — OpenClaw-inspired Design System === */

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

:root {
    --bg-deep: #0B0E14;
    --bg-card: #131720;
    --bg-card-hover: #1A2030;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(239, 68, 68, 0.3);

    --text-primary: #E8EAF0;
    --text-secondary: #A0AEC0;
    --text-muted: #718096;

    --accent: #E53E3E;
    --accent-light: #F87171;
    --accent-dark: #B91C1C;
    --accent-glow: rgba(229, 62, 62, 0.4);

    --cyan: #22D3EE;

    --max-width: 1100px;
    --radius: 12px;
    --radius-lg: 16px;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: #0B0E14;
}

body {
    font-family: var(--font-body);
    background-color: #0B0E14;
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-light);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

/* --- Stars Background --- */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--duration) infinite var(--delay);
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: var(--max-opacity);
    }
}

/* --- Language Switcher (Dropdown) --- */
.lang-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(11, 14, 20, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.lang-current:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(19, 23, 32, 0.95);
}

.lang-chevron {
    transition: transform 0.2s;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 150px;
    background: rgba(19, 23, 32, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 12px;
    list-style: none;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.lang-switcher:hover .lang-dropdown,
.lang-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-switcher:hover .lang-chevron,
.lang-switcher.open .lang-chevron {
    transform: rotate(180deg);
}

.lang-option {
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.15s;
    white-space: nowrap;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.lang-option.active {
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
}

/* --- Hero --- */
.hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 100px 24px 60px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.hero-logo {
    margin-bottom: 24px;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    background: linear-gradient(135deg, var(--accent) 0%, #f87171 50%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    line-height: 1.1;
}

.hero-tagline {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: #FFFFFF;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero-desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 32px;
    line-height: 1.8;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 32px;
    background: #8E1B1B;
    color: white !important;
    font-weight: 700;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(142, 27, 27, 0.4);
    text-decoration: none !important;
}

.hero-cta:hover {
    background: #7F1D1D;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(127, 29, 29, 0.4);
    text-decoration: none !important;
}

/* --- Section --- */
.section {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 32px;
    letter-spacing: -0.5px;
}

.section-title .accent {
    color: var(--accent);
    margin-right: 4px;
}

.section-desc {
    color: var(--text-secondary);
    max-width: 640px;
    margin-bottom: 24px;
    line-height: 1.8;
}

/* --- Terminal Card --- */
.terminal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.3s;
}

.terminal-card:hover {
    border-color: var(--border-hover);
}

.terminal-dots {
    display: flex;
    gap: 8px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #EF4444;
}

.dot.yellow {
    background: #F59E0B;
}

.dot.green {
    background: #22C55E;
}

.terminal-code {
    padding: 20px 24px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--text-primary);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.terminal-code .comment {
    color: #CBD5E0;
    font-style: italic;
}

.terminal-code .prompt {
    color: var(--accent);
}

.terminal-code .key {
    color: var(--cyan);
}

/* --- Features Grid --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    transition: all 0.3s;
    cursor: default;
}

.feature-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

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

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

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* --- Architecture --- */
.arch-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.arch-diagram {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre;
}

/* --- Pipeline --- */
.pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
    padding: 20px 0;
}

.pipeline-step {
    text-align: center;
    padding: 24px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 150px;
    transition: all 0.3s;
}

.pipeline-step:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

.pipeline-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.pipeline-label {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.pipeline-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pipeline-arrow {
    font-size: 1.5rem;
    color: var(--accent);
    padding: 0 12px;
    font-weight: 700;
}

/* --- Ecosystem --- */
.eco-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.eco-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-decoration: none;
    transition: all 0.3s;
}

.eco-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    text-decoration: none;
}

.eco-card.active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

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

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

/* --- Roadmap --- */
.roadmap-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.roadmap-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.roadmap-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.roadmap-check {
    font-size: 1rem;
    width: 24px;
    flex-shrink: 0;
    text-align: center;
}

.roadmap-item.done .roadmap-check {
    color: #22C55E;
    font-weight: 700;
}

.roadmap-item:not(.done) .roadmap-check {
    color: var(--text-muted);
}

.roadmap-item.done span:last-child {
    color: var(--text-primary);
}

.roadmap-item:not(.done) span:last-child {
    color: var(--text-secondary);
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 60px 24px 40px;
    max-width: var(--max-width);
    margin: 0 auto;
    border-top: 1px solid var(--border);
}

.footer a {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    text-decoration: underline;
}

.footer-links a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.footer-dot {
    color: var(--text-muted);
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.footer-copy {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-style: italic;
    margin-bottom: 16px;
}

.footer-disclaimer {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.footer-disclaimer a {
    color: var(--text-primary);
    text-decoration: underline !important;
}

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

/* ===== Responsive ===== */

/* Tablet */
@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

/* Mobile */
@media (max-width: 640px) {
    .hero {
        padding: 80px 20px 40px;
    }

    .hero-logo svg {
        width: 90px;
        height: 90px;
    }

    .hero-title {
        font-size: 2.5rem;
        letter-spacing: -1px;
    }

    .hero-tagline {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }

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

    .hero-cta {
        padding: 12px 24px;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }

    .section {
        padding: 40px 16px;
    }

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

    .features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .feature-card {
        padding: 24px 20px;
    }

    .feature-card:hover {
        transform: none;
    }

    /* disable lift on mobile */

    .eco-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pipeline {
        flex-direction: column;
        gap: 0;
    }

    .pipeline-step {
        width: 100%;
        min-width: auto;
    }

    .pipeline-arrow {
        transform: rotate(90deg);
        padding: 8px 0;
        font-size: 1.2rem;
    }

    .arch-card {
        padding: 16px;
    }

    .arch-diagram {
        font-size: 0.65rem;
    }

    .terminal-code {
        font-size: 0.78rem;
        padding: 16px;
    }

    .terminal-dots {
        padding: 10px 16px;
    }

    .dot {
        width: 10px;
        height: 10px;
    }

    .roadmap-item {
        padding: 12px 16px;
        font-size: 0.88rem;
    }

    .lang-switcher {
        top: 12px;
        right: 12px;
    }

    .lang-current {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .lang-dropdown {
        min-width: 130px;
    }

    .footer {
        padding: 40px 16px 30px;
    }

    .footer-links {
        gap: 6px;
    }

    .footer-links a {
        font-size: 0.82rem;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .hero-title {
        font-size: 2rem;
    }

    .arch-diagram {
        font-size: 0.55rem;
    }
}

/* Touch device optimizations */
@media (hover: none) {

    .feature-card:hover,
    .pipeline-step:hover,
    .eco-card:hover {
        transform: none;
        box-shadow: none;
    }

    /* Make dropdown work with tap on touch devices */
    .lang-switcher.open .lang-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}