/* Librewispr Landing Page — Design System */

/* ===== Font Face ===== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/inter-latin-v20.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== Design Tokens ===== */
:root {
    --gradient-brand: linear-gradient(135deg, #FF0076, #590FB7, #00E5FF);
    --gradient-brand-reverse: linear-gradient(135deg, #00E5FF, #590FB7, #FF0076);
    --color-pink: #FF0076;
    --color-indigo: #590FB7;
    --color-cyan: #00E5FF;
    --color-canvas: #000000;
    --color-base: #0B0F19;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.2);
    --container-max: 1200px;
    --section-padding: 120px 24px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--color-canvas);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ===== Ambient Background ===== */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(120px);
}

body::before {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 0, 118, 0.12) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    animation: float-orb-1 20s ease-in-out infinite;
}

body::after {
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.08) 0%, transparent 70%);
    bottom: -300px;
    right: -300px;
    animation: float-orb-2 25s ease-in-out infinite;
}

.ambient-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(140px);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(89, 15, 183, 0.1) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    animation: float-orb-3 22s ease-in-out infinite;
}

@keyframes float-orb-1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(60px, 40px); }
    66% { transform: translate(-30px, 80px); }
}

@keyframes float-orb-2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-50px, -30px); }
    66% { transform: translate(40px, -60px); }
}

@keyframes float-orb-3 {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-80px); }
}

/* ===== Noise Texture Overlay ===== */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

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

.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 24px;
    transition: var(--transition-normal);
}

.nav.scrolled {
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
}

.nav-brand svg {
    width: 24px;
    height: 24px;
}

.nav-brand span {
    background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

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

.nav-github {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.nav-github:hover { color: var(--text-primary); }
.nav-github svg { width: 20px; height: 20px; }

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    transition: var(--transition-fast);
    cursor: pointer;
}

.lang-toggle:hover {
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

.lang-toggle .active {
    color: var(--text-primary);
}

.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
    cursor: pointer;
}

.nav-mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: var(--transition-fast);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 24px 120px;
    position: relative;
    overflow: hidden;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content {
    max-width: 560px;
}

.hero-title {
    font-size: clamp(40px, 5vw, 64px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -2px;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 20px;
}

.hero-body {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 480px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #fff;
    color: #000;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    transition: var(--transition-fast);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.25);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid var(--border-default);
    transition: var(--transition-fast);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.btn-ghost svg {
    width: 18px;
    height: 18px;
}

.hero-note {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== App Mockup ===== */
.hero-mockup {
    perspective: 1200px;
    display: flex;
    justify-content: center;
}

.mockup-window {
    width: 520px;
    background: var(--color-base);
    border-radius: 12px;
    border: 1px solid var(--border-default);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), 0 0 120px rgba(89, 15, 183, 0.08);
    transform: rotateY(-8deg) rotateX(3deg);
    transition: transform 0.6s ease;
    overflow: hidden;
}

.mockup-window:hover {
    transform: rotateY(-3deg) rotateX(1deg);
}

.mockup-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

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

.mockup-dot.red { background: #FF5F57; }
.mockup-dot.yellow { background: #FEBC2E; }
.mockup-dot.green { background: #28C840; }

.mockup-body {
    display: flex;
    height: 360px;
}

.mockup-sidebar {
    width: 180px;
    padding: 16px 12px;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mockup-nav-item {
    height: 36px;
    border-radius: 8px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mockup-nav-item.active {
    background: rgba(255, 0, 118, 0.08);
    border-left: 3px solid var(--color-pink);
}

.mockup-nav-icon {
    width: 16px;
    height: 2px;
    border-radius: 1px;
    background: var(--text-muted);
}

.mockup-nav-item.active .mockup-nav-icon {
    background: var(--text-primary);
}

.mockup-nav-label {
    height: 2px;
    border-radius: 1px;
    background: var(--text-muted);
    opacity: 0.5;
}

.mockup-nav-item.active .mockup-nav-label {
    background: var(--text-primary);
    opacity: 0.8;
}

.mockup-content {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    position: relative;
    overflow: hidden;
}

.mockup-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(89, 15, 183, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

/* Waveform visualization in mockup */
.mockup-waveform {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 80px;
}

.mockup-waveform span {
    width: 4px;
    border-radius: 2px;
    background: var(--gradient-brand);
    animation: waveform-bar 1.5s ease-in-out infinite;
}

.mockup-waveform span:nth-child(1) { height: 20px; animation-delay: 0s; }
.mockup-waveform span:nth-child(2) { height: 35px; animation-delay: 0.1s; }
.mockup-waveform span:nth-child(3) { height: 55px; animation-delay: 0.2s; }
.mockup-waveform span:nth-child(4) { height: 70px; animation-delay: 0.3s; }
.mockup-waveform span:nth-child(5) { height: 80px; animation-delay: 0.4s; }
.mockup-waveform span:nth-child(6) { height: 65px; animation-delay: 0.5s; }
.mockup-waveform span:nth-child(7) { height: 50px; animation-delay: 0.6s; }
.mockup-waveform span:nth-child(8) { height: 30px; animation-delay: 0.7s; }
.mockup-waveform span:nth-child(9) { height: 45px; animation-delay: 0.8s; }
.mockup-waveform span:nth-child(10) { height: 25px; animation-delay: 0.9s; }

@keyframes waveform-bar {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.4); }
}

/* Floating pill widget in mockup */
.mockup-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(30, 30, 35, 0.9);
    border: 1px solid var(--border-default);
    border-radius: 100px;
    backdrop-filter: blur(12px);
}

.mockup-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-pink);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 0, 118, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(255, 0, 118, 0); }
}

.mockup-pill-text {
    height: 2px;
    width: 60px;
    border-radius: 1px;
    background: var(--text-secondary);
}

.mockup-pill-time {
    height: 2px;
    width: 30px;
    border-radius: 1px;
    background: var(--text-muted);
}

/* Text lines in mockup */
.mockup-text-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 0 12px;
}

.mockup-line {
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.06);
}

.mockup-line.w80 { width: 80%; }
.mockup-line.w60 { width: 60%; }
.mockup-line.w70 { width: 70%; }
.mockup-line.w45 { width: 45%; }

/* ===== Section shared ===== */
section {
    padding: var(--section-padding);
    position: relative;
}

.section-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 16px;
    text-align: center;
}

