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

:root {
    /* Dark mode default */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.3);
    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.3);
    --bg: #0a0a0f;
    --bg-alt: #12121a;
    --bg-card: #16161f;
    --bg-input: #1a1a24;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --shadow-glow: 0 0 20px var(--primary-glow);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
}

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

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: 1.25rem; }

.section-title {
    text-align: center;
    margin-bottom: 16px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 48px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: var(--border);
}

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

.btn-white:hover {
    background: var(--bg-alt);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

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

.logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.footer-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 8px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-ai {
    color: var(--primary);
}

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

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

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

/* Hero */
.hero {
    padding: 160px 0 80px;
    background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.5;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    margin-bottom: 24px;
}

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

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

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 64px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Features */
.features {
    padding: 100px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

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

.feature-card:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
    border-color: var(--primary);
}

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

.feature-card h3 {
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-muted);
}

/* Letter Types */
.letter-types {
    padding: 100px 0;
    background: var(--bg);
}

.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 48px;
}

.type-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.type-card:hover {
    box-shadow: var(--shadow-glow);
    border-color: var(--accent);
}

.type-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.type-card h3 {
    margin-bottom: 8px;
}

.type-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Demo */
.demo {
    padding: 100px 0;
}

.demo-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-top: 48px;
}

@media (max-width: 900px) {
    .demo-container {
        grid-template-columns: 1fr;
    }
}

.demo-input {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.demo-input label {
    font-weight: 600;
    font-size: 0.9rem;
}

.demo-input input,
.demo-input select,
.demo-input textarea {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg-input);
    color: var(--text);
}

.demo-input input::placeholder,
.demo-input textarea::placeholder {
    color: var(--text-muted);
}

.demo-input input:focus,
.demo-input select:focus,
.demo-input textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.demo-input textarea {
    resize: vertical;
    min-height: 120px;
}

.demo-output {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
}

.letter-output {
    padding: 24px;
    color: var(--text);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    white-space: pre-wrap;
    background: var(--bg-input);
}

.placeholder-text {
    color: var(--text-muted);
    font-style: italic;
}

/* CTA */
.cta {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-alt) 100%);
    text-align: center;
    color: var(--text);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
}

.cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.4;
}

.cta h2 {
    margin-bottom: 16px;
}

.cta p {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 32px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* White Glove Section */
.white-glove {
    padding: 80px 0;
    background: var(--bg-alt);
}

.white-glove-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.white-glove-text h2 {
    margin-bottom: 16px;
}

.white-glove-text p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.white-glove-list {
    list-style: none;
    text-align: left;
    max-width: 400px;
    margin: 0 auto 32px;
}

.white-glove-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    position: relative;
    padding-left: 32px;
}

.white-glove-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* Footer */
.footer {
    padding: 64px 0 32px;
    background: var(--bg-alt);
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .logo-icon,
.footer-brand .logo-text {
    color: var(--text);
}

.footer-brand p {
    margin-top: 16px;
}

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

.footer-col h4 {
    color: var(--text);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 12px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

/* Mail Panel */
.mail-panel {
    margin-top: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.mail-panel h3 {
    margin-bottom: 8px;
}

.mail-desc {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.mail-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.mail-options label {
    font-weight: 600;
    font-size: 0.9rem;
}

.mail-options select {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-input);
    color: var(--text);
}

.price-breakdown {
    background: var(--bg-input);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: var(--text-muted);
}

.price-row.total {
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 16px;
    font-weight: 700;
    color: var(--text);
    font-size: 1.1rem;
}

.payment-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 12px;
}

/* Output Actions */
.output-actions {
    display: flex;
    gap: 8px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    position: relative;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.qr-container {
    background: white;
    padding: 16px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 24px;
}

.qr-container canvas,
.qr-container img {
    display: block;
    width: 200px;
    height: 200px;
}

.payment-details {
    text-align: left;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.payment-row:last-child {
    border-bottom: none;
}

.payment-value {
    font-weight: 600;
}

.payment-value.ens {
    color: var(--primary);
}

.address-row {
    flex-wrap: wrap;
}

.payment-address {
    font-size: 0.7rem;
    word-break: break-all;
    background: var(--bg);
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 4px;
    max-width: 200px;
    border: 1px solid var(--border);
}

.copy-address-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

.payment-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-alt);
    border-radius: 8px;
    margin-bottom: 16px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #fbbf24;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.payment-status.confirmed .status-dot {
    background: #22c55e;
    animation: none;
}

.payment-expires {
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

    .hero-stats {
        gap: 32px;
    }

    .footer-links {
        gap: 32px;
    }

    .output-actions {
        flex-direction: column;
    }
}
