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

:root {
    --bg-primary: #060a12;
    --bg-secondary: #0a0f1a;
    --bg-card: #0e1520;
    --bg-card-hover: #141d2e;
    --accent-400: #38bdf8;
    --accent-500: #0ea5e9;
    --accent-600: #0284c7;
    --accent-700: #0369a1;
    --accent-glow: rgba(14, 165, 233, 0.15);
    --accent-glow-strong: rgba(14, 165, 233, 0.3);
    --text-primary: #edf2f7;
    --text-secondary: #8fa3b8;
    --text-muted: #4a6178;
    --border: #152030;
    --border-hover: #1e3048;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-400);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 48px;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(0px);
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.nav-logo:hover {
    opacity: 0.8;
}

.nav-logo-img {
    height: 44px;
    width: auto;
}

.footer-logo-img {
    height: 40px;
    width: auto;
}

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

.nav-link {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--accent-400);
}

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

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

.hero-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-tag {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-400);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 16px;
    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
}

.hero-title {
    font-size: clamp(3rem, 7vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.1s forwards;
}

.hero-app-icon {
    display: inline-block;
    width: 0.72em;
    height: 0.72em;
    vertical-align: middle;
    margin-left: 14px;
    position: relative;
    top: -0.04em;
    filter: drop-shadow(0 0 20px rgba(14, 165, 233, 0.4));
    transition: filter 0.3s ease;
}

.hero-app-icon:hover {
    filter: drop-shadow(0 0 30px rgba(14, 165, 233, 0.6));
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin-bottom: 36px;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.2s forwards;
}

.hero-actions {
    display: flex;
    gap: 16px;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.3s forwards;
}

.hero-visual {
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.4s forwards;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-sans);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-500), var(--accent-700));
    color: white;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 30px rgba(14, 165, 233, 0.5);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
}

.btn-outline:hover {
    border-color: var(--accent-500);
    color: var(--accent-400);
    background: rgba(14, 165, 233, 0.05);
}

.btn-sm {
    padding: 10px 22px;
    font-size: 0.85rem;
}

/* ===== Browser Mockup ===== */
.browser-mockup {
    background: var(--bg-card);
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 80px var(--accent-glow);
}

.mockup-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.mockup-dots {
    display: flex;
    gap: 7px;
}

.mockup-dots span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.4;
}

.mockup-dots span:first-child { background: #ff5f57; opacity: 0.8; }
.mockup-dots span:nth-child(2) { background: #ffbd2e; opacity: 0.8; }
.mockup-dots span:last-child { background: #28c840; opacity: 0.8; }

.mockup-url {
    flex: 1;
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 7px 14px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mockup-body {
    padding: 28px 24px;
    min-height: 240px;
}

.mockup-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mockup-line {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    opacity: 0.6;
}

.mockup-line.w40 { width: 40%; }
.mockup-line.w50 { width: 50%; }
.mockup-line.w60 { width: 60%; }
.mockup-line.w70 { width: 70%; }
.mockup-line.w80 { width: 80%; }
.mockup-line.w90 { width: 90%; }

.mockup-block {
    height: 80px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(14, 165, 233, 0.05));
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 8px 0;
}

/* ===== Scroll Indicator ===== */
.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fadeIn 1s ease 1s forwards;
}

.scroll-indicator span {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.scroll-arrow {
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom, var(--text-muted), transparent);
    animation: scrollBounce 2s ease infinite;
}

/* ===== About / Features ===== */
.about {
    padding: 120px 0;
    text-align: center;
}

.about .section-desc {
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.features-grid .feature-card {
    flex: 0 1 calc((100% - 40px) / 3);
    min-width: 240px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px 28px;
    transition: all 0.3s ease;
    text-align: left;
}

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

.feature-icon {
    font-size: 1.8rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

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

/* ===== Download ===== */
.download {
    padding: 120px 0;
    position: relative;
    text-align: center;
}

.download .section-desc {
    margin-left: auto;
    margin-right: auto;
}

.download-glow {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
}

.download-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 36px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.download-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.download-icon {
    font-size: 2.2rem;
    margin-bottom: 4px;
}

.os-icon {
    width: 1em;
    height: 1em;
}

.download-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.download-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.download-size {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.download-alt {
    position: relative;
    z-index: 1;
}

.download-alt p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.code-block {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 24px;
    color: var(--accent-400);
    word-break: break-all;
}

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

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.opensource {
    text-align: center;
    padding: 120px 0;
}

.opensource .section-desc {
    margin-left: auto;
    margin-right: auto;
}

.opensource-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
}

/* ===== Serenio Labs Homepage ===== */
.nav-back {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
}

.nav-back:hover {
    color: var(--accent-400) !important;
}

.serenio-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
    padding-top: 20px;
    text-align: center;
}

.serenio-hero .container {
    display: block;
    grid-template-columns: none;
}

.serenio-hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 720px;
    margin: 0 auto;
}

.serenio-hero-icon {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin-bottom: -8px;
}

.serenio-hero .hero-subtitle {
    max-width: 560px;
    margin: 0 auto;
}

.serenio-hero .hero-actions {
    justify-content: center;
}

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

.products .section-desc {
    margin-left: auto;
    margin-right: auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 48px;
    position: relative;
    z-index: 1;
}

.product-card {
    display: flex;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    text-align: left;
    transition: all 0.3s ease;
    color: inherit;
    text-decoration: none;
}

.product-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.product-card-soon {
    opacity: 0.6;
    cursor: default;
}

.product-card-soon:hover {
    transform: none;
    background: var(--bg-card);
    border-color: var(--border);
    box-shadow: none;
}

.product-card-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--border);
}

.product-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-icon-placeholder {
    color: var(--text-muted);
    font-size: 1.6rem;
    font-weight: 600;
}

.product-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-card-body h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.product-card-tagline {
    font-size: 0.85rem;
    color: var(--accent-400);
    font-family: var(--font-mono);
}

.product-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 4px;
}

.product-card-link {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: auto;
    padding-top: 8px;
    transition: color 0.2s;
}

.product-card:hover .product-card-link {
    color: var(--accent-400);
}

/* ===== Email Dialog ===== */
.email-dialog {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.email-dialog.open {
    display: flex;
}

.email-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.email-dialog-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeUp 0.2s ease;
    text-align: left;
}

.email-dialog-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.email-dialog-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.email-dialog-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.email-dialog-close:hover {
    color: var(--text-primary);
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.email-form-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.email-form-label input,
.email-form-label textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    resize: vertical;
}

.email-form-label input:focus,
.email-form-label textarea:focus {
    outline: none;
    border-color: var(--accent-400);
}

.email-form-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

.email-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.email-form-status {
    font-size: 0.85rem;
    margin: 0;
    min-height: 1.2em;
}

.email-form-status.success {
    color: #4ade80;
}

.email-form-status.error {
    color: #f87171;
}

/* ===== Animations ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(8px); opacity: 1; }
}

/* Scroll-triggered fade-in */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

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

    .features-grid .feature-card {
        flex-basis: calc((100% - 20px) / 2);
    }
}

@media (max-width: 640px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 16px 24px;
        border-bottom: 1px solid var(--border);
    }

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

    .nav-toggle {
        display: flex;
    }

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

    .features-grid .feature-card {
        flex-basis: 100%;
    }

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

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