.section-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 64px;
    line-height: 1.6;
}

/* ===== Features Section ===== */
#features {
    padding-top: 0;
    padding-bottom: 140px;
}

#features::before {
    content: '';
    display: block;
    width: 120px;
    height: 1px;
    background: var(--gradient-brand);
    margin: 0 auto 80px;
    opacity: 0.4;
}

/* ===== Features Grid ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: var(--container-max);
    margin: 0 auto;
}

.feature-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 28px 24px;
    transition: var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--color-cyan);
    stroke-width: 1.75;
    fill: none;
}

.feature-card:nth-child(2) .feature-icon svg { stroke: var(--color-pink); }
.feature-card:nth-child(3) .feature-icon svg { stroke: var(--color-indigo); }
.feature-card:nth-child(4) .feature-icon svg { stroke: var(--color-cyan); }
.feature-card:nth-child(5) .feature-icon svg { stroke: var(--color-pink); }
.feature-card:nth-child(6) .feature-icon svg { stroke: var(--color-indigo); }
.feature-card:nth-child(7) .feature-icon svg { stroke: var(--color-cyan); }
.feature-card:nth-child(8) .feature-icon svg { stroke: var(--color-pink); }

.feature-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.feature-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== Open Source CTA ===== */
.oss-card {
    max-width: 800px;
    margin: 0 auto;
    padding: 56px;
    border-radius: 20px;
    border: 1px solid transparent;
    background-image: linear-gradient(#0B0F19, #0B0F19),
                      var(--gradient-brand);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.oss-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(89, 15, 183, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.oss-title {
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 12px;
    position: relative;
}

.oss-desc {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    position: relative;
}

.oss-badges {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

.badge {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}


/* ===== Footer ===== */
.footer {
    padding: 48px 24px;
    border-top: 1px solid var(--border-subtle);
}

.footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-secondary);
}

.footer-brand svg { width: 20px; height: 20px; }

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 14px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

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


/* ===== Scroll Animations ===== */
.animate-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.animate-in.delay-1 { transition-delay: 0.1s; }
.animate-in.delay-2 { transition-delay: 0.2s; }
.animate-in.delay-3 { transition-delay: 0.3s; }
.animate-in.delay-4 { transition-delay: 0.4s; }
.animate-in.delay-5 { transition-delay: 0.5s; }
.animate-in.delay-6 { transition-delay: 0.6s; }
.animate-in.delay-7 { transition-delay: 0.7s; }

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

    .hero .container {
        grid-template-columns: 1fr;
        gap: 48px;
        text-align: center;
    }

    .hero-content {
        max-width: 600px;
        margin: 0 auto;
    }

    .hero-body { margin-left: auto; margin-right: auto; }
    .hero-buttons { justify-content: center; }
    .hero-note { text-align: center; }

    .mockup-window {
        transform: rotateY(0) rotateX(0);
        max-width: 480px;
        margin: 0 auto;
    }

    .mockup-window:hover {
        transform: rotateY(0) rotateX(0) translateY(-4px);
    }
}

@media (max-width: 767px) {
    :root {
        --section-padding: 80px 20px;
    }

    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(11, 15, 25, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 20px 24px;
        gap: 16px;
        border-bottom: 1px solid var(--border-subtle);
    }

    .nav-mobile-toggle { display: flex; }

    .hero {
        min-height: auto;
        padding: 100px 20px 60px;
    }

    .hero-title {
        letter-spacing: -1.5px;
    }

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

    #features {
        padding-bottom: 80px;
    }

    .mockup-sidebar { display: none; }
    .mockup-window { width: 100%; }

    .oss-card { padding: 32px 20px; }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary, .btn-ghost {
        justify-content: center;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}
