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

:root {
    --bg: #0d1117;
    --bg-surface: #161b22;
    --bg-card: #1c2128;
    --border: #30363d;
    --border-light: #484f58;
    --text: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #A0C4B4;
    --accent-dim: rgba(160, 196, 180, 0.15);
    --accent-blue: #58A6FF;
    --accent-blue-dim: rgba(88, 166, 255, 0.15);
    --accent-gold: #E3B341;
    --accent-gold-dim: rgba(227, 179, 65, 0.15);
    --accent-red: #f85149;
    --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Code", "Fira Code", "Consolas", "Courier New", monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --max-width: 1140px;
    --nav-height: 64px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== NAVIGATION ===== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-inner {
    width: 100%;
    max-width: var(--max-width);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.nav-logo svg {
    width: 36px;
    height: 36px;
}

.nav-logo span {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.nav-links .btn-nav {
    background: var(--accent);
    color: var(--bg);
    font-weight: 600;
    padding: 8px 18px;
}

.nav-links .btn-nav:hover {
    background: #b5d4c7;
    color: var(--bg);
}

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
}

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

/* ===== SECTIONS ===== */
section {
    padding: 96px 24px;
}

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

.section-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--font-mono);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 640px;
    line-height: 1.8;
}

/* ===== HERO ===== */
.hero {
    padding-top: calc(var(--nav-height) + 80px);
    padding-bottom: 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(160, 196, 180, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-logo {
    margin-bottom: 32px;
}

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

.hero-tagline {
    font-family: var(--font-mono);
    font-size: clamp(1.5rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.hero-tagline .highlight {
    background: linear-gradient(135deg, var(--accent), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
}

.btn-primary:hover {
    background: #b5d4c7;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(160, 196, 180, 0.2);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--accent-dim);
    border: 1px solid rgba(160, 196, 180, 0.2);
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--accent);
    font-family: var(--font-mono);
    margin-bottom: 24px;
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero-preview {
    max-width: 560px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.hero-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== FEATURES ===== */
.features {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

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

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 28px;
    transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.feature-icon.green { background: var(--accent-dim); }
.feature-icon.blue { background: var(--accent-blue-dim); }
.feature-icon.gold { background: var(--accent-gold-dim); }

.feature-card h3 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

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

/* ===== HOW IT WORKS ===== */
.how-it-works .section-desc {
    margin-bottom: 56px;
}

.flow-diagram {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    position: relative;
    margin-top: 48px;
}

.flow-step {
    text-align: center;
    padding: 32px 24px;
    position: relative;
}

.flow-step::after {
    content: '';
    position: absolute;
    top: 56px;
    right: -12px;
    width: 24px;
    height: 2px;
    background: var(--border-light);
}

.flow-step:last-child::after {
    display: none;
}

.flow-number {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent);
    margin: 0 auto 20px;
}

.flow-step h3 {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    margin-bottom: 8px;
}

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

/* ===== MESSAGE TYPES ===== */
.msg-types {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

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

.msg-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
}

.msg-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.msg-card.type-uptt::before { background: var(--accent); }
.msg-card.type-mail::before { background: var(--accent-blue); }
.msg-card.type-waterball::before { background: var(--accent-gold); }

.msg-card .msg-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 100px;
    display: inline-block;
    margin-bottom: 14px;
    font-weight: 600;
}

.type-uptt .msg-tag { background: var(--accent-dim); color: var(--accent); }
.type-mail .msg-tag { background: var(--accent-blue-dim); color: var(--accent-blue); }
.type-waterball .msg-tag { background: var(--accent-gold-dim); color: var(--accent-gold); }

.msg-card h3 {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    margin-bottom: 10px;
}

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

/* ===== SECURITY ===== */
.security-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.security-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.security-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.security-item h4 {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    margin-bottom: 6px;
}

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

/* ===== DOWNLOAD ===== */
.download {
    text-align: center;
}

.download-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 48px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.download-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, transform 0.2s;
    display: block;
}

.download-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.download-card svg {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.download-card h3 {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

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

/* ===== DEVELOPER ===== */
.developer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 32px;
    margin-top: 32px;
    overflow-x: auto;
    max-width: 640px;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 2;
    color: var(--text-secondary);
}

.code-block .comment {
    color: var(--text-muted);
}

.code-block .cmd {
    color: var(--accent);
}

.code-block .prompt {
    color: var(--accent-blue);
    user-select: none;
}

.dev-links {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

/* ===== KEYBOARD SHORTCUTS ===== */
.shortcuts-table {
    margin-top: 32px;
    width: 100%;
    max-width: 480px;
    border-collapse: collapse;
}

.shortcuts-table th,
.shortcuts-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.shortcuts-table th {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.shortcuts-table kbd {
    font-family: var(--font-mono);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--accent-blue);
}

.shortcuts-table td:last-child {
    color: var(--text-secondary);
}

/* ===== FOOTER ===== */
footer {
    padding: 48px 24px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

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

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

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

.footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.8;
}

.footer-copy a {
    color: var(--text-secondary);
    text-decoration: none;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .features-grid,
    .msg-grid,
    .flow-diagram {
        grid-template-columns: 1fr;
    }

    .flow-step::after {
        display: none;
    }

    .security-grid,
    .download-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    section {
        padding: 64px 20px;
    }

    .nav-links {
        display: none;
    }

    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border);
        padding: 16px 24px;
        gap: 4px;
    }

    .nav-links.open a {
        display: block;
        padding: 12px 14px;
    }

    .nav-hamburger {
        display: block;
    }

    .hero {
        padding-top: calc(var(--nav-height) + 48px);
        padding-bottom: 48px;
    }

    .hero-logo svg {
        width: 200px;
    }

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

    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

/* ===== ANIMATIONS ===== */
@media (prefers-reduced-motion: no-preference) {
    .fade-in {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }

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

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        opacity: 1;
        transform: none;
    }
}
