@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;700&family=Noto+Serif+SC:wght@400;700;900&display=swap');

:root {
    /* Light Mode - Xuan Paper Ivory */
    --bg-color: #FAF9F6;
    --bg-alt: #F2F0E9;
    --text-primary: #08080A;
    --text-secondary: #4A4A4A;
    --primary-color: #D9383A;
    --primary-hover: #b02b2d;
    --card-bg: #ffffff;
    --border-color: #E0DDD5;
    --footer-bg: #EAE7DF;
    --footer-text: #666666;
    --shadow: 0 10px 30px rgba(8, 8, 10, 0.05);
    
    /* Typography */
    --font-serif: 'Noto Serif SC', 'Cormorant Garamond', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spring physics for hover */
    --transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

[data-theme="dark"] {
    --bg-color: #08080A;
    --bg-alt: #121215;
    --text-primary: #FAF9F6;
    --text-secondary: #9A9A9C;
    --primary-color: #D9383A;
    --primary-hover: #FF4A4D;
    --card-bg: #141417;
    --border-color: #2A2A2E;
    --footer-bg: #040405;
    --footer-text: #777777;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background-color 0.4s ease, color 0.4s ease;
    /* Subtle ink wash fluid texture */
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(217, 56, 58, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 40%);
    margin: 0;
    padding: 0;
}

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

h1, h2, h3, h4, .headline, .section-title {
    font-family: var(--font-serif);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}
a:hover {
    color: var(--primary-hover);
}

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

.section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: var(--text-primary);
}

.bg-alt {
    background-color: var(--bg-alt);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(250, 249, 246, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.4s ease;
}
[data-theme="dark"] .navbar {
    background-color: rgba(8, 8, 10, 0.85);
}

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

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

.seal-mark {
    background-color: var(--primary-color);
    color: #FAF9F6;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px; /* Traditional seal look */
    font-size: 1.1rem;
    font-weight: 400;
    font-family: var(--font-serif);
    position: relative;
    overflow: hidden;
}

.seal-mark::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 1px solid rgba(250, 249, 246, 0.3);
    margin: 2px;
    border-radius: 2px;
}

.heartbeat-dot {
    width: 8px;
    height: 8px;
    background-color: #10B981;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    margin-left: 6px;
}
.heartbeat-dot::after {
    content: '';
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border-radius: 50%;
    border: 2px solid #10B981;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

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

.nav-links a {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}
.nav-links a:hover::after {
    width: 100%;
}
.nav-links a:hover {
    color: var(--primary-color);
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.theme-toggle:hover {
    background: var(--bg-alt);
    transform: rotate(15deg);
}
.theme-icon {
    width: 20px;
    height: 20px;
}
.hidden { display: none; }

/* Hero Section */
.hero {
    padding: 120px 0 100px;
    text-align: center;
    position: relative;
}

.headline {
    font-size: 4rem;
    margin-bottom: 24px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.headline .brand-highlight {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto 48px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.05rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    font-family: var(--font-sans);
}

.btn-large {
    padding: 18px 48px;
    font-size: 1.15rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #FAF9F6 !important;
    box-shadow: 0 8px 24px rgba(217, 56, 58, 0.25);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(217, 56, 58, 0.35);
}

.btn-outline {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}
.btn-outline:hover {
    background-color: var(--primary-color);
    color: #FAF9F6 !important;
}

/* Grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }

/* Cards (Bento) */
.card, .bento-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 36px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover, .bento-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
    border-color: rgba(217, 56, 58, 0.3);
}

.card h3 {
    font-size: 1.4rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

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

.card-icon {
    font-size: 2rem;
    margin-bottom: 24px;
    color: var(--primary-color);
    display: inline-block;
}

/* Interactive Components */
.protocol-tags {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}
.proto-tag {
    padding: 6px 14px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.3s ease;
    cursor: default;
}
.proto-tag:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(217, 56, 58, 0.05);
}

.latency-list {
    margin-top: 24px;
    list-style: none;
}
.latency-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}
.latency-list li:last-child { border-bottom: none; }
.latency-list li:hover {
    padding-left: 8px;
    color: var(--primary-color);
}
.latency-list li .ping {
    color: #10B981;
}

/* Scenario Tags */
.scenario-card .tags {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.scenario-card .tags span {
    background-color: transparent;
    color: var(--text-primary);
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    font-family: var(--font-sans);
    transition: var(--transition);
}
.scenario-card:hover .tags span {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Pricing - Bamboo Slip Style */
.pricing-card {
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    /* Bamboo slip aesthetic */
    border-left: 4px solid var(--border-color);
    border-right: 4px solid var(--border-color);
}
.pricing-card:hover {
    border-left-color: var(--primary-color);
    border-right-color: var(--primary-color);
}
.pricing-card.popular {
    border-left: 4px solid var(--primary-color);
    border-right: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
}
.popular-badge {
    position: absolute;
    top: 0;
    right: 20px;
    background-color: var(--primary-color);
    color: #FAF9F6;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-family: var(--font-serif);
    letter-spacing: 1px;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.price {
    font-size: 3rem;
    font-weight: 700;
    margin: 24px 0;
    color: var(--text-primary);
    font-family: var(--font-mono);
}
.price span {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
    font-family: var(--font-sans);
}

.pricing-features {
    list-style: none;
    margin-bottom: 36px;
    flex-grow: 1;
    text-align: left;
}
.pricing-features li {
    padding: 12px 0;
    color: var(--text-secondary);
    border-bottom: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
}
.pricing-features li::before {
    content: '✓';
    color: var(--primary-color);
    margin-right: 12px;
    font-weight: bold;
}

/* Reviews */
.stars {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 16px;
    letter-spacing: 2px;
}
.review-text {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 24px;
    line-height: 1.8;
}
.review-author {
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* FAQ */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.faq-answer { color: var(--text-secondary); }

/* Footer */
.footer {
    background-color: var(--footer-bg);
    padding: 60px 0 40px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 36px;
    margin-bottom: 24px;
}
.footer-links a { color: var(--footer-text); font-weight: 500; }
.footer-links a:hover { color: var(--primary-color); }
.copyright {
    color: var(--footer-text);
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

/* Responsive */
@media (max-width: 992px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .headline { font-size: 3rem; }
}

@media (max-width: 768px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .hidden-mobile { display: none !important; }
    .hero { padding: 80px 0; }
    .section { padding: 80px 0; }
}

@media (max-width: 480px) {
    .headline { font-size: 2.2rem; }
    .btn { width: 100%; display: block; }
    .footer-links { flex-direction: column; gap: 16px; }
}
