/* General Styles */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #1e40af;
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --error-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Red Hat Display', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    padding-top: 80px;
    /* Make space for the fixed nav bar */
}

.top-nav {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0 20px;
    backdrop-filter: blur(10px);
    background-color: rgba(30, 41, 59, 0.95);
}

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

.top-nav .brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.top-nav .brand {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.top-nav nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    margin-left: 25px;
    transition: color 0.2s ease;
}

.top-nav nav a:hover,
.top-nav nav a.active {
    color: var(--primary-color);
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--surface-color) 0%, #1a1f3a 100%);
    text-align: center;
    padding: 100px 0;
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid var(--primary-color);
}

.cta-button:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.3);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1,
.hero p,
.hero .cta-button {
    opacity: 0;
    /* Start hidden */
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero p {
    animation-delay: 0.2s;
}

.hero .cta-button {
    animation-delay: 0.4s;
}

/* Animate on Scroll */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Features, Use Cases, & Dev Experience Sections */
.features,
.use-cases,
.dev-experience {
    padding: 80px 0;
}

.dev-experience {
    background-color: rgba(15, 23, 42, 0.5);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-item {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.15);
}

.feature-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Pricing Section */
.pricing {
    padding: 80px 0;
    text-align: center;
}

/* Billing Toggle */
.billing-toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 3rem;
}

.billing-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.savings-badge {
    background-color: var(--primary-color);
    color: var(--background-color);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-left: 8px;
}

.billing-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.billing-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.billing-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 30px;
}

.billing-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: var(--text-primary);
    transition: 0.3s;
    border-radius: 50%;
}

.billing-switch input:checked+.billing-slider {
    background-color: var(--primary-color);
}

.billing-switch input:checked+.billing-slider:before {
    transform: translateX(30px);
}

.price-container {
    min-height: 120px;
}

.yearly-savings {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    align-items: stretch;
    /* Make cards equal height */
}

.pricing-card {
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-basis: 320px;
    /* Set a base width for flex items */
    flex-grow: 1;
}

