:root {
    --bg-primary: #0b0f1f;
    --bg-secondary: #111827;
    --bg-card: #161f33;
    --bg-card-hover: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #ef4444;
    --accent-hover: #dc2626;
    --accent-secondary: #f59e0b;
    --border: rgba(148, 163, 184, 0.1);
    --radius: 12px;
    --shadow: 0 10px 40px rgba(0,0,0,0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 15, 31, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.logo svg {
    color: var(--accent);
}

.main-nav {
    display: flex;
    gap: 32px;
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

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

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

.main-nav a:hover::after {
    width: 100%;
}

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

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* Hero */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

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

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.highlight {
    color: var(--accent);
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

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

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

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

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: rgba(148, 163, 184, 0.2);
}

/* Sections General */
section {
    padding: 80px 0;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 48px;
}

/* Facts */
.facts-section {
    background: var(--bg-secondary);
}

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

.fact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
}

.fact-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.fact-card:hover {
    border-color: rgba(239, 68, 68, 0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.fact-icon {
    width: 56px;
    height: 56px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 20px;
}

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

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

/* Letters Tabs */
.letters-section {
    padding-bottom: 60px;
}

.tabs {
    max-width: 800px;
    margin: 0 auto;
}

.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 20px;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: var(--transition);
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--accent);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.letter-header {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.letter-tag {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.letter-target {
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
}

.letter-body {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text-secondary);
    max-height: 500px;
    overflow-y: auto;
}

.letter-body p {
    margin-bottom: 12px;
}

.letter-body ul,
.letter-body ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

.letter-body li {
    margin-bottom: 8px;
}

.letter-body strong {
    color: var(--text-primary);
}

/* Letter subject box */
.letter-subject-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 12px;
}

.letter-subject-box label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.letter-subject-box p {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 12px;
    line-height: 1.5;
}

.copy-subject {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.copy-body {
    margin-top: 8px;
}

/* Inline links in fact cards and letter body */
.fact-card a,
.letter-body a {
    color: var(--accent-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fact-card a:hover,
.letter-body a:hover {
    color: var(--accent);
}

.letter-header .letter-target {
    text-decoration: none;
    transition: var(--transition);
}

.letter-header .letter-target:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.copy-btn:hover {
    background: var(--bg-card-hover);
    border-color: rgba(148, 163, 184, 0.2);
}

.copy-btn.copied {
    border-color: #22c55e;
    color: #22c55e;
}

/* Guide */
.guide-section {
    background: var(--bg-secondary);
}

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

.guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
}

.guide-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.guide-card:hover {
    border-color: rgba(239, 68, 68, 0.2);
}

.guide-number {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 2.5rem;
    font-weight: 800;
    color: rgba(239, 68, 68, 0.1);
    line-height: 1;
}

.guide-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    padding-right: 60px;
}

.guide-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.guide-steps {
    list-style: none;
    counter-reset: step;
    margin-bottom: 24px;
}

.guide-steps li {
    position: relative;
    padding-left: 32px;
    margin-bottom: 14px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.guide-steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-steps a {
    color: var(--accent-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.guide-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.guide-link:hover {
    color: var(--accent-hover);
    gap: 12px;
}

/* Alternatives */
.alternatives-section {
    padding-bottom: 100px;
}

.alternatives-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.alt-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
    opacity: 0;
    transform: translateX(-20px);
}

.alt-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.alt-item:hover {
    border-color: rgba(245, 158, 11, 0.2);
}

.alt-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-secondary);
}

.alt-item h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

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

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    text-align: center;
}

.site-footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

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

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

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

/* Toast */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    padding: 14px 24px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 200;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Scrollbar */
.letter-body::-webkit-scrollbar {
    width: 8px;
}

.letter-body::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

.letter-body::-webkit-scrollbar-thumb {
    background: var(--bg-card-hover);
    border-radius: 4px;
}

.letter-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 20px 24px;
        border-bottom: 1px solid var(--border);
        gap: 16px;
    }

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

    .menu-toggle {
        display: flex;
    }

    .hero {
        padding: 60px 0 50px;
    }

    section {
        padding: 50px 0;
    }

    .fact-card,
    .guide-card,
    .alt-item {
        padding: 24px;
    }

    .letter-body {
        padding: 24px;
    }

    .tab-buttons {
        gap: 4px;
    }

    .tab-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .alternatives-section {
        padding-bottom: 60px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .guide-number {
        font-size: 2rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