.pricing-card.featured {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.pricing-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.pricing-card .price {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.pricing-card .price .price-amount {
    font-size: 3rem;
    font-weight: 700;
    color: white;
}

.pricing-card .price .price-amount::before {
    content: '$';
}

.pricing-card .price .price-period {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: -10px;
    color: white;
}

.pricing-card .price span {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: -10px;
}

.pricing-card ul {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.pricing-card ul li {
    margin-bottom: 0.8rem;
    text-align: left;
}

.pricing-card ul li strong {
    color: var(--primary-color);
}

.pricing-card ul li em {
    font-style: italic;
    color: var(--text-secondary);
}

.pricing-card .button {
    display: block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-top: auto;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.pricing-card .button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.pricing-card.featured .button {
    background-color: var(--primary-color);
}

/* Sign-in button placed top-left */
.signin-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    margin-right: 12px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.15s ease;
}

.signin-top:hover {
    background-color: rgba(59, 130, 246, 0.08);
    color: var(--primary-color);
    border-color: rgba(59, 130, 246, 0.14);
}

/* Small layout tweak: ensure brand doesn't collide with sign-in */
.top-nav .brand {
    margin-left: 6px;
}

.disclaimer {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}


/* API Docs Section */
.docs-body-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
}

.docs-sidebar {
    position: sticky;
    top: 100px;
    /* Adjust based on nav height */
    left: 0;
    width: 250px;
    height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 20px;
    flex-shrink: 0;
    /* Prevent sidebar from shrinking */
}

.docs-sidebar h4 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.docs-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-sidebar ul li a {
    border-left: 2px solid transparent;
    /* Default transparent border */
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 0;
    font-size: 0.9rem;
    padding-left: 15px;
    transition: all 0.2s ease;
}

.docs-sidebar ul li a:hover {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.docs-sidebar ul li a.nav-h2 {
    font-weight: 700;
    padding-left: 15px;
}

.docs-sidebar ul li a.nav-h3 {
    padding-left: 30px;
    /* Indent sub-headings */
}

.docs-sidebar ul li a.active {
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.docs-sidebar ul li a.active.nav-h2 {
    font-weight: 700;
    /* Keep it bold */
}

.docs-sidebar ul li a.active.nav-h3 {
    font-weight: 600;
    /* Slightly bolder for active sub-heading */
}

.docs-main-content {
    flex-grow: 1;
    min-width: 0;
    /* Prevents flexbox overflow issues */
    padding-left: 40px;
}

.language-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.lang-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.lang-tab:hover {
    color: var(--text-primary);
}

.lang-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.api-docs {
    background-color: var(--surface-color);
}

.docs-heading {
    position: relative;
    /* Required for anchor link positioning */
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.heading-anchor-link {
    position: absolute;
    left: -1.2em;
    /* Position to the left of the heading */
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    /* Hide by default */
    transition: opacity 0.2s ease-in-out;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
    padding: 0 0.5em;
}

.docs-heading:hover .heading-anchor-link {
    opacity: 1;
    /* Show on hover */
}

.docs-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.code-block {
    position: relative;
    margin: 1.5rem 0;
}

.code-block pre {
    background-color: #0D1117;
    /* A slightly different dark shade */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-block code {
    color: #C9D1D9;
}


.copy-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--border-color);
    color: var(--text-secondary);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.copy-button:hover {
    background-color: #444;
    color: var(--text-primary);
}

/* Message Calculation Page */
.message-calc-section {
    padding: 60px 0;
}

.calc-content {
    max-width: 900px;
    margin: 0 auto;
}

.calc-intro {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 3rem;
}

.calc-intro p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 0;
}

.calc-card {
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.calc-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.calc-card h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.calc-definition {
    background-color: var(--background-color);
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    margin: 1.5rem 0;
    font-size: 1.1rem;
}

.calc-card ul {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.calc-card ul li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.calc-example {
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 6px;
    margin-top: 1.5rem;
}

.calc-example h4 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 0.8rem;
}

.calc-summary {
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin: 3rem 0;
}

.calc-summary h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
}

.calc-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.calc-table th,
.calc-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.calc-table th {
    background-color: var(--background-color);
    color: var(--primary-color);
    font-weight: 600;
}

.calc-table tbody tr:hover {
    background-color: var(--background-color);
}

.calc-faq {
    margin: 3rem 0;
}

.calc-faq h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
}

.faq-item {
    background-color: var(--surface-color);
    padding: 25px 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.faq-item h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.faq-item p {
    margin: 0;
    line-height: 1.7;
}

.calc-cta {
    text-align: center;
    padding: 60px 40px;
    background-color: var(--surface-color);
    border-radius: 8px;
    margin-top: 3rem;
}

.calc-cta h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.calc-cta p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.pricing-note {
    text-align: center;
    margin-top: 2rem;
    padding: 20px;
}

.pricing-note p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.pricing-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.pricing-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

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

.footer p {
    margin: 5px 0;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Responsive */

/* Tablet and larger mobile */
@media (max-width: 1024px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Smaller mobile */
@media (max-width: 768px) {
    .hero {
        padding: 60px 0;
    }

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

    .features,
    .use-cases,
    .dev-experience,
    .pricing,
    .waitlist {
        padding: 60px 0;
    }

    .section-header h2 {
        font-size: 2.2rem;
    }

    .feature-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .feature-grid>.feature-item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        /* Center the last item if it's the only one in the row */
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    #waitlist-form {
        flex-direction: column;
    }

    #waitlist-form button {
        width: 100%;
    }

    .calc-card,
    .calc-intro,
    .calc-summary,
    .calc-cta {
        padding: 25px 20px;
    }

    .calc-table {
        font-size: 0.85rem;
    }

    .calc-table th,
    .calc-table td {
        padding: 10px 8px;
    }
}

.brand-container {
    display: flex;
    align-items: center;
    /* vertically center icon + text */
    gap: 8px;
    /* space between them */
